From 08d87c54ad37795efd757fd819fc3b6a556433ae Mon Sep 17 00:00:00 2001 From: Adam Chidlow Date: Fri, 8 Dec 2023 17:58:46 +0800 Subject: [PATCH] Initial ARC-4 support Co-authored-by: Daniel McGregor Co-authored-by: Tristan Menzel --- examples/TEALScript/algopy.log | 628 +++ examples/TEALScript/auction/README.md | 3 + examples/TEALScript/auction/algopy.log | 502 ++ examples/TEALScript/auction/auction.algo.ts | 118 + examples/TEALScript/auction/contract.py | 128 + .../TEALScript/auction/out/application.json | 163 + .../auction/out/contract.approval.debug.teal | 374 ++ .../auction/out/contract.approval.teal | 366 ++ .../contract.approval_unoptimized.debug.teal | 390 ++ .../out/contract.approval_unoptimized.teal | 382 ++ examples/TEALScript/auction/out/contract.awst | 103 + .../auction/out/contract.clear.debug.teal | 9 + .../auction}/out/contract.clear.teal | 2 +- .../out/contract.clear_unoptimized.debug.teal | 9 + .../out/contract.clear_unoptimized.teal | 2 +- .../auction/out/contract_Auction.cssa.ir | 236 + .../auction/out/contract_Auction.final.ir | 233 + .../out/contract_Auction.final_unoptimized.ir | 245 + .../out/contract_Auction.parallel_copies.ir | 235 + .../auction/out/contract_Auction.post_ssa.ir | 235 + .../auction/out/contract_Auction.ssa.ir | 241 + .../out/contract_Auction.ssa.opt_pass_1.ir | 233 + .../out/contract_Auction.ssa.opt_pass_2.ir | 233 + .../tealscript_artifacts/Auction.abi.json | 112 + .../Auction.approval.teal | 533 ++ .../tealscript_artifacts/Auction.clear.teal | 2 + .../auction/tealscript_artifacts/Auction.json | 213 + .../tealscript_artifacts/Auction.src_map.json | 4104 +++++++++++++++ examples/abi_routing/algopy.log | 1234 +++++ examples/abi_routing/contract.py | 157 + examples/abi_routing/out/application.json | 351 ++ .../out/contract.approval.debug.teal | 486 ++ .../abi_routing/out/contract.approval.teal | 481 ++ .../contract.approval_unoptimized.debug.teal | 523 ++ .../out/contract.approval_unoptimized.teal | 517 ++ examples/abi_routing/out/contract.awst | 103 + .../abi_routing/out/contract.clear.debug.teal | 9 + examples/abi_routing/out/contract.clear.teal | 7 + .../out/contract.clear_unoptimized.debug.teal | 9 + .../out/contract.clear_unoptimized.teal | 7 + .../out/contract_Reference.cssa.ir | 307 ++ .../out/contract_Reference.final.ir | 307 ++ .../contract_Reference.final_unoptimized.ir | 320 ++ .../out/contract_Reference.parallel_copies.ir | 307 ++ .../out/contract_Reference.post_ssa.ir | 307 ++ .../abi_routing/out/contract_Reference.ssa.ir | 319 ++ .../out/contract_Reference.ssa.opt_pass_1.ir | 310 ++ .../out/contract_Reference.ssa.opt_pass_2.ir | 309 ++ .../out/contract_Reference.ssa.opt_pass_3.ir | 308 ++ .../out/contract_Reference.ssa.opt_pass_4.ir | 307 ++ examples/abi_types/algopy.log | 235 - examples/abi_types/contract.py | 70 - examples/abi_types/out/abi_types.O0.log | 139 - examples/abi_types/out/abi_types.O1.log | 111 - examples/abi_types/out/abi_types.O2.log | 111 - .../out/contract.approval.debug.teal | 115 - examples/abi_types/out/contract.approval.teal | 113 - .../contract.approval_unoptimized.debug.teal | 143 - .../out/contract.approval_unoptimized.teal | 141 - examples/abi_types/out/contract.awst | 34 - .../abi_types/out/contract.clear.debug.teal | 9 - .../out/contract.clear_unoptimized.debug.teal | 9 - .../out/contract_AbiTypesContract.cssa.ir | 63 - .../out/contract_AbiTypesContract.final.ir | 63 - ...ract_AbiTypesContract.final_unoptimized.ir | 89 - ...ntract_AbiTypesContract.parallel_copies.ir | 63 - .../out/contract_AbiTypesContract.post_ssa.ir | 63 - .../out/contract_AbiTypesContract.ssa.ir | 89 - ...ontract_AbiTypesContract.ssa.opt_pass_1.ir | 68 - ...ontract_AbiTypesContract.ssa.opt_pass_2.ir | 65 - ...ontract_AbiTypesContract.ssa.opt_pass_3.ir | 63 - examples/address_constant.algopy.log | 27 +- examples/address_constant.py | 6 +- examples/algopy.log | 127 + examples/amm/algopy.log | 1593 +++++- examples/amm/contract.py | 181 +- examples/amm/out/application.json | 246 + examples/amm/out/contract.approval.debug.teal | 839 +++ examples/amm/out/contract.approval.teal | 828 +++ .../contract.approval_unoptimized.debug.teal | 850 +++ .../out/contract.approval_unoptimized.teal | 839 +++ examples/amm/out/contract.awst | 139 +- examples/amm/out/contract.clear.debug.teal | 9 + examples/amm/out/contract.clear.teal | 7 + .../out/contract.clear_unoptimized.debug.teal | 9 + .../amm/out/contract.clear_unoptimized.teal | 7 + .../out/contract_ConstantProductAMM.cssa.ir | 511 ++ .../out/contract_ConstantProductAMM.final.ir | 503 ++ ...ct_ConstantProductAMM.final_unoptimized.ir | 518 ++ ...ract_ConstantProductAMM.parallel_copies.ir | 513 ++ .../contract_ConstantProductAMM.post_ssa.ir | 507 ++ .../out/contract_ConstantProductAMM.ssa.ir | 517 ++ ...tract_ConstantProductAMM.ssa.opt_pass_1.ir | 505 ++ ...tract_ConstantProductAMM.ssa.opt_pass_2.ir | 505 ++ examples/application/algopy.log | 214 + examples/application/contract.py | 51 + .../out/contract.approval.debug.teal | 115 + .../application/out/contract.approval.teal | 109 + .../contract.approval_unoptimized.debug.teal | 118 + .../out/contract.approval_unoptimized.teal | 111 + examples/application/out/contract.awst | 54 + .../application/out/contract.clear.debug.teal | 9 + examples/application/out/contract.clear.teal | 7 + .../out/contract.clear_unoptimized.debug.teal | 9 + .../out/contract.clear_unoptimized.teal | 7 + .../out/contract_Reference.cssa.ir | 78 + .../out/contract_Reference.final.ir | 78 + .../contract_Reference.final_unoptimized.ir | 80 + .../out/contract_Reference.parallel_copies.ir | 78 + .../out/contract_Reference.post_ssa.ir | 78 + .../application/out/contract_Reference.ssa.ir | 80 + .../out/contract_Reference.ssa.opt_pass_1.ir | 78 + examples/arc4_types/algopy.log | 4604 +++++++++++++++++ examples/arc4_types/array.py | 71 + examples/arc4_types/bool.py | 53 + examples/arc4_types/dynamic_string_array.py | 20 + examples/arc4_types/numeric.py | 69 + examples/arc4_types/out/application.json | 61 + examples/arc4_types/out/array.O0.log | 485 ++ examples/arc4_types/out/array.O1.log | 402 ++ examples/arc4_types/out/array.O2.log | 396 ++ .../arc4_types/out/array.approval.debug.teal | 312 ++ examples/arc4_types/out/array.approval.teal | 296 ++ .../out/array.approval_unoptimized.debug.teal | 406 ++ .../out/array.approval_unoptimized.teal | 385 ++ examples/arc4_types/out/array.awst | 53 + .../arc4_types/out/array.clear.debug.teal | 9 + examples/arc4_types/out/array.clear.teal | 7 + .../out/array.clear_unoptimized.debug.teal | 9 + .../out/array.clear_unoptimized.teal | 7 + .../out/array_Arc4ArraysContract.cssa.ir | 181 + .../out/array_Arc4ArraysContract.final.ir | 152 + ...ay_Arc4ArraysContract.final_unoptimized.ir | 203 + ...rray_Arc4ArraysContract.parallel_copies.ir | 184 + .../out/array_Arc4ArraysContract.post_ssa.ir | 169 + .../out/array_Arc4ArraysContract.ssa.ir | 215 + ...array_Arc4ArraysContract.ssa.opt_pass_1.ir | 179 + ...array_Arc4ArraysContract.ssa.opt_pass_2.ir | 170 + ...array_Arc4ArraysContract.ssa.opt_pass_3.ir | 163 + ...array_Arc4ArraysContract.ssa.opt_pass_4.ir | 161 + ...array_Arc4ArraysContract.ssa.opt_pass_5.ir | 160 + examples/arc4_types/out/bool.O0.log | 251 + examples/arc4_types/out/bool.O1.log | 39 + examples/arc4_types/out/bool.O2.log | 39 + .../arc4_types/out/bool.approval.debug.teal | 49 + examples/arc4_types/out/bool.approval.teal | 47 + .../out/bool.approval_unoptimized.debug.teal | 261 + .../out/bool.approval_unoptimized.teal | 259 + examples/arc4_types/out/bool.awst | 27 + examples/arc4_types/out/bool.clear.debug.teal | 9 + examples/arc4_types/out/bool.clear.teal | 7 + .../out/bool.clear_unoptimized.debug.teal | 9 + .../out/bool.clear_unoptimized.teal | 7 + .../out/bool_Arc4BoolTypeContract.cssa.ir | 28 + .../out/bool_Arc4BoolTypeContract.final.ir | 28 + ..._Arc4BoolTypeContract.final_unoptimized.ir | 96 + ...ol_Arc4BoolTypeContract.parallel_copies.ir | 28 + .../out/bool_Arc4BoolTypeContract.post_ssa.ir | 28 + .../out/bool_Arc4BoolTypeContract.ssa.ir | 96 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_1.ir | 69 + ...ol_Arc4BoolTypeContract.ssa.opt_pass_10.ir | 41 + ...ol_Arc4BoolTypeContract.ssa.opt_pass_11.ir | 40 + ...ol_Arc4BoolTypeContract.ssa.opt_pass_12.ir | 39 + ...ol_Arc4BoolTypeContract.ssa.opt_pass_13.ir | 38 + ...ol_Arc4BoolTypeContract.ssa.opt_pass_14.ir | 34 + ...ol_Arc4BoolTypeContract.ssa.opt_pass_15.ir | 32 + ...ol_Arc4BoolTypeContract.ssa.opt_pass_16.ir | 28 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_2.ir | 53 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_3.ir | 51 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_4.ir | 49 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_5.ir | 46 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_6.ir | 45 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_7.ir | 44 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_8.ir | 43 + ...ool_Arc4BoolTypeContract.ssa.opt_pass_9.ir | 42 + .../dynamic_string_array.approval.debug.teal | 120 + .../out/dynamic_string_array.approval.teal | 116 + ...ring_array.approval_unoptimized.debug.teal | 179 + ...mic_string_array.approval_unoptimized.teal | 175 + .../arc4_types/out/dynamic_string_array.awst | 13 + .../out/dynamic_string_array.clear.debug.teal | 9 + .../out/dynamic_string_array.clear.teal | 7 + ..._string_array.clear_unoptimized.debug.teal | 9 + ...ynamic_string_array.clear_unoptimized.teal | 7 + ...ray_Arc4DynamicStringArrayContract.cssa.ir | 78 + ...ay_Arc4DynamicStringArrayContract.final.ir | 78 + ...icStringArrayContract.final_unoptimized.ir | 105 + ...amicStringArrayContract.parallel_copies.ir | 78 + ...Arc4DynamicStringArrayContract.post_ssa.ir | 78 + ...rray_Arc4DynamicStringArrayContract.ssa.ir | 105 + ...namicStringArrayContract.ssa.opt_pass_1.ir | 90 + ...namicStringArrayContract.ssa.opt_pass_2.ir | 86 + ...namicStringArrayContract.ssa.opt_pass_3.ir | 82 + ...namicStringArrayContract.ssa.opt_pass_4.ir | 80 + ...namicStringArrayContract.ssa.opt_pass_5.ir | 79 + ...namicStringArrayContract.ssa.opt_pass_6.ir | 78 + examples/arc4_types/out/named_tuples.O0.log | 97 + examples/arc4_types/out/named_tuples.O1.log | 90 + examples/arc4_types/out/named_tuples.O2.log | 88 + examples/arc4_types/out/numeric.O0.log | 158 + examples/arc4_types/out/numeric.O1.log | 74 + examples/arc4_types/out/numeric.O2.log | 74 + .../out/numeric.approval.debug.teal | 78 + examples/arc4_types/out/numeric.approval.teal | 76 + .../numeric.approval_unoptimized.debug.teal | 209 + .../out/numeric.approval_unoptimized.teal | 197 + examples/arc4_types/out/numeric.awst | 36 + .../arc4_types/out/numeric.clear.debug.teal | 9 + examples/arc4_types/out/numeric.clear.teal | 7 + .../out/numeric.clear_unoptimized.debug.teal | 9 + .../out/numeric.clear_unoptimized.teal | 7 + .../numeric_Arc4NumericTypesContract.cssa.ir | 52 + .../numeric_Arc4NumericTypesContract.final.ir | 52 + ...4NumericTypesContract.final_unoptimized.ir | 123 + ...rc4NumericTypesContract.parallel_copies.ir | 52 + ...meric_Arc4NumericTypesContract.post_ssa.ir | 52 + .../numeric_Arc4NumericTypesContract.ssa.ir | 128 + ...Arc4NumericTypesContract.ssa.opt_pass_1.ir | 117 + ...Arc4NumericTypesContract.ssa.opt_pass_2.ir | 113 + ...Arc4NumericTypesContract.ssa.opt_pass_3.ir | 77 + ...Arc4NumericTypesContract.ssa.opt_pass_4.ir | 57 + ...Arc4NumericTypesContract.ssa.opt_pass_5.ir | 52 + examples/arc4_types/out/string.O0.log | 44 + examples/arc4_types/out/string.O1.log | 40 + examples/arc4_types/out/string.O2.log | 39 + .../arc4_types/out/string.approval.debug.teal | 53 + examples/arc4_types/out/string.approval.teal | 49 + .../string.approval_unoptimized.debug.teal | 58 + .../out/string.approval_unoptimized.teal | 54 + examples/arc4_types/out/string.awst | 18 + .../arc4_types/out/string.clear.debug.teal | 9 + examples/arc4_types/out/string.clear.teal | 7 + .../out/string.clear_unoptimized.debug.teal | 9 + .../out/string.clear_unoptimized.teal | 7 + .../string_Arc4StringTypesContract.cssa.ir | 35 + .../string_Arc4StringTypesContract.final.ir | 32 + ...c4StringTypesContract.final_unoptimized.ir | 34 + ...Arc4StringTypesContract.parallel_copies.ir | 34 + ...string_Arc4StringTypesContract.post_ssa.ir | 34 + .../out/string_Arc4StringTypesContract.ssa.ir | 35 + ..._Arc4StringTypesContract.ssa.opt_pass_1.ir | 33 + ..._Arc4StringTypesContract.ssa.opt_pass_2.ir | 32 + examples/arc4_types/out/structs.O0.log | 212 + examples/arc4_types/out/structs.O1.log | 141 + examples/arc4_types/out/structs.O2.log | 139 + .../out/structs.approval.debug.teal | 166 + examples/arc4_types/out/structs.approval.teal | 162 + .../structs.approval_unoptimized.debug.teal | 243 + .../out/structs.approval_unoptimized.teal | 237 + examples/arc4_types/out/structs.awst | 58 + .../arc4_types/out/structs.clear.debug.teal | 9 + examples/arc4_types/out/structs.clear.teal | 7 + .../out/structs.clear_unoptimized.debug.teal | 9 + .../out/structs.clear_unoptimized.teal | 7 + .../structs_Arc4StructsTypeContract.cssa.ir | 83 + .../structs_Arc4StructsTypeContract.final.ir | 80 + ...c4StructsTypeContract.final_unoptimized.ir | 116 + ...Arc4StructsTypeContract.parallel_copies.ir | 84 + ...tructs_Arc4StructsTypeContract.post_ssa.ir | 81 + .../structs_Arc4StructsTypeContract.ssa.ir | 117 + ..._Arc4StructsTypeContract.ssa.opt_pass_1.ir | 94 + ..._Arc4StructsTypeContract.ssa.opt_pass_2.ir | 86 + ..._Arc4StructsTypeContract.ssa.opt_pass_3.ir | 83 + ..._Arc4StructsTypeContract.ssa.opt_pass_4.ir | 82 + ..._Arc4StructsTypeContract.ssa.opt_pass_5.ir | 81 + ..._Arc4StructsTypeContract.ssa.opt_pass_6.ir | 80 + examples/arc4_types/out/tuples.O0.log | 512 ++ examples/arc4_types/out/tuples.O1.log | 99 + examples/arc4_types/out/tuples.O2.log | 99 + .../arc4_types/out/tuples.approval.debug.teal | 110 + examples/arc4_types/out/tuples.approval.teal | 108 + .../tuples.approval_unoptimized.debug.teal | 592 +++ .../out/tuples.approval_unoptimized.teal | 576 +++ examples/arc4_types/out/tuples.awst | 34 + .../arc4_types/out/tuples.clear.debug.teal | 9 + examples/arc4_types/out/tuples.clear.teal | 7 + .../out/tuples.clear_unoptimized.debug.teal | 9 + .../out/tuples.clear_unoptimized.teal | 7 + .../out/tuples_Arc4TuplesTypeContract.cssa.ir | 61 + .../tuples_Arc4TuplesTypeContract.final.ir | 61 + ...rc4TuplesTypeContract.final_unoptimized.ir | 252 + ..._Arc4TuplesTypeContract.parallel_copies.ir | 61 + .../tuples_Arc4TuplesTypeContract.post_ssa.ir | 61 + .../out/tuples_Arc4TuplesTypeContract.ssa.ir | 259 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_1.ir | 208 + ..._Arc4TuplesTypeContract.ssa.opt_pass_10.ir | 187 + ..._Arc4TuplesTypeContract.ssa.opt_pass_11.ir | 186 + ..._Arc4TuplesTypeContract.ssa.opt_pass_12.ir | 185 + ..._Arc4TuplesTypeContract.ssa.opt_pass_13.ir | 160 + ..._Arc4TuplesTypeContract.ssa.opt_pass_14.ir | 149 + ..._Arc4TuplesTypeContract.ssa.opt_pass_15.ir | 99 + ..._Arc4TuplesTypeContract.ssa.opt_pass_16.ir | 75 + ..._Arc4TuplesTypeContract.ssa.opt_pass_17.ir | 70 + ..._Arc4TuplesTypeContract.ssa.opt_pass_18.ir | 69 + ..._Arc4TuplesTypeContract.ssa.opt_pass_19.ir | 68 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_2.ir | 197 + ..._Arc4TuplesTypeContract.ssa.opt_pass_20.ir | 67 + ..._Arc4TuplesTypeContract.ssa.opt_pass_21.ir | 66 + ..._Arc4TuplesTypeContract.ssa.opt_pass_22.ir | 65 + ..._Arc4TuplesTypeContract.ssa.opt_pass_23.ir | 64 + ..._Arc4TuplesTypeContract.ssa.opt_pass_24.ir | 63 + ..._Arc4TuplesTypeContract.ssa.opt_pass_25.ir | 61 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_3.ir | 194 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_4.ir | 193 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_5.ir | 192 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_6.ir | 191 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_7.ir | 190 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_8.ir | 189 + ...s_Arc4TuplesTypeContract.ssa.opt_pass_9.ir | 188 + examples/arc4_types/string.py | 28 + examples/arc4_types/structs.py | 64 + examples/arc4_types/tuples.py | 61 + examples/asset/algopy.log | 209 +- examples/asset/contract.py | 17 +- .../asset/out/contract.approval.debug.teal | 193 +- examples/asset/out/contract.approval.teal | 87 +- .../contract.approval_unoptimized.debug.teal | 194 +- .../out/contract.approval_unoptimized.teal | 88 +- examples/asset/out/contract.awst | 28 +- examples/asset/out/contract.clear.debug.teal | 4 +- .../out/contract.clear_unoptimized.debug.teal | 4 +- examples/asset/out/contract_Reference.cssa.ir | 80 +- .../asset/out/contract_Reference.final.ir | 80 +- .../contract_Reference.final_unoptimized.ir | 84 +- .../out/contract_Reference.parallel_copies.ir | 80 +- .../asset/out/contract_Reference.post_ssa.ir | 80 +- examples/asset/out/contract_Reference.ssa.ir | 84 +- .../out/contract_Reference.ssa.opt_pass_1.ir | 80 +- examples/aug_ass_wit_side_efex/algopy.log | 33 +- examples/aug_ass_wit_side_efex/lol.py | 2 +- examples/augmented_assignment/algopy.log | 72 +- .../out/contract.approval.debug.teal | 18 +- .../out/contract.approval.teal | 18 +- .../contract.approval_unoptimized.debug.teal | 18 +- .../out/contract.approval_unoptimized.teal | 18 +- .../augmented_assignment/out/contract.awst | 2 +- examples/biguint_binary_ops/algopy.log | 101 +- .../out/contract.approval.debug.teal | 2 +- .../out/contract.approval.teal | 2 +- .../contract.approval_unoptimized.debug.teal | 6 +- .../out/contract.approval_unoptimized.teal | 6 +- examples/boolean_binary_ops/algopy.log | 135 +- .../out/contract.approval.debug.teal | 20 +- .../out/contract.approval.teal | 20 +- .../contract.approval_unoptimized.debug.teal | 16 +- .../out/contract.approval_unoptimized.teal | 16 +- examples/boolean_binary_ops/out/contract.awst | 2 +- .../out/contract_BooleanBinaryOps.cssa.ir | 4 +- .../out/contract_BooleanBinaryOps.final.ir | 4 +- ...ntract_BooleanBinaryOps.parallel_copies.ir | 4 +- .../out/contract_BooleanBinaryOps.post_ssa.ir | 4 +- ...ontract_BooleanBinaryOps.ssa.opt_pass_1.ir | 4 +- examples/byte_constants.algopy.log | 37 +- examples/bytes_ops/algopy.log | 51 +- .../out/contract.approval.debug.teal | 4 +- examples/bytes_ops/out/contract.approval.teal | 4 +- .../contract.approval_unoptimized.debug.teal | 6 +- .../out/contract.approval_unoptimized.teal | 6 +- examples/bytes_ops/out/contract.awst | 16 +- examples/calculator/algopy.log | 146 +- .../out/contract.approval.debug.teal | 12 +- .../calculator/out/contract.approval.teal | 12 +- .../contract.approval_unoptimized.debug.teal | 24 +- .../out/contract.approval_unoptimized.teal | 24 +- examples/callsub/algopy.log | 26 +- .../callsub/out/contract.approval.debug.teal | 2 +- examples/callsub/out/contract.approval.teal | 2 +- .../contract.approval_unoptimized.debug.teal | 2 +- .../out/contract.approval_unoptimized.teal | 2 +- examples/chained_assignment/algopy.log | 34 +- .../out/contract.approval.debug.teal | 6 +- .../out/contract.approval.teal | 6 +- .../contract.approval_unoptimized.debug.teal | 6 +- .../out/contract.approval_unoptimized.teal | 6 +- examples/conditional_execution/algopy.log | 394 ++ examples/conditional_execution/contract.py | 75 + .../out/contract.approval.debug.teal | 386 ++ .../out/contract.approval.teal | 345 ++ .../contract.approval_unoptimized.debug.teal | 386 ++ .../out/contract.approval_unoptimized.teal | 345 ++ .../conditional_execution/out/contract.awst | 61 + .../out/contract.clear.debug.teal | 9 + .../out/contract.clear.teal | 7 + .../out/contract.clear_unoptimized.debug.teal | 9 + .../out/contract.clear_unoptimized.teal | 7 + ...tract_ConditionalExecutionContract.cssa.ir | 268 + ...ract_ConditionalExecutionContract.final.ir | 216 + ...onalExecutionContract.final_unoptimized.ir | 216 + ...tionalExecutionContract.parallel_copies.ir | 255 + ...t_ConditionalExecutionContract.post_ssa.ir | 255 + ...ntract_ConditionalExecutionContract.ssa.ir | 229 + .../conditional_execution/out/trace.O0.log | 291 ++ .../conditional_execution/out/trace.O1.log | 291 ++ .../conditional_execution/out/trace.O2.log | 291 ++ examples/conditional_expressions/algopy.log | 86 +- .../out/contract.approval.debug.teal | 10 +- .../out/contract.approval.teal | 10 +- .../contract.approval_unoptimized.debug.teal | 8 +- .../out/contract.approval_unoptimized.teal | 8 +- .../conditional_expressions/out/contract.awst | 14 +- examples/contains/algopy.log | 73 +- .../contains/out/contract.approval.debug.teal | 142 +- examples/contains/out/contract.approval.teal | 22 +- .../contract.approval_unoptimized.debug.teal | 148 +- .../out/contract.approval_unoptimized.teal | 20 +- .../contains/out/contract_MyContract.cssa.ir | 3 +- .../contains/out/contract_MyContract.final.ir | 3 +- .../contract_MyContract.parallel_copies.ir | 3 +- .../out/contract_MyContract.post_ssa.ir | 3 +- .../out/contract_MyContract.ssa.opt_pass_1.ir | 3 +- examples/edverify/algopy.log | 81 + examples/edverify/contract.py | 16 + .../edverify/out/contract.approval.debug.teal | 31 + examples/edverify/out/contract.approval.teal | 27 + .../contract.approval_unoptimized.debug.teal | 31 + .../out/contract.approval_unoptimized.teal | 27 + examples/edverify/out/contract.awst | 15 + .../edverify/out/contract.clear.debug.teal | 9 + examples/edverify/out/contract.clear.teal | 7 + .../out/contract.clear_unoptimized.debug.teal | 9 + .../out/contract.clear_unoptimized.teal | 7 + .../out/contract_VerifyContract.cssa.ir | 31 + .../out/contract_VerifyContract.final.ir | 27 + ...ntract_VerifyContract.final_unoptimized.ir | 27 + ...contract_VerifyContract.parallel_copies.ir | 30 + .../out/contract_VerifyContract.post_ssa.ir | 30 + .../out/contract_VerifyContract.ssa.ir | 28 + examples/edverify/out/edverify.O0.log | 17 + examples/edverify/out/edverify.O1.log | 17 + examples/edverify/out/edverify.O2.log | 17 + examples/enumeration/algopy.log | 139 +- .../out/contract.approval.debug.teal | 18 +- .../enumeration/out/contract.approval.teal | 18 +- .../contract.approval_unoptimized.debug.teal | 12 +- .../out/contract.approval_unoptimized.teal | 12 +- examples/everything/algopy.log | 638 ++- examples/everything/contract.py | 20 +- examples/everything/my_base.py | 6 +- examples/everything/out/application.json | 124 + .../out/contract.approval.debug.teal | 306 ++ .../everything/out/contract.approval.teal | 297 ++ .../contract.approval_unoptimized.debug.teal | 318 ++ .../out/contract.approval_unoptimized.teal | 306 ++ examples/everything/out/contract.awst | 14 +- .../everything/out/contract.clear.debug.teal | 36 + examples/everything/out/contract.clear.teal | 34 + .../out/contract.clear_unoptimized.debug.teal | 36 + .../out/contract.clear_unoptimized.teal | 34 + .../out/contract_Everything.cssa.ir | 190 + .../out/contract_Everything.final.ir | 190 + .../contract_Everything.final_unoptimized.ir | 201 + .../contract_Everything.parallel_copies.ir | 190 + .../out/contract_Everything.post_ssa.ir | 190 + .../everything/out/contract_Everything.ssa.ir | 201 + .../out/contract_Everything.ssa.opt_pass_1.ir | 190 + examples/everything/out/my_base.awst | 8 +- examples/koopman/algopy.log | 27 +- examples/less_simple/algopy.log | 61 +- examples/local_storage/algopy.log | 199 +- .../local_storage/local_storage_contract.py | 12 +- ...local_storage_contract.approval.debug.teal | 34 +- .../out/local_storage_contract.approval.teal | 14 +- ...e_contract.approval_unoptimized.debug.teal | 34 +- ...storage_contract.approval_unoptimized.teal | 14 +- .../out/local_storage_contract.awst | 12 +- ...l_storage_with_offsets.approval.debug.teal | 18 +- .../local_storage_with_offsets.approval.teal | 18 +- ...th_offsets.approval_unoptimized.debug.teal | 18 +- ...age_with_offsets.approval_unoptimized.teal | 18 +- .../out/local_storage_with_offsets.awst | 2 +- examples/module_consts/algopy.log | 17 +- examples/mylib/algopy.log | 9 +- examples/mylib/out/simple_functions.awst | 4 +- examples/nested_loops/algopy.log | 91 +- .../out/contract.approval.debug.teal | 6 +- .../nested_loops/out/contract.approval.teal | 6 +- examples/non_utf8.algopy.log | 7 +- examples/out/address_constant.awst | 6 +- ..._constants.approval_unoptimized.debug.teal | 8 +- .../byte_constants.approval_unoptimized.teal | 8 +- examples/out/byte_constants.awst | 6 +- .../out/tuple_support.approval.debug.teal | 292 +- examples/out/tuple_support.approval.teal | 62 +- ...le_support.approval_unoptimized.debug.teal | 413 +- .../tuple_support.approval_unoptimized.teal | 67 +- examples/out/tuple_support.awst | 10 +- examples/out/tuple_support.clear.debug.teal | 4 +- ...tuple_support.clear_unoptimized.debug.teal | 4 +- .../out/tuple_support_TupleSupport.cssa.ir | 40 +- .../out/tuple_support_TupleSupport.final.ir | 40 +- ..._support_TupleSupport.final_unoptimized.ir | 47 +- ...le_support_TupleSupport.parallel_copies.ir | 40 +- .../tuple_support_TupleSupport.post_ssa.ir | 40 +- .../out/tuple_support_TupleSupport.ssa.ir | 45 +- ...ple_support_TupleSupport.ssa.opt_pass_1.ir | 36 +- ...ple_support_TupleSupport.ssa.opt_pass_2.ir | 38 +- ...ple_support_TupleSupport.ssa.opt_pass_3.ir | 38 +- ...ple_support_TupleSupport.ssa.opt_pass_4.ir | 40 +- examples/out/typing_interactions.awst | 10 +- examples/simple/algopy.log | 51 +- .../contract.approval_unoptimized.debug.teal | 4 +- .../out/contract.approval_unoptimized.teal | 4 +- examples/simplish/algopy.log | 177 +- .../simplish/out/contract.approval.debug.teal | 32 +- examples/simplish/out/contract.approval.teal | 32 +- .../contract.approval_unoptimized.debug.teal | 46 +- .../out/contract.approval_unoptimized.teal | 46 +- examples/simplish/out/contract.awst | 2 +- examples/sizes.txt | 67 +- examples/ssa/algopy.log | 95 +- .../contract.approval_unoptimized.debug.teal | 4 +- .../out/contract.approval_unoptimized.teal | 4 +- .../out/contract.clear_unoptimized.debug.teal | 4 +- .../ssa/out/contract.clear_unoptimized.teal | 4 +- examples/ssa/out/trace.O0.log | 316 +- examples/ssa/out/trace.O1.log | 250 +- examples/ssa/out/trace.O2.log | 52 +- examples/ssa2/algopy.log | 45 +- .../out/contract.clear_unoptimized.debug.teal | 4 +- .../ssa2/out/contract.clear_unoptimized.teal | 4 +- examples/string_ops/algopy.log | 175 +- .../out/contract.approval.debug.teal | 122 +- .../string_ops/out/contract.approval.teal | 68 +- .../contract.approval_unoptimized.debug.teal | 122 +- .../out/contract.approval_unoptimized.teal | 68 +- examples/string_ops/out/contract.awst | 2 +- .../out/contract_MyContract.cssa.ir | 53 +- .../out/contract_MyContract.final.ir | 42 +- .../contract_MyContract.final_unoptimized.ir | 42 +- .../contract_MyContract.parallel_copies.ir | 52 +- .../out/contract_MyContract.post_ssa.ir | 49 +- .../string_ops/out/contract_MyContract.ssa.ir | 44 +- examples/stubs/algopy.log | 1414 +++-- examples/stubs/bytes.approval.teal | 7 + examples/stubs/bytes.clear.teal | 7 + examples/stubs/bytes.py | 3 +- .../stubs/out/biguint.approval.debug.teal | 16 +- examples/stubs/out/biguint.approval.teal | 16 +- .../biguint.approval_unoptimized.debug.teal | 6 +- .../out/biguint.approval_unoptimized.teal | 6 +- .../stubs/out/biguint_BigUIntContract.cssa.ir | 5 - .../out/biguint_BigUIntContract.final.ir | 5 - ...biguint_BigUIntContract.parallel_copies.ir | 5 - .../out/biguint_BigUIntContract.post_ssa.ir | 5 - .../biguint_BigUIntContract.ssa.opt_pass_1.ir | 5 - examples/stubs/out/bytes.O0.log | 557 +- examples/stubs/out/bytes.O1.log | 156 +- examples/stubs/out/bytes.O2.log | 156 +- examples/stubs/out/bytes.approval.debug.teal | 154 +- examples/stubs/out/bytes.approval.teal | 148 - .../out/bytes.approval_unoptimized.debug.teal | 720 ++- .../stubs/out/bytes.approval_unoptimized.teal | 384 +- examples/stubs/out/bytes.awst | 41 +- examples/stubs/out/bytes.clear.debug.teal | 4 +- .../out/bytes.clear_unoptimized.debug.teal | 4 +- .../stubs/out/bytes_BytesContract.cssa.ir | 76 +- .../stubs/out/bytes_BytesContract.final.ir | 76 +- .../bytes_BytesContract.final_unoptimized.ir | 359 +- .../bytes_BytesContract.parallel_copies.ir | 76 +- .../stubs/out/bytes_BytesContract.post_ssa.ir | 76 +- examples/stubs/out/bytes_BytesContract.ssa.ir | 387 +- .../out/bytes_BytesContract.ssa.opt_pass_1.ir | 376 +- .../out/bytes_BytesContract.ssa.opt_pass_2.ir | 262 +- .../out/bytes_BytesContract.ssa.opt_pass_3.ir | 142 +- .../out/bytes_BytesContract.ssa.opt_pass_4.ir | 33 + .../out/bytes_BytesContract.ssa.opt_pass_5.ir | 24 + .../out/bytes_BytesContract.ssa.opt_pass_6.ir | 10 + examples/stubs/out/uint64.approval.debug.teal | 128 +- examples/stubs/out/uint64.approval.teal | 122 - .../uint64.approval_unoptimized.debug.teal | 12 +- .../out/uint64.approval_unoptimized.teal | 12 +- examples/stubs/out/uint64.awst | 16 +- .../stubs/out/uint64_Uint64Contract.cssa.ir | 62 - .../stubs/out/uint64_Uint64Contract.final.ir | 62 - .../uint64_Uint64Contract.parallel_copies.ir | 62 - .../out/uint64_Uint64Contract.post_ssa.ir | 62 - .../uint64_Uint64Contract.ssa.opt_pass_1.ir | 5 - .../uint64_Uint64Contract.ssa.opt_pass_2.ir | 34 +- .../uint64_Uint64Contract.ssa.opt_pass_3.ir | 50 +- .../uint64_Uint64Contract.ssa.opt_pass_4.ir | 52 +- .../uint64_Uint64Contract.ssa.opt_pass_5.ir | 58 +- .../uint64_Uint64Contract.ssa.opt_pass_6.ir | 15 + .../uint64_Uint64Contract.ssa.opt_pass_7.ir | 12 + .../uint64_Uint64Contract.ssa.opt_pass_8.ir | 10 + examples/transaction/algopy.log | 673 +++ examples/transaction/contract.py | 114 + examples/transaction/out/application.json | 149 + .../out/contract.approval.debug.teal | 468 ++ .../transaction/out/contract.approval.teal | 465 ++ .../contract.approval_unoptimized.debug.teal | 482 ++ .../out/contract.approval_unoptimized.teal | 477 ++ examples/transaction/out/contract.awst | 104 + .../transaction/out/contract.clear.debug.teal | 9 + examples/transaction/out/contract.clear.teal | 7 + .../out/contract.clear_unoptimized.debug.teal | 9 + .../out/contract.clear_unoptimized.teal | 7 + .../out/contract_TransactionContract.cssa.ir | 316 ++ .../out/contract_TransactionContract.final.ir | 316 ++ ...t_TransactionContract.final_unoptimized.ir | 332 ++ ...act_TransactionContract.parallel_copies.ir | 316 ++ .../contract_TransactionContract.post_ssa.ir | 316 ++ .../out/contract_TransactionContract.ssa.ir | 326 ++ ...ract_TransactionContract.ssa.opt_pass_1.ir | 316 ++ examples/tuple_support.algopy.log | 411 +- examples/tuple_support.py | 23 +- examples/typing_interactions.algopy.log | 13 +- examples/typing_interactions.py | 4 +- examples/unary/algopy.log | 70 +- .../unary/out/contract.approval.debug.teal | 76 +- examples/unary/out/contract.approval.teal | 28 +- .../contract.approval_unoptimized.debug.teal | 20 +- .../out/contract.approval_unoptimized.teal | 20 +- examples/unary/out/contract.awst | 4 +- .../unary/out/contract_UnaryContract.cssa.ir | 10 - .../unary/out/contract_UnaryContract.final.ir | 10 - .../contract_UnaryContract.parallel_copies.ir | 10 - .../out/contract_UnaryContract.post_ssa.ir | 10 - .../contract_UnaryContract.ssa.opt_pass_1.ir | 9 +- .../contract_UnaryContract.ssa.opt_pass_2.ir | 10 - examples/unary/out/execution_trace.O0.log | 170 +- examples/unary/out/execution_trace.O1.log | 179 +- examples/unary/out/execution_trace.O2.log | 185 +- examples/undefined_phi_args/algopy.log | 128 +- examples/unreachable.algopy.log | 7 +- examples/unssa/algopy.log | 155 +- .../unssa/out/contract.approval.debug.teal | 26 +- examples/unssa/out/contract.approval.teal | 26 +- .../contract.approval_unoptimized.debug.teal | 20 +- .../out/contract.approval_unoptimized.teal | 20 +- examples/unssa/out/execution_trace.O0.log | 1988 +++---- examples/unssa/out/execution_trace.O1.log | 1846 +++---- examples/unssa/out/execution_trace.O2.log | 1810 +++---- examples/voting/algopy.log | 1749 +++++++ examples/voting/out/application.json | 228 + .../voting/out/voting.approval.debug.teal | 960 ++++ examples/voting/out/voting.approval.teal | 927 ++++ .../voting.approval_unoptimized.debug.teal | 1010 ++++ .../out/voting.approval_unoptimized.teal | 971 ++++ examples/voting/out/voting.awst | 192 + examples/voting/out/voting.clear.debug.teal | 9 + examples/voting/out/voting.clear.teal | 7 + .../out/voting.clear_unoptimized.debug.teal | 9 + .../voting/out/voting.clear_unoptimized.teal | 7 + .../voting/out/voting_VotingRoundApp.cssa.ir | 560 ++ .../voting/out/voting_VotingRoundApp.final.ir | 521 ++ ...voting_VotingRoundApp.final_unoptimized.ir | 552 ++ .../voting_VotingRoundApp.parallel_copies.ir | 561 ++ .../out/voting_VotingRoundApp.post_ssa.ir | 543 ++ .../voting/out/voting_VotingRoundApp.ssa.ir | 567 ++ .../voting_VotingRoundApp.ssa.opt_pass_1.ir | 528 ++ .../voting_VotingRoundApp.ssa.opt_pass_2.ir | 527 ++ .../arc4 => examples}/voting/voting.py | 113 +- examples/with_reentrancy/algopy.log | 98 +- .../out/contract.approval.debug.teal | 10 +- .../out/contract.approval.teal | 10 +- .../contract.approval_unoptimized.debug.teal | 22 +- .../out/contract.approval_unoptimized.teal | 22 +- examples/with_structs.algopy.log | 7 +- poetry.lock | 520 +- pyproject.toml | 9 +- real_examples/arc4/voting/out/voting.awst | 118 - scripts/compile_all_examples.py | 46 +- scripts/dry_run_create.py | 16 +- scripts/generate_stubs.py | 26 +- scripts/transform_lang_spec.py | 5 +- src/algopy-stubs/__init__.pyi | 2 + src/algopy-stubs/_array.pyi | 2 +- src/algopy-stubs/_contract.pyi | 2 +- src/algopy-stubs/_gen.pyi | 460 +- src/algopy-stubs/_primitives.pyi | 43 +- src/algopy-stubs/_reference.pyi | 143 + src/algopy-stubs/_storage.pyi | 16 +- src/algopy-stubs/_transactions.pyi | 169 + src/algopy-stubs/_util.pyi | 4 +- src/algopy-stubs/arc4.pyi | 272 +- src/wyvern/ARCHITECTURE.md | 5 +- src/wyvern/__main__.py | 6 + src/wyvern/algo_constants.py | 8 +- src/wyvern/arc32.py | 198 + src/wyvern/avm_type.py | 8 + src/wyvern/awst/function_traverser.py | 36 +- src/wyvern/awst/nodes.py | 319 +- src/wyvern/awst/to_code_visitor.py | 107 +- src/wyvern/awst/visitors.py | 22 +- src/wyvern/awst/wtypes.py | 352 +- src/wyvern/awst_build/constants.py | 89 +- src/wyvern/awst_build/context.py | 136 +- src/wyvern/awst_build/contract.py | 276 +- src/wyvern/awst_build/eb/abi.py | 502 -- src/wyvern/awst_build/eb/arc4/__init__.py | 7 + src/wyvern/awst_build/eb/arc4/arrays.py | 307 ++ src/wyvern/awst_build/eb/arc4/base.py | 170 + src/wyvern/awst_build/eb/arc4/bool.py | 80 + src/wyvern/awst_build/eb/arc4/numeric.py | 178 + src/wyvern/awst_build/eb/arc4/string.py | 59 + src/wyvern/awst_build/eb/arc4/struct.py | 104 + src/wyvern/awst_build/eb/arc4/tuple.py | 172 + src/wyvern/awst_build/eb/array.py | 2 +- src/wyvern/awst_build/eb/asset.py | 110 - src/wyvern/awst_build/eb/base.py | 60 +- src/wyvern/awst_build/eb/bytes.py | 129 +- src/wyvern/awst_build/eb/contracts.py | 23 +- src/wyvern/awst_build/eb/ensure_budget.py | 49 +- src/wyvern/awst_build/eb/intrinsics.py | 94 +- .../awst_build/eb/named_int_constants.py | 10 +- .../awst_build/eb/reference_types/__init__.py | 0 .../account.py} | 74 +- .../eb/reference_types/application.py | 62 + .../awst_build/eb/reference_types/asset.py | 118 + .../awst_build/eb/reference_types/base.py | 94 + .../awst_build/eb/temporary_assignment.py | 12 +- src/wyvern/awst_build/eb/transaction.py | 337 ++ src/wyvern/awst_build/eb/tuple.py | 83 +- src/wyvern/awst_build/eb/type_registry.py | 117 + src/wyvern/awst_build/eb/typing_literal.py | 36 - src/wyvern/awst_build/eb/var_factory.py | 54 +- src/wyvern/awst_build/eb/void.py | 7 +- src/wyvern/awst_build/intrinsic_data.py | 302 +- src/wyvern/awst_build/main.py | 13 +- src/wyvern/awst_build/module.py | 86 +- src/wyvern/awst_build/subroutine.py | 211 +- src/wyvern/awst_build/utils.py | 61 +- src/wyvern/codegen/builder.py | 28 +- src/wyvern/codegen/emitprogram.py | 13 +- src/wyvern/codegen/ops.py | 33 +- src/wyvern/codegen/stack.py | 93 +- src/wyvern/codegen/stack_baileys.py | 28 +- src/wyvern/codegen/stack_frame_allocation.py | 14 +- src/wyvern/codegen/stack_koopmans.py | 20 +- src/wyvern/codegen/stack_simplify_teal.py | 2 +- src/wyvern/codegen/teal.py | 37 +- src/wyvern/codegen/teal_annotaters.py | 59 +- src/wyvern/codegen/visitor.py | 8 +- src/wyvern/codegen/vla.py | 4 +- src/wyvern/compile.py | 54 +- src/wyvern/errors.py | 41 +- src/wyvern/ir/arc4_router.py | 683 +++ src/wyvern/ir/arc4_util.py | 95 + src/wyvern/ir/avm_ops.py | 6 +- src/wyvern/ir/blocks_builder.py | 6 +- src/wyvern/ir/builder.py | 1615 +++--- src/wyvern/ir/main.py | 85 +- src/wyvern/ir/models.py | 39 +- src/wyvern/ir/optimize/arithmetic.py | 259 +- src/wyvern/ir/optimize/collapse_blocks.py | 8 + .../ir/optimize/constant_propagation.py | 159 +- .../ir/optimize/dead_code_elimination.py | 42 +- src/wyvern/ir/optimize/main.py | 2 + src/wyvern/ir/ssa.py | 16 +- src/wyvern/ir/to_text_visitor.py | 7 +- src/wyvern/ir/types_.py | 44 +- src/wyvern/ir/visitor.py | 7 + src/wyvern/ir/visitor_mutator.py | 6 +- src/wyvern/lib_embedded/_algopy_.py | 46 + src/wyvern/metadata.py | 103 + src/wyvern/options.py | 3 +- src/wyvern/parse.py | 46 + src/wyvern/utils.py | 29 + tests/conftest.py | 55 + tests/test_arc32.py | 534 ++ tests/test_awst/module.test | 15 +- tests/test_execution.py | 279 +- 762 files changed, 96439 insertions(+), 15365 deletions(-) create mode 100644 examples/TEALScript/algopy.log create mode 100644 examples/TEALScript/auction/README.md create mode 100644 examples/TEALScript/auction/algopy.log create mode 100644 examples/TEALScript/auction/auction.algo.ts create mode 100644 examples/TEALScript/auction/contract.py create mode 100644 examples/TEALScript/auction/out/application.json create mode 100644 examples/TEALScript/auction/out/contract.approval.debug.teal create mode 100644 examples/TEALScript/auction/out/contract.approval.teal create mode 100644 examples/TEALScript/auction/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/TEALScript/auction/out/contract.approval_unoptimized.teal create mode 100644 examples/TEALScript/auction/out/contract.awst create mode 100644 examples/TEALScript/auction/out/contract.clear.debug.teal rename examples/{abi_types => TEALScript/auction}/out/contract.clear.teal (55%) create mode 100644 examples/TEALScript/auction/out/contract.clear_unoptimized.debug.teal rename examples/{abi_types => TEALScript/auction}/out/contract.clear_unoptimized.teal (55%) create mode 100644 examples/TEALScript/auction/out/contract_Auction.cssa.ir create mode 100644 examples/TEALScript/auction/out/contract_Auction.final.ir create mode 100644 examples/TEALScript/auction/out/contract_Auction.final_unoptimized.ir create mode 100644 examples/TEALScript/auction/out/contract_Auction.parallel_copies.ir create mode 100644 examples/TEALScript/auction/out/contract_Auction.post_ssa.ir create mode 100644 examples/TEALScript/auction/out/contract_Auction.ssa.ir create mode 100644 examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_1.ir create mode 100644 examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_2.ir create mode 100644 examples/TEALScript/auction/tealscript_artifacts/Auction.abi.json create mode 100644 examples/TEALScript/auction/tealscript_artifacts/Auction.approval.teal create mode 100644 examples/TEALScript/auction/tealscript_artifacts/Auction.clear.teal create mode 100644 examples/TEALScript/auction/tealscript_artifacts/Auction.json create mode 100644 examples/TEALScript/auction/tealscript_artifacts/Auction.src_map.json create mode 100644 examples/abi_routing/algopy.log create mode 100644 examples/abi_routing/contract.py create mode 100644 examples/abi_routing/out/application.json create mode 100644 examples/abi_routing/out/contract.approval.debug.teal create mode 100644 examples/abi_routing/out/contract.approval.teal create mode 100644 examples/abi_routing/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/abi_routing/out/contract.approval_unoptimized.teal create mode 100644 examples/abi_routing/out/contract.awst create mode 100644 examples/abi_routing/out/contract.clear.debug.teal create mode 100644 examples/abi_routing/out/contract.clear.teal create mode 100644 examples/abi_routing/out/contract.clear_unoptimized.debug.teal create mode 100644 examples/abi_routing/out/contract.clear_unoptimized.teal create mode 100644 examples/abi_routing/out/contract_Reference.cssa.ir create mode 100644 examples/abi_routing/out/contract_Reference.final.ir create mode 100644 examples/abi_routing/out/contract_Reference.final_unoptimized.ir create mode 100644 examples/abi_routing/out/contract_Reference.parallel_copies.ir create mode 100644 examples/abi_routing/out/contract_Reference.post_ssa.ir create mode 100644 examples/abi_routing/out/contract_Reference.ssa.ir create mode 100644 examples/abi_routing/out/contract_Reference.ssa.opt_pass_1.ir create mode 100644 examples/abi_routing/out/contract_Reference.ssa.opt_pass_2.ir create mode 100644 examples/abi_routing/out/contract_Reference.ssa.opt_pass_3.ir create mode 100644 examples/abi_routing/out/contract_Reference.ssa.opt_pass_4.ir delete mode 100644 examples/abi_types/algopy.log delete mode 100644 examples/abi_types/contract.py delete mode 100644 examples/abi_types/out/abi_types.O0.log delete mode 100644 examples/abi_types/out/abi_types.O1.log delete mode 100644 examples/abi_types/out/abi_types.O2.log delete mode 100644 examples/abi_types/out/contract.approval.debug.teal delete mode 100644 examples/abi_types/out/contract.approval.teal delete mode 100644 examples/abi_types/out/contract.approval_unoptimized.debug.teal delete mode 100644 examples/abi_types/out/contract.approval_unoptimized.teal delete mode 100644 examples/abi_types/out/contract.awst delete mode 100644 examples/abi_types/out/contract.clear.debug.teal delete mode 100644 examples/abi_types/out/contract.clear_unoptimized.debug.teal delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.cssa.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.final.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.final_unoptimized.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.parallel_copies.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.post_ssa.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.ssa.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_1.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_2.ir delete mode 100644 examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_3.ir create mode 100644 examples/algopy.log create mode 100644 examples/amm/out/application.json create mode 100644 examples/amm/out/contract.approval.debug.teal create mode 100644 examples/amm/out/contract.approval.teal create mode 100644 examples/amm/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/amm/out/contract.approval_unoptimized.teal create mode 100644 examples/amm/out/contract.clear.debug.teal create mode 100644 examples/amm/out/contract.clear.teal create mode 100644 examples/amm/out/contract.clear_unoptimized.debug.teal create mode 100644 examples/amm/out/contract.clear_unoptimized.teal create mode 100644 examples/amm/out/contract_ConstantProductAMM.cssa.ir create mode 100644 examples/amm/out/contract_ConstantProductAMM.final.ir create mode 100644 examples/amm/out/contract_ConstantProductAMM.final_unoptimized.ir create mode 100644 examples/amm/out/contract_ConstantProductAMM.parallel_copies.ir create mode 100644 examples/amm/out/contract_ConstantProductAMM.post_ssa.ir create mode 100644 examples/amm/out/contract_ConstantProductAMM.ssa.ir create mode 100644 examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_1.ir create mode 100644 examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_2.ir create mode 100644 examples/application/algopy.log create mode 100644 examples/application/contract.py create mode 100644 examples/application/out/contract.approval.debug.teal create mode 100644 examples/application/out/contract.approval.teal create mode 100644 examples/application/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/application/out/contract.approval_unoptimized.teal create mode 100644 examples/application/out/contract.awst create mode 100644 examples/application/out/contract.clear.debug.teal create mode 100644 examples/application/out/contract.clear.teal create mode 100644 examples/application/out/contract.clear_unoptimized.debug.teal create mode 100644 examples/application/out/contract.clear_unoptimized.teal create mode 100644 examples/application/out/contract_Reference.cssa.ir create mode 100644 examples/application/out/contract_Reference.final.ir create mode 100644 examples/application/out/contract_Reference.final_unoptimized.ir create mode 100644 examples/application/out/contract_Reference.parallel_copies.ir create mode 100644 examples/application/out/contract_Reference.post_ssa.ir create mode 100644 examples/application/out/contract_Reference.ssa.ir create mode 100644 examples/application/out/contract_Reference.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/algopy.log create mode 100644 examples/arc4_types/array.py create mode 100644 examples/arc4_types/bool.py create mode 100644 examples/arc4_types/dynamic_string_array.py create mode 100644 examples/arc4_types/numeric.py create mode 100644 examples/arc4_types/out/application.json create mode 100644 examples/arc4_types/out/array.O0.log create mode 100644 examples/arc4_types/out/array.O1.log create mode 100644 examples/arc4_types/out/array.O2.log create mode 100644 examples/arc4_types/out/array.approval.debug.teal create mode 100644 examples/arc4_types/out/array.approval.teal create mode 100644 examples/arc4_types/out/array.approval_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/array.approval_unoptimized.teal create mode 100644 examples/arc4_types/out/array.awst create mode 100644 examples/arc4_types/out/array.clear.debug.teal create mode 100644 examples/arc4_types/out/array.clear.teal create mode 100644 examples/arc4_types/out/array.clear_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/array.clear_unoptimized.teal create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.cssa.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.final.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.final_unoptimized.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.parallel_copies.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.post_ssa.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.ssa.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_2.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_3.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_4.ir create mode 100644 examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_5.ir create mode 100644 examples/arc4_types/out/bool.O0.log create mode 100644 examples/arc4_types/out/bool.O1.log create mode 100644 examples/arc4_types/out/bool.O2.log create mode 100644 examples/arc4_types/out/bool.approval.debug.teal create mode 100644 examples/arc4_types/out/bool.approval.teal create mode 100644 examples/arc4_types/out/bool.approval_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/bool.approval_unoptimized.teal create mode 100644 examples/arc4_types/out/bool.awst create mode 100644 examples/arc4_types/out/bool.clear.debug.teal create mode 100644 examples/arc4_types/out/bool.clear.teal create mode 100644 examples/arc4_types/out/bool.clear_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/bool.clear_unoptimized.teal create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.cssa.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.final.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.final_unoptimized.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.parallel_copies.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.post_ssa.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_10.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_11.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_12.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_13.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_14.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_15.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_16.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_2.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_3.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_4.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_5.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_6.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_7.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_8.ir create mode 100644 examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_9.ir create mode 100644 examples/arc4_types/out/dynamic_string_array.approval.debug.teal create mode 100644 examples/arc4_types/out/dynamic_string_array.approval.teal create mode 100644 examples/arc4_types/out/dynamic_string_array.approval_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/dynamic_string_array.approval_unoptimized.teal create mode 100644 examples/arc4_types/out/dynamic_string_array.awst create mode 100644 examples/arc4_types/out/dynamic_string_array.clear.debug.teal create mode 100644 examples/arc4_types/out/dynamic_string_array.clear.teal create mode 100644 examples/arc4_types/out/dynamic_string_array.clear_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/dynamic_string_array.clear_unoptimized.teal create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.cssa.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final_unoptimized.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.parallel_copies.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.post_ssa.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_2.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_3.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_4.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_5.ir create mode 100644 examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_6.ir create mode 100644 examples/arc4_types/out/named_tuples.O0.log create mode 100644 examples/arc4_types/out/named_tuples.O1.log create mode 100644 examples/arc4_types/out/named_tuples.O2.log create mode 100644 examples/arc4_types/out/numeric.O0.log create mode 100644 examples/arc4_types/out/numeric.O1.log create mode 100644 examples/arc4_types/out/numeric.O2.log create mode 100644 examples/arc4_types/out/numeric.approval.debug.teal create mode 100644 examples/arc4_types/out/numeric.approval.teal create mode 100644 examples/arc4_types/out/numeric.approval_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/numeric.approval_unoptimized.teal create mode 100644 examples/arc4_types/out/numeric.awst create mode 100644 examples/arc4_types/out/numeric.clear.debug.teal create mode 100644 examples/arc4_types/out/numeric.clear.teal create mode 100644 examples/arc4_types/out/numeric.clear_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/numeric.clear_unoptimized.teal create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.cssa.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.final.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.final_unoptimized.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.parallel_copies.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.post_ssa.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_2.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_3.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_4.ir create mode 100644 examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_5.ir create mode 100644 examples/arc4_types/out/string.O0.log create mode 100644 examples/arc4_types/out/string.O1.log create mode 100644 examples/arc4_types/out/string.O2.log create mode 100644 examples/arc4_types/out/string.approval.debug.teal create mode 100644 examples/arc4_types/out/string.approval.teal create mode 100644 examples/arc4_types/out/string.approval_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/string.approval_unoptimized.teal create mode 100644 examples/arc4_types/out/string.awst create mode 100644 examples/arc4_types/out/string.clear.debug.teal create mode 100644 examples/arc4_types/out/string.clear.teal create mode 100644 examples/arc4_types/out/string.clear_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/string.clear_unoptimized.teal create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.cssa.ir create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.final.ir create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.final_unoptimized.ir create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.parallel_copies.ir create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.post_ssa.ir create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.ssa.ir create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_2.ir create mode 100644 examples/arc4_types/out/structs.O0.log create mode 100644 examples/arc4_types/out/structs.O1.log create mode 100644 examples/arc4_types/out/structs.O2.log create mode 100644 examples/arc4_types/out/structs.approval.debug.teal create mode 100644 examples/arc4_types/out/structs.approval.teal create mode 100644 examples/arc4_types/out/structs.approval_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/structs.approval_unoptimized.teal create mode 100644 examples/arc4_types/out/structs.awst create mode 100644 examples/arc4_types/out/structs.clear.debug.teal create mode 100644 examples/arc4_types/out/structs.clear.teal create mode 100644 examples/arc4_types/out/structs.clear_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/structs.clear_unoptimized.teal create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.cssa.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.final.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.final_unoptimized.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.parallel_copies.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.post_ssa.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_2.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_3.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_4.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_5.ir create mode 100644 examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_6.ir create mode 100644 examples/arc4_types/out/tuples.O0.log create mode 100644 examples/arc4_types/out/tuples.O1.log create mode 100644 examples/arc4_types/out/tuples.O2.log create mode 100644 examples/arc4_types/out/tuples.approval.debug.teal create mode 100644 examples/arc4_types/out/tuples.approval.teal create mode 100644 examples/arc4_types/out/tuples.approval_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/tuples.approval_unoptimized.teal create mode 100644 examples/arc4_types/out/tuples.awst create mode 100644 examples/arc4_types/out/tuples.clear.debug.teal create mode 100644 examples/arc4_types/out/tuples.clear.teal create mode 100644 examples/arc4_types/out/tuples.clear_unoptimized.debug.teal create mode 100644 examples/arc4_types/out/tuples.clear_unoptimized.teal create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.cssa.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final_unoptimized.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.parallel_copies.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.post_ssa.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_1.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_10.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_11.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_12.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_13.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_14.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_15.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_16.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_17.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_18.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_19.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_2.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_20.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_21.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_22.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_23.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_24.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_25.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_3.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_4.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_5.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_6.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_7.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_8.ir create mode 100644 examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_9.ir create mode 100644 examples/arc4_types/string.py create mode 100644 examples/arc4_types/structs.py create mode 100644 examples/arc4_types/tuples.py create mode 100644 examples/conditional_execution/algopy.log create mode 100644 examples/conditional_execution/contract.py create mode 100644 examples/conditional_execution/out/contract.approval.debug.teal create mode 100644 examples/conditional_execution/out/contract.approval.teal create mode 100644 examples/conditional_execution/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/conditional_execution/out/contract.approval_unoptimized.teal create mode 100644 examples/conditional_execution/out/contract.awst create mode 100644 examples/conditional_execution/out/contract.clear.debug.teal create mode 100644 examples/conditional_execution/out/contract.clear.teal create mode 100644 examples/conditional_execution/out/contract.clear_unoptimized.debug.teal create mode 100644 examples/conditional_execution/out/contract.clear_unoptimized.teal create mode 100644 examples/conditional_execution/out/contract_ConditionalExecutionContract.cssa.ir create mode 100644 examples/conditional_execution/out/contract_ConditionalExecutionContract.final.ir create mode 100644 examples/conditional_execution/out/contract_ConditionalExecutionContract.final_unoptimized.ir create mode 100644 examples/conditional_execution/out/contract_ConditionalExecutionContract.parallel_copies.ir create mode 100644 examples/conditional_execution/out/contract_ConditionalExecutionContract.post_ssa.ir create mode 100644 examples/conditional_execution/out/contract_ConditionalExecutionContract.ssa.ir create mode 100644 examples/conditional_execution/out/trace.O0.log create mode 100644 examples/conditional_execution/out/trace.O1.log create mode 100644 examples/conditional_execution/out/trace.O2.log create mode 100644 examples/edverify/algopy.log create mode 100644 examples/edverify/contract.py create mode 100644 examples/edverify/out/contract.approval.debug.teal create mode 100644 examples/edverify/out/contract.approval.teal create mode 100644 examples/edverify/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/edverify/out/contract.approval_unoptimized.teal create mode 100644 examples/edverify/out/contract.awst create mode 100644 examples/edverify/out/contract.clear.debug.teal create mode 100644 examples/edverify/out/contract.clear.teal create mode 100644 examples/edverify/out/contract.clear_unoptimized.debug.teal create mode 100644 examples/edverify/out/contract.clear_unoptimized.teal create mode 100644 examples/edverify/out/contract_VerifyContract.cssa.ir create mode 100644 examples/edverify/out/contract_VerifyContract.final.ir create mode 100644 examples/edverify/out/contract_VerifyContract.final_unoptimized.ir create mode 100644 examples/edverify/out/contract_VerifyContract.parallel_copies.ir create mode 100644 examples/edverify/out/contract_VerifyContract.post_ssa.ir create mode 100644 examples/edverify/out/contract_VerifyContract.ssa.ir create mode 100644 examples/edverify/out/edverify.O0.log create mode 100644 examples/edverify/out/edverify.O1.log create mode 100644 examples/edverify/out/edverify.O2.log create mode 100644 examples/everything/out/application.json create mode 100644 examples/everything/out/contract.approval.debug.teal create mode 100644 examples/everything/out/contract.approval.teal create mode 100644 examples/everything/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/everything/out/contract.approval_unoptimized.teal create mode 100644 examples/everything/out/contract.clear.debug.teal create mode 100644 examples/everything/out/contract.clear.teal create mode 100644 examples/everything/out/contract.clear_unoptimized.debug.teal create mode 100644 examples/everything/out/contract.clear_unoptimized.teal create mode 100644 examples/everything/out/contract_Everything.cssa.ir create mode 100644 examples/everything/out/contract_Everything.final.ir create mode 100644 examples/everything/out/contract_Everything.final_unoptimized.ir create mode 100644 examples/everything/out/contract_Everything.parallel_copies.ir create mode 100644 examples/everything/out/contract_Everything.post_ssa.ir create mode 100644 examples/everything/out/contract_Everything.ssa.ir create mode 100644 examples/everything/out/contract_Everything.ssa.opt_pass_1.ir create mode 100644 examples/stubs/bytes.approval.teal create mode 100644 examples/stubs/bytes.clear.teal create mode 100644 examples/stubs/out/bytes_BytesContract.ssa.opt_pass_4.ir create mode 100644 examples/stubs/out/bytes_BytesContract.ssa.opt_pass_5.ir create mode 100644 examples/stubs/out/bytes_BytesContract.ssa.opt_pass_6.ir create mode 100644 examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_6.ir create mode 100644 examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_7.ir create mode 100644 examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_8.ir create mode 100644 examples/transaction/algopy.log create mode 100644 examples/transaction/contract.py create mode 100644 examples/transaction/out/application.json create mode 100644 examples/transaction/out/contract.approval.debug.teal create mode 100644 examples/transaction/out/contract.approval.teal create mode 100644 examples/transaction/out/contract.approval_unoptimized.debug.teal create mode 100644 examples/transaction/out/contract.approval_unoptimized.teal create mode 100644 examples/transaction/out/contract.awst create mode 100644 examples/transaction/out/contract.clear.debug.teal create mode 100644 examples/transaction/out/contract.clear.teal create mode 100644 examples/transaction/out/contract.clear_unoptimized.debug.teal create mode 100644 examples/transaction/out/contract.clear_unoptimized.teal create mode 100644 examples/transaction/out/contract_TransactionContract.cssa.ir create mode 100644 examples/transaction/out/contract_TransactionContract.final.ir create mode 100644 examples/transaction/out/contract_TransactionContract.final_unoptimized.ir create mode 100644 examples/transaction/out/contract_TransactionContract.parallel_copies.ir create mode 100644 examples/transaction/out/contract_TransactionContract.post_ssa.ir create mode 100644 examples/transaction/out/contract_TransactionContract.ssa.ir create mode 100644 examples/transaction/out/contract_TransactionContract.ssa.opt_pass_1.ir create mode 100644 examples/voting/algopy.log create mode 100644 examples/voting/out/application.json create mode 100644 examples/voting/out/voting.approval.debug.teal create mode 100644 examples/voting/out/voting.approval.teal create mode 100644 examples/voting/out/voting.approval_unoptimized.debug.teal create mode 100644 examples/voting/out/voting.approval_unoptimized.teal create mode 100644 examples/voting/out/voting.awst create mode 100644 examples/voting/out/voting.clear.debug.teal create mode 100644 examples/voting/out/voting.clear.teal create mode 100644 examples/voting/out/voting.clear_unoptimized.debug.teal create mode 100644 examples/voting/out/voting.clear_unoptimized.teal create mode 100644 examples/voting/out/voting_VotingRoundApp.cssa.ir create mode 100644 examples/voting/out/voting_VotingRoundApp.final.ir create mode 100644 examples/voting/out/voting_VotingRoundApp.final_unoptimized.ir create mode 100644 examples/voting/out/voting_VotingRoundApp.parallel_copies.ir create mode 100644 examples/voting/out/voting_VotingRoundApp.post_ssa.ir create mode 100644 examples/voting/out/voting_VotingRoundApp.ssa.ir create mode 100644 examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_1.ir create mode 100644 examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_2.ir rename {real_examples/arc4 => examples}/voting/voting.py (73%) delete mode 100644 real_examples/arc4/voting/out/voting.awst create mode 100644 src/algopy-stubs/_reference.pyi create mode 100644 src/algopy-stubs/_transactions.pyi create mode 100644 src/wyvern/arc32.py create mode 100644 src/wyvern/avm_type.py delete mode 100644 src/wyvern/awst_build/eb/abi.py create mode 100644 src/wyvern/awst_build/eb/arc4/__init__.py create mode 100644 src/wyvern/awst_build/eb/arc4/arrays.py create mode 100644 src/wyvern/awst_build/eb/arc4/base.py create mode 100644 src/wyvern/awst_build/eb/arc4/bool.py create mode 100644 src/wyvern/awst_build/eb/arc4/numeric.py create mode 100644 src/wyvern/awst_build/eb/arc4/string.py create mode 100644 src/wyvern/awst_build/eb/arc4/struct.py create mode 100644 src/wyvern/awst_build/eb/arc4/tuple.py delete mode 100644 src/wyvern/awst_build/eb/asset.py create mode 100644 src/wyvern/awst_build/eb/reference_types/__init__.py rename src/wyvern/awst_build/eb/{address.py => reference_types/account.py} (53%) create mode 100644 src/wyvern/awst_build/eb/reference_types/application.py create mode 100644 src/wyvern/awst_build/eb/reference_types/asset.py create mode 100644 src/wyvern/awst_build/eb/reference_types/base.py create mode 100644 src/wyvern/awst_build/eb/transaction.py create mode 100644 src/wyvern/awst_build/eb/type_registry.py delete mode 100644 src/wyvern/awst_build/eb/typing_literal.py create mode 100644 src/wyvern/ir/arc4_router.py create mode 100644 src/wyvern/ir/arc4_util.py create mode 100644 src/wyvern/lib_embedded/_algopy_.py create mode 100644 src/wyvern/metadata.py create mode 100644 tests/test_arc32.py diff --git a/examples/TEALScript/algopy.log b/examples/TEALScript/algopy.log new file mode 100644 index 0000000000..3878d5f5d2 --- /dev/null +++ b/examples/TEALScript/algopy.log @@ -0,0 +1,628 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug TEALScript +debug: Building AWST for __init__.py +debug: Building AWST for TEALScript +debug: Building AWST for TEALScript/auction +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for TEALScript/auction/contract.py +debug: Sealing block@0: // L28 +debug: Terminated block@0: // L28 +debug: Sealing block@0: // L45 +debug: Terminated block@0: // L45 +debug: Sealing block@0: // L66 +debug: Terminated block@0: // L66 +debug: Sealing block@0: // L70 +debug: Terminated block@0: // L70 +debug: Sealing block@0: // L86 +debug: Terminated block@0: // L86 +debug: Sealing block@None: // if_body_L92 +debug: Sealing block@None: // else_body_L92 +debug: Terminated block@1: // if_body_L92 +debug: Sealing block@2: // after_if_else_L92 +debug: Created Phi assignment: let amount#2: uint64 = undefined while trying to resolve 'amount' in block@2: // after_if_else_L92 +debug: Added amount#0 to Phi node: let amount#2: uint64 = φ(amount#0 <- block@0) in block@0: // L86 +debug: Added amount#1 to Phi node: let amount#2: uint64 = φ(amount#0 <- block@0, amount#1 <- block@1) in block@1: // if_body_L92 +debug: Created Phi assignment: let original_amount#1: uint64 = undefined while trying to resolve 'original_amount' in block@2: // after_if_else_L92 +debug: Added original_amount#0 to Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0) in block@0: // L86 +debug: Added original_amount#0 to Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) in block@1: // if_body_L92 +debug: Replacing trivial Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) (original_amount#1) with original_amount#0 +debug: Deleting Phi assignment: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) +debug: Replaced trivial Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) (original_amount#1) with original_amount#0 in current definition for 1 blocks +debug: Terminated block@2: // after_if_else_L92 +debug: Sealing block@0: // L105 +debug: Terminated block@0: // L105 +debug: Sealing block@0: // L18 +debug: Terminated block@0: // L18 +debug: Sealing block@0: // L17 +debug: Terminated block@0: // L17 +debug: Sealing block@None: // on_create_L18 +debug: Terminated block@1: // on_create_L18 +debug: Sealing block@2: // entrypoint_L18 +debug: Terminated block@2: // entrypoint_L18 +debug: Sealing block@None: // abi_routing_L17 +debug: Sealing block@None: // bare_routing_L17 +debug: Terminated block@3: // abi_routing_L17 +debug: Sealing block@None: // switch_case_default_L17 +debug: Sealing block@None: // opt_into_asset_route_L27 +debug: Sealing block@None: // start_auction_route_L44 +debug: Sealing block@None: // opt_in_route_L65 +debug: Sealing block@None: // bid_route_L69 +debug: Sealing block@None: // claim_bids_route_L85 +debug: Sealing block@None: // claim_asset_route_L104 +debug: Terminated block@4: // opt_into_asset_route_L27 +debug: Terminated block@5: // start_auction_route_L44 +debug: Terminated block@6: // opt_in_route_L65 +debug: Terminated block@7: // bid_route_L69 +debug: Terminated block@8: // claim_bids_route_L85 +debug: Terminated block@9: // claim_asset_route_L104 +debug: Terminated block@10: // switch_case_default_L17 +debug: Sealing block@11: // switch_case_next_L17 +debug: Terminated block@11: // switch_case_next_L17 +debug: Terminated block@12: // bare_routing_L17 +debug: Sealing block@None: // reject_bare_on_completion_L17 +debug: Sealing block@None: // create_L17 +debug: Terminated block@13: // create_L17 +debug: Terminated block@14: // reject_bare_on_completion_L17 +debug: Sealing block@None: // switch_case_next_L17 +debug: Sealing block@15: // after_if_else_L17 +debug: Terminated block@15: // after_if_else_L17 +debug: Sealing block@0: // L127 +debug: Terminated block@0: // L127 +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.ssa.ir +info: Optimizing examples.TEALScript.auction.contract.Auction at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%17#0, maybe_value%14#0 +debug: Replacing {maybe_value%14#0} with awst_tmp%17#0 made 1 modifications +debug: Found equivalence set: tmp%19#0, maybe_value_did_exist%15#0 +debug: Replacing {maybe_value_did_exist%15#0} with tmp%19#0 made 1 modifications +debug: Found equivalence set: awst_tmp%17#1, maybe_value%26#0 +debug: Replacing {maybe_value%26#0} with awst_tmp%17#1 made 1 modifications +debug: Found equivalence set: tmp%30#0, maybe_value_did_exist%27#0 +debug: Replacing {maybe_value_did_exist%27#0} with tmp%30#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Switch switch tmp%40#0 {0u => block@13, * => block@14} simplified to goto [block@13, ...block@14][tmp%40#0] +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@11: // switch_case_next_L17 with block@10: // switch_case_default_L17 in block@15: // after_if_else_L17 +debug: Merged linear block@11: // switch_case_next_L17 into block@10: // switch_case_default_L17 +debug: Merged linear block@15: // after_if_else_L17 into block@10: // switch_case_default_L17 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.start_auction +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_in +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.bid +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_bids +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: app_local_get_ex_value%1#0, original_amount#0, amount#0 +debug: Replacing {app_local_get_ex_value%1#0, amount#0} with original_amount#0 made 3 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_asset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: GotoNth goto [block@13, ...block@14][tmp%40#0] simplified to goto tmp%40#0 ? block@14 : block@13 +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.start_auction +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_in +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.bid +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_bids +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.start_auction +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_in +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.bid +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_bids +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 3, ending loop +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.cssa.ir +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.approval_program +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.start_auction +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.opt_in +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.bid +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.claim_bids +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.claim_asset +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.__init__ +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.post_ssa.ir +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.approval_program +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.start_auction +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.opt_in +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.bid +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.claim_bids +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.claim_asset +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.__init__ +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.parallel_copies.ir +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.approval_program using strategy RootOperandGrouping +debug: Coalescing awst_tmp%17#0 with [awst_tmp%17#1] +debug: Coalescing resulted in 3 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.opt_into_asset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.start_auction using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.opt_in using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.bid using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.claim_bids using strategy RootOperandGrouping +debug: Coalescing amount#1 with [amount#4, amount#2] +debug: Coalescing resulted in 6 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.claim_asset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@3.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_abi_routing@3.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[5]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[7]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[10]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[12]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[15]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[17]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[19]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[21]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[23]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[25]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[1]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[3]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[5]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[7]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[10]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[12]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[19]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[21]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[24]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[26]: 'load awst_tmp%17#0' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[28]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[30]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[33]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[35]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[27]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[40]: 'load awst_tmp%17#0' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[17]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[40]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[15]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[40]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_opt_in_route@6.ops[1]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_opt_in_route@6.ops[3]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_opt_in_route@6.ops[5]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_opt_in_route@6.ops[7]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_opt_in_route@6.ops[10]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_opt_in_route@6.ops[12]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[1]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[3]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[5]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[7]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[10]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[12]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[15]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[17]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[20]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[22]: 'load awst_tmp%17#0' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[24]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[26]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[29]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[31]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[23]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[34]: 'load awst_tmp%17#0' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_claim_bids_route@8.ops[1]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_claim_bids_route@8.ops[3]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_claim_bids_route@8.ops[5]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced main_claim_bids_route@8.ops[7]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted main_claim_bids_route@8.ops[10]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_claim_bids_route@8.ops[12]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[1]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[3]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[5]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[7]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[10]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[12]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[15]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[17]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[19]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[21]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[23]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[25]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@12.ops[1]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_bare_routing@12.ops[3]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_create@13.ops[1]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced main_create@13.ops[3]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted main_create@13.ops[5]: 'store tmp%42#0 to l-stack (copy)' +debug: Replaced main_create@13.ops[7]: 'load tmp%42#0' with 'load tmp%42#0 from l-stack (no copy)' +debug: Found 4 edge set/s for examples.TEALScript.auction.contract.Auction.approval_program +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Inserted opt_into_asset_block@0.ops[7]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[20]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[22]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[33]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[35]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[3]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[15]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[18]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[18]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[22]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[7]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[20]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[22]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[32]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[34]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[3]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[6]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[15]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[18]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[30]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[33]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[41]: 'store new_state_value%9#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[44]: 'load new_state_value%9#0' with 'load new_state_value%9#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[50]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[53]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[55]: 'store new_state_value%12#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[58]: 'load new_state_value%12#0' with 'load new_state_value%12#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[62]: 'store new_state_value%13#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[65]: 'load new_state_value%13#0' with 'load new_state_value%13#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[18]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[22]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[30]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[35]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[50]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[56]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[12]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[14]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[24]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[26]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[41]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[43]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[61]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[63]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[5]: 'store app_global_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[8]: 'load app_global_get_ex_did_exist%2#0' with 'load app_global_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[21]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[24]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[36]: 'store app_global_get_ex_did_exist%9#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[39]: 'load app_global_get_ex_did_exist%9#0' with 'load app_global_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[50]: 'store new_state_value%11#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[53]: 'load new_state_value%11#0' with 'load new_state_value%11#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[57]: 'store new_state_value%12#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[60]: 'load new_state_value%12#0' with 'load new_state_value%12#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[19]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[24]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[7]: 'store app_global_get_ex_value%1#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[12]: 'load app_global_get_ex_value%1#0' with 'load app_global_get_ex_value%1#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[40]: 'store app_global_get_ex_value%8#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[45]: 'load app_global_get_ex_value%8#0' with 'load app_global_get_ex_value%8#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[67]: 'store new_state_value%13#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[74]: 'load new_state_value%13#0' with 'load new_state_value%13#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[12]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[35]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[46]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[7]: 'store app_local_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[10]: 'load app_local_get_ex_did_exist%2#0' with 'load app_local_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[17]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[20]: 'load app_global_get_ex_did_exist%5#0' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[25]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[29]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[19]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[24]: 'load app_global_get_ex_value%4#0' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[13]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[24]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[9]: 'store original_amount#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[30]: 'load original_amount#0' with 'load original_amount#0 from l-stack (no copy)' +debug: Inserted claim_bids_if_body@1.ops[3]: 'store app_global_get_ex_did_exist%8#0 to l-stack (copy)' +debug: Replaced claim_bids_if_body@1.ops[6]: 'load app_global_get_ex_did_exist%8#0' with 'load app_global_get_ex_did_exist%8#0 from l-stack (no copy)' +debug: Inserted claim_bids_if_body@1.ops[5]: 'store app_global_get_ex_value%7#0 to l-stack (copy)' +debug: Replaced claim_bids_if_body@1.ops[10]: 'load app_global_get_ex_value%7#0' with 'load app_global_get_ex_value%7#0 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[6]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[8]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[18]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[20]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[11]: 'store amount#1 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[15]: 'load amount#1' with 'load amount#1 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[17]: 'store new_state_value%10#0 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[24]: 'load new_state_value%10#0' with 'load new_state_value%10#0 from l-stack (no copy)' +debug: Found 1 edge set/s for examples.TEALScript.auction.contract.Auction.claim_bids +debug: examples.TEALScript.auction.contract.Auction.claim_bids f-stack entry: [] +debug: examples.TEALScript.auction.contract.Auction.claim_bids f-stack on first store: ['original_amount#0', 'amount#1'] +debug: Inserted claim_asset_block@0.ops[12]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[14]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[5]: 'store app_global_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[8]: 'load app_global_get_ex_did_exist%2#0' with 'load app_global_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[25]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[28]: 'load app_global_get_ex_did_exist%5#0' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[37]: 'store app_global_get_ex_did_exist%7#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[40]: 'load app_global_get_ex_did_exist%7#0' with 'load app_global_get_ex_did_exist%7#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[47]: 'store app_global_get_ex_did_exist%9#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[50]: 'load app_global_get_ex_did_exist%9#0' with 'load app_global_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[27]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[31]: 'load app_global_get_ex_value%4#0' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[40]: 'store app_global_get_ex_value%6#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[44]: 'load app_global_get_ex_value%6#0' with 'load app_global_get_ex_value%6#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[51]: 'store app_global_get_ex_value%8#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[55]: 'load app_global_get_ex_value%8#0' with 'load app_global_get_ex_value%8#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[7]: 'store app_global_get_ex_value%1#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[12]: 'load app_global_get_ex_value%1#0' with 'load app_global_get_ex_value%1#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[12]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted __init___block@0.ops[13]: 'store new_state_value%0#0 to l-stack (copy)' +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 TEALScript/auction/out/contract.approval.teal +info: Writing TEALScript/auction/out/contract.approval.debug.teal +info: Writing TEALScript/auction/out/contract.clear.teal +info: Writing TEALScript/auction/out/contract.clear.debug.teal +info: Writing TEALScript/auction/out/application.json +>> exit code = 0 \ No newline at end of file diff --git a/examples/TEALScript/auction/README.md b/examples/TEALScript/auction/README.md new file mode 100644 index 0000000000..94016d3e32 --- /dev/null +++ b/examples/TEALScript/auction/README.md @@ -0,0 +1,3 @@ +Port of Beaker auction contract to TEALScript. Original source: https://github.com/algorand-devrel/beaker-auction/tree/7e1fe62b852c0d819954a931f10cf39d841cbc02 + + diff --git a/examples/TEALScript/auction/algopy.log b/examples/TEALScript/auction/algopy.log new file mode 100644 index 0000000000..c0f455552e --- /dev/null +++ b/examples/TEALScript/auction/algopy.log @@ -0,0 +1,502 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 TEALScript/auction +info: Building AWST for __init__.py +info: Building AWST for TEALScript +info: Building AWST for TEALScript/auction +info: Building AWST for TEALScript/auction/contract.py +debug: Sealing block@0: // L28 +debug: Terminated block@0: // L28 +debug: Sealing block@0: // L45 +debug: Terminated block@0: // L45 +debug: Sealing block@0: // L66 +debug: Terminated block@0: // L66 +debug: Sealing block@0: // L70 +debug: Terminated block@0: // L70 +debug: Sealing block@0: // L86 +debug: Terminated block@0: // L86 +debug: Sealing block@None: // if_body_L92 +debug: Sealing block@None: // else_body_L92 +debug: Terminated block@1: // if_body_L92 +debug: Sealing block@2: // after_if_else_L92 +debug: Created Phi assignment: let amount#2: uint64 = undefined while trying to resolve 'amount' in block@2: // after_if_else_L92 +debug: Added amount#0 to Phi node: let amount#2: uint64 = φ(amount#0 <- block@0) in block@0: // L86 +debug: Added amount#1 to Phi node: let amount#2: uint64 = φ(amount#0 <- block@0, amount#1 <- block@1) in block@1: // if_body_L92 +debug: Created Phi assignment: let original_amount#1: uint64 = undefined while trying to resolve 'original_amount' in block@2: // after_if_else_L92 +debug: Added original_amount#0 to Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0) in block@0: // L86 +debug: Added original_amount#0 to Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) in block@1: // if_body_L92 +debug: Replacing trivial Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) (original_amount#1) with original_amount#0 +debug: Deleting Phi assignment: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) +debug: Replaced trivial Phi node: let original_amount#1: uint64 = φ(original_amount#0 <- block@0, original_amount#0 <- block@1) (original_amount#1) with original_amount#0 in current definition for 1 blocks +debug: Terminated block@2: // after_if_else_L92 +debug: Sealing block@0: // L105 +debug: Terminated block@0: // L105 +debug: Sealing block@0: // L18 +debug: Terminated block@0: // L18 +debug: Sealing block@0: // L17 +debug: Terminated block@0: // L17 +debug: Sealing block@None: // on_create_L18 +debug: Terminated block@1: // on_create_L18 +debug: Sealing block@2: // entrypoint_L18 +debug: Terminated block@2: // entrypoint_L18 +debug: Sealing block@None: // abi_routing_L17 +debug: Sealing block@None: // else_body_L17 +debug: Terminated block@3: // abi_routing_L17 +debug: Sealing block@None: // switch_case_default_L17 +debug: Sealing block@None: // opt_into_asset_route_L27 +debug: Sealing block@None: // start_auction_route_L44 +debug: Sealing block@None: // opt_in_route_L65 +debug: Sealing block@None: // bid_route_L69 +debug: Sealing block@None: // claim_bids_route_L85 +debug: Sealing block@None: // claim_asset_route_L104 +debug: Terminated block@4: // opt_into_asset_route_L27 +debug: Terminated block@5: // start_auction_route_L44 +debug: Terminated block@6: // opt_in_route_L65 +debug: Terminated block@7: // bid_route_L69 +debug: Terminated block@8: // claim_bids_route_L85 +debug: Terminated block@9: // claim_asset_route_L104 +debug: Terminated block@10: // switch_case_default_L17 +debug: Sealing block@11: // switch_case_next_L17 +debug: Terminated block@11: // switch_case_next_L17 +debug: Sealing block@12: // after_if_else_L17 +debug: Terminated block@12: // after_if_else_L17 +debug: Sealing block@0: // L127 +debug: Terminated block@0: // L127 +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.ssa.ir +info: Optimizing examples.TEALScript.auction.contract.Auction at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%17#0, maybe_value%14#0 +debug: Replacing {maybe_value%14#0} with awst_tmp%17#0 made 1 modifications +debug: Found equivalence set: tmp%19#0, maybe_value_did_exist%15#0 +debug: Replacing {maybe_value_did_exist%15#0} with tmp%19#0 made 1 modifications +debug: Found equivalence set: awst_tmp%17#1, maybe_value%26#0 +debug: Replacing {maybe_value%26#0} with awst_tmp%17#1 made 1 modifications +debug: Found equivalence set: tmp%30#0, maybe_value_did_exist%27#0 +debug: Replacing {maybe_value_did_exist%27#0} with tmp%30#0 made 1 modifications +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@11: // switch_case_next_L17 with block@10: // switch_case_default_L17 in block@12: // after_if_else_L17 +debug: Merged linear block@11: // switch_case_next_L17 into block@10: // switch_case_default_L17 +debug: Optimizer: Remove Empty Blocks +debug: Removed empty block: block@10: // switch_case_default_L17 +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.start_auction +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_in +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.bid +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_bids +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: app_local_get_ex_value%1#0, original_amount#0, amount#0 +debug: Replacing {app_local_get_ex_value%1#0, amount#0} with original_amount#0 made 3 modifications +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_asset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.start_auction +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.opt_in +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.bid +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_bids +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.claim_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 2, ending loop +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.cssa.ir +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.approval_program +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.start_auction +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.opt_in +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.bid +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.claim_bids +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.claim_asset +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.__init__ +debug: Removing Phis from examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.post_ssa.ir +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.approval_program +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.opt_into_asset +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.start_auction +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.opt_in +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.bid +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.claim_bids +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.claim_asset +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.__init__ +debug: Sequentializing parallel copies in examples.TEALScript.auction.contract.Auction.clear_state_program +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.parallel_copies.ir +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.approval_program using strategy RootOperandGrouping +debug: Coalescing awst_tmp%17#0 with [awst_tmp%17#1] +debug: Coalescing resulted in 3 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.opt_into_asset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.start_auction using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.opt_in using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.bid using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.claim_bids using strategy RootOperandGrouping +debug: Coalescing amount#1 with [amount#4, amount#2] +debug: Coalescing resulted in 6 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.claim_asset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.TEALScript.auction.contract.Auction.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/TEALScript/auction/out/contract_Auction.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@3.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_abi_routing@3.ops[9]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[3]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[5]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[7]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[10]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[12]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[15]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[17]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[19]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[21]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@4.ops[23]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@4.ops[25]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[1]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[3]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[5]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[7]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[10]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[12]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[19]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[21]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[24]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[26]: 'load awst_tmp%17#0 from scratch' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[28]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[30]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[33]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[35]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[27]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[40]: 'load awst_tmp%17#0 from scratch' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[17]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[40]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_start_auction_route@5.ops[15]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_start_auction_route@5.ops[40]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_opt_in_route@6.ops[1]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_opt_in_route@6.ops[3]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_opt_in_route@6.ops[5]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_opt_in_route@6.ops[7]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_opt_in_route@6.ops[10]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_opt_in_route@6.ops[12]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[1]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[3]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[5]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[7]: 'load tmp%24#0 from scratch' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[10]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[12]: 'load tmp%25#0 from scratch' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[15]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[17]: 'load tmp%28#0 from scratch' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[20]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[22]: 'load awst_tmp%17#0 from scratch' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[24]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[26]: 'load tmp%29#0 from scratch' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[29]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[31]: 'load tmp%30#0 from scratch' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_bid_route@7.ops[23]: 'store awst_tmp%17#0 to l-stack (copy)' +debug: Replaced main_bid_route@7.ops[34]: 'load awst_tmp%17#0 from scratch' with 'load awst_tmp%17#0 from l-stack (no copy)' +debug: Inserted main_claim_bids_route@8.ops[1]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_claim_bids_route@8.ops[3]: 'load tmp%31#0 from scratch' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_claim_bids_route@8.ops[5]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced main_claim_bids_route@8.ops[7]: 'load tmp%32#0 from scratch' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted main_claim_bids_route@8.ops[10]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_claim_bids_route@8.ops[12]: 'load tmp%33#0 from scratch' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[1]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[3]: 'load tmp%34#0 from scratch' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[5]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[7]: 'load tmp%35#0 from scratch' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[10]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[12]: 'load tmp%36#0 from scratch' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[15]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[17]: 'load tmp%37#0 from scratch' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[19]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[21]: 'load tmp%38#0 from scratch' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted main_claim_asset_route@9.ops[23]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_claim_asset_route@9.ops[25]: 'load tmp%39#0 from scratch' with 'load tmp%39#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.TEALScript.auction.contract.Auction.approval_program +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Inserted opt_into_asset_block@0.ops[7]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[9]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[21]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[23]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[34]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[36]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[3]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[15]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[18]: 'load app_global_get_ex_did_exist%4#0 from scratch' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[18]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[22]: 'load app_global_get_ex_value%3#0 from scratch' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[7]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[9]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[21]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[23]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[33]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[35]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[3]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[6]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[15]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[18]: 'load app_global_get_ex_did_exist%4#0 from scratch' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[31]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[34]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[42]: 'store new_state_value%9#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[45]: 'load new_state_value%9#0 from scratch' with 'load new_state_value%9#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[51]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[54]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[56]: 'store new_state_value%12#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[59]: 'load new_state_value%12#0 from scratch' with 'load new_state_value%12#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[63]: 'store new_state_value%13#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[66]: 'load new_state_value%13#0 from scratch' with 'load new_state_value%13#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[6]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[18]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[22]: 'load app_global_get_ex_value%3#0 from scratch' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[31]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[36]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted start_auction_block@0.ops[51]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced start_auction_block@0.ops[57]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[12]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[14]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[24]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[26]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[41]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[43]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[61]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[63]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[5]: 'store app_global_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[8]: 'load app_global_get_ex_did_exist%2#0 from scratch' with 'load app_global_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[21]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[24]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[36]: 'store app_global_get_ex_did_exist%9#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[39]: 'load app_global_get_ex_did_exist%9#0 from scratch' with 'load app_global_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[50]: 'store new_state_value%11#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[53]: 'load new_state_value%11#0 from scratch' with 'load new_state_value%11#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[57]: 'store new_state_value%12#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[60]: 'load new_state_value%12#0 from scratch' with 'load new_state_value%12#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[19]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[24]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[7]: 'store app_global_get_ex_value%1#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[12]: 'load app_global_get_ex_value%1#0 from scratch' with 'load app_global_get_ex_value%1#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[40]: 'store app_global_get_ex_value%8#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[45]: 'load app_global_get_ex_value%8#0 from scratch' with 'load app_global_get_ex_value%8#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[67]: 'store new_state_value%13#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[74]: 'load new_state_value%13#0 from scratch' with 'load new_state_value%13#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[12]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted bid_block@0.ops[35]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced bid_block@0.ops[46]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[3]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[7]: 'store app_local_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[10]: 'load app_local_get_ex_did_exist%2#0 from scratch' with 'load app_local_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[17]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[20]: 'load app_global_get_ex_did_exist%5#0 from scratch' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[25]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[29]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[19]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[24]: 'load app_global_get_ex_value%4#0 from scratch' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[13]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[24]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted claim_bids_block@0.ops[9]: 'store original_amount#0 to l-stack (copy)' +debug: Replaced claim_bids_block@0.ops[30]: 'load original_amount#0 from scratch' with 'load original_amount#0 from l-stack (no copy)' +debug: Inserted claim_bids_if_body@1.ops[3]: 'store app_global_get_ex_did_exist%8#0 to l-stack (copy)' +debug: Replaced claim_bids_if_body@1.ops[6]: 'load app_global_get_ex_did_exist%8#0 from scratch' with 'load app_global_get_ex_did_exist%8#0 from l-stack (no copy)' +debug: Inserted claim_bids_if_body@1.ops[5]: 'store app_global_get_ex_value%7#0 to l-stack (copy)' +debug: Replaced claim_bids_if_body@1.ops[10]: 'load app_global_get_ex_value%7#0 from scratch' with 'load app_global_get_ex_value%7#0 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[6]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[8]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[18]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[20]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[11]: 'store amount#1 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[15]: 'load amount#1 from scratch' with 'load amount#1 from l-stack (no copy)' +debug: Inserted claim_bids_after_if_else@2.ops[17]: 'store new_state_value%10#0 to l-stack (copy)' +debug: Replaced claim_bids_after_if_else@2.ops[24]: 'load new_state_value%10#0 from scratch' with 'load new_state_value%10#0 from l-stack (no copy)' +debug: Found 1 edge set/s for examples.TEALScript.auction.contract.Auction.claim_bids +debug: examples.TEALScript.auction.contract.Auction.claim_bids f-stack entry: [] +debug: examples.TEALScript.auction.contract.Auction.claim_bids f-stack on first store: ['original_amount#0', 'amount#1'] +debug: Inserted claim_asset_block@0.ops[12]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[14]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[5]: 'store app_global_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[8]: 'load app_global_get_ex_did_exist%2#0 from scratch' with 'load app_global_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[25]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[28]: 'load app_global_get_ex_did_exist%5#0 from scratch' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[37]: 'store app_global_get_ex_did_exist%7#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[40]: 'load app_global_get_ex_did_exist%7#0 from scratch' with 'load app_global_get_ex_did_exist%7#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[47]: 'store app_global_get_ex_did_exist%9#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[50]: 'load app_global_get_ex_did_exist%9#0 from scratch' with 'load app_global_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[27]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[31]: 'load app_global_get_ex_value%4#0 from scratch' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[40]: 'store app_global_get_ex_value%6#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[44]: 'load app_global_get_ex_value%6#0 from scratch' with 'load app_global_get_ex_value%6#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[51]: 'store app_global_get_ex_value%8#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[55]: 'load app_global_get_ex_value%8#0 from scratch' with 'load app_global_get_ex_value%8#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[7]: 'store app_global_get_ex_value%1#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[12]: 'load app_global_get_ex_value%1#0 from scratch' with 'load app_global_get_ex_value%1#0 from l-stack (no copy)' +debug: Inserted claim_asset_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced claim_asset_block@0.ops[12]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted __init___block@0.ops[13]: 'store new_state_value%0#0 to l-stack (copy)' +debug: Replaced __init___block@0.ops[16]: 'load new_state_value%0#0 from scratch' with 'load new_state_value%0#0 from l-stack (no copy)' +info: Writing /examples/TEALScript/auction/out/contract.approval.teal +info: Writing /examples/TEALScript/auction/out/contract.approval.debug.teal +info: Writing /examples/TEALScript/auction/out/contract.clear.teal +info: Writing /examples/TEALScript/auction/out/contract.clear.debug.teal +>> exit code = 0 \ No newline at end of file diff --git a/examples/TEALScript/auction/auction.algo.ts b/examples/TEALScript/auction/auction.algo.ts new file mode 100644 index 0000000000..fded724e84 --- /dev/null +++ b/examples/TEALScript/auction/auction.algo.ts @@ -0,0 +1,118 @@ +import { Contract } from '../../src/lib/index'; + +// eslint-disable-next-line no-unused-vars +class Auction extends Contract { + previousBidder = GlobalStateKey
(); + + auctionEnd = GlobalStateKey(); + + previousBid = GlobalStateKey(); + + asaAmt = GlobalStateKey(); + + asa = GlobalStateKey(); + + claimableAmount = LocalStateKey(); + + createApplication(): void { + this.auctionEnd.value = 0; + this.previousBid.value = 0; + this.asaAmt.value = 0; + this.asa.value = Asset.zeroIndex; + + // Use zero address rather than an empty string for Account type safety + this.previousBidder.value = globals.zeroAddress; + } + + optIntoAsset(asset: Asset): void { + /// Only allow app creator to opt the app account into a ASA + verifyTxn(this.txn, { sender: globals.creatorAddress }); + + /// Verify a ASA hasn't already been opted into + assert(this.asa.value === Asset.zeroIndex); + + /// Save ASA ID in global state + this.asa.value = asset; + + /// Submit opt-in transaction: 0 asset transfer to self + sendAssetTransfer({ + assetReceiver: this.app.address, + xferAsset: asset, + assetAmount: 0, + }); + } + + startAuction(startingPrice: uint64, length: uint64, axfer: AssetTransferTxn): void { + verifyTxn(this.txn, { sender: globals.creatorAddress }); + + /// Ensure the auction hasn't already been started + assert(this.auctionEnd.value === 0); + + /// Verify axfer + verifyTxn(axfer, { assetReceiver: this.app.address }); + + /// Set global state + this.asaAmt.value = axfer.assetAmount; + this.auctionEnd.value = globals.latestTimestamp + length; + this.previousBid.value = startingPrice; + } + + private pay(receiver: Account, amount: uint64): void { + sendPayment({ + receiver: receiver, + amount: amount, + }); + } + + optInToApplication(): void {} + + // eslint-disable-next-line no-unused-vars + bid(payment: PayTxn): void { + /// Ensure auction hasn't ended + assert(globals.latestTimestamp < this.auctionEnd.value); + + /// Verify payment transaction + verifyTxn(payment, { + sender: this.txn.sender, + amount: { greaterThan: this.previousBid.value }, + }); + + /// Set global state + this.previousBid.value = payment.amount; + this.previousBidder.value = payment.sender; + + /// Update claimable amount + this.claimableAmount(this.txn.sender).value = payment.amount; + } + + claimBids(): void { + const originalAmount = this.claimableAmount(this.txn.sender).value; + let amount = originalAmount; + + /// subtract previous bid if sender is previous bidder + if (this.txn.sender === this.previousBidder.value) amount = amount - this.previousBid.value; + + this.pay(this.txn.sender, amount); + this.claimableAmount(this.txn.sender).value = originalAmount - amount; + } + + claim_asset(asset: Asset): void { + assert(globals.latestTimestamp > this.auctionEnd.value); + + /// Send ASA to previous bidder + sendAssetTransfer({ + assetReceiver: this.previousBidder.value, + xferAsset: asset, + assetAmount: this.asaAmt.value, + assetCloseTo: this.previousBidder.value, + }); + } + + deleteApplication(): void { + sendPayment({ + receiver: globals.creatorAddress, + closeRemainderTo: globals.creatorAddress, + amount: 0, + }); + } +} diff --git a/examples/TEALScript/auction/contract.py b/examples/TEALScript/auction/contract.py new file mode 100644 index 0000000000..b781eed995 --- /dev/null +++ b/examples/TEALScript/auction/contract.py @@ -0,0 +1,128 @@ +from algopy import ( + ARC4Contract, + AssetTransferTransaction, + CreateInnerTransaction, + Global, + Local, + PaymentTransaction, + Transaction, + TransactionType, + UInt64, + arc4, + subroutine, +) +from algopy._reference import Asset + + +class Auction(ARC4Contract): + def __init__(self) -> None: + self.auction_end = UInt64(0) + self.previous_bid = UInt64(0) + self.asa_amount = UInt64(0) + self.asa = Asset(0) + # Use zero address rather than an empty string for Account type safety + self.previous_bidder = Global.zero_address() + self.claimable_amount = Local(UInt64) + + @arc4.abimethod + def opt_into_asset(self, asset: Asset) -> None: + # Only allow app creator to opt the app account into a ASA + assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" + # Verify a ASA hasn't already been opted into + assert self.asa.asset_id == 0, "ASA already opted in" + # Save ASA ID in global state + self.asa = asset + + # Submit opt-in transaction: 0 asset transfer to self + CreateInnerTransaction.begin() + CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) + CreateInnerTransaction.set_fee(UInt64(0)) # cover fee with outer txn + CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) + CreateInnerTransaction.set_xfer_asset(asset.asset_id) + CreateInnerTransaction.submit() + + @arc4.abimethod + def start_auction( + self, starting_price: arc4.UInt64, length: arc4.UInt64, axfer: AssetTransferTransaction + ) -> None: + assert ( + Transaction.sender() == Global.creator_address() + ), "auction must be started by creator" + + # Ensure the auction hasn't already been started + assert self.auction_end == 0, "auction already started" + + # Verify axfer + assert ( + axfer.asset_receiver == Global.current_application_address() + ), "axfer must transfer to this app" + + # Set global state + self.asa_amount = axfer.asset_amount + self.auction_end = Global.latest_timestamp() + length.decode() + self.previous_bid = starting_price.decode() + + @arc4.abimethod + def opt_in(self) -> None: + pass + + @arc4.abimethod + def bid(self, pay: PaymentTransaction) -> None: + # Ensure auction hasn't ended + assert Global.latest_timestamp() < self.auction_end, "auction has ended" + + # Verify payment transaction + assert pay.sender == Transaction.sender(), "payment sender must match transaction sender" + assert pay.amount > self.previous_bid, "Bid must be higher than previous bid" + + # set global state + self.previous_bid = pay.amount + self.previous_bidder = pay.sender + + # Update claimable amount + self.claimable_amount[Transaction.sender()] = pay.amount + + @arc4.abimethod + def claim_bids(self) -> None: + original_amount = self.claimable_amount[Transaction.sender()] + + amount = original_amount + + # subtract previous bid if sender is previous bidder + if Transaction.sender() == self.previous_bidder: + amount -= self.previous_bid + + CreateInnerTransaction.begin() + CreateInnerTransaction.set_type_enum(TransactionType.Payment) + CreateInnerTransaction.set_fee(UInt64(0)) # cover fee with outer txn + CreateInnerTransaction.set_receiver(Transaction.sender()) + CreateInnerTransaction.set_asset_amount(amount) + CreateInnerTransaction.submit() + + self.claimable_amount[Transaction.sender()] = original_amount - amount + + @arc4.abimethod + def claim_asset(self, asset: Asset) -> None: + assert Global.latest_timestamp() > self.auction_end, "auction has not ended" + + # Send ASA to previous bidder + CreateInnerTransaction.begin() + CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) + CreateInnerTransaction.set_fee(UInt64(0)) # cover fee with outer txn + CreateInnerTransaction.set_asset_receiver(self.previous_bidder) + CreateInnerTransaction.set_xfer_asset(asset.asset_id) + CreateInnerTransaction.set_asset_amount(self.asa_amount) + CreateInnerTransaction.set_asset_close_to(self.previous_bidder) + CreateInnerTransaction.submit() + + @subroutine + def delete_application(self) -> None: + CreateInnerTransaction.begin() + CreateInnerTransaction.set_type_enum(TransactionType.Payment) + CreateInnerTransaction.set_fee(UInt64(0)) # cover fee with outer txn + CreateInnerTransaction.set_receiver(Global.creator_address()) + CreateInnerTransaction.set_close_remainder_to(Global.creator_address()) + CreateInnerTransaction.submit() + + def clear_state_program(self) -> bool: + return True diff --git a/examples/TEALScript/auction/out/application.json b/examples/TEALScript/auction/out/application.json new file mode 100644 index 0000000000..6a9834ca95 --- /dev/null +++ b/examples/TEALScript/auction/out/application.json @@ -0,0 +1,163 @@ +{ + "hints": { + "opt_into_asset(asset)void": { + "call_config": { + "no_op": "CALL" + } + }, + "start_auction(uint64,uint64,axfer)void": { + "call_config": { + "no_op": "CALL" + } + }, + "opt_in()void": { + "call_config": { + "no_op": "CALL" + } + }, + "bid(pay)void": { + "call_config": { + "no_op": "CALL" + } + }, + "claim_bids()void": { + "call_config": { + "no_op": "CALL" + } + }, + "claim_asset(asset)void": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLlRFQUxTY3JpcHQuYXVjdGlvbi5jb250cmFjdC5BdWN0aW9uLmFwcHJvdmFsX3Byb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW5fYmxvY2tAMDoKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGJueiBtYWluX2VudHJ5cG9pbnRAMgoKbWFpbl9vbl9jcmVhdGVAMToKICAgICAgICBjYWxsc3ViIF9faW5pdF9fCgptYWluX2VudHJ5cG9pbnRAMjoKICAgICAgICB0eG4gTnVtQXBwQXJncwogICAgICAgIGJ6IG1haW5fYmFyZV9yb3V0aW5nQDEyCgptYWluX2FiaV9yb3V0aW5nQDM6CiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgICAgIG1ldGhvZCAib3B0X2ludG9fYXNzZXQoYXNzZXQpdm9pZCIKICAgICAgICBtZXRob2QgInN0YXJ0X2F1Y3Rpb24odWludDY0LHVpbnQ2NCxheGZlcil2b2lkIgogICAgICAgIG1ldGhvZCAib3B0X2luKCl2b2lkIgogICAgICAgIG1ldGhvZCAiYmlkKHBheSl2b2lkIgogICAgICAgIG1ldGhvZCAiY2xhaW1fYmlkcygpdm9pZCIKICAgICAgICBtZXRob2QgImNsYWltX2Fzc2V0KGFzc2V0KXZvaWQiCiAgICAgICAgdW5jb3ZlciA2CiAgICAgICAgbWF0Y2ggbWFpbl9vcHRfaW50b19hc3NldF9yb3V0ZUA0IG1haW5fc3RhcnRfYXVjdGlvbl9yb3V0ZUA1IG1haW5fb3B0X2luX3JvdXRlQDYgbWFpbl9iaWRfcm91dGVANyBtYWluX2NsYWltX2JpZHNfcm91dGVAOCBtYWluX2NsYWltX2Fzc2V0X3JvdXRlQDkKICAgICAgICBiIG1haW5fc3dpdGNoX2Nhc2VfZGVmYXVsdEAxMAoKbWFpbl9vcHRfaW50b19hc3NldF9yb3V0ZUA0OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBc3NldHMKICAgICAgICBjYWxsc3ViIG9wdF9pbnRvX2Fzc2V0CiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fc3RhcnRfYXVjdGlvbl9yb3V0ZUA1OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDIKICAgICAgICB0eG4gR3JvdXBJbmRleAogICAgICAgIGludCAxCiAgICAgICAgLQogICAgICAgIGR1cAogICAgICAgIGd0eG5zIFR5cGVFbnVtCiAgICAgICAgaW50IGF4ZmVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBheGZlcgogICAgICAgIGNhbGxzdWIgc3RhcnRfYXVjdGlvbgogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX29wdF9pbl9yb3V0ZUA2OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgY2FsbHN1YiBvcHRfaW4KICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9iaWRfcm91dGVANzoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4biBHcm91cEluZGV4CiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZHVwCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBpbnQgcGF5CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBwYXkKICAgICAgICBjYWxsc3ViIGJpZAogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2NsYWltX2JpZHNfcm91dGVAODoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIGNhbGxzdWIgY2xhaW1fYmlkcwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2NsYWltX2Fzc2V0X3JvdXRlQDk6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICAgICAgYnRvaQogICAgICAgIHR4bmFzIEFzc2V0cwogICAgICAgIGNhbGxzdWIgY2xhaW1fYXNzZXQKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9zd2l0Y2hfY2FzZV9kZWZhdWx0QDEwOgogICAgICAgIGVyciAvLyByZWplY3QgdHJhbnNhY3Rpb24KCm1haW5fYmFyZV9yb3V0aW5nQDEyOgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICBibnogbWFpbl9yZWplY3RfYmFyZV9vbl9jb21wbGV0aW9uQDE0CgptYWluX2NyZWF0ZUAxMzoKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gaXMgY3JlYXRpbmcKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9yZWplY3RfYmFyZV9vbl9jb21wbGV0aW9uQDE0OgogICAgICAgIGVyciAvLyByZWplY3QgdHJhbnNhY3Rpb24KCgovLyBleGFtcGxlcy5URUFMU2NyaXB0LmF1Y3Rpb24uY29udHJhY3QuQXVjdGlvbi5vcHRfaW50b19hc3NldChhc3NldCMwOiB1aW50NjQpIC0+IHZvaWQ6Cm9wdF9pbnRvX2Fzc2V0OgogICAgICAgIHByb3RvIDEgMAoKb3B0X2ludG9fYXNzZXRfYmxvY2tAMDoKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgZ2xvYmFsIENyZWF0b3JBZGRyZXNzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gT25seSBjcmVhdG9yIGNhbiBvcHQgaW4gdG8gQVNBCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhc2EiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBBU0EgYWxyZWFkeSBvcHRlZCBpbgogICAgICAgIGJ5dGUgImFzYSIKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGl0eG5fYmVnaW4KICAgICAgICBpbnQgYXhmZXIKICAgICAgICBpdHhuX2ZpZWxkIFR5cGVFbnVtCiAgICAgICAgaW50IDAKICAgICAgICBpdHhuX2ZpZWxkIEZlZQogICAgICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICAgICAgaXR4bl9maWVsZCBBc3NldFJlY2VpdmVyCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgaXR4bl9maWVsZCBYZmVyQXNzZXQKICAgICAgICBpdHhuX3N1Ym1pdAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLlRFQUxTY3JpcHQuYXVjdGlvbi5jb250cmFjdC5BdWN0aW9uLnN0YXJ0X2F1Y3Rpb24oc3RhcnRpbmdfcHJpY2UjMDogYnl0ZXMsIGxlbmd0aCMwOiBieXRlcywgYXhmZXIjMDogdWludDY0KSAtPiB2b2lkOgpzdGFydF9hdWN0aW9uOgogICAgICAgIHByb3RvIDMgMAoKc3RhcnRfYXVjdGlvbl9ibG9ja0AwOgogICAgICAgIHR4biBTZW5kZXIKICAgICAgICBnbG9iYWwgQ3JlYXRvckFkZHJlc3MKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBhdWN0aW9uIG11c3QgYmUgc3RhcnRlZCBieSBjcmVhdG9yCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhdWN0aW9uX2VuZCIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIGF1Y3Rpb24gYWxyZWFkeSBzdGFydGVkCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQXNzZXRSZWNlaXZlcgogICAgICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gYXhmZXIgbXVzdCB0cmFuc2ZlciB0byB0aGlzIGFwcAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIEFzc2V0QW1vdW50CiAgICAgICAgYnl0ZSAiYXNhX2Ftb3VudCIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBnbG9iYWwgTGF0ZXN0VGltZXN0YW1wCiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgYnRvaQogICAgICAgICsKICAgICAgICBieXRlICJhdWN0aW9uX2VuZCIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBidG9pCiAgICAgICAgYnl0ZSAicHJldmlvdXNfYmlkIgogICAgICAgIHN3YXAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLlRFQUxTY3JpcHQuYXVjdGlvbi5jb250cmFjdC5BdWN0aW9uLm9wdF9pbigpIC0+IHZvaWQ6Cm9wdF9pbjoKICAgICAgICBwcm90byAwIDAKCm9wdF9pbl9ibG9ja0AwOgogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLlRFQUxTY3JpcHQuYXVjdGlvbi5jb250cmFjdC5BdWN0aW9uLmJpZChwYXkjMDogdWludDY0KSAtPiB2b2lkOgpiaWQ6CiAgICAgICAgcHJvdG8gMSAwCgpiaWRfYmxvY2tAMDoKICAgICAgICBnbG9iYWwgTGF0ZXN0VGltZXN0YW1wCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhdWN0aW9uX2VuZCIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICA8CiAgICAgICAgYXNzZXJ0IC8vIGF1Y3Rpb24gaGFzIGVuZGVkCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgU2VuZGVyCiAgICAgICAgdHhuIFNlbmRlcgogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIHBheW1lbnQgc2VuZGVyIG11c3QgbWF0Y2ggdHJhbnNhY3Rpb24gc2VuZGVyCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQW1vdW50CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJwcmV2aW91c19iaWQiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgPgogICAgICAgIGFzc2VydCAvLyBCaWQgbXVzdCBiZSBoaWdoZXIgdGhhbiBwcmV2aW91cyBiaWQKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBBbW91bnQKICAgICAgICBieXRlICJwcmV2aW91c19iaWQiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgU2VuZGVyCiAgICAgICAgYnl0ZSAicHJldmlvdXNfYmlkZGVyIgogICAgICAgIHN3YXAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIEFtb3VudAogICAgICAgIHR4biBTZW5kZXIKICAgICAgICBieXRlICJjbGFpbWFibGVfYW1vdW50IgogICAgICAgIHVuY292ZXIgMgogICAgICAgIGFwcF9sb2NhbF9wdXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5URUFMU2NyaXB0LmF1Y3Rpb24uY29udHJhY3QuQXVjdGlvbi5jbGFpbV9iaWRzKCkgLT4gdm9pZDoKY2xhaW1fYmlkczoKICAgICAgICBwcm90byAwIDAKCmNsYWltX2JpZHNfYmxvY2tAMDoKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJjbGFpbWFibGVfYW1vdW50IgogICAgICAgIGFwcF9sb2NhbF9nZXRfZXgKICAgICAgICBzd2FwCiAgICAgICAgZHVwCiAgICAgICAgY292ZXIgMgogICAgICAgIGNvdmVyIDIKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgdHhuIFNlbmRlcgogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAicHJldmlvdXNfYmlkZGVyIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgID09CiAgICAgICAgYnogY2xhaW1fYmlkc19hZnRlcl9pZl9lbHNlQDIKCmNsYWltX2JpZHNfaWZfYm9keUAxOgogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAicHJldmlvdXNfYmlkIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGZyYW1lX2RpZyAwCiAgICAgICAgc3dhcAogICAgICAgIC0KICAgICAgICBmcmFtZV9idXJ5IDEKCmNsYWltX2JpZHNfYWZ0ZXJfaWZfZWxzZUAyOgogICAgICAgIGl0eG5fYmVnaW4KICAgICAgICBpbnQgcGF5CiAgICAgICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgICAgIGludCAwCiAgICAgICAgaXR4bl9maWVsZCBGZWUKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgaXR4bl9maWVsZCBSZWNlaXZlcgogICAgICAgIGZyYW1lX2RpZyAxCiAgICAgICAgZHVwCiAgICAgICAgaXR4bl9maWVsZCBBc3NldEFtb3VudAogICAgICAgIGl0eG5fc3VibWl0CiAgICAgICAgZnJhbWVfZGlnIDAKICAgICAgICBzd2FwCiAgICAgICAgLQogICAgICAgIHR4biBTZW5kZXIKICAgICAgICBieXRlICJjbGFpbWFibGVfYW1vdW50IgogICAgICAgIHVuY292ZXIgMgogICAgICAgIGFwcF9sb2NhbF9wdXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5URUFMU2NyaXB0LmF1Y3Rpb24uY29udHJhY3QuQXVjdGlvbi5jbGFpbV9hc3NldChhc3NldCMwOiB1aW50NjQpIC0+IHZvaWQ6CmNsYWltX2Fzc2V0OgogICAgICAgIHByb3RvIDEgMAoKY2xhaW1fYXNzZXRfYmxvY2tAMDoKICAgICAgICBnbG9iYWwgTGF0ZXN0VGltZXN0YW1wCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhdWN0aW9uX2VuZCIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICA+CiAgICAgICAgYXNzZXJ0IC8vIGF1Y3Rpb24gaGFzIG5vdCBlbmRlZAogICAgICAgIGl0eG5fYmVnaW4KICAgICAgICBpbnQgYXhmZXIKICAgICAgICBpdHhuX2ZpZWxkIFR5cGVFbnVtCiAgICAgICAgaW50IDAKICAgICAgICBpdHhuX2ZpZWxkIEZlZQogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAicHJldmlvdXNfYmlkZGVyIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGl0eG5fZmllbGQgQXNzZXRSZWNlaXZlcgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGl0eG5fZmllbGQgWGZlckFzc2V0CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhc2FfYW1vdW50IgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGl0eG5fZmllbGQgQXNzZXRBbW91bnQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgInByZXZpb3VzX2JpZGRlciIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBpdHhuX2ZpZWxkIEFzc2V0Q2xvc2VUbwogICAgICAgIGl0eG5fc3VibWl0CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuVEVBTFNjcmlwdC5hdWN0aW9uLmNvbnRyYWN0LkF1Y3Rpb24uX19pbml0X18oKSAtPiB2b2lkOgpfX2luaXRfXzoKICAgICAgICBwcm90byAwIDAKCl9faW5pdF9fX2Jsb2NrQDA6CiAgICAgICAgYnl0ZSAiYXVjdGlvbl9lbmQiCiAgICAgICAgaW50IDAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGJ5dGUgInByZXZpb3VzX2JpZCIKICAgICAgICBpbnQgMAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgYnl0ZSAiYXNhX2Ftb3VudCIKICAgICAgICBpbnQgMAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgYnl0ZSAiYXNhIgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICAgICBieXRlICJwcmV2aW91c19iaWRkZXIiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgcmV0c3ViCgo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLlRFQUxTY3JpcHQuYXVjdGlvbi5jb250cmFjdC5BdWN0aW9uLmNsZWFyX3N0YXRlX3Byb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW5fYmxvY2tAMDoKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoK" + }, + "state": { + "global": { + "num_byte_slices": 1, + "num_uints": 4 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 1 + } + }, + "schema": { + "global": { + "declared": { + "asa": { + "type": "uint64", + "key": "asa" + }, + "asa_amount": { + "type": "uint64", + "key": "asa_amount" + }, + "auction_end": { + "type": "uint64", + "key": "auction_end" + }, + "previous_bid": { + "type": "uint64", + "key": "previous_bid" + }, + "previous_bidder": { + "type": "bytes", + "key": "previous_bidder" + } + }, + "reserved": {} + }, + "local": { + "declared": { + "claimable_amount": { + "type": "uint64", + "key": "claimable_amount" + } + }, + "reserved": {} + } + }, + "contract": { + "name": "Auction", + "methods": [ + { + "name": "opt_into_asset", + "args": [ + { + "type": "asset", + "name": "asset" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "start_auction", + "args": [ + { + "type": "uint64", + "name": "starting_price" + }, + { + "type": "uint64", + "name": "length" + }, + { + "type": "axfer", + "name": "axfer" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "opt_in", + "args": [], + "returns": { + "type": "void" + } + }, + { + "name": "bid", + "args": [ + { + "type": "pay", + "name": "pay" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "claim_bids", + "args": [], + "returns": { + "type": "void" + } + }, + { + "name": "claim_asset", + "args": [ + { + "type": "asset", + "name": "asset" + } + ], + "returns": { + "type": "void" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract.approval.debug.teal b/examples/TEALScript/auction/out/contract.approval.debug.teal new file mode 100644 index 0000000000..60ef257170 --- /dev/null +++ b/examples/TEALScript/auction/out/contract.approval.debug.teal @@ -0,0 +1,374 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + bz main_bare_routing@12 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + // Implicit fall through to main_abi_routing@3 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + method "opt_into_asset(asset)void" // tmp%2#0,method<"opt_into_asset(asset)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 27 + method "start_auction(uint64,uint64,axfer)void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 44 + method "opt_in()void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void"> arc4.abimethod File "TEALScript/auction/contract.py", line 65 + method "bid(pay)void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 69 + method "claim_bids()void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void">,method<"claim_bids()void"> arc4.abimethod File "TEALScript/auction/contract.py", line 85 + method "claim_asset(asset)void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void">,method<"claim_bids()void">,method<"claim_asset(asset)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 104 + uncover 6 // load tmp%2#0 from l-stack (no copy) method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void">,method<"claim_bids()void">,method<"claim_asset(asset)void">,tmp%2#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + match main_opt_into_asset_route@4 main_start_auction_route@5 main_opt_in_route@6 main_bid_route@7 main_claim_bids_route@8 main_claim_asset_route@9 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + b main_switch_case_default@10 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_opt_into_asset_route@4: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 27 + ! // {!} arc4.abimethod File "TEALScript/auction/contract.py", line 27 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 27 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + txna ApplicationArgs 1 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + btoi // {btoi} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txnas Assets // {txnas} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub opt_into_asset // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 27 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + +main_start_auction_route@5: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 44 + ! // {!} arc4.abimethod File "TEALScript/auction/contract.py", line 44 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 44 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + txna ApplicationArgs 1 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txna ApplicationArgs 2 // tmp%12#0,{txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txn GroupIndex // tmp%12#0,tmp%13#0,{txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int 1 // tmp%12#0,tmp%13#0,tmp%16#0,1 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + - // tmp%12#0,tmp%13#0,{-} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + dup // load awst_tmp%17#0 from l-stack (copy) tmp%12#0,tmp%13#0,awst_tmp%17#0,awst_tmp%17#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + gtxns TypeEnum // tmp%12#0,tmp%13#0,awst_tmp%17#0,{gtxns} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int axfer // tmp%12#0,tmp%13#0,awst_tmp%17#0,tmp%18#0,axfer class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + == // tmp%12#0,tmp%13#0,awst_tmp%17#0,{==} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + assert // transaction type is axfer // tmp%12#0,tmp%13#0,awst_tmp%17#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub start_auction // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 44 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + +main_opt_in_route@6: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 65 + ! // {!} arc4.abimethod File "TEALScript/auction/contract.py", line 65 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 65 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + callsub opt_in // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 65 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + +main_bid_route@7: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 69 + ! // {!} arc4.abimethod File "TEALScript/auction/contract.py", line 69 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 69 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + txn GroupIndex // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int 1 // tmp%28#0,1 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + - // {-} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + dup // load awst_tmp%17#0 from l-stack (copy) awst_tmp%17#0,awst_tmp%17#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + gtxns TypeEnum // awst_tmp%17#0,{gtxns} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int pay // awst_tmp%17#0,tmp%29#0,pay class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + == // awst_tmp%17#0,{==} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + assert // transaction type is pay // awst_tmp%17#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub bid // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 69 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + +main_claim_bids_route@8: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 85 + ! // {!} arc4.abimethod File "TEALScript/auction/contract.py", line 85 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 85 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + callsub claim_bids // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 85 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + +main_claim_asset_route@9: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 104 + ! // {!} arc4.abimethod File "TEALScript/auction/contract.py", line 104 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 104 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + txna ApplicationArgs 1 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + btoi // {btoi} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txnas Assets // {txnas} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub claim_asset // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 104 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + +main_switch_case_default@10: + err // reject transaction // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_bare_routing@12: + txn OnCompletion // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + bnz main_reject_bare_on_completion@14 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + // Implicit fall through to main_create@13 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_create@13: + txn ApplicationID // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + ! // {!} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + assert // is creating // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int 1 // 1 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + return // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_reject_bare_on_completion@14: + err // reject transaction // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + + +// examples.TEALScript.auction.contract.Auction.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "TEALScript/auction/contract.py", line 28 + +opt_into_asset_block@0: + txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "TEALScript/auction/contract.py", line 30 + global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "TEALScript/auction/contract.py", line 30 + == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "TEALScript/auction/contract.py", line 30 + assert // Only creator can opt in to ASA // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "TEALScript/auction/contract.py", line 30 + int 0 // (𝕡) asset#0 | 0 self.asa File "TEALScript/auction/contract.py", line 32 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "TEALScript/auction/contract.py", line 32 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "TEALScript/auction/contract.py", line 32 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "TEALScript/auction/contract.py", line 32 + ! // (𝕡) asset#0 | {!} self.asa.asset_id == 0, "ASA already opted in" File "TEALScript/auction/contract.py", line 32 + assert // ASA already opted in // (𝕡) asset#0 | assert self.asa.asset_id == 0, "ASA already opted in" File "TEALScript/auction/contract.py", line 32 + byte "asa" // (𝕡) asset#0 | "asa" self.asa File "TEALScript/auction/contract.py", line 34 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "TEALScript/auction/contract.py", line 28 + app_global_put // (𝕡) asset#0 | self.asa = asset File "TEALScript/auction/contract.py", line 34 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "TEALScript/auction/contract.py", line 37 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "TEALScript/auction/contract.py", line 38 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "TEALScript/auction/contract.py", line 38 + int 0 // (𝕡) asset#0 | 0 0 File "TEALScript/auction/contract.py", line 39 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "TEALScript/auction/contract.py", line 39 + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "TEALScript/auction/contract.py", line 40 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "TEALScript/auction/contract.py", line 40 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "TEALScript/auction/contract.py", line 28 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "TEALScript/auction/contract.py", line 41 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "TEALScript/auction/contract.py", line 42 + retsub // + + +// examples.TEALScript.auction.contract.Auction.start_auction(starting_price#0: bytes, length#0: bytes, axfer#0: uint64) -> void: +start_auction: + proto 3 0 // (𝕡) starting_price#0,length#0,axfer#0 | def start_auction( File "TEALScript/auction/contract.py", line 45 + +start_auction_block@0: + txn Sender // (𝕡) starting_price#0,length#0,axfer#0 | {txn} Transaction.sender() File "TEALScript/auction/contract.py", line 49 + global CreatorAddress // (𝕡) starting_price#0,length#0,axfer#0 | tmp%0#0,{global} Global.creator_address() File "TEALScript/auction/contract.py", line 49 + == // (𝕡) starting_price#0,length#0,axfer#0 | {==} Transaction.sender() == Global.creator_address() File "TEALScript/auction/contract.py", line 49 + assert // auction must be started by creator // (𝕡) starting_price#0,length#0,axfer#0 | assert ( File "TEALScript/auction/contract.py", line 48 + int 0 // (𝕡) starting_price#0,length#0,axfer#0 | 0 self.auction_end File "TEALScript/auction/contract.py", line 53 + byte "auction_end" // (𝕡) starting_price#0,length#0,axfer#0 | 0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 53 + app_global_get_ex // (𝕡) starting_price#0,length#0,axfer#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.auction_end File "TEALScript/auction/contract.py", line 53 + assert // check value exists // (𝕡) starting_price#0,length#0,axfer#0 | app_global_get_ex_value%3#0 self.auction_end File "TEALScript/auction/contract.py", line 53 + ! // (𝕡) starting_price#0,length#0,axfer#0 | {!} self.auction_end == 0, "auction already started" File "TEALScript/auction/contract.py", line 53 + assert // auction already started // (𝕡) starting_price#0,length#0,axfer#0 | assert self.auction_end == 0, "auction already started" File "TEALScript/auction/contract.py", line 53 + frame_dig -1 // load axfer#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | axfer#0 axfer: AssetTransferTransaction File "TEALScript/auction/contract.py", line 46 + gtxns AssetReceiver // (𝕡) starting_price#0,length#0,axfer#0 | {gtxns} axfer.asset_receiver File "TEALScript/auction/contract.py", line 57 + global CurrentApplicationAddress // (𝕡) starting_price#0,length#0,axfer#0 | tmp%6#0,{global} Global.current_application_address() File "TEALScript/auction/contract.py", line 57 + == // (𝕡) starting_price#0,length#0,axfer#0 | {==} axfer.asset_receiver == Global.current_application_address() File "TEALScript/auction/contract.py", line 57 + assert // axfer must transfer to this app // (𝕡) starting_price#0,length#0,axfer#0 | assert ( File "TEALScript/auction/contract.py", line 56 + frame_dig -1 // load axfer#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | axfer#0 axfer: AssetTransferTransaction File "TEALScript/auction/contract.py", line 46 + gtxns AssetAmount // (𝕡) starting_price#0,length#0,axfer#0 | {gtxns} axfer.asset_amount File "TEALScript/auction/contract.py", line 61 + byte "asa_amount" // (𝕡) starting_price#0,length#0,axfer#0 | new_state_value%9#0,"asa_amount" self.asa_amount File "TEALScript/auction/contract.py", line 61 + swap // load new_state_value%9#0 from l-stack (no copy) (𝕡) starting_price#0,length#0,axfer#0 | "asa_amount",new_state_value%9#0 axfer.asset_amount File "TEALScript/auction/contract.py", line 61 + app_global_put // (𝕡) starting_price#0,length#0,axfer#0 | self.asa_amount = axfer.asset_amount File "TEALScript/auction/contract.py", line 61 + global LatestTimestamp // (𝕡) starting_price#0,length#0,axfer#0 | {global} Global.latest_timestamp() File "TEALScript/auction/contract.py", line 62 + frame_dig -2 // load length#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | tmp%10#0,length#0 length: arc4.UInt64 File "TEALScript/auction/contract.py", line 46 + btoi // (𝕡) starting_price#0,length#0,axfer#0 | tmp%10#0,{btoi} length.decode() File "TEALScript/auction/contract.py", line 62 + + // (𝕡) starting_price#0,length#0,axfer#0 | {+} Global.latest_timestamp() + length.decode() File "TEALScript/auction/contract.py", line 62 + byte "auction_end" // (𝕡) starting_price#0,length#0,axfer#0 | new_state_value%12#0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 62 + swap // load new_state_value%12#0 from l-stack (no copy) (𝕡) starting_price#0,length#0,axfer#0 | "auction_end",new_state_value%12#0 Global.latest_timestamp() + length.decode() File "TEALScript/auction/contract.py", line 62 + app_global_put // (𝕡) starting_price#0,length#0,axfer#0 | self.auction_end = Global.latest_timestamp() + length.decode() File "TEALScript/auction/contract.py", line 62 + frame_dig -3 // load starting_price#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | starting_price#0 starting_price: arc4.UInt64 File "TEALScript/auction/contract.py", line 46 + btoi // (𝕡) starting_price#0,length#0,axfer#0 | {btoi} starting_price.decode() File "TEALScript/auction/contract.py", line 63 + byte "previous_bid" // (𝕡) starting_price#0,length#0,axfer#0 | new_state_value%13#0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 63 + swap // load new_state_value%13#0 from l-stack (no copy) (𝕡) starting_price#0,length#0,axfer#0 | "previous_bid",new_state_value%13#0 starting_price.decode() File "TEALScript/auction/contract.py", line 63 + app_global_put // (𝕡) starting_price#0,length#0,axfer#0 | self.previous_bid = starting_price.decode() File "TEALScript/auction/contract.py", line 63 + retsub // + + +// examples.TEALScript.auction.contract.Auction.opt_in() -> void: +opt_in: + proto 0 0 // def opt_in(self) -> None: File "TEALScript/auction/contract.py", line 66 + +opt_in_block@0: + retsub // + + +// examples.TEALScript.auction.contract.Auction.bid(pay#0: uint64) -> void: +bid: + proto 1 0 // (𝕡) pay#0 | def bid(self, pay: PaymentTransaction) -> None: File "TEALScript/auction/contract.py", line 70 + +bid_block@0: + global LatestTimestamp // (𝕡) pay#0 | {global} Global.latest_timestamp() File "TEALScript/auction/contract.py", line 72 + int 0 // (𝕡) pay#0 | tmp%0#0,0 self.auction_end File "TEALScript/auction/contract.py", line 72 + byte "auction_end" // (𝕡) pay#0 | tmp%0#0,0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 72 + app_global_get_ex // (𝕡) pay#0 | tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.auction_end File "TEALScript/auction/contract.py", line 72 + assert // check value exists // (𝕡) pay#0 | tmp%0#0,app_global_get_ex_value%1#0 self.auction_end File "TEALScript/auction/contract.py", line 72 + < // (𝕡) pay#0 | {<} Global.latest_timestamp() < self.auction_end, "auction has ended" File "TEALScript/auction/contract.py", line 72 + assert // auction has ended // (𝕡) pay#0 | assert Global.latest_timestamp() < self.auction_end, "auction has ended" File "TEALScript/auction/contract.py", line 72 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Sender // (𝕡) pay#0 | {gtxns} pay.sender File "TEALScript/auction/contract.py", line 75 + txn Sender // (𝕡) pay#0 | tmp%4#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 75 + == // (𝕡) pay#0 | {==} pay.sender == Transaction.sender(), "payment sender must match transaction sender" File "TEALScript/auction/contract.py", line 75 + assert // payment sender must match transaction sender // (𝕡) pay#0 | assert pay.sender == Transaction.sender(), "payment sender must match transaction sender" File "TEALScript/auction/contract.py", line 75 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Amount // (𝕡) pay#0 | {gtxns} pay.amount File "TEALScript/auction/contract.py", line 76 + int 0 // (𝕡) pay#0 | tmp%7#0,0 self.previous_bid File "TEALScript/auction/contract.py", line 76 + byte "previous_bid" // (𝕡) pay#0 | tmp%7#0,0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 76 + app_global_get_ex // (𝕡) pay#0 | tmp%7#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bid File "TEALScript/auction/contract.py", line 76 + assert // check value exists // (𝕡) pay#0 | tmp%7#0,app_global_get_ex_value%8#0 self.previous_bid File "TEALScript/auction/contract.py", line 76 + > // (𝕡) pay#0 | {>} pay.amount > self.previous_bid, "Bid must be higher than previous bid" File "TEALScript/auction/contract.py", line 76 + assert // Bid must be higher than previous bid // (𝕡) pay#0 | assert pay.amount > self.previous_bid, "Bid must be higher than previous bid" File "TEALScript/auction/contract.py", line 76 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Amount // (𝕡) pay#0 | {gtxns} pay.amount File "TEALScript/auction/contract.py", line 79 + byte "previous_bid" // (𝕡) pay#0 | new_state_value%11#0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 79 + swap // load new_state_value%11#0 from l-stack (no copy) (𝕡) pay#0 | "previous_bid",new_state_value%11#0 pay.amount File "TEALScript/auction/contract.py", line 79 + app_global_put // (𝕡) pay#0 | self.previous_bid = pay.amount File "TEALScript/auction/contract.py", line 79 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Sender // (𝕡) pay#0 | {gtxns} pay.sender File "TEALScript/auction/contract.py", line 80 + byte "previous_bidder" // (𝕡) pay#0 | new_state_value%12#0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 80 + swap // load new_state_value%12#0 from l-stack (no copy) (𝕡) pay#0 | "previous_bidder",new_state_value%12#0 pay.sender File "TEALScript/auction/contract.py", line 80 + app_global_put // (𝕡) pay#0 | self.previous_bidder = pay.sender File "TEALScript/auction/contract.py", line 80 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Amount // (𝕡) pay#0 | {gtxns} pay.amount File "TEALScript/auction/contract.py", line 83 + txn Sender // (𝕡) pay#0 | new_state_value%13#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 83 + byte "claimable_amount" // (𝕡) pay#0 | new_state_value%13#0,tmp%14#0,"claimable_amount" self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 83 + uncover 2 // load new_state_value%13#0 from l-stack (no copy) (𝕡) pay#0 | tmp%14#0,"claimable_amount",new_state_value%13#0 pay.amount File "TEALScript/auction/contract.py", line 83 + app_local_put // (𝕡) pay#0 | self.claimable_amount[Transaction.sender()] = pay.amount File "TEALScript/auction/contract.py", line 83 + retsub // + + +// examples.TEALScript.auction.contract.Auction.claim_bids() -> void: +claim_bids: + proto 0 0 // def claim_bids(self) -> None: File "TEALScript/auction/contract.py", line 86 + +claim_bids_block@0: + txn Sender // {txn} Transaction.sender() File "TEALScript/auction/contract.py", line 87 + int 0 // tmp%0#0,0 self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + byte "claimable_amount" // tmp%0#0,0,"claimable_amount" self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + app_local_get_ex // {app_local_get_ex}.0,{app_local_get_ex}.1 self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + swap // store app_local_get_ex_did_exist%2#0 to l-stack (no copy) app_local_get_ex_did_exist%2#0,{app_local_get_ex}.0 self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + dup + cover 2 // store original_amount#0 to l-stack (copy) original_amount#0,app_local_get_ex_did_exist%2#0,original_amount#0 original_amount File "TEALScript/auction/contract.py", line 87 + cover 2 // store original_amount#0 to f-stack (𝕗) original_amount#0 | original_amount#0,app_local_get_ex_did_exist%2#0 original_amount File "TEALScript/auction/contract.py", line 87 + assert // check value exists // (𝕗) original_amount#0 | original_amount#0 self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + txn Sender // (𝕗) original_amount#0 | original_amount#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 92 + int 0 // (𝕗) original_amount#0 | original_amount#0,tmp%3#0,0 self.previous_bidder File "TEALScript/auction/contract.py", line 92 + byte "previous_bidder" // (𝕗) original_amount#0 | original_amount#0,tmp%3#0,0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 92 + app_global_get_ex // (𝕗) original_amount#0 | original_amount#0,tmp%3#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bidder File "TEALScript/auction/contract.py", line 92 + assert // check value exists // (𝕗) original_amount#0 | original_amount#0,tmp%3#0,app_global_get_ex_value%4#0 self.previous_bidder File "TEALScript/auction/contract.py", line 92 + == // (𝕗) original_amount#0 | original_amount#0,{==} Transaction.sender() == self.previous_bidder: File "TEALScript/auction/contract.py", line 92 + bz claim_bids_after_if_else@2 // (𝕗) original_amount#0,amount#1 | if Transaction.sender() == self.previous_bidder: File "TEALScript/auction/contract.py", line 92 + // Implicit fall through to claim_bids_if_body@1 // (𝕗) original_amount#0,amount#1 | if Transaction.sender() == self.previous_bidder: File "TEALScript/auction/contract.py", line 92 + +claim_bids_if_body@1: + int 0 // (𝕗) original_amount#0,amount#1 | 0 self.previous_bid File "TEALScript/auction/contract.py", line 93 + byte "previous_bid" // (𝕗) original_amount#0,amount#1 | 0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 93 + app_global_get_ex // (𝕗) original_amount#0,amount#1 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bid File "TEALScript/auction/contract.py", line 93 + assert // check value exists // (𝕗) original_amount#0,amount#1 | app_global_get_ex_value%7#0 self.previous_bid File "TEALScript/auction/contract.py", line 93 + frame_dig 0 // load original_amount#0 from f-stack (𝕗) original_amount#0,amount#1 | app_global_get_ex_value%7#0,original_amount#0 original_amount File "TEALScript/auction/contract.py", line 87 + swap // load app_global_get_ex_value%7#0 from l-stack (no copy) (𝕗) original_amount#0,amount#1 | original_amount#0,app_global_get_ex_value%7#0 self.previous_bid File "TEALScript/auction/contract.py", line 93 + - // (𝕗) original_amount#0,amount#1 | {-} amount -= self.previous_bid File "TEALScript/auction/contract.py", line 93 + frame_bury 1 // store amount#1 to f-stack (𝕗) original_amount#0,amount#1 | amount File "TEALScript/auction/contract.py", line 93 + // Implicit fall through to claim_bids_after_if_else@2 // (𝕗) original_amount#0,amount#1 | + +claim_bids_after_if_else@2: + itxn_begin // (𝕗) original_amount#0,amount#1 | CreateInnerTransaction.begin() File "TEALScript/auction/contract.py", line 95 + int pay // (𝕗) original_amount#0,amount#1 | pay TransactionType.Payment File "TEALScript/auction/contract.py", line 96 + itxn_field TypeEnum // (𝕗) original_amount#0,amount#1 | CreateInnerTransaction.set_type_enum(TransactionType.Payment) File "TEALScript/auction/contract.py", line 96 + int 0 // (𝕗) original_amount#0,amount#1 | 0 0 File "TEALScript/auction/contract.py", line 97 + itxn_field Fee // (𝕗) original_amount#0,amount#1 | CreateInnerTransaction.set_fee(UInt64(0)) File "TEALScript/auction/contract.py", line 97 + txn Sender // (𝕗) original_amount#0,amount#1 | {txn} Transaction.sender() File "TEALScript/auction/contract.py", line 98 + itxn_field Receiver // (𝕗) original_amount#0,amount#1 | CreateInnerTransaction.set_receiver(Transaction.sender()) File "TEALScript/auction/contract.py", line 98 + frame_dig 1 // load amount#1 from f-stack (𝕗) original_amount#0,amount#1 | amount#1 amount File "TEALScript/auction/contract.py", line 93 + dup // store amount#1 to l-stack (copy) (𝕗) original_amount#0,amount#1 | amount#1,amount#1 amount File "TEALScript/auction/contract.py", line 93 + itxn_field AssetAmount // (𝕗) original_amount#0,amount#1 | amount#1 CreateInnerTransaction.set_asset_amount(amount) File "TEALScript/auction/contract.py", line 99 + itxn_submit // (𝕗) original_amount#0,amount#1 | amount#1 CreateInnerTransaction.submit() File "TEALScript/auction/contract.py", line 100 + frame_dig 0 // load original_amount#0 from f-stack (𝕗) original_amount#0,amount#1 | amount#1,original_amount#0 original_amount File "TEALScript/auction/contract.py", line 87 + swap // load amount#1 from l-stack (no copy) (𝕗) original_amount#0,amount#1 | original_amount#0,amount#1 amount File "TEALScript/auction/contract.py", line 93 + - // (𝕗) original_amount#0,amount#1 | {-} original_amount - amount File "TEALScript/auction/contract.py", line 102 + txn Sender // (𝕗) original_amount#0,amount#1 | new_state_value%10#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 102 + byte "claimable_amount" // (𝕗) original_amount#0,amount#1 | new_state_value%10#0,tmp%11#0,"claimable_amount" self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 102 + uncover 2 // load new_state_value%10#0 from l-stack (no copy) (𝕗) original_amount#0,amount#1 | tmp%11#0,"claimable_amount",new_state_value%10#0 original_amount - amount File "TEALScript/auction/contract.py", line 102 + app_local_put // (𝕗) original_amount#0,amount#1 | self.claimable_amount[Transaction.sender()] = original_amount - amount File "TEALScript/auction/contract.py", line 102 + retsub // + + +// examples.TEALScript.auction.contract.Auction.claim_asset(asset#0: uint64) -> void: +claim_asset: + proto 1 0 // (𝕡) asset#0 | def claim_asset(self, asset: Asset) -> None: File "TEALScript/auction/contract.py", line 105 + +claim_asset_block@0: + global LatestTimestamp // (𝕡) asset#0 | {global} Global.latest_timestamp() File "TEALScript/auction/contract.py", line 106 + int 0 // (𝕡) asset#0 | tmp%0#0,0 self.auction_end File "TEALScript/auction/contract.py", line 106 + byte "auction_end" // (𝕡) asset#0 | tmp%0#0,0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 106 + app_global_get_ex // (𝕡) asset#0 | tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.auction_end File "TEALScript/auction/contract.py", line 106 + assert // check value exists // (𝕡) asset#0 | tmp%0#0,app_global_get_ex_value%1#0 self.auction_end File "TEALScript/auction/contract.py", line 106 + > // (𝕡) asset#0 | {>} Global.latest_timestamp() > self.auction_end, "auction has not ended" File "TEALScript/auction/contract.py", line 106 + assert // auction has not ended // (𝕡) asset#0 | assert Global.latest_timestamp() > self.auction_end, "auction has not ended" File "TEALScript/auction/contract.py", line 106 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "TEALScript/auction/contract.py", line 109 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "TEALScript/auction/contract.py", line 110 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "TEALScript/auction/contract.py", line 110 + int 0 // (𝕡) asset#0 | 0 0 File "TEALScript/auction/contract.py", line 111 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "TEALScript/auction/contract.py", line 111 + int 0 // (𝕡) asset#0 | 0 self.previous_bidder File "TEALScript/auction/contract.py", line 112 + byte "previous_bidder" // (𝕡) asset#0 | 0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 112 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bidder File "TEALScript/auction/contract.py", line 112 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%4#0 self.previous_bidder File "TEALScript/auction/contract.py", line 112 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(self.previous_bidder) File "TEALScript/auction/contract.py", line 112 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "TEALScript/auction/contract.py", line 105 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "TEALScript/auction/contract.py", line 113 + int 0 // (𝕡) asset#0 | 0 self.asa_amount File "TEALScript/auction/contract.py", line 114 + byte "asa_amount" // (𝕡) asset#0 | 0,"asa_amount" self.asa_amount File "TEALScript/auction/contract.py", line 114 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa_amount File "TEALScript/auction/contract.py", line 114 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%6#0 self.asa_amount File "TEALScript/auction/contract.py", line 114 + itxn_field AssetAmount // (𝕡) asset#0 | CreateInnerTransaction.set_asset_amount(self.asa_amount) File "TEALScript/auction/contract.py", line 114 + int 0 // (𝕡) asset#0 | 0 self.previous_bidder File "TEALScript/auction/contract.py", line 115 + byte "previous_bidder" // (𝕡) asset#0 | 0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 115 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bidder File "TEALScript/auction/contract.py", line 115 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%8#0 self.previous_bidder File "TEALScript/auction/contract.py", line 115 + itxn_field AssetCloseTo // (𝕡) asset#0 | CreateInnerTransaction.set_asset_close_to(self.previous_bidder) File "TEALScript/auction/contract.py", line 115 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "TEALScript/auction/contract.py", line 116 + retsub // + + +// examples.TEALScript.auction.contract.Auction.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "TEALScript/auction/contract.py", line 18 + +__init___block@0: + byte "auction_end" // "auction_end" self.auction_end File "TEALScript/auction/contract.py", line 19 + int 0 // "auction_end",0 0 File "TEALScript/auction/contract.py", line 19 + app_global_put // self.auction_end = UInt64(0) File "TEALScript/auction/contract.py", line 19 + byte "previous_bid" // "previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 20 + int 0 // "previous_bid",0 0 File "TEALScript/auction/contract.py", line 20 + app_global_put // self.previous_bid = UInt64(0) File "TEALScript/auction/contract.py", line 20 + byte "asa_amount" // "asa_amount" self.asa_amount File "TEALScript/auction/contract.py", line 21 + int 0 // "asa_amount",0 0 File "TEALScript/auction/contract.py", line 21 + app_global_put // self.asa_amount = UInt64(0) File "TEALScript/auction/contract.py", line 21 + byte "asa" // "asa" self.asa File "TEALScript/auction/contract.py", line 22 + int 0 // "asa",0 0 File "TEALScript/auction/contract.py", line 22 + app_global_put // self.asa = Asset(0) File "TEALScript/auction/contract.py", line 22 + global ZeroAddress // {global} Global.zero_address() File "TEALScript/auction/contract.py", line 24 + byte "previous_bidder" // new_state_value%0#0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 24 + swap // load new_state_value%0#0 from l-stack (no copy) "previous_bidder",new_state_value%0#0 Global.zero_address() File "TEALScript/auction/contract.py", line 24 + app_global_put // self.previous_bidder = Global.zero_address() File "TEALScript/auction/contract.py", line 24 + retsub // + diff --git a/examples/TEALScript/auction/out/contract.approval.teal b/examples/TEALScript/auction/out/contract.approval.teal new file mode 100644 index 0000000000..b9c6422423 --- /dev/null +++ b/examples/TEALScript/auction/out/contract.approval.teal @@ -0,0 +1,366 @@ +#pragma version 8 + +// examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_bare_routing@12 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "opt_into_asset(asset)void" + method "start_auction(uint64,uint64,axfer)void" + method "opt_in()void" + method "bid(pay)void" + method "claim_bids()void" + method "claim_asset(asset)void" + uncover 6 + match main_opt_into_asset_route@4 main_start_auction_route@5 main_opt_in_route@6 main_bid_route@7 main_claim_bids_route@8 main_claim_asset_route@9 + b main_switch_case_default@10 + +main_opt_into_asset_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + callsub opt_into_asset + int 1 + return + +main_start_auction_route@5: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + txna ApplicationArgs 2 + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + callsub start_auction + int 1 + return + +main_opt_in_route@6: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub opt_in + int 1 + return + +main_bid_route@7: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + callsub bid + int 1 + return + +main_claim_bids_route@8: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub claim_bids + int 1 + return + +main_claim_asset_route@9: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + callsub claim_asset + int 1 + return + +main_switch_case_default@10: + err // reject transaction + +main_bare_routing@12: + txn OnCompletion + bnz main_reject_bare_on_completion@14 + +main_create@13: + txn ApplicationID + ! + assert // is creating + int 1 + return + +main_reject_bare_on_completion@14: + err // reject transaction + + +// examples.TEALScript.auction.contract.Auction.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 + +opt_into_asset_block@0: + txn Sender + global CreatorAddress + == + assert // Only creator can opt in to ASA + int 0 + byte "asa" + app_global_get_ex + assert // check value exists + ! + assert // ASA already opted in + byte "asa" + frame_dig -1 + app_global_put + itxn_begin + int axfer + itxn_field TypeEnum + int 0 + itxn_field Fee + global CurrentApplicationAddress + itxn_field AssetReceiver + frame_dig -1 + itxn_field XferAsset + itxn_submit + retsub + + +// examples.TEALScript.auction.contract.Auction.start_auction(starting_price#0: bytes, length#0: bytes, axfer#0: uint64) -> void: +start_auction: + proto 3 0 + +start_auction_block@0: + txn Sender + global CreatorAddress + == + assert // auction must be started by creator + int 0 + byte "auction_end" + app_global_get_ex + assert // check value exists + ! + assert // auction already started + frame_dig -1 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // axfer must transfer to this app + frame_dig -1 + gtxns AssetAmount + byte "asa_amount" + swap + app_global_put + global LatestTimestamp + frame_dig -2 + btoi + + + byte "auction_end" + swap + app_global_put + frame_dig -3 + btoi + byte "previous_bid" + swap + app_global_put + retsub + + +// examples.TEALScript.auction.contract.Auction.opt_in() -> void: +opt_in: + proto 0 0 + +opt_in_block@0: + retsub + + +// examples.TEALScript.auction.contract.Auction.bid(pay#0: uint64) -> void: +bid: + proto 1 0 + +bid_block@0: + global LatestTimestamp + int 0 + byte "auction_end" + app_global_get_ex + assert // check value exists + < + assert // auction has ended + frame_dig -1 + gtxns Sender + txn Sender + == + assert // payment sender must match transaction sender + frame_dig -1 + gtxns Amount + int 0 + byte "previous_bid" + app_global_get_ex + assert // check value exists + > + assert // Bid must be higher than previous bid + frame_dig -1 + gtxns Amount + byte "previous_bid" + swap + app_global_put + frame_dig -1 + gtxns Sender + byte "previous_bidder" + swap + app_global_put + frame_dig -1 + gtxns Amount + txn Sender + byte "claimable_amount" + uncover 2 + app_local_put + retsub + + +// examples.TEALScript.auction.contract.Auction.claim_bids() -> void: +claim_bids: + proto 0 0 + +claim_bids_block@0: + txn Sender + int 0 + byte "claimable_amount" + app_local_get_ex + swap + dup + cover 2 + cover 2 + assert // check value exists + txn Sender + int 0 + byte "previous_bidder" + app_global_get_ex + assert // check value exists + == + bz claim_bids_after_if_else@2 + +claim_bids_if_body@1: + int 0 + byte "previous_bid" + app_global_get_ex + assert // check value exists + frame_dig 0 + swap + - + frame_bury 1 + +claim_bids_after_if_else@2: + itxn_begin + int pay + itxn_field TypeEnum + int 0 + itxn_field Fee + txn Sender + itxn_field Receiver + frame_dig 1 + dup + itxn_field AssetAmount + itxn_submit + frame_dig 0 + swap + - + txn Sender + byte "claimable_amount" + uncover 2 + app_local_put + retsub + + +// examples.TEALScript.auction.contract.Auction.claim_asset(asset#0: uint64) -> void: +claim_asset: + proto 1 0 + +claim_asset_block@0: + global LatestTimestamp + int 0 + byte "auction_end" + app_global_get_ex + assert // check value exists + > + assert // auction has not ended + itxn_begin + int axfer + itxn_field TypeEnum + int 0 + itxn_field Fee + int 0 + byte "previous_bidder" + app_global_get_ex + assert // check value exists + itxn_field AssetReceiver + frame_dig -1 + itxn_field XferAsset + int 0 + byte "asa_amount" + app_global_get_ex + assert // check value exists + itxn_field AssetAmount + int 0 + byte "previous_bidder" + app_global_get_ex + assert // check value exists + itxn_field AssetCloseTo + itxn_submit + retsub + + +// examples.TEALScript.auction.contract.Auction.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "auction_end" + int 0 + app_global_put + byte "previous_bid" + int 0 + app_global_put + byte "asa_amount" + int 0 + app_global_put + byte "asa" + int 0 + app_global_put + global ZeroAddress + byte "previous_bidder" + swap + app_global_put + retsub + diff --git a/examples/TEALScript/auction/out/contract.approval_unoptimized.debug.teal b/examples/TEALScript/auction/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..b870cf4dfb --- /dev/null +++ b/examples/TEALScript/auction/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,390 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + bz main_bare_routing@12 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + // Implicit fall through to main_abi_routing@3 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + method "opt_into_asset(asset)void" // tmp%2#0,method<"opt_into_asset(asset)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 27 + method "start_auction(uint64,uint64,axfer)void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 44 + method "opt_in()void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void"> arc4.abimethod File "TEALScript/auction/contract.py", line 65 + method "bid(pay)void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 69 + method "claim_bids()void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void">,method<"claim_bids()void"> arc4.abimethod File "TEALScript/auction/contract.py", line 85 + method "claim_asset(asset)void" // tmp%2#0,method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void">,method<"claim_bids()void">,method<"claim_asset(asset)void"> arc4.abimethod File "TEALScript/auction/contract.py", line 104 + uncover 6 // load tmp%2#0 from l-stack (no copy) method<"opt_into_asset(asset)void">,method<"start_auction(uint64,uint64,axfer)void">,method<"opt_in()void">,method<"bid(pay)void">,method<"claim_bids()void">,method<"claim_asset(asset)void">,tmp%2#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + match main_opt_into_asset_route@4 main_start_auction_route@5 main_opt_in_route@6 main_bid_route@7 main_claim_bids_route@8 main_claim_asset_route@9 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + b main_switch_case_default@10 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_opt_into_asset_route@4: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 27 + int NoOp // tmp%3#0,NoOp arc4.abimethod File "TEALScript/auction/contract.py", line 27 + == // {==} arc4.abimethod File "TEALScript/auction/contract.py", line 27 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 27 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + txna ApplicationArgs 1 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + btoi // {btoi} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txnas Assets // {txnas} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub opt_into_asset // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 27 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 27 + +main_start_auction_route@5: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 44 + int NoOp // tmp%9#0,NoOp arc4.abimethod File "TEALScript/auction/contract.py", line 44 + == // {==} arc4.abimethod File "TEALScript/auction/contract.py", line 44 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 44 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + txna ApplicationArgs 1 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txna ApplicationArgs 2 // tmp%12#0,{txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txn GroupIndex // tmp%12#0,tmp%13#0,{txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int 1 // tmp%12#0,tmp%13#0,tmp%16#0,1 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + - // tmp%12#0,tmp%13#0,{-} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + dup // load awst_tmp%17#0 from l-stack (copy) tmp%12#0,tmp%13#0,awst_tmp%17#0,awst_tmp%17#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + gtxns TypeEnum // tmp%12#0,tmp%13#0,awst_tmp%17#0,{gtxns} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int axfer // tmp%12#0,tmp%13#0,awst_tmp%17#0,tmp%18#0,axfer class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + == // tmp%12#0,tmp%13#0,awst_tmp%17#0,{==} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + assert // transaction type is axfer // tmp%12#0,tmp%13#0,maybe_value%14#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub start_auction // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 44 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 44 + +main_opt_in_route@6: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 65 + int NoOp // tmp%20#0,NoOp arc4.abimethod File "TEALScript/auction/contract.py", line 65 + == // {==} arc4.abimethod File "TEALScript/auction/contract.py", line 65 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 65 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + callsub opt_in // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 65 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 65 + +main_bid_route@7: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 69 + int NoOp // tmp%23#0,NoOp arc4.abimethod File "TEALScript/auction/contract.py", line 69 + == // {==} arc4.abimethod File "TEALScript/auction/contract.py", line 69 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 69 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + txn GroupIndex // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int 1 // tmp%28#0,1 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + - // {-} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + dup // load awst_tmp%17#0 from l-stack (copy) awst_tmp%17#0,awst_tmp%17#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + gtxns TypeEnum // awst_tmp%17#0,{gtxns} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int pay // awst_tmp%17#0,tmp%29#0,pay class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + == // awst_tmp%17#0,{==} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + assert // transaction type is pay // maybe_value%26#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub bid // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 69 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 69 + +main_claim_bids_route@8: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 85 + int NoOp // tmp%31#0,NoOp arc4.abimethod File "TEALScript/auction/contract.py", line 85 + == // {==} arc4.abimethod File "TEALScript/auction/contract.py", line 85 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 85 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + callsub claim_bids // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 85 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 85 + +main_claim_asset_route@9: + txn OnCompletion // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 104 + int NoOp // tmp%34#0,NoOp arc4.abimethod File "TEALScript/auction/contract.py", line 104 + == // {==} arc4.abimethod File "TEALScript/auction/contract.py", line 104 + assert // OnCompletion is NoOp // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + txn ApplicationID // {txn} arc4.abimethod File "TEALScript/auction/contract.py", line 104 + assert // is not creating // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + txna ApplicationArgs 1 // {txna} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + btoi // {btoi} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + txnas Assets // {txnas} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + callsub claim_asset // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + int 1 // 1 arc4.abimethod File "TEALScript/auction/contract.py", line 104 + return // arc4.abimethod File "TEALScript/auction/contract.py", line 104 + +main_switch_case_default@10: + // Implicit fall through to main_switch_case_next@11 // + +main_switch_case_next@11: + b main_after_if_else@15 // + +main_bare_routing@12: + txn OnCompletion // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int 0 // tmp%40#0,0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + swap // load tmp%40#0 from l-stack (no copy) 0,tmp%40#0 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + match main_create@13 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + b main_reject_bare_on_completion@14 // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_create@13: + txn ApplicationID // {txn} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + ! // {!} class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + assert // is creating // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + int 1 // 1 class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + return // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_reject_bare_on_completion@14: + err // reject transaction // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + +main_after_if_else@15: + err // reject transaction // class Auction(ARC4Contract): File "TEALScript/auction/contract.py", line 17 + + +// examples.TEALScript.auction.contract.Auction.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "TEALScript/auction/contract.py", line 28 + +opt_into_asset_block@0: + txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "TEALScript/auction/contract.py", line 30 + global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "TEALScript/auction/contract.py", line 30 + == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "TEALScript/auction/contract.py", line 30 + assert // Only creator can opt in to ASA // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "TEALScript/auction/contract.py", line 30 + int 0 // (𝕡) asset#0 | 0 self.asa File "TEALScript/auction/contract.py", line 32 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "TEALScript/auction/contract.py", line 32 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "TEALScript/auction/contract.py", line 32 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "TEALScript/auction/contract.py", line 32 + int 0 // (𝕡) asset#0 | app_global_get_ex_value%3#0,0 0 File "TEALScript/auction/contract.py", line 32 + == // (𝕡) asset#0 | {==} self.asa.asset_id == 0, "ASA already opted in" File "TEALScript/auction/contract.py", line 32 + assert // ASA already opted in // (𝕡) asset#0 | assert self.asa.asset_id == 0, "ASA already opted in" File "TEALScript/auction/contract.py", line 32 + byte "asa" // (𝕡) asset#0 | "asa" self.asa File "TEALScript/auction/contract.py", line 34 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "TEALScript/auction/contract.py", line 28 + app_global_put // (𝕡) asset#0 | self.asa = asset File "TEALScript/auction/contract.py", line 34 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "TEALScript/auction/contract.py", line 37 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "TEALScript/auction/contract.py", line 38 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "TEALScript/auction/contract.py", line 38 + int 0 // (𝕡) asset#0 | 0 0 File "TEALScript/auction/contract.py", line 39 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "TEALScript/auction/contract.py", line 39 + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "TEALScript/auction/contract.py", line 40 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "TEALScript/auction/contract.py", line 40 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "TEALScript/auction/contract.py", line 28 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "TEALScript/auction/contract.py", line 41 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "TEALScript/auction/contract.py", line 42 + retsub // + + +// examples.TEALScript.auction.contract.Auction.start_auction(starting_price#0: bytes, length#0: bytes, axfer#0: uint64) -> void: +start_auction: + proto 3 0 // (𝕡) starting_price#0,length#0,axfer#0 | def start_auction( File "TEALScript/auction/contract.py", line 45 + +start_auction_block@0: + txn Sender // (𝕡) starting_price#0,length#0,axfer#0 | {txn} Transaction.sender() File "TEALScript/auction/contract.py", line 49 + global CreatorAddress // (𝕡) starting_price#0,length#0,axfer#0 | tmp%0#0,{global} Global.creator_address() File "TEALScript/auction/contract.py", line 49 + == // (𝕡) starting_price#0,length#0,axfer#0 | {==} Transaction.sender() == Global.creator_address() File "TEALScript/auction/contract.py", line 49 + assert // auction must be started by creator // (𝕡) starting_price#0,length#0,axfer#0 | assert ( File "TEALScript/auction/contract.py", line 48 + int 0 // (𝕡) starting_price#0,length#0,axfer#0 | 0 self.auction_end File "TEALScript/auction/contract.py", line 53 + byte "auction_end" // (𝕡) starting_price#0,length#0,axfer#0 | 0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 53 + app_global_get_ex // (𝕡) starting_price#0,length#0,axfer#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.auction_end File "TEALScript/auction/contract.py", line 53 + assert // check value exists // (𝕡) starting_price#0,length#0,axfer#0 | app_global_get_ex_value%3#0 self.auction_end File "TEALScript/auction/contract.py", line 53 + int 0 // (𝕡) starting_price#0,length#0,axfer#0 | app_global_get_ex_value%3#0,0 0 File "TEALScript/auction/contract.py", line 53 + == // (𝕡) starting_price#0,length#0,axfer#0 | {==} self.auction_end == 0, "auction already started" File "TEALScript/auction/contract.py", line 53 + assert // auction already started // (𝕡) starting_price#0,length#0,axfer#0 | assert self.auction_end == 0, "auction already started" File "TEALScript/auction/contract.py", line 53 + frame_dig -1 // load axfer#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | axfer#0 axfer: AssetTransferTransaction File "TEALScript/auction/contract.py", line 46 + gtxns AssetReceiver // (𝕡) starting_price#0,length#0,axfer#0 | {gtxns} axfer.asset_receiver File "TEALScript/auction/contract.py", line 57 + global CurrentApplicationAddress // (𝕡) starting_price#0,length#0,axfer#0 | tmp%6#0,{global} Global.current_application_address() File "TEALScript/auction/contract.py", line 57 + == // (𝕡) starting_price#0,length#0,axfer#0 | {==} axfer.asset_receiver == Global.current_application_address() File "TEALScript/auction/contract.py", line 57 + assert // axfer must transfer to this app // (𝕡) starting_price#0,length#0,axfer#0 | assert ( File "TEALScript/auction/contract.py", line 56 + frame_dig -1 // load axfer#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | axfer#0 axfer: AssetTransferTransaction File "TEALScript/auction/contract.py", line 46 + gtxns AssetAmount // (𝕡) starting_price#0,length#0,axfer#0 | {gtxns} axfer.asset_amount File "TEALScript/auction/contract.py", line 61 + byte "asa_amount" // (𝕡) starting_price#0,length#0,axfer#0 | new_state_value%9#0,"asa_amount" self.asa_amount File "TEALScript/auction/contract.py", line 61 + swap // load new_state_value%9#0 from l-stack (no copy) (𝕡) starting_price#0,length#0,axfer#0 | "asa_amount",new_state_value%9#0 axfer.asset_amount File "TEALScript/auction/contract.py", line 61 + app_global_put // (𝕡) starting_price#0,length#0,axfer#0 | self.asa_amount = axfer.asset_amount File "TEALScript/auction/contract.py", line 61 + global LatestTimestamp // (𝕡) starting_price#0,length#0,axfer#0 | {global} Global.latest_timestamp() File "TEALScript/auction/contract.py", line 62 + frame_dig -2 // load length#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | tmp%10#0,length#0 length: arc4.UInt64 File "TEALScript/auction/contract.py", line 46 + btoi // (𝕡) starting_price#0,length#0,axfer#0 | tmp%10#0,{btoi} length.decode() File "TEALScript/auction/contract.py", line 62 + + // (𝕡) starting_price#0,length#0,axfer#0 | {+} Global.latest_timestamp() + length.decode() File "TEALScript/auction/contract.py", line 62 + byte "auction_end" // (𝕡) starting_price#0,length#0,axfer#0 | new_state_value%12#0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 62 + swap // load new_state_value%12#0 from l-stack (no copy) (𝕡) starting_price#0,length#0,axfer#0 | "auction_end",new_state_value%12#0 Global.latest_timestamp() + length.decode() File "TEALScript/auction/contract.py", line 62 + app_global_put // (𝕡) starting_price#0,length#0,axfer#0 | self.auction_end = Global.latest_timestamp() + length.decode() File "TEALScript/auction/contract.py", line 62 + frame_dig -3 // load starting_price#0 from parameters (𝕡) starting_price#0,length#0,axfer#0 | starting_price#0 starting_price: arc4.UInt64 File "TEALScript/auction/contract.py", line 46 + btoi // (𝕡) starting_price#0,length#0,axfer#0 | {btoi} starting_price.decode() File "TEALScript/auction/contract.py", line 63 + byte "previous_bid" // (𝕡) starting_price#0,length#0,axfer#0 | new_state_value%13#0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 63 + swap // load new_state_value%13#0 from l-stack (no copy) (𝕡) starting_price#0,length#0,axfer#0 | "previous_bid",new_state_value%13#0 starting_price.decode() File "TEALScript/auction/contract.py", line 63 + app_global_put // (𝕡) starting_price#0,length#0,axfer#0 | self.previous_bid = starting_price.decode() File "TEALScript/auction/contract.py", line 63 + retsub // + + +// examples.TEALScript.auction.contract.Auction.opt_in() -> void: +opt_in: + proto 0 0 // def opt_in(self) -> None: File "TEALScript/auction/contract.py", line 66 + +opt_in_block@0: + retsub // + + +// examples.TEALScript.auction.contract.Auction.bid(pay#0: uint64) -> void: +bid: + proto 1 0 // (𝕡) pay#0 | def bid(self, pay: PaymentTransaction) -> None: File "TEALScript/auction/contract.py", line 70 + +bid_block@0: + global LatestTimestamp // (𝕡) pay#0 | {global} Global.latest_timestamp() File "TEALScript/auction/contract.py", line 72 + int 0 // (𝕡) pay#0 | tmp%0#0,0 self.auction_end File "TEALScript/auction/contract.py", line 72 + byte "auction_end" // (𝕡) pay#0 | tmp%0#0,0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 72 + app_global_get_ex // (𝕡) pay#0 | tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.auction_end File "TEALScript/auction/contract.py", line 72 + assert // check value exists // (𝕡) pay#0 | tmp%0#0,app_global_get_ex_value%1#0 self.auction_end File "TEALScript/auction/contract.py", line 72 + < // (𝕡) pay#0 | {<} Global.latest_timestamp() < self.auction_end, "auction has ended" File "TEALScript/auction/contract.py", line 72 + assert // auction has ended // (𝕡) pay#0 | assert Global.latest_timestamp() < self.auction_end, "auction has ended" File "TEALScript/auction/contract.py", line 72 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Sender // (𝕡) pay#0 | {gtxns} pay.sender File "TEALScript/auction/contract.py", line 75 + txn Sender // (𝕡) pay#0 | tmp%4#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 75 + == // (𝕡) pay#0 | {==} pay.sender == Transaction.sender(), "payment sender must match transaction sender" File "TEALScript/auction/contract.py", line 75 + assert // payment sender must match transaction sender // (𝕡) pay#0 | assert pay.sender == Transaction.sender(), "payment sender must match transaction sender" File "TEALScript/auction/contract.py", line 75 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Amount // (𝕡) pay#0 | {gtxns} pay.amount File "TEALScript/auction/contract.py", line 76 + int 0 // (𝕡) pay#0 | tmp%7#0,0 self.previous_bid File "TEALScript/auction/contract.py", line 76 + byte "previous_bid" // (𝕡) pay#0 | tmp%7#0,0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 76 + app_global_get_ex // (𝕡) pay#0 | tmp%7#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bid File "TEALScript/auction/contract.py", line 76 + assert // check value exists // (𝕡) pay#0 | tmp%7#0,app_global_get_ex_value%8#0 self.previous_bid File "TEALScript/auction/contract.py", line 76 + > // (𝕡) pay#0 | {>} pay.amount > self.previous_bid, "Bid must be higher than previous bid" File "TEALScript/auction/contract.py", line 76 + assert // Bid must be higher than previous bid // (𝕡) pay#0 | assert pay.amount > self.previous_bid, "Bid must be higher than previous bid" File "TEALScript/auction/contract.py", line 76 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Amount // (𝕡) pay#0 | {gtxns} pay.amount File "TEALScript/auction/contract.py", line 79 + byte "previous_bid" // (𝕡) pay#0 | new_state_value%11#0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 79 + swap // load new_state_value%11#0 from l-stack (no copy) (𝕡) pay#0 | "previous_bid",new_state_value%11#0 pay.amount File "TEALScript/auction/contract.py", line 79 + app_global_put // (𝕡) pay#0 | self.previous_bid = pay.amount File "TEALScript/auction/contract.py", line 79 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Sender // (𝕡) pay#0 | {gtxns} pay.sender File "TEALScript/auction/contract.py", line 80 + byte "previous_bidder" // (𝕡) pay#0 | new_state_value%12#0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 80 + swap // load new_state_value%12#0 from l-stack (no copy) (𝕡) pay#0 | "previous_bidder",new_state_value%12#0 pay.sender File "TEALScript/auction/contract.py", line 80 + app_global_put // (𝕡) pay#0 | self.previous_bidder = pay.sender File "TEALScript/auction/contract.py", line 80 + frame_dig -1 // load pay#0 from parameters (𝕡) pay#0 | pay#0 pay: PaymentTransaction File "TEALScript/auction/contract.py", line 70 + gtxns Amount // (𝕡) pay#0 | {gtxns} pay.amount File "TEALScript/auction/contract.py", line 83 + txn Sender // (𝕡) pay#0 | new_state_value%13#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 83 + byte "claimable_amount" // (𝕡) pay#0 | new_state_value%13#0,tmp%14#0,"claimable_amount" self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 83 + uncover 2 // load new_state_value%13#0 from l-stack (no copy) (𝕡) pay#0 | tmp%14#0,"claimable_amount",new_state_value%13#0 pay.amount File "TEALScript/auction/contract.py", line 83 + app_local_put // (𝕡) pay#0 | self.claimable_amount[Transaction.sender()] = pay.amount File "TEALScript/auction/contract.py", line 83 + retsub // + + +// examples.TEALScript.auction.contract.Auction.claim_bids() -> void: +claim_bids: + proto 0 0 // def claim_bids(self) -> None: File "TEALScript/auction/contract.py", line 86 + +claim_bids_block@0: + txn Sender // {txn} Transaction.sender() File "TEALScript/auction/contract.py", line 87 + int 0 // tmp%0#0,0 self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + byte "claimable_amount" // tmp%0#0,0,"claimable_amount" self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + app_local_get_ex // {app_local_get_ex}.0,{app_local_get_ex}.1 self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + assert // check value exists // app_local_get_ex_value%1#0 self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 87 + dup // store original_amount#0 to l-stack (copy) original_amount#0,original_amount#0 original_amount File "TEALScript/auction/contract.py", line 87 + swap // store original_amount#0 to f-stack (𝕗) original_amount#0 | original_amount#0 original_amount File "TEALScript/auction/contract.py", line 87 + dup // store amount#0 to l-stack (copy) (𝕗) original_amount#0 | amount#0,amount#0 amount File "TEALScript/auction/contract.py", line 89 + swap // store amount#0 to f-stack (𝕗) original_amount#0,amount#0 | amount#0 amount File "TEALScript/auction/contract.py", line 89 + txn Sender // (𝕗) original_amount#0,amount#0 | amount#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 92 + int 0 // (𝕗) original_amount#0,amount#0 | amount#0,tmp%3#0,0 self.previous_bidder File "TEALScript/auction/contract.py", line 92 + byte "previous_bidder" // (𝕗) original_amount#0,amount#0 | amount#0,tmp%3#0,0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 92 + app_global_get_ex // (𝕗) original_amount#0,amount#0 | amount#0,tmp%3#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bidder File "TEALScript/auction/contract.py", line 92 + assert // check value exists // (𝕗) original_amount#0,amount#0 | amount#0,tmp%3#0,app_global_get_ex_value%4#0 self.previous_bidder File "TEALScript/auction/contract.py", line 92 + == // (𝕗) original_amount#0,amount#0 | amount#0,{==} Transaction.sender() == self.previous_bidder: File "TEALScript/auction/contract.py", line 92 + bz claim_bids_after_if_else@2 // (𝕗) original_amount#0,amount#0,amount#5 | if Transaction.sender() == self.previous_bidder: File "TEALScript/auction/contract.py", line 92 + // Implicit fall through to claim_bids_if_body@1 // (𝕗) original_amount#0,amount#0,amount#5 | if Transaction.sender() == self.previous_bidder: File "TEALScript/auction/contract.py", line 92 + +claim_bids_if_body@1: + int 0 // (𝕗) original_amount#0,amount#0,amount#5 | 0 self.previous_bid File "TEALScript/auction/contract.py", line 93 + byte "previous_bid" // (𝕗) original_amount#0,amount#0,amount#5 | 0,"previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 93 + app_global_get_ex // (𝕗) original_amount#0,amount#0,amount#5 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bid File "TEALScript/auction/contract.py", line 93 + assert // check value exists // (𝕗) original_amount#0,amount#0,amount#5 | app_global_get_ex_value%7#0 self.previous_bid File "TEALScript/auction/contract.py", line 93 + frame_dig 1 // load amount#0 from f-stack (𝕗) original_amount#0,amount#0,amount#5 | app_global_get_ex_value%7#0,amount#0 amount File "TEALScript/auction/contract.py", line 89 + swap // load app_global_get_ex_value%7#0 from l-stack (no copy) (𝕗) original_amount#0,amount#0,amount#5 | amount#0,app_global_get_ex_value%7#0 self.previous_bid File "TEALScript/auction/contract.py", line 93 + - // (𝕗) original_amount#0,amount#0,amount#5 | {-} amount -= self.previous_bid File "TEALScript/auction/contract.py", line 93 + frame_bury 2 // store amount#5 to f-stack (𝕗) original_amount#0,amount#0,amount#5 | + // Implicit fall through to claim_bids_after_if_else@2 // (𝕗) original_amount#0,amount#0,amount#5 | + +claim_bids_after_if_else@2: + frame_dig 2 // load amount#5 from f-stack (𝕗) original_amount#0,amount#0,amount#5 | amount#5 + itxn_begin // (𝕗) original_amount#0,amount#0,amount#5 | amount#0 CreateInnerTransaction.begin() File "TEALScript/auction/contract.py", line 95 + int pay // (𝕗) original_amount#0,amount#0,amount#5 | amount#0,pay TransactionType.Payment File "TEALScript/auction/contract.py", line 96 + itxn_field TypeEnum // (𝕗) original_amount#0,amount#0,amount#5 | amount#0 CreateInnerTransaction.set_type_enum(TransactionType.Payment) File "TEALScript/auction/contract.py", line 96 + int 0 // (𝕗) original_amount#0,amount#0,amount#5 | amount#0,0 0 File "TEALScript/auction/contract.py", line 97 + itxn_field Fee // (𝕗) original_amount#0,amount#0,amount#5 | amount#0 CreateInnerTransaction.set_fee(UInt64(0)) File "TEALScript/auction/contract.py", line 97 + txn Sender // (𝕗) original_amount#0,amount#0,amount#5 | amount#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 98 + itxn_field Receiver // (𝕗) original_amount#0,amount#0,amount#5 | amount#0 CreateInnerTransaction.set_receiver(Transaction.sender()) File "TEALScript/auction/contract.py", line 98 + dup // load amount#0 from l-stack (copy) (𝕗) original_amount#0,amount#0,amount#5 | amount#0,amount#0 amount File "TEALScript/auction/contract.py", line 89 + itxn_field AssetAmount // (𝕗) original_amount#0,amount#0,amount#5 | amount#0 CreateInnerTransaction.set_asset_amount(amount) File "TEALScript/auction/contract.py", line 99 + itxn_submit // (𝕗) original_amount#0,amount#0,amount#5 | amount#0 CreateInnerTransaction.submit() File "TEALScript/auction/contract.py", line 100 + frame_dig 0 // load original_amount#0 from f-stack (𝕗) original_amount#0,amount#0,amount#5 | amount#0,original_amount#0 original_amount File "TEALScript/auction/contract.py", line 87 + swap // load amount#0 from l-stack (no copy) (𝕗) original_amount#0,amount#0,amount#5 | original_amount#0,amount#0 amount File "TEALScript/auction/contract.py", line 89 + - // (𝕗) original_amount#0,amount#0,amount#5 | {-} original_amount - amount File "TEALScript/auction/contract.py", line 102 + txn Sender // (𝕗) original_amount#0,amount#0,amount#5 | new_state_value%10#0,{txn} Transaction.sender() File "TEALScript/auction/contract.py", line 102 + byte "claimable_amount" // (𝕗) original_amount#0,amount#0,amount#5 | new_state_value%10#0,tmp%11#0,"claimable_amount" self.claimable_amount[Transaction.sender()] File "TEALScript/auction/contract.py", line 102 + uncover 2 // load new_state_value%10#0 from l-stack (no copy) (𝕗) original_amount#0,amount#0,amount#5 | tmp%11#0,"claimable_amount",new_state_value%10#0 original_amount - amount File "TEALScript/auction/contract.py", line 102 + app_local_put // (𝕗) original_amount#0,amount#0,amount#5 | self.claimable_amount[Transaction.sender()] = original_amount - amount File "TEALScript/auction/contract.py", line 102 + retsub // + + +// examples.TEALScript.auction.contract.Auction.claim_asset(asset#0: uint64) -> void: +claim_asset: + proto 1 0 // (𝕡) asset#0 | def claim_asset(self, asset: Asset) -> None: File "TEALScript/auction/contract.py", line 105 + +claim_asset_block@0: + global LatestTimestamp // (𝕡) asset#0 | {global} Global.latest_timestamp() File "TEALScript/auction/contract.py", line 106 + int 0 // (𝕡) asset#0 | tmp%0#0,0 self.auction_end File "TEALScript/auction/contract.py", line 106 + byte "auction_end" // (𝕡) asset#0 | tmp%0#0,0,"auction_end" self.auction_end File "TEALScript/auction/contract.py", line 106 + app_global_get_ex // (𝕡) asset#0 | tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.auction_end File "TEALScript/auction/contract.py", line 106 + assert // check value exists // (𝕡) asset#0 | tmp%0#0,app_global_get_ex_value%1#0 self.auction_end File "TEALScript/auction/contract.py", line 106 + > // (𝕡) asset#0 | {>} Global.latest_timestamp() > self.auction_end, "auction has not ended" File "TEALScript/auction/contract.py", line 106 + assert // auction has not ended // (𝕡) asset#0 | assert Global.latest_timestamp() > self.auction_end, "auction has not ended" File "TEALScript/auction/contract.py", line 106 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "TEALScript/auction/contract.py", line 109 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "TEALScript/auction/contract.py", line 110 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "TEALScript/auction/contract.py", line 110 + int 0 // (𝕡) asset#0 | 0 0 File "TEALScript/auction/contract.py", line 111 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "TEALScript/auction/contract.py", line 111 + int 0 // (𝕡) asset#0 | 0 self.previous_bidder File "TEALScript/auction/contract.py", line 112 + byte "previous_bidder" // (𝕡) asset#0 | 0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 112 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bidder File "TEALScript/auction/contract.py", line 112 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%4#0 self.previous_bidder File "TEALScript/auction/contract.py", line 112 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(self.previous_bidder) File "TEALScript/auction/contract.py", line 112 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "TEALScript/auction/contract.py", line 105 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "TEALScript/auction/contract.py", line 113 + int 0 // (𝕡) asset#0 | 0 self.asa_amount File "TEALScript/auction/contract.py", line 114 + byte "asa_amount" // (𝕡) asset#0 | 0,"asa_amount" self.asa_amount File "TEALScript/auction/contract.py", line 114 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa_amount File "TEALScript/auction/contract.py", line 114 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%6#0 self.asa_amount File "TEALScript/auction/contract.py", line 114 + itxn_field AssetAmount // (𝕡) asset#0 | CreateInnerTransaction.set_asset_amount(self.asa_amount) File "TEALScript/auction/contract.py", line 114 + int 0 // (𝕡) asset#0 | 0 self.previous_bidder File "TEALScript/auction/contract.py", line 115 + byte "previous_bidder" // (𝕡) asset#0 | 0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 115 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.previous_bidder File "TEALScript/auction/contract.py", line 115 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%8#0 self.previous_bidder File "TEALScript/auction/contract.py", line 115 + itxn_field AssetCloseTo // (𝕡) asset#0 | CreateInnerTransaction.set_asset_close_to(self.previous_bidder) File "TEALScript/auction/contract.py", line 115 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "TEALScript/auction/contract.py", line 116 + retsub // + + +// examples.TEALScript.auction.contract.Auction.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "TEALScript/auction/contract.py", line 18 + +__init___block@0: + byte "auction_end" // "auction_end" self.auction_end File "TEALScript/auction/contract.py", line 19 + int 0 // "auction_end",0 0 File "TEALScript/auction/contract.py", line 19 + app_global_put // self.auction_end = UInt64(0) File "TEALScript/auction/contract.py", line 19 + byte "previous_bid" // "previous_bid" self.previous_bid File "TEALScript/auction/contract.py", line 20 + int 0 // "previous_bid",0 0 File "TEALScript/auction/contract.py", line 20 + app_global_put // self.previous_bid = UInt64(0) File "TEALScript/auction/contract.py", line 20 + byte "asa_amount" // "asa_amount" self.asa_amount File "TEALScript/auction/contract.py", line 21 + int 0 // "asa_amount",0 0 File "TEALScript/auction/contract.py", line 21 + app_global_put // self.asa_amount = UInt64(0) File "TEALScript/auction/contract.py", line 21 + byte "asa" // "asa" self.asa File "TEALScript/auction/contract.py", line 22 + int 0 // "asa",0 0 File "TEALScript/auction/contract.py", line 22 + app_global_put // self.asa = Asset(0) File "TEALScript/auction/contract.py", line 22 + global ZeroAddress // {global} Global.zero_address() File "TEALScript/auction/contract.py", line 24 + byte "previous_bidder" // new_state_value%0#0,"previous_bidder" self.previous_bidder File "TEALScript/auction/contract.py", line 24 + swap // load new_state_value%0#0 from l-stack (no copy) "previous_bidder",new_state_value%0#0 Global.zero_address() File "TEALScript/auction/contract.py", line 24 + app_global_put // self.previous_bidder = Global.zero_address() File "TEALScript/auction/contract.py", line 24 + retsub // + diff --git a/examples/TEALScript/auction/out/contract.approval_unoptimized.teal b/examples/TEALScript/auction/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..8467cc3463 --- /dev/null +++ b/examples/TEALScript/auction/out/contract.approval_unoptimized.teal @@ -0,0 +1,382 @@ +#pragma version 8 + +// examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_bare_routing@12 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "opt_into_asset(asset)void" + method "start_auction(uint64,uint64,axfer)void" + method "opt_in()void" + method "bid(pay)void" + method "claim_bids()void" + method "claim_asset(asset)void" + uncover 6 + match main_opt_into_asset_route@4 main_start_auction_route@5 main_opt_in_route@6 main_bid_route@7 main_claim_bids_route@8 main_claim_asset_route@9 + b main_switch_case_default@10 + +main_opt_into_asset_route@4: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + callsub opt_into_asset + int 1 + return + +main_start_auction_route@5: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + txna ApplicationArgs 2 + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + callsub start_auction + int 1 + return + +main_opt_in_route@6: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub opt_in + int 1 + return + +main_bid_route@7: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + callsub bid + int 1 + return + +main_claim_bids_route@8: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub claim_bids + int 1 + return + +main_claim_asset_route@9: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + callsub claim_asset + int 1 + return + +main_switch_case_default@10: + +main_switch_case_next@11: + b main_after_if_else@15 + +main_bare_routing@12: + txn OnCompletion + int 0 + swap + match main_create@13 + b main_reject_bare_on_completion@14 + +main_create@13: + txn ApplicationID + ! + assert // is creating + int 1 + return + +main_reject_bare_on_completion@14: + err // reject transaction + +main_after_if_else@15: + err // reject transaction + + +// examples.TEALScript.auction.contract.Auction.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 + +opt_into_asset_block@0: + txn Sender + global CreatorAddress + == + assert // Only creator can opt in to ASA + int 0 + byte "asa" + app_global_get_ex + assert // check value exists + int 0 + == + assert // ASA already opted in + byte "asa" + frame_dig -1 + app_global_put + itxn_begin + int axfer + itxn_field TypeEnum + int 0 + itxn_field Fee + global CurrentApplicationAddress + itxn_field AssetReceiver + frame_dig -1 + itxn_field XferAsset + itxn_submit + retsub + + +// examples.TEALScript.auction.contract.Auction.start_auction(starting_price#0: bytes, length#0: bytes, axfer#0: uint64) -> void: +start_auction: + proto 3 0 + +start_auction_block@0: + txn Sender + global CreatorAddress + == + assert // auction must be started by creator + int 0 + byte "auction_end" + app_global_get_ex + assert // check value exists + int 0 + == + assert // auction already started + frame_dig -1 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // axfer must transfer to this app + frame_dig -1 + gtxns AssetAmount + byte "asa_amount" + swap + app_global_put + global LatestTimestamp + frame_dig -2 + btoi + + + byte "auction_end" + swap + app_global_put + frame_dig -3 + btoi + byte "previous_bid" + swap + app_global_put + retsub + + +// examples.TEALScript.auction.contract.Auction.opt_in() -> void: +opt_in: + proto 0 0 + +opt_in_block@0: + retsub + + +// examples.TEALScript.auction.contract.Auction.bid(pay#0: uint64) -> void: +bid: + proto 1 0 + +bid_block@0: + global LatestTimestamp + int 0 + byte "auction_end" + app_global_get_ex + assert // check value exists + < + assert // auction has ended + frame_dig -1 + gtxns Sender + txn Sender + == + assert // payment sender must match transaction sender + frame_dig -1 + gtxns Amount + int 0 + byte "previous_bid" + app_global_get_ex + assert // check value exists + > + assert // Bid must be higher than previous bid + frame_dig -1 + gtxns Amount + byte "previous_bid" + swap + app_global_put + frame_dig -1 + gtxns Sender + byte "previous_bidder" + swap + app_global_put + frame_dig -1 + gtxns Amount + txn Sender + byte "claimable_amount" + uncover 2 + app_local_put + retsub + + +// examples.TEALScript.auction.contract.Auction.claim_bids() -> void: +claim_bids: + proto 0 0 + +claim_bids_block@0: + txn Sender + int 0 + byte "claimable_amount" + app_local_get_ex + assert // check value exists + dup + swap + dup + swap + txn Sender + int 0 + byte "previous_bidder" + app_global_get_ex + assert // check value exists + == + bz claim_bids_after_if_else@2 + +claim_bids_if_body@1: + int 0 + byte "previous_bid" + app_global_get_ex + assert // check value exists + frame_dig 1 + swap + - + frame_bury 2 + +claim_bids_after_if_else@2: + frame_dig 2 + itxn_begin + int pay + itxn_field TypeEnum + int 0 + itxn_field Fee + txn Sender + itxn_field Receiver + dup + itxn_field AssetAmount + itxn_submit + frame_dig 0 + swap + - + txn Sender + byte "claimable_amount" + uncover 2 + app_local_put + retsub + + +// examples.TEALScript.auction.contract.Auction.claim_asset(asset#0: uint64) -> void: +claim_asset: + proto 1 0 + +claim_asset_block@0: + global LatestTimestamp + int 0 + byte "auction_end" + app_global_get_ex + assert // check value exists + > + assert // auction has not ended + itxn_begin + int axfer + itxn_field TypeEnum + int 0 + itxn_field Fee + int 0 + byte "previous_bidder" + app_global_get_ex + assert // check value exists + itxn_field AssetReceiver + frame_dig -1 + itxn_field XferAsset + int 0 + byte "asa_amount" + app_global_get_ex + assert // check value exists + itxn_field AssetAmount + int 0 + byte "previous_bidder" + app_global_get_ex + assert // check value exists + itxn_field AssetCloseTo + itxn_submit + retsub + + +// examples.TEALScript.auction.contract.Auction.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "auction_end" + int 0 + app_global_put + byte "previous_bid" + int 0 + app_global_put + byte "asa_amount" + int 0 + app_global_put + byte "asa" + int 0 + app_global_put + global ZeroAddress + byte "previous_bidder" + swap + app_global_put + retsub + diff --git a/examples/TEALScript/auction/out/contract.awst b/examples/TEALScript/auction/out/contract.awst new file mode 100644 index 0000000000..ed4fd4bdb8 --- /dev/null +++ b/examples/TEALScript/auction/out/contract.awst @@ -0,0 +1,103 @@ +contract Auction +{ + globals { + ['auction_end']: algopy.UInt64 + ['previous_bid']: algopy.UInt64 + ['asa_amount']: algopy.UInt64 + ['asa']: algopy.Asset + ['previous_bidder']: algopy.Account + } + locals { + ['claimable_amount']: algopy.UInt64 + } + + constructor() + { + this.globals['auction_end']: algopy.UInt64 = 0u + this.globals['previous_bid']: algopy.UInt64 = 0u + this.globals['asa_amount']: algopy.UInt64 = 0u + this.globals['asa']: algopy.Asset = reinterpret_cast(0u) + this.globals['previous_bidder']: algopy.Account = global() + } + + clear_state_program(): bool + { + return true + } + + abimethod opt_into_asset(asset: algopy.Asset): None + { + assert(txn() == global(), comment="Only creator can opt in to ASA") + assert(reinterpret_cast(this.globals['asa']) == 0u, comment="ASA already opted in") + this.globals['asa']: algopy.Asset = asset + itxn_begin() + itxn_field(axfer) + itxn_field(0u) + itxn_field(global()) + itxn_field(reinterpret_cast(asset)) + itxn_submit() + } + + abimethod start_auction(starting_price: algopy.arc4.UIntN[typing.Literal[64]], length: algopy.arc4.UIntN[typing.Literal[64]], axfer: algopy.AssetTransferTransaction): None + { + assert(txn() == global(), comment="auction must be started by creator") + assert(this.globals['auction_end'] == 0u, comment="auction already started") + assert(gtxns(axfer) == global(), comment="axfer must transfer to this app") + this.globals['asa_amount']: algopy.UInt64 = gtxns(axfer) + this.globals['auction_end']: algopy.UInt64 = global() + arc4_decode(length, algopy.UInt64) + this.globals['previous_bid']: algopy.UInt64 = arc4_decode(starting_price, algopy.UInt64) + } + + abimethod opt_in(): None + { + } + + abimethod bid(pay: algopy.PaymentTransaction): None + { + assert(global() < this.globals['auction_end'], comment="auction has ended") + assert(gtxns(pay) == txn(), comment="payment sender must match transaction sender") + assert(gtxns(pay) > this.globals['previous_bid'], comment="Bid must be higher than previous bid") + this.globals['previous_bid']: algopy.UInt64 = gtxns(pay) + this.globals['previous_bidder']: algopy.Account = gtxns(pay) + this.locals['claimable_amount'].account[txn()]: algopy.UInt64 = gtxns(pay) + } + + abimethod claim_bids(): None + { + original_amount: algopy.UInt64 = this.locals['claimable_amount'].account[txn()] + amount: algopy.UInt64 = original_amount + if (txn() == this.globals['previous_bidder']) { + amount -= this.globals['previous_bid'] + } + itxn_begin() + itxn_field(pay) + itxn_field(0u) + itxn_field(txn()) + itxn_field(amount) + itxn_submit() + this.locals['claimable_amount'].account[txn()]: algopy.UInt64 = original_amount - amount + } + + abimethod claim_asset(asset: algopy.Asset): None + { + assert(global() > this.globals['auction_end'], comment="auction has not ended") + itxn_begin() + itxn_field(axfer) + itxn_field(0u) + itxn_field(this.globals['previous_bidder']) + itxn_field(reinterpret_cast(asset)) + itxn_field(this.globals['asa_amount']) + itxn_field(this.globals['previous_bidder']) + itxn_submit() + } + + subroutine delete_application(): None + { + itxn_begin() + itxn_field(pay) + itxn_field(0u) + itxn_field(global()) + itxn_field(global()) + itxn_submit() + } +} \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract.clear.debug.teal b/examples/TEALScript/auction/out/contract.clear.debug.teal new file mode 100644 index 0000000000..4c1686c12e --- /dev/null +++ b/examples/TEALScript/auction/out/contract.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "TEALScript/auction/contract.py", line 128 + return // return True File "TEALScript/auction/contract.py", line 128 + diff --git a/examples/abi_types/out/contract.clear.teal b/examples/TEALScript/auction/out/contract.clear.teal similarity index 55% rename from examples/abi_types/out/contract.clear.teal rename to examples/TEALScript/auction/out/contract.clear.teal index 1f3da47f9f..04ff538ae0 100644 --- a/examples/abi_types/out/contract.clear.teal +++ b/examples/TEALScript/auction/out/contract.clear.teal @@ -1,6 +1,6 @@ #pragma version 8 -// examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: +// examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: main_block@0: int 1 return diff --git a/examples/TEALScript/auction/out/contract.clear_unoptimized.debug.teal b/examples/TEALScript/auction/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..4c1686c12e --- /dev/null +++ b/examples/TEALScript/auction/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "TEALScript/auction/contract.py", line 128 + return // return True File "TEALScript/auction/contract.py", line 128 + diff --git a/examples/abi_types/out/contract.clear_unoptimized.teal b/examples/TEALScript/auction/out/contract.clear_unoptimized.teal similarity index 55% rename from examples/abi_types/out/contract.clear_unoptimized.teal rename to examples/TEALScript/auction/out/contract.clear_unoptimized.teal index 1f3da47f9f..04ff538ae0 100644 --- a/examples/abi_types/out/contract.clear_unoptimized.teal +++ b/examples/TEALScript/auction/out/contract.clear_unoptimized.teal @@ -1,6 +1,6 @@ #pragma version 8 -// examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: +// examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: main_block@0: int 1 return diff --git a/examples/TEALScript/auction/out/contract_Auction.cssa.ir b/examples/TEALScript/auction/out/contract_Auction.cssa.ir new file mode 100644 index 0000000000..b74fdac97a --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.cssa.ir @@ -0,0 +1,236 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + (assert tmp%19#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, awst_tmp%17#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#1: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#1) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + (assert tmp%30#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(awst_tmp%17#1) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (! tmp%34#0) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + fail // reject transaction + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + goto tmp%40#0 ? block@14 : block@13 + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (original_amount#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + let original_amount#1: uint64 = original_amount#0 + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#1: uint64 = (- original_amount#0 app_global_get_ex_value%7#0) + let amount#3: uint64 = amount#1 + goto block@2 + block@2: // after_if_else_L92 + let amount#4: uint64 = φ(original_amount#1 <- block@0, amount#3 <- block@1) + let amount#2: uint64 = amount#4 + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#2) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#2) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract_Auction.final.ir b/examples/TEALScript/auction/out/contract_Auction.final.ir new file mode 100644 index 0000000000..baa02033ae --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.final.ir @@ -0,0 +1,233 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + (assert tmp%19#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, awst_tmp%17#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + (assert tmp%30#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(awst_tmp%17#0) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (! tmp%34#0) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + fail // reject transaction + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + goto tmp%40#0 ? block@14 : block@13 + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (original_amount#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + let amount#1: uint64 = original_amount#0 + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#1: uint64 = (- original_amount#0 app_global_get_ex_value%7#0) + goto block@2 + block@2: // after_if_else_L92 + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#1) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#1) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract_Auction.final_unoptimized.ir b/examples/TEALScript/auction/out/contract_Auction.final_unoptimized.ir new file mode 100644 index 0000000000..10ab389016 --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.final_unoptimized.ir @@ -0,0 +1,245 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (== tmp%9#0 NoOp) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + let maybe_value_did_exist%15#0: uint64 = tmp%19#0 + let maybe_value%14#0: uint64 = awst_tmp%17#0 + (assert maybe_value_did_exist%15#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, maybe_value%14#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (== tmp%23#0 NoOp) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + let maybe_value_did_exist%27#0: uint64 = tmp%30#0 + let maybe_value%26#0: uint64 = awst_tmp%17#0 + (assert maybe_value_did_exist%27#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(maybe_value%26#0) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (== tmp%31#0 NoOp) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (== tmp%34#0 NoOp) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + goto block@11 + block@11: // switch_case_next_L17 + goto block@15 + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + switch tmp%40#0 {0u => block@13, * => block@14} + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + block@15: // after_if_else_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== app_global_get_ex_value%3#0 0u) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== app_global_get_ex_value%3#0 0u) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (app_local_get_ex_value%1#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let original_amount#0: uint64 = app_local_get_ex_value%1#0 + let amount#0: uint64 = original_amount#0 + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + let amount#5: uint64 = amount#0 + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#0: uint64 = (- amount#0 app_global_get_ex_value%7#0) + let amount#5: uint64 = amount#0 + goto block@2 + block@2: // after_if_else_L92 + let amount#0: uint64 = amount#5 + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#0) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#0) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract_Auction.parallel_copies.ir b/examples/TEALScript/auction/out/contract_Auction.parallel_copies.ir new file mode 100644 index 0000000000..df8b65368b --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.parallel_copies.ir @@ -0,0 +1,235 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + (assert tmp%19#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, awst_tmp%17#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#1: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#1) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + (assert tmp%30#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(awst_tmp%17#1) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (! tmp%34#0) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + fail // reject transaction + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + goto tmp%40#0 ? block@14 : block@13 + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (original_amount#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + let amount#4: uint64 = original_amount#0 + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#1: uint64 = (- original_amount#0 app_global_get_ex_value%7#0) + let amount#4: uint64 = amount#1 + goto block@2 + block@2: // after_if_else_L92 + let amount#2: uint64 = amount#4 + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#2) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#2) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract_Auction.post_ssa.ir b/examples/TEALScript/auction/out/contract_Auction.post_ssa.ir new file mode 100644 index 0000000000..df8b65368b --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.post_ssa.ir @@ -0,0 +1,235 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + (assert tmp%19#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, awst_tmp%17#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#1: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#1) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + (assert tmp%30#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(awst_tmp%17#1) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (! tmp%34#0) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + fail // reject transaction + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + goto tmp%40#0 ? block@14 : block@13 + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (original_amount#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + let amount#4: uint64 = original_amount#0 + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#1: uint64 = (- original_amount#0 app_global_get_ex_value%7#0) + let amount#4: uint64 = amount#1 + goto block@2 + block@2: // after_if_else_L92 + let amount#2: uint64 = amount#4 + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#2) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#2) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract_Auction.ssa.ir b/examples/TEALScript/auction/out/contract_Auction.ssa.ir new file mode 100644 index 0000000000..b867045601 --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.ssa.ir @@ -0,0 +1,241 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (== tmp%9#0 NoOp) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + let (maybe_value%14#0: uint64, maybe_value_did_exist%15#0: uint64) = (awst_tmp%17#0, tmp%19#0) + (assert maybe_value_did_exist%15#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, maybe_value%14#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (== tmp%23#0 NoOp) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#1: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#1) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + let (maybe_value%26#0: uint64, maybe_value_did_exist%27#0: uint64) = (awst_tmp%17#1, tmp%30#0) + (assert maybe_value_did_exist%27#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(maybe_value%26#0) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (== tmp%31#0 NoOp) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (== tmp%34#0 NoOp) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + goto block@11 + block@11: // switch_case_next_L17 + goto block@15 + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + switch tmp%40#0 {0u => block@13, * => block@14} + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + block@15: // after_if_else_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== app_global_get_ex_value%3#0 0u) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== app_global_get_ex_value%3#0 0u) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (app_local_get_ex_value%1#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let original_amount#0: uint64 = app_local_get_ex_value%1#0 + let amount#0: uint64 = original_amount#0 + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#1: uint64 = (- amount#0 app_global_get_ex_value%7#0) + goto block@2 + block@2: // after_if_else_L92 + let amount#2: uint64 = φ(amount#0 <- block@0, amount#1 <- block@1) + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#2) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#2) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_1.ir b/examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..c443a6a42e --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_1.ir @@ -0,0 +1,233 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + (assert tmp%19#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, awst_tmp%17#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#1: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#1) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + (assert tmp%30#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(awst_tmp%17#1) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (! tmp%34#0) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + fail // reject transaction + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + goto [block@13, ...block@14][tmp%40#0] + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (original_amount#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#1: uint64 = (- original_amount#0 app_global_get_ex_value%7#0) + goto block@2 + block@2: // after_if_else_L92 + let amount#2: uint64 = φ(original_amount#0 <- block@0, amount#1 <- block@1) + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#2) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#2) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_2.ir b/examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..e147fc8c58 --- /dev/null +++ b/examples/TEALScript/auction/out/contract_Auction.ssa.opt_pass_2.ir @@ -0,0 +1,233 @@ +contract examples.TEALScript.auction.contract.Auction: + program approval: + subroutine examples.TEALScript.auction.contract.Auction.approval_program() -> uint64: + block@0: // L17 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L18 + examples.TEALScript.auction.contract.Auction.__init__() + goto block@2 + block@2: // entrypoint_L18 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@12 + block@3: // abi_routing_L17 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "opt_into_asset(asset)void" => block@4, method "start_auction(uint64,uint64,axfer)void" => block@5, method "opt_in()void" => block@6, method "bid(pay)void" => block@7, method "claim_bids()void" => block@8, method "claim_asset(asset)void" => block@9, * => block@10} + block@4: // opt_into_asset_route_L27 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: uint64 = ((txnas Assets) tmp%7#0) + examples.TEALScript.auction.contract.Auction.opt_into_asset(tmp%8#0) + return 1u + block@5: // start_auction_route_L44 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%12#0: bytes = (txna ApplicationArgs 1) + let tmp%13#0: bytes = (txna ApplicationArgs 2) + let tmp%16#0: uint64 = (txn GroupIndex) + let awst_tmp%17#0: uint64 = (- tmp%16#0 1u) + let tmp%18#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 axfer) + (assert tmp%19#0) // transaction type is axfer + examples.TEALScript.auction.contract.Auction.start_auction(tmp%12#0, tmp%13#0, awst_tmp%17#0) + return 1u + block@6: // opt_in_route_L65 + 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 + examples.TEALScript.auction.contract.Auction.opt_in() + return 1u + block@7: // bid_route_L69 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%17#1: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%17#1) + let tmp%30#0: uint64 = (== tmp%29#0 pay) + (assert tmp%30#0) // transaction type is pay + examples.TEALScript.auction.contract.Auction.bid(awst_tmp%17#1) + return 1u + block@8: // claim_bids_route_L85 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + examples.TEALScript.auction.contract.Auction.claim_bids() + return 1u + block@9: // claim_asset_route_L104 + let tmp%34#0: uint64 = (txn OnCompletion) + let tmp%35#0: uint64 = (! tmp%34#0) + (assert tmp%35#0) // OnCompletion is NoOp + let tmp%36#0: uint64 = (txn ApplicationID) + (assert tmp%36#0) // is not creating + let tmp%37#0: bytes = (txna ApplicationArgs 1) + let tmp%38#0: uint64 = (btoi tmp%37#0) + let tmp%39#0: uint64 = ((txnas Assets) tmp%38#0) + examples.TEALScript.auction.contract.Auction.claim_asset(tmp%39#0) + return 1u + block@10: // switch_case_default_L17 + fail // reject transaction + block@12: // bare_routing_L17 + let tmp%40#0: uint64 = (txn OnCompletion) + goto tmp%40#0 ? block@14 : block@13 + block@13: // create_L17 + let tmp%41#0: uint64 = (txn ApplicationID) + let tmp%42#0: uint64 = (! tmp%41#0) + (assert tmp%42#0) // is creating + return 1u + block@14: // reject_bare_on_completion_L17 + fail // reject transaction + + subroutine examples.TEALScript.auction.contract.Auction.opt_into_asset(asset: uint64) -> void: + block@0: // L28 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.start_auction(starting_price: bytes, length: bytes, axfer: uint64) -> void: + block@0: // L45 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // auction must be started by creator + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // auction already started + let tmp%6#0: bytes = ((gtxns AssetReceiver) axfer#0) + let tmp%7#0: bytes = (global CurrentApplicationAddress) + let tmp%8#0: uint64 = (== tmp%6#0 tmp%7#0) + (assert tmp%8#0) // axfer must transfer to this app + let new_state_value%9#0: uint64 = ((gtxns AssetAmount) axfer#0) + (app_global_put "asa_amount" new_state_value%9#0) + let tmp%10#0: uint64 = (global LatestTimestamp) + let tmp%11#0: uint64 = (btoi length#0) + let new_state_value%12#0: uint64 = (+ tmp%10#0 tmp%11#0) + (app_global_put "auction_end" new_state_value%12#0) + let new_state_value%13#0: uint64 = (btoi starting_price#0) + (app_global_put "previous_bid" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.opt_in() -> void: + block@0: // L66 + return + + subroutine examples.TEALScript.auction.contract.Auction.bid(pay: uint64) -> void: + block@0: // L70 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (< tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has ended + let tmp%4#0: bytes = ((gtxns Sender) pay#0) + let tmp%5#0: bytes = (txn Sender) + let tmp%6#0: uint64 = (== tmp%4#0 tmp%5#0) + (assert tmp%6#0) // payment sender must match transaction sender + let tmp%7#0: uint64 = ((gtxns Amount) pay#0) + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (> tmp%7#0 app_global_get_ex_value%8#0) + (assert tmp%10#0) // Bid must be higher than previous bid + let new_state_value%11#0: uint64 = ((gtxns Amount) pay#0) + (app_global_put "previous_bid" new_state_value%11#0) + let new_state_value%12#0: bytes = ((gtxns Sender) pay#0) + (app_global_put "previous_bidder" new_state_value%12#0) + let new_state_value%13#0: uint64 = ((gtxns Amount) pay#0) + let tmp%14#0: bytes = (txn Sender) + (app_local_put tmp%14#0 "claimable_amount" new_state_value%13#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_bids() -> void: + block@0: // L86 + let tmp%0#0: bytes = (txn Sender) + let (original_amount#0: uint64, app_local_get_ex_did_exist%2#0: uint64) = (app_local_get_ex tmp%0#0 0u "claimable_amount") + (assert app_local_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: bytes = (txn Sender) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = (== tmp%3#0 app_global_get_ex_value%4#0) + goto tmp%6#0 ? block@1 : block@2 + block@1: // if_body_L92 + let (app_global_get_ex_value%7#0: uint64, app_global_get_ex_did_exist%8#0: uint64) = (app_global_get_ex 0u "previous_bid") + (assert app_global_get_ex_did_exist%8#0) // check value exists + let amount#1: uint64 = (- original_amount#0 app_global_get_ex_value%7#0) + goto block@2 + block@2: // after_if_else_L92 + let amount#2: uint64 = φ(original_amount#0 <- block@0, amount#1 <- block@1) + itxn_begin + ((itxn_field TypeEnum) pay) + ((itxn_field Fee) 0u) + let tmp%9#0: bytes = (txn Sender) + ((itxn_field Receiver) tmp%9#0) + ((itxn_field AssetAmount) amount#2) + itxn_submit + let new_state_value%10#0: uint64 = (- original_amount#0 amount#2) + let tmp%11#0: bytes = (txn Sender) + (app_local_put tmp%11#0 "claimable_amount" new_state_value%10#0) + return + + subroutine examples.TEALScript.auction.contract.Auction.claim_asset(asset: uint64) -> void: + block@0: // L105 + let tmp%0#0: uint64 = (global LatestTimestamp) + let (app_global_get_ex_value%1#0: uint64, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "auction_end") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (> tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // auction has not ended + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%5#0) // check value exists + ((itxn_field AssetReceiver) app_global_get_ex_value%4#0) + ((itxn_field XferAsset) asset#0) + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asa_amount") + (assert app_global_get_ex_did_exist%7#0) // check value exists + ((itxn_field AssetAmount) app_global_get_ex_value%6#0) + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "previous_bidder") + (assert app_global_get_ex_did_exist%9#0) // check value exists + ((itxn_field AssetCloseTo) app_global_get_ex_value%8#0) + itxn_submit + return + + subroutine examples.TEALScript.auction.contract.Auction.__init__() -> void: + block@0: // L18 + (app_global_put "auction_end" 0u) + (app_global_put "previous_bid" 0u) + (app_global_put "asa_amount" 0u) + (app_global_put "asa" 0u) + let new_state_value%0#0: bytes = (global ZeroAddress) + (app_global_put "previous_bidder" new_state_value%0#0) + return + + program clear-state: + subroutine examples.TEALScript.auction.contract.Auction.clear_state_program() -> uint64: + block@0: // L127 + return 1u \ No newline at end of file diff --git a/examples/TEALScript/auction/tealscript_artifacts/Auction.abi.json b/examples/TEALScript/auction/tealscript_artifacts/Auction.abi.json new file mode 100644 index 0000000000..db2f02f734 --- /dev/null +++ b/examples/TEALScript/auction/tealscript_artifacts/Auction.abi.json @@ -0,0 +1,112 @@ +{ + "name": "Auction", + "desc": "", + "methods": [ + { + "name": "createApplication", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "optIntoAsset", + "args": [ + { + "name": "asset", + "type": "asset", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "startAuction", + "args": [ + { + "name": "startingPrice", + "type": "uint64", + "desc": "" + }, + { + "name": "length", + "type": "uint64", + "desc": "" + }, + { + "name": "axfer", + "type": "axfer", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "optInToApplication", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "bid", + "args": [ + { + "name": "payment", + "type": "pay", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "claimBids", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "claim_asset", + "args": [ + { + "name": "asset", + "type": "asset", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "deleteApplication", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + } + ] +} \ No newline at end of file diff --git a/examples/TEALScript/auction/tealscript_artifacts/Auction.approval.teal b/examples/TEALScript/auction/tealscript_artifacts/Auction.approval.teal new file mode 100644 index 0000000000..aecc839908 --- /dev/null +++ b/examples/TEALScript/auction/tealscript_artifacts/Auction.approval.teal @@ -0,0 +1,533 @@ +#pragma version 9 + +// This TEAL was generated by TEALScript v0.47.1 +// https://github.com/algorand-devrel/TEALScript + +// This contract is compliant with and/or implements the following ARCs: [ ARC4 ] + +// The following ten lines of TEAL handle initial program flow +// This pattern is used to make it easy for anyone to parse the start of the program and determine if a specific action is allowed +// Here, action refers to the OnComplete in combination with whether the app is being created or called +// Every possible action for this contract is represented in the switch statement +// If the action is not implmented in the contract, its repsective branch will be "NOT_IMPLMENTED" which just contains "err" +txn ApplicationID +int 0 +> +int 6 +* +txn OnCompletion ++ +switch create_NoOp NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED call_NoOp call_OptIn NOT_IMPLEMENTED NOT_IMPLEMENTED NOT_IMPLEMENTED call_DeleteApplication + +NOT_IMPLEMENTED: + err + +// createApplication()void +abi_route_createApplication: + // execute createApplication()void + callsub createApplication + int 1 + return + +createApplication: + proto 0 0 + + // examples/auction/auction.algo.ts:18 + // this.auctionEnd.value = 0 + byte "auctionEnd" + int 0 + app_global_put + + // examples/auction/auction.algo.ts:19 + // this.previousBid.value = 0 + byte "previousBid" + int 0 + app_global_put + + // examples/auction/auction.algo.ts:20 + // this.asaAmt.value = 0 + byte "asaAmt" + int 0 + app_global_put + + // examples/auction/auction.algo.ts:21 + // this.asa.value = Asset.zeroIndex + byte "asa" + int 0 + app_global_put + + // examples/auction/auction.algo.ts:24 + // this.previousBidder.value = globals.zeroAddress + byte "previousBidder" + global ZeroAddress + app_global_put + retsub + +// optIntoAsset(asset)void +abi_route_optIntoAsset: + // asset: asset + txna ApplicationArgs 1 + btoi + txnas Assets + + // execute optIntoAsset(asset)void + callsub optIntoAsset + int 1 + return + +optIntoAsset: + proto 1 0 + + // Only allow app creator to opt the app account into a ASA + // examples/auction/auction.algo.ts:29 + // verify sender + txn Sender + global CreatorAddress + == + assert + + // Verify a ASA hasn't already been opted into + // examples/auction/auction.algo.ts:32 + // assert(this.asa.value === Asset.zeroIndex) + byte "asa" + app_global_get + int 0 + == + assert + + // Save ASA ID in global state + // examples/auction/auction.algo.ts:35 + // this.asa.value = asset + byte "asa" + frame_dig -1 // asset: asset + app_global_put + + // Submit opt-in transaction: 0 asset transfer to self + // examples/auction/auction.algo.ts:38 + // sendAssetTransfer({ + // assetReceiver: this.app.address, + // xferAsset: asset, + // assetAmount: 0, + // }) + itxn_begin + int axfer + itxn_field TypeEnum + + // examples/auction/auction.algo.ts:39 + // assetReceiver: this.app.address + txna Applications 0 + app_params_get AppAddress + assert + itxn_field AssetReceiver + + // examples/auction/auction.algo.ts:40 + // xferAsset: asset + frame_dig -1 // asset: asset + itxn_field XferAsset + + // examples/auction/auction.algo.ts:41 + // assetAmount: 0 + int 0 + itxn_field AssetAmount + + // Fee field not set, defaulting to 0 + int 0 + itxn_field Fee + + // Submit inner transaction + itxn_submit + retsub + +// startAuction(axfer,uint64,uint64)void +abi_route_startAuction: + // axfer: axfer + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert + + // length: uint64 + txna ApplicationArgs 2 + btoi + + // startingPrice: uint64 + txna ApplicationArgs 1 + btoi + + // execute startAuction(axfer,uint64,uint64)void + callsub startAuction + int 1 + return + +startAuction: + proto 3 0 + + // examples/auction/auction.algo.ts:46 + // verify sender + txn Sender + global CreatorAddress + == + assert + + // Ensure the auction hasn't already been started + // examples/auction/auction.algo.ts:49 + // assert(this.auctionEnd.value === 0) + byte "auctionEnd" + app_global_get + int 0 + == + assert + + // Verify axfer + // examples/auction/auction.algo.ts:52 + // verifyTxn(axfer, { assetReceiver: this.app.address }) + // verify assetReceiver + frame_dig -3 // axfer: axfer + gtxns AssetReceiver + txna Applications 0 + app_params_get AppAddress + assert + == + assert + + // Set global state + // examples/auction/auction.algo.ts:55 + // this.asaAmt.value = axfer.assetAmount + byte "asaAmt" + frame_dig -3 // axfer: axfer + gtxns AssetAmount + app_global_put + + // examples/auction/auction.algo.ts:56 + // this.auctionEnd.value = globals.latestTimestamp + length + byte "auctionEnd" + global LatestTimestamp + frame_dig -2 // length: uint64 + + + app_global_put + + // examples/auction/auction.algo.ts:57 + // this.previousBid.value = startingPrice + byte "previousBid" + frame_dig -1 // startingPrice: uint64 + app_global_put + retsub + +pay: + proto 2 0 + + // examples/auction/auction.algo.ts:61 + // sendPayment({ + // receiver: receiver, + // amount: amount, + // }) + itxn_begin + int pay + itxn_field TypeEnum + + // examples/auction/auction.algo.ts:62 + // receiver: receiver + frame_dig -1 // receiver: account + itxn_field Receiver + + // examples/auction/auction.algo.ts:63 + // amount: amount + frame_dig -2 // amount: uint64 + itxn_field Amount + + // Fee field not set, defaulting to 0 + int 0 + itxn_field Fee + + // Submit inner transaction + itxn_submit + retsub + +// optInToApplication()void +abi_route_optInToApplication: + // execute optInToApplication()void + callsub optInToApplication + int 1 + return + +optInToApplication: + proto 0 0 + retsub + +// bid(pay)void +// +// // eslint-disable-next-line no-unused-vars +abi_route_bid: + // payment: pay + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert + + // execute bid(pay)void + callsub bid + int 1 + return + +bid: + proto 1 0 + + // Ensure auction hasn't ended + // examples/auction/auction.algo.ts:72 + // assert(globals.latestTimestamp < this.auctionEnd.value) + global LatestTimestamp + byte "auctionEnd" + app_global_get + < + assert + + // Verify payment transaction + // examples/auction/auction.algo.ts:75 + // verifyTxn(payment, { + // sender: this.txn.sender, + // amount: { greaterThan: this.previousBid.value }, + // }) + // verify sender + frame_dig -1 // payment: pay + gtxns Sender + txn Sender + == + assert + + // verify amount + frame_dig -1 // payment: pay + gtxns Amount + byte "previousBid" + app_global_get + > + assert + + // Set global state + // examples/auction/auction.algo.ts:81 + // this.previousBid.value = payment.amount + byte "previousBid" + frame_dig -1 // payment: pay + gtxns Amount + app_global_put + + // examples/auction/auction.algo.ts:82 + // this.previousBidder.value = payment.sender + byte "previousBidder" + frame_dig -1 // payment: pay + gtxns Sender + app_global_put + + // Update claimable amount + // examples/auction/auction.algo.ts:85 + // this.claimableAmount(this.txn.sender).value = payment.amount + txn Sender + byte "claimableAmount" + frame_dig -1 // payment: pay + gtxns Amount + app_local_put + retsub + +// claimBids()void +abi_route_claimBids: + byte 0x; dup // push empty bytes to fill the stack frame for this subroutine's local variables + + // execute claimBids()void + callsub claimBids + int 1 + return + +claimBids: + proto 2 0 + + // examples/auction/auction.algo.ts:89 + // originalAmount = this.claimableAmount(this.txn.sender).value + txn Sender + byte "claimableAmount" + app_local_get + frame_bury -1 // originalAmount: uint64 + + // examples/auction/auction.algo.ts:90 + // amount = originalAmount + frame_dig -1 // originalAmount: uint64 + frame_bury -2 // amount: uint64 + + // subtract previous bid if sender is previous bidder + // if0_condition + // examples/auction/auction.algo.ts:93 + // this.txn.sender === this.previousBidder.value + txn Sender + byte "previousBidder" + app_global_get + == + bz if0_end + + // if0_consequent + // examples/auction/auction.algo.ts:93 + // amount = amount - this.previousBid.value + frame_dig -2 // amount: uint64 + byte "previousBid" + app_global_get + - + frame_bury -2 // amount: uint64 + +if0_end: + // examples/auction/auction.algo.ts:95 + // this.pay(this.txn.sender, amount) + frame_dig -2 // amount: uint64 + txn Sender + callsub pay + + // examples/auction/auction.algo.ts:96 + // this.claimableAmount(this.txn.sender).value = originalAmount - amount + txn Sender + byte "claimableAmount" + frame_dig -1 // originalAmount: uint64 + frame_dig -2 // amount: uint64 + - + app_local_put + retsub + +// claim_asset(asset)void +abi_route_claim_asset: + // asset: asset + txna ApplicationArgs 1 + btoi + txnas Assets + + // execute claim_asset(asset)void + callsub claim_asset + int 1 + return + +claim_asset: + proto 1 0 + + // examples/auction/auction.algo.ts:100 + // assert(globals.latestTimestamp > this.auctionEnd.value) + global LatestTimestamp + byte "auctionEnd" + app_global_get + > + assert + + // Send ASA to previous bidder + // examples/auction/auction.algo.ts:103 + // sendAssetTransfer({ + // assetReceiver: this.previousBidder.value, + // xferAsset: asset, + // assetAmount: this.asaAmt.value, + // assetCloseTo: this.previousBidder.value, + // }) + itxn_begin + int axfer + itxn_field TypeEnum + + // examples/auction/auction.algo.ts:104 + // assetReceiver: this.previousBidder.value + byte "previousBidder" + app_global_get + itxn_field AssetReceiver + + // examples/auction/auction.algo.ts:105 + // xferAsset: asset + frame_dig -1 // asset: asset + itxn_field XferAsset + + // examples/auction/auction.algo.ts:106 + // assetAmount: this.asaAmt.value + byte "asaAmt" + app_global_get + itxn_field AssetAmount + + // examples/auction/auction.algo.ts:107 + // assetCloseTo: this.previousBidder.value + byte "previousBidder" + app_global_get + itxn_field AssetCloseTo + + // Fee field not set, defaulting to 0 + int 0 + itxn_field Fee + + // Submit inner transaction + itxn_submit + retsub + +// deleteApplication()void +abi_route_deleteApplication: + // execute deleteApplication()void + callsub deleteApplication + int 1 + return + +deleteApplication: + proto 0 0 + + // examples/auction/auction.algo.ts:112 + // sendPayment({ + // receiver: globals.creatorAddress, + // closeRemainderTo: globals.creatorAddress, + // amount: 0, + // }) + itxn_begin + int pay + itxn_field TypeEnum + + // examples/auction/auction.algo.ts:113 + // receiver: globals.creatorAddress + global CreatorAddress + itxn_field Receiver + + // examples/auction/auction.algo.ts:114 + // closeRemainderTo: globals.creatorAddress + global CreatorAddress + itxn_field CloseRemainderTo + + // examples/auction/auction.algo.ts:115 + // amount: 0 + int 0 + itxn_field Amount + + // Fee field not set, defaulting to 0 + int 0 + itxn_field Fee + + // Submit inner transaction + itxn_submit + retsub + +create_NoOp: + method "createApplication()void" + txna ApplicationArgs 0 + match abi_route_createApplication + err + +call_NoOp: + method "optIntoAsset(asset)void" + method "startAuction(uint64,uint64,axfer)void" + method "bid(pay)void" + method "claimBids()void" + method "claim_asset(asset)void" + txna ApplicationArgs 0 + match abi_route_optIntoAsset abi_route_startAuction abi_route_bid abi_route_claimBids abi_route_claim_asset + err + +call_OptIn: + method "optInToApplication()void" + txna ApplicationArgs 0 + match abi_route_optInToApplication + err + +call_DeleteApplication: + method "deleteApplication()void" + txna ApplicationArgs 0 + match abi_route_deleteApplication + err \ No newline at end of file diff --git a/examples/TEALScript/auction/tealscript_artifacts/Auction.clear.teal b/examples/TEALScript/auction/tealscript_artifacts/Auction.clear.teal new file mode 100644 index 0000000000..6bbec507aa --- /dev/null +++ b/examples/TEALScript/auction/tealscript_artifacts/Auction.clear.teal @@ -0,0 +1,2 @@ +#pragma version 9 +int 1 \ No newline at end of file diff --git a/examples/TEALScript/auction/tealscript_artifacts/Auction.json b/examples/TEALScript/auction/tealscript_artifacts/Auction.json new file mode 100644 index 0000000000..b930cbfaf3 --- /dev/null +++ b/examples/TEALScript/auction/tealscript_artifacts/Auction.json @@ -0,0 +1,213 @@ +{ + "hints": { + "createApplication()void": { + "call_config": { + "no_op": "CREATE" + } + }, + "optIntoAsset(asset)void": { + "call_config": { + "no_op": "CALL" + } + }, + "startAuction(uint64,uint64,axfer)void": { + "call_config": { + "no_op": "CALL" + } + }, + "optInToApplication()void": { + "call_config": { + "opt_in": "CALL" + } + }, + "bid(pay)void": { + "call_config": { + "no_op": "CALL" + } + }, + "claimBids()void": { + "call_config": { + "no_op": "CALL" + } + }, + "claim_asset(asset)void": { + "call_config": { + "no_op": "CALL" + } + }, + "deleteApplication()void": { + "call_config": { + "delete_application": "CALL" + } + } + }, + "bare_call_config": { + "no_op": "NEVER", + "opt_in": "NEVER", + "close_out": "NEVER", + "update_application": "NEVER", + "delete_application": "NEVER" + }, + "schema": { + "local": { + "declared": { + "claimableAmount": { + "type": "uint64", + "key": "claimableAmount" + } + }, + "reserved": {} + }, + "global": { + "declared": { + "previousBidder": { + "type": "bytes", + "key": "previousBidder" + }, + "auctionEnd": { + "type": "uint64", + "key": "auctionEnd" + }, + "previousBid": { + "type": "uint64", + "key": "previousBid" + }, + "asaAmt": { + "type": "uint64", + "key": "asaAmt" + }, + "asa": { + "type": "uint64", + "key": "asa" + } + }, + "reserved": {} + } + }, + "state": { + "global": { + "num_byte_slices": 1, + "num_uints": 4 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 1 + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDkKCi8vIFRoaXMgVEVBTCB3YXMgZ2VuZXJhdGVkIGJ5IFRFQUxTY3JpcHQgdjAuNDcuMQovLyBodHRwczovL2dpdGh1Yi5jb20vYWxnb3JhbmQtZGV2cmVsL1RFQUxTY3JpcHQKCi8vIFRoaXMgY29udHJhY3QgaXMgY29tcGxpYW50IHdpdGggYW5kL29yIGltcGxlbWVudHMgdGhlIGZvbGxvd2luZyBBUkNzOiBbIEFSQzQgXQoKLy8gVGhlIGZvbGxvd2luZyB0ZW4gbGluZXMgb2YgVEVBTCBoYW5kbGUgaW5pdGlhbCBwcm9ncmFtIGZsb3cKLy8gVGhpcyBwYXR0ZXJuIGlzIHVzZWQgdG8gbWFrZSBpdCBlYXN5IGZvciBhbnlvbmUgdG8gcGFyc2UgdGhlIHN0YXJ0IG9mIHRoZSBwcm9ncmFtIGFuZCBkZXRlcm1pbmUgaWYgYSBzcGVjaWZpYyBhY3Rpb24gaXMgYWxsb3dlZAovLyBIZXJlLCBhY3Rpb24gcmVmZXJzIHRvIHRoZSBPbkNvbXBsZXRlIGluIGNvbWJpbmF0aW9uIHdpdGggd2hldGhlciB0aGUgYXBwIGlzIGJlaW5nIGNyZWF0ZWQgb3IgY2FsbGVkCi8vIEV2ZXJ5IHBvc3NpYmxlIGFjdGlvbiBmb3IgdGhpcyBjb250cmFjdCBpcyByZXByZXNlbnRlZCBpbiB0aGUgc3dpdGNoIHN0YXRlbWVudAovLyBJZiB0aGUgYWN0aW9uIGlzIG5vdCBpbXBsbWVudGVkIGluIHRoZSBjb250cmFjdCwgaXRzIHJlcHNlY3RpdmUgYnJhbmNoIHdpbGwgYmUgIk5PVF9JTVBMTUVOVEVEIiB3aGljaCBqdXN0IGNvbnRhaW5zICJlcnIiCnR4biBBcHBsaWNhdGlvbklECmludCAwCj4KaW50IDYKKgp0eG4gT25Db21wbGV0aW9uCisKc3dpdGNoIGNyZWF0ZV9Ob09wIE5PVF9JTVBMRU1FTlRFRCBOT1RfSU1QTEVNRU5URUQgTk9UX0lNUExFTUVOVEVEIE5PVF9JTVBMRU1FTlRFRCBOT1RfSU1QTEVNRU5URUQgY2FsbF9Ob09wIGNhbGxfT3B0SW4gTk9UX0lNUExFTUVOVEVEIE5PVF9JTVBMRU1FTlRFRCBOT1RfSU1QTEVNRU5URUQgY2FsbF9EZWxldGVBcHBsaWNhdGlvbgoKTk9UX0lNUExFTUVOVEVEOgoJZXJyCgovLyBjcmVhdGVBcHBsaWNhdGlvbigpdm9pZAphYmlfcm91dGVfY3JlYXRlQXBwbGljYXRpb246CgkvLyBleGVjdXRlIGNyZWF0ZUFwcGxpY2F0aW9uKCl2b2lkCgljYWxsc3ViIGNyZWF0ZUFwcGxpY2F0aW9uCglpbnQgMQoJcmV0dXJuCgpjcmVhdGVBcHBsaWNhdGlvbjoKCXByb3RvIDAgMAoKCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjE4CgkvLyB0aGlzLmF1Y3Rpb25FbmQudmFsdWUgPSAwCglieXRlICJhdWN0aW9uRW5kIgoJaW50IDAKCWFwcF9nbG9iYWxfcHV0CgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6MTkKCS8vIHRoaXMucHJldmlvdXNCaWQudmFsdWUgPSAwCglieXRlICJwcmV2aW91c0JpZCIKCWludCAwCglhcHBfZ2xvYmFsX3B1dAoKCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjIwCgkvLyB0aGlzLmFzYUFtdC52YWx1ZSA9IDAKCWJ5dGUgImFzYUFtdCIKCWludCAwCglhcHBfZ2xvYmFsX3B1dAoKCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjIxCgkvLyB0aGlzLmFzYS52YWx1ZSA9IEFzc2V0Lnplcm9JbmRleAoJYnl0ZSAiYXNhIgoJaW50IDAKCWFwcF9nbG9iYWxfcHV0CgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6MjQKCS8vIHRoaXMucHJldmlvdXNCaWRkZXIudmFsdWUgPSBnbG9iYWxzLnplcm9BZGRyZXNzCglieXRlICJwcmV2aW91c0JpZGRlciIKCWdsb2JhbCBaZXJvQWRkcmVzcwoJYXBwX2dsb2JhbF9wdXQKCXJldHN1YgoKLy8gb3B0SW50b0Fzc2V0KGFzc2V0KXZvaWQKYWJpX3JvdXRlX29wdEludG9Bc3NldDoKCS8vIGFzc2V0OiBhc3NldAoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQoJYnRvaQoJdHhuYXMgQXNzZXRzCgoJLy8gZXhlY3V0ZSBvcHRJbnRvQXNzZXQoYXNzZXQpdm9pZAoJY2FsbHN1YiBvcHRJbnRvQXNzZXQKCWludCAxCglyZXR1cm4KCm9wdEludG9Bc3NldDoKCXByb3RvIDEgMAoKCS8vIE9ubHkgYWxsb3cgYXBwIGNyZWF0b3IgdG8gb3B0IHRoZSBhcHAgYWNjb3VudCBpbnRvIGEgQVNBCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoyOQoJLy8gdmVyaWZ5IHNlbmRlcgoJdHhuIFNlbmRlcgoJZ2xvYmFsIENyZWF0b3JBZGRyZXNzCgk9PQoJYXNzZXJ0CgoJLy8gVmVyaWZ5IGEgQVNBIGhhc24ndCBhbHJlYWR5IGJlZW4gb3B0ZWQgaW50bwoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6MzIKCS8vIGFzc2VydCh0aGlzLmFzYS52YWx1ZSA9PT0gQXNzZXQuemVyb0luZGV4KQoJYnl0ZSAiYXNhIgoJYXBwX2dsb2JhbF9nZXQKCWludCAwCgk9PQoJYXNzZXJ0CgoJLy8gU2F2ZSBBU0EgSUQgaW4gZ2xvYmFsIHN0YXRlCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czozNQoJLy8gdGhpcy5hc2EudmFsdWUgPSBhc3NldAoJYnl0ZSAiYXNhIgoJZnJhbWVfZGlnIC0xIC8vIGFzc2V0OiBhc3NldAoJYXBwX2dsb2JhbF9wdXQKCgkvLyBTdWJtaXQgb3B0LWluIHRyYW5zYWN0aW9uOiAwIGFzc2V0IHRyYW5zZmVyIHRvIHNlbGYKCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjM4CgkvLyBzZW5kQXNzZXRUcmFuc2Zlcih7CgkvLyAgICAgICBhc3NldFJlY2VpdmVyOiB0aGlzLmFwcC5hZGRyZXNzLAoJLy8gICAgICAgeGZlckFzc2V0OiBhc3NldCwKCS8vICAgICAgIGFzc2V0QW1vdW50OiAwLAoJLy8gICAgIH0pCglpdHhuX2JlZ2luCglpbnQgYXhmZXIKCWl0eG5fZmllbGQgVHlwZUVudW0KCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czozOQoJLy8gYXNzZXRSZWNlaXZlcjogdGhpcy5hcHAuYWRkcmVzcwoJdHhuYSBBcHBsaWNhdGlvbnMgMAoJYXBwX3BhcmFtc19nZXQgQXBwQWRkcmVzcwoJYXNzZXJ0CglpdHhuX2ZpZWxkIEFzc2V0UmVjZWl2ZXIKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo0MAoJLy8geGZlckFzc2V0OiBhc3NldAoJZnJhbWVfZGlnIC0xIC8vIGFzc2V0OiBhc3NldAoJaXR4bl9maWVsZCBYZmVyQXNzZXQKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo0MQoJLy8gYXNzZXRBbW91bnQ6IDAKCWludCAwCglpdHhuX2ZpZWxkIEFzc2V0QW1vdW50CgoJLy8gRmVlIGZpZWxkIG5vdCBzZXQsIGRlZmF1bHRpbmcgdG8gMAoJaW50IDAKCWl0eG5fZmllbGQgRmVlCgoJLy8gU3VibWl0IGlubmVyIHRyYW5zYWN0aW9uCglpdHhuX3N1Ym1pdAoJcmV0c3ViCgovLyBzdGFydEF1Y3Rpb24oYXhmZXIsdWludDY0LHVpbnQ2NCl2b2lkCmFiaV9yb3V0ZV9zdGFydEF1Y3Rpb246CgkvLyBheGZlcjogYXhmZXIKCXR4biBHcm91cEluZGV4CglpbnQgMQoJLQoJZHVwCglndHhucyBUeXBlRW51bQoJaW50IGF4ZmVyCgk9PQoJYXNzZXJ0CgoJLy8gbGVuZ3RoOiB1aW50NjQKCXR4bmEgQXBwbGljYXRpb25BcmdzIDIKCWJ0b2kKCgkvLyBzdGFydGluZ1ByaWNlOiB1aW50NjQKCXR4bmEgQXBwbGljYXRpb25BcmdzIDEKCWJ0b2kKCgkvLyBleGVjdXRlIHN0YXJ0QXVjdGlvbihheGZlcix1aW50NjQsdWludDY0KXZvaWQKCWNhbGxzdWIgc3RhcnRBdWN0aW9uCglpbnQgMQoJcmV0dXJuCgpzdGFydEF1Y3Rpb246Cglwcm90byAzIDAKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo0NgoJLy8gdmVyaWZ5IHNlbmRlcgoJdHhuIFNlbmRlcgoJZ2xvYmFsIENyZWF0b3JBZGRyZXNzCgk9PQoJYXNzZXJ0CgoJLy8gRW5zdXJlIHRoZSBhdWN0aW9uIGhhc24ndCBhbHJlYWR5IGJlZW4gc3RhcnRlZAoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6NDkKCS8vIGFzc2VydCh0aGlzLmF1Y3Rpb25FbmQudmFsdWUgPT09IDApCglieXRlICJhdWN0aW9uRW5kIgoJYXBwX2dsb2JhbF9nZXQKCWludCAwCgk9PQoJYXNzZXJ0CgoJLy8gVmVyaWZ5IGF4ZmVyCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo1MgoJLy8gdmVyaWZ5VHhuKGF4ZmVyLCB7IGFzc2V0UmVjZWl2ZXI6IHRoaXMuYXBwLmFkZHJlc3MgfSkKCS8vIHZlcmlmeSBhc3NldFJlY2VpdmVyCglmcmFtZV9kaWcgLTMgLy8gYXhmZXI6IGF4ZmVyCglndHhucyBBc3NldFJlY2VpdmVyCgl0eG5hIEFwcGxpY2F0aW9ucyAwCglhcHBfcGFyYW1zX2dldCBBcHBBZGRyZXNzCglhc3NlcnQKCT09Cglhc3NlcnQKCgkvLyBTZXQgZ2xvYmFsIHN0YXRlCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo1NQoJLy8gdGhpcy5hc2FBbXQudmFsdWUgPSBheGZlci5hc3NldEFtb3VudAoJYnl0ZSAiYXNhQW10IgoJZnJhbWVfZGlnIC0zIC8vIGF4ZmVyOiBheGZlcgoJZ3R4bnMgQXNzZXRBbW91bnQKCWFwcF9nbG9iYWxfcHV0CgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6NTYKCS8vIHRoaXMuYXVjdGlvbkVuZC52YWx1ZSA9IGdsb2JhbHMubGF0ZXN0VGltZXN0YW1wICsgbGVuZ3RoCglieXRlICJhdWN0aW9uRW5kIgoJZ2xvYmFsIExhdGVzdFRpbWVzdGFtcAoJZnJhbWVfZGlnIC0yIC8vIGxlbmd0aDogdWludDY0CgkrCglhcHBfZ2xvYmFsX3B1dAoKCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjU3CgkvLyB0aGlzLnByZXZpb3VzQmlkLnZhbHVlID0gc3RhcnRpbmdQcmljZQoJYnl0ZSAicHJldmlvdXNCaWQiCglmcmFtZV9kaWcgLTEgLy8gc3RhcnRpbmdQcmljZTogdWludDY0CglhcHBfZ2xvYmFsX3B1dAoJcmV0c3ViCgpwYXk6Cglwcm90byAyIDAKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo2MQoJLy8gc2VuZFBheW1lbnQoewoJLy8gICAgICAgcmVjZWl2ZXI6IHJlY2VpdmVyLAoJLy8gICAgICAgYW1vdW50OiBhbW91bnQsCgkvLyAgICAgfSkKCWl0eG5fYmVnaW4KCWludCBwYXkKCWl0eG5fZmllbGQgVHlwZUVudW0KCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo2MgoJLy8gcmVjZWl2ZXI6IHJlY2VpdmVyCglmcmFtZV9kaWcgLTEgLy8gcmVjZWl2ZXI6IGFjY291bnQKCWl0eG5fZmllbGQgUmVjZWl2ZXIKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo2MwoJLy8gYW1vdW50OiBhbW91bnQKCWZyYW1lX2RpZyAtMiAvLyBhbW91bnQ6IHVpbnQ2NAoJaXR4bl9maWVsZCBBbW91bnQKCgkvLyBGZWUgZmllbGQgbm90IHNldCwgZGVmYXVsdGluZyB0byAwCglpbnQgMAoJaXR4bl9maWVsZCBGZWUKCgkvLyBTdWJtaXQgaW5uZXIgdHJhbnNhY3Rpb24KCWl0eG5fc3VibWl0CglyZXRzdWIKCi8vIG9wdEluVG9BcHBsaWNhdGlvbigpdm9pZAphYmlfcm91dGVfb3B0SW5Ub0FwcGxpY2F0aW9uOgoJLy8gZXhlY3V0ZSBvcHRJblRvQXBwbGljYXRpb24oKXZvaWQKCWNhbGxzdWIgb3B0SW5Ub0FwcGxpY2F0aW9uCglpbnQgMQoJcmV0dXJuCgpvcHRJblRvQXBwbGljYXRpb246Cglwcm90byAwIDAKCXJldHN1YgoKLy8gYmlkKHBheSl2b2lkCi8vCi8vIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bnVzZWQtdmFycwphYmlfcm91dGVfYmlkOgoJLy8gcGF5bWVudDogcGF5Cgl0eG4gR3JvdXBJbmRleAoJaW50IDEKCS0KCWR1cAoJZ3R4bnMgVHlwZUVudW0KCWludCBwYXkKCT09Cglhc3NlcnQKCgkvLyBleGVjdXRlIGJpZChwYXkpdm9pZAoJY2FsbHN1YiBiaWQKCWludCAxCglyZXR1cm4KCmJpZDoKCXByb3RvIDEgMAoKCS8vIEVuc3VyZSBhdWN0aW9uIGhhc24ndCBlbmRlZAoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6NzIKCS8vIGFzc2VydChnbG9iYWxzLmxhdGVzdFRpbWVzdGFtcCA8IHRoaXMuYXVjdGlvbkVuZC52YWx1ZSkKCWdsb2JhbCBMYXRlc3RUaW1lc3RhbXAKCWJ5dGUgImF1Y3Rpb25FbmQiCglhcHBfZ2xvYmFsX2dldAoJPAoJYXNzZXJ0CgoJLy8gVmVyaWZ5IHBheW1lbnQgdHJhbnNhY3Rpb24KCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjc1CgkvLyB2ZXJpZnlUeG4ocGF5bWVudCwgewoJLy8gICAgICAgc2VuZGVyOiB0aGlzLnR4bi5zZW5kZXIsCgkvLyAgICAgICBhbW91bnQ6IHsgZ3JlYXRlclRoYW46IHRoaXMucHJldmlvdXNCaWQudmFsdWUgfSwKCS8vICAgICB9KQoJLy8gdmVyaWZ5IHNlbmRlcgoJZnJhbWVfZGlnIC0xIC8vIHBheW1lbnQ6IHBheQoJZ3R4bnMgU2VuZGVyCgl0eG4gU2VuZGVyCgk9PQoJYXNzZXJ0CgoJLy8gdmVyaWZ5IGFtb3VudAoJZnJhbWVfZGlnIC0xIC8vIHBheW1lbnQ6IHBheQoJZ3R4bnMgQW1vdW50CglieXRlICJwcmV2aW91c0JpZCIKCWFwcF9nbG9iYWxfZ2V0Cgk+Cglhc3NlcnQKCgkvLyBTZXQgZ2xvYmFsIHN0YXRlCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo4MQoJLy8gdGhpcy5wcmV2aW91c0JpZC52YWx1ZSA9IHBheW1lbnQuYW1vdW50CglieXRlICJwcmV2aW91c0JpZCIKCWZyYW1lX2RpZyAtMSAvLyBwYXltZW50OiBwYXkKCWd0eG5zIEFtb3VudAoJYXBwX2dsb2JhbF9wdXQKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo4MgoJLy8gdGhpcy5wcmV2aW91c0JpZGRlci52YWx1ZSA9IHBheW1lbnQuc2VuZGVyCglieXRlICJwcmV2aW91c0JpZGRlciIKCWZyYW1lX2RpZyAtMSAvLyBwYXltZW50OiBwYXkKCWd0eG5zIFNlbmRlcgoJYXBwX2dsb2JhbF9wdXQKCgkvLyBVcGRhdGUgY2xhaW1hYmxlIGFtb3VudAoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6ODUKCS8vIHRoaXMuY2xhaW1hYmxlQW1vdW50KHRoaXMudHhuLnNlbmRlcikudmFsdWUgPSBwYXltZW50LmFtb3VudAoJdHhuIFNlbmRlcgoJYnl0ZSAiY2xhaW1hYmxlQW1vdW50IgoJZnJhbWVfZGlnIC0xIC8vIHBheW1lbnQ6IHBheQoJZ3R4bnMgQW1vdW50CglhcHBfbG9jYWxfcHV0CglyZXRzdWIKCi8vIGNsYWltQmlkcygpdm9pZAphYmlfcm91dGVfY2xhaW1CaWRzOgoJYnl0ZSAweDsgZHVwIC8vIHB1c2ggZW1wdHkgYnl0ZXMgdG8gZmlsbCB0aGUgc3RhY2sgZnJhbWUgZm9yIHRoaXMgc3Vicm91dGluZSdzIGxvY2FsIHZhcmlhYmxlcwoKCS8vIGV4ZWN1dGUgY2xhaW1CaWRzKCl2b2lkCgljYWxsc3ViIGNsYWltQmlkcwoJaW50IDEKCXJldHVybgoKY2xhaW1CaWRzOgoJcHJvdG8gMiAwCgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6ODkKCS8vIG9yaWdpbmFsQW1vdW50ID0gdGhpcy5jbGFpbWFibGVBbW91bnQodGhpcy50eG4uc2VuZGVyKS52YWx1ZQoJdHhuIFNlbmRlcgoJYnl0ZSAiY2xhaW1hYmxlQW1vdW50IgoJYXBwX2xvY2FsX2dldAoJZnJhbWVfYnVyeSAtMSAvLyBvcmlnaW5hbEFtb3VudDogdWludDY0CgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6OTAKCS8vIGFtb3VudCA9IG9yaWdpbmFsQW1vdW50CglmcmFtZV9kaWcgLTEgLy8gb3JpZ2luYWxBbW91bnQ6IHVpbnQ2NAoJZnJhbWVfYnVyeSAtMiAvLyBhbW91bnQ6IHVpbnQ2NAoKCS8vIHN1YnRyYWN0IHByZXZpb3VzIGJpZCBpZiBzZW5kZXIgaXMgcHJldmlvdXMgYmlkZGVyCgkvLyBpZjBfY29uZGl0aW9uCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo5MwoJLy8gdGhpcy50eG4uc2VuZGVyID09PSB0aGlzLnByZXZpb3VzQmlkZGVyLnZhbHVlCgl0eG4gU2VuZGVyCglieXRlICJwcmV2aW91c0JpZGRlciIKCWFwcF9nbG9iYWxfZ2V0Cgk9PQoJYnogaWYwX2VuZAoKCS8vIGlmMF9jb25zZXF1ZW50CgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czo5MwoJLy8gYW1vdW50ID0gYW1vdW50IC0gdGhpcy5wcmV2aW91c0JpZC52YWx1ZQoJZnJhbWVfZGlnIC0yIC8vIGFtb3VudDogdWludDY0CglieXRlICJwcmV2aW91c0JpZCIKCWFwcF9nbG9iYWxfZ2V0CgktCglmcmFtZV9idXJ5IC0yIC8vIGFtb3VudDogdWludDY0CgppZjBfZW5kOgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6OTUKCS8vIHRoaXMucGF5KHRoaXMudHhuLnNlbmRlciwgYW1vdW50KQoJZnJhbWVfZGlnIC0yIC8vIGFtb3VudDogdWludDY0Cgl0eG4gU2VuZGVyCgljYWxsc3ViIHBheQoKCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjk2CgkvLyB0aGlzLmNsYWltYWJsZUFtb3VudCh0aGlzLnR4bi5zZW5kZXIpLnZhbHVlID0gb3JpZ2luYWxBbW91bnQgLSBhbW91bnQKCXR4biBTZW5kZXIKCWJ5dGUgImNsYWltYWJsZUFtb3VudCIKCWZyYW1lX2RpZyAtMSAvLyBvcmlnaW5hbEFtb3VudDogdWludDY0CglmcmFtZV9kaWcgLTIgLy8gYW1vdW50OiB1aW50NjQKCS0KCWFwcF9sb2NhbF9wdXQKCXJldHN1YgoKLy8gY2xhaW1fYXNzZXQoYXNzZXQpdm9pZAphYmlfcm91dGVfY2xhaW1fYXNzZXQ6CgkvLyBhc3NldDogYXNzZXQKCXR4bmEgQXBwbGljYXRpb25BcmdzIDEKCWJ0b2kKCXR4bmFzIEFzc2V0cwoKCS8vIGV4ZWN1dGUgY2xhaW1fYXNzZXQoYXNzZXQpdm9pZAoJY2FsbHN1YiBjbGFpbV9hc3NldAoJaW50IDEKCXJldHVybgoKY2xhaW1fYXNzZXQ6Cglwcm90byAxIDAKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoxMDAKCS8vIGFzc2VydChnbG9iYWxzLmxhdGVzdFRpbWVzdGFtcCA+IHRoaXMuYXVjdGlvbkVuZC52YWx1ZSkKCWdsb2JhbCBMYXRlc3RUaW1lc3RhbXAKCWJ5dGUgImF1Y3Rpb25FbmQiCglhcHBfZ2xvYmFsX2dldAoJPgoJYXNzZXJ0CgoJLy8gU2VuZCBBU0EgdG8gcHJldmlvdXMgYmlkZGVyCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoxMDMKCS8vIHNlbmRBc3NldFRyYW5zZmVyKHsKCS8vICAgICAgIGFzc2V0UmVjZWl2ZXI6IHRoaXMucHJldmlvdXNCaWRkZXIudmFsdWUsCgkvLyAgICAgICB4ZmVyQXNzZXQ6IGFzc2V0LAoJLy8gICAgICAgYXNzZXRBbW91bnQ6IHRoaXMuYXNhQW10LnZhbHVlLAoJLy8gICAgICAgYXNzZXRDbG9zZVRvOiB0aGlzLnByZXZpb3VzQmlkZGVyLnZhbHVlLAoJLy8gICAgIH0pCglpdHhuX2JlZ2luCglpbnQgYXhmZXIKCWl0eG5fZmllbGQgVHlwZUVudW0KCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoxMDQKCS8vIGFzc2V0UmVjZWl2ZXI6IHRoaXMucHJldmlvdXNCaWRkZXIudmFsdWUKCWJ5dGUgInByZXZpb3VzQmlkZGVyIgoJYXBwX2dsb2JhbF9nZXQKCWl0eG5fZmllbGQgQXNzZXRSZWNlaXZlcgoKCS8vIGV4YW1wbGVzL2F1Y3Rpb24vYXVjdGlvbi5hbGdvLnRzOjEwNQoJLy8geGZlckFzc2V0OiBhc3NldAoJZnJhbWVfZGlnIC0xIC8vIGFzc2V0OiBhc3NldAoJaXR4bl9maWVsZCBYZmVyQXNzZXQKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoxMDYKCS8vIGFzc2V0QW1vdW50OiB0aGlzLmFzYUFtdC52YWx1ZQoJYnl0ZSAiYXNhQW10IgoJYXBwX2dsb2JhbF9nZXQKCWl0eG5fZmllbGQgQXNzZXRBbW91bnQKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoxMDcKCS8vIGFzc2V0Q2xvc2VUbzogdGhpcy5wcmV2aW91c0JpZGRlci52YWx1ZQoJYnl0ZSAicHJldmlvdXNCaWRkZXIiCglhcHBfZ2xvYmFsX2dldAoJaXR4bl9maWVsZCBBc3NldENsb3NlVG8KCgkvLyBGZWUgZmllbGQgbm90IHNldCwgZGVmYXVsdGluZyB0byAwCglpbnQgMAoJaXR4bl9maWVsZCBGZWUKCgkvLyBTdWJtaXQgaW5uZXIgdHJhbnNhY3Rpb24KCWl0eG5fc3VibWl0CglyZXRzdWIKCi8vIGRlbGV0ZUFwcGxpY2F0aW9uKCl2b2lkCmFiaV9yb3V0ZV9kZWxldGVBcHBsaWNhdGlvbjoKCS8vIGV4ZWN1dGUgZGVsZXRlQXBwbGljYXRpb24oKXZvaWQKCWNhbGxzdWIgZGVsZXRlQXBwbGljYXRpb24KCWludCAxCglyZXR1cm4KCmRlbGV0ZUFwcGxpY2F0aW9uOgoJcHJvdG8gMCAwCgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6MTEyCgkvLyBzZW5kUGF5bWVudCh7CgkvLyAgICAgICByZWNlaXZlcjogZ2xvYmFscy5jcmVhdG9yQWRkcmVzcywKCS8vICAgICAgIGNsb3NlUmVtYWluZGVyVG86IGdsb2JhbHMuY3JlYXRvckFkZHJlc3MsCgkvLyAgICAgICBhbW91bnQ6IDAsCgkvLyAgICAgfSkKCWl0eG5fYmVnaW4KCWludCBwYXkKCWl0eG5fZmllbGQgVHlwZUVudW0KCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoxMTMKCS8vIHJlY2VpdmVyOiBnbG9iYWxzLmNyZWF0b3JBZGRyZXNzCglnbG9iYWwgQ3JlYXRvckFkZHJlc3MKCWl0eG5fZmllbGQgUmVjZWl2ZXIKCgkvLyBleGFtcGxlcy9hdWN0aW9uL2F1Y3Rpb24uYWxnby50czoxMTQKCS8vIGNsb3NlUmVtYWluZGVyVG86IGdsb2JhbHMuY3JlYXRvckFkZHJlc3MKCWdsb2JhbCBDcmVhdG9yQWRkcmVzcwoJaXR4bl9maWVsZCBDbG9zZVJlbWFpbmRlclRvCgoJLy8gZXhhbXBsZXMvYXVjdGlvbi9hdWN0aW9uLmFsZ28udHM6MTE1CgkvLyBhbW91bnQ6IDAKCWludCAwCglpdHhuX2ZpZWxkIEFtb3VudAoKCS8vIEZlZSBmaWVsZCBub3Qgc2V0LCBkZWZhdWx0aW5nIHRvIDAKCWludCAwCglpdHhuX2ZpZWxkIEZlZQoKCS8vIFN1Ym1pdCBpbm5lciB0cmFuc2FjdGlvbgoJaXR4bl9zdWJtaXQKCXJldHN1YgoKY3JlYXRlX05vT3A6CgltZXRob2QgImNyZWF0ZUFwcGxpY2F0aW9uKCl2b2lkIgoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAoJbWF0Y2ggYWJpX3JvdXRlX2NyZWF0ZUFwcGxpY2F0aW9uCgllcnIKCmNhbGxfTm9PcDoKCW1ldGhvZCAib3B0SW50b0Fzc2V0KGFzc2V0KXZvaWQiCgltZXRob2QgInN0YXJ0QXVjdGlvbih1aW50NjQsdWludDY0LGF4ZmVyKXZvaWQiCgltZXRob2QgImJpZChwYXkpdm9pZCIKCW1ldGhvZCAiY2xhaW1CaWRzKCl2b2lkIgoJbWV0aG9kICJjbGFpbV9hc3NldChhc3NldCl2b2lkIgoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAoJbWF0Y2ggYWJpX3JvdXRlX29wdEludG9Bc3NldCBhYmlfcm91dGVfc3RhcnRBdWN0aW9uIGFiaV9yb3V0ZV9iaWQgYWJpX3JvdXRlX2NsYWltQmlkcyBhYmlfcm91dGVfY2xhaW1fYXNzZXQKCWVycgoKY2FsbF9PcHRJbjoKCW1ldGhvZCAib3B0SW5Ub0FwcGxpY2F0aW9uKCl2b2lkIgoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAoJbWF0Y2ggYWJpX3JvdXRlX29wdEluVG9BcHBsaWNhdGlvbgoJZXJyCgpjYWxsX0RlbGV0ZUFwcGxpY2F0aW9uOgoJbWV0aG9kICJkZWxldGVBcHBsaWNhdGlvbigpdm9pZCIKCXR4bmEgQXBwbGljYXRpb25BcmdzIDAKCW1hdGNoIGFiaV9yb3V0ZV9kZWxldGVBcHBsaWNhdGlvbgoJZXJy", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDkKaW50IDE=" + }, + "contract": { + "name": "Auction", + "desc": "", + "methods": [ + { + "name": "createApplication", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "optIntoAsset", + "args": [ + { + "name": "asset", + "type": "asset", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "startAuction", + "args": [ + { + "name": "startingPrice", + "type": "uint64", + "desc": "" + }, + { + "name": "length", + "type": "uint64", + "desc": "" + }, + { + "name": "axfer", + "type": "axfer", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "optInToApplication", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "bid", + "args": [ + { + "name": "payment", + "type": "pay", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "claimBids", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "claim_asset", + "args": [ + { + "name": "asset", + "type": "asset", + "desc": "" + } + ], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + }, + { + "name": "deleteApplication", + "args": [], + "desc": "", + "returns": { + "type": "void", + "desc": "" + } + } + ] + } +} \ No newline at end of file diff --git a/examples/TEALScript/auction/tealscript_artifacts/Auction.src_map.json b/examples/TEALScript/auction/tealscript_artifacts/Auction.src_map.json new file mode 100644 index 0000000000..8331296c85 --- /dev/null +++ b/examples/TEALScript/auction/tealscript_artifacts/Auction.src_map.json @@ -0,0 +1,4104 @@ +[ + { + "teal": 1, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 2, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 5, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 7, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 13, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 14, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 15, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 16, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 17, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 18, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 19, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 20, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 22, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 23, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 26, + "source": { + "start": { + "line": 17, + "col": 2 + }, + "end": { + "line": 25, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 28, + "source": { + "start": { + "line": 17, + "col": 2 + }, + "end": { + "line": 25, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 29, + "source": { + "start": { + "line": 17, + "col": 2 + }, + "end": { + "line": 25, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 30, + "source": { + "start": { + "line": 17, + "col": 2 + }, + "end": { + "line": 25, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 32, + "source": { + "start": { + "line": 17, + "col": 2 + }, + "end": { + "line": 25, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 33, + "source": { + "start": { + "line": 17, + "col": 2 + }, + "end": { + "line": 25, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 37, + "source": { + "start": { + "line": 18, + "col": 4 + }, + "end": { + "line": 18, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 38, + "source": { + "start": { + "line": 18, + "col": 4 + }, + "end": { + "line": 18, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 39, + "source": { + "start": { + "line": 18, + "col": 4 + }, + "end": { + "line": 18, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 43, + "source": { + "start": { + "line": 19, + "col": 4 + }, + "end": { + "line": 19, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 44, + "source": { + "start": { + "line": 19, + "col": 4 + }, + "end": { + "line": 19, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 45, + "source": { + "start": { + "line": 19, + "col": 4 + }, + "end": { + "line": 19, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 49, + "source": { + "start": { + "line": 20, + "col": 4 + }, + "end": { + "line": 20, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 50, + "source": { + "start": { + "line": 20, + "col": 4 + }, + "end": { + "line": 20, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 51, + "source": { + "start": { + "line": 20, + "col": 4 + }, + "end": { + "line": 20, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 55, + "source": { + "start": { + "line": 21, + "col": 4 + }, + "end": { + "line": 21, + "col": 12 + } + }, + "pc": 0 + }, + { + "teal": 56, + "source": { + "start": { + "line": 21, + "col": 4 + }, + "end": { + "line": 21, + "col": 12 + } + }, + "pc": 0 + }, + { + "teal": 57, + "source": { + "start": { + "line": 21, + "col": 4 + }, + "end": { + "line": 21, + "col": 12 + } + }, + "pc": 0 + }, + { + "teal": 61, + "source": { + "start": { + "line": 24, + "col": 4 + }, + "end": { + "line": 24, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 62, + "source": { + "start": { + "line": 24, + "col": 4 + }, + "end": { + "line": 24, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 63, + "source": { + "start": { + "line": 24, + "col": 4 + }, + "end": { + "line": 24, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 64, + "source": { + "start": { + "line": 17, + "col": 2 + }, + "end": { + "line": 25, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 67, + "source": { + "start": { + "line": 27, + "col": 2 + }, + "end": { + "line": 43, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 69, + "source": { + "start": { + "line": 27, + "col": 15 + }, + "end": { + "line": 27, + "col": 27 + } + }, + "pc": 0 + }, + { + "teal": 70, + "source": { + "start": { + "line": 27, + "col": 15 + }, + "end": { + "line": 27, + "col": 27 + } + }, + "pc": 0 + }, + { + "teal": 71, + "source": { + "start": { + "line": 27, + "col": 15 + }, + "end": { + "line": 27, + "col": 27 + } + }, + "pc": 0 + }, + { + "teal": 74, + "source": { + "start": { + "line": 27, + "col": 2 + }, + "end": { + "line": 43, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 75, + "source": { + "start": { + "line": 27, + "col": 2 + }, + "end": { + "line": 43, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 76, + "source": { + "start": { + "line": 27, + "col": 2 + }, + "end": { + "line": 43, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 78, + "source": { + "start": { + "line": 27, + "col": 2 + }, + "end": { + "line": 43, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 79, + "source": { + "start": { + "line": 27, + "col": 2 + }, + "end": { + "line": 43, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 84, + "source": { + "start": { + "line": 29, + "col": 26 + }, + "end": { + "line": 29, + "col": 56 + } + }, + "pc": 0 + }, + { + "teal": 85, + "source": { + "start": { + "line": 29, + "col": 34 + }, + "end": { + "line": 29, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 86, + "source": { + "start": { + "line": 29, + "col": 26 + }, + "end": { + "line": 29, + "col": 56 + } + }, + "pc": 0 + }, + { + "teal": 87, + "source": { + "start": { + "line": 29, + "col": 26 + }, + "end": { + "line": 29, + "col": 56 + } + }, + "pc": 0 + }, + { + "teal": 92, + "source": { + "start": { + "line": 32, + "col": 11 + }, + "end": { + "line": 32, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 93, + "source": { + "start": { + "line": 32, + "col": 11 + }, + "end": { + "line": 32, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 94, + "source": { + "start": { + "line": 32, + "col": 36 + }, + "end": { + "line": 32, + "col": 45 + } + }, + "pc": 0 + }, + { + "teal": 95, + "source": { + "start": { + "line": 32, + "col": 26 + }, + "end": { + "line": 32, + "col": 29 + } + }, + "pc": 0 + }, + { + "teal": 96, + "source": { + "start": { + "line": 32, + "col": 11 + }, + "end": { + "line": 32, + "col": 45 + } + }, + "pc": 0 + }, + { + "teal": 101, + "source": { + "start": { + "line": 35, + "col": 4 + }, + "end": { + "line": 35, + "col": 12 + } + }, + "pc": 0 + }, + { + "teal": 102, + "source": { + "start": { + "line": 35, + "col": 4 + }, + "end": { + "line": 35, + "col": 12 + } + }, + "pc": 0 + }, + { + "teal": 103, + "source": { + "start": { + "line": 35, + "col": 4 + }, + "end": { + "line": 35, + "col": 12 + } + }, + "pc": 0 + }, + { + "teal": 112, + "source": { + "start": { + "line": 38, + "col": 4 + }, + "end": { + "line": 42, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 113, + "source": { + "start": { + "line": 38, + "col": 4 + }, + "end": { + "line": 42, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 114, + "source": { + "start": { + "line": 38, + "col": 4 + }, + "end": { + "line": 42, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 118, + "source": { + "start": { + "line": 39, + "col": 21 + }, + "end": { + "line": 39, + "col": 29 + } + }, + "pc": 0 + }, + { + "teal": 119, + "source": { + "start": { + "line": 39, + "col": 21 + }, + "end": { + "line": 39, + "col": 29 + } + }, + "pc": 0 + }, + { + "teal": 120, + "source": { + "start": { + "line": 39, + "col": 30 + }, + "end": { + "line": 39, + "col": 37 + } + }, + "pc": 0 + }, + { + "teal": 121, + "source": { + "start": { + "line": 39, + "col": 6 + }, + "end": { + "line": 39, + "col": 37 + } + }, + "pc": 0 + }, + { + "teal": 125, + "source": { + "start": { + "line": 40, + "col": 17 + }, + "end": { + "line": 40, + "col": 22 + } + }, + "pc": 0 + }, + { + "teal": 126, + "source": { + "start": { + "line": 40, + "col": 6 + }, + "end": { + "line": 40, + "col": 22 + } + }, + "pc": 0 + }, + { + "teal": 130, + "source": { + "start": { + "line": 41, + "col": 19 + }, + "end": { + "line": 41, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 131, + "source": { + "start": { + "line": 41, + "col": 6 + }, + "end": { + "line": 41, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 134, + "source": { + "start": { + "line": 38, + "col": 4 + }, + "end": { + "line": 42, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 135, + "source": { + "start": { + "line": 38, + "col": 4 + }, + "end": { + "line": 42, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 138, + "source": { + "start": { + "line": 38, + "col": 4 + }, + "end": { + "line": 42, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 139, + "source": { + "start": { + "line": 27, + "col": 2 + }, + "end": { + "line": 43, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 142, + "source": { + "start": { + "line": 45, + "col": 2 + }, + "end": { + "line": 58, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 144, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 145, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 146, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 147, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 148, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 149, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 150, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 151, + "source": { + "start": { + "line": 45, + "col": 54 + }, + "end": { + "line": 45, + "col": 77 + } + }, + "pc": 0 + }, + { + "teal": 154, + "source": { + "start": { + "line": 45, + "col": 38 + }, + "end": { + "line": 45, + "col": 52 + } + }, + "pc": 0 + }, + { + "teal": 155, + "source": { + "start": { + "line": 45, + "col": 38 + }, + "end": { + "line": 45, + "col": 52 + } + }, + "pc": 0 + }, + { + "teal": 158, + "source": { + "start": { + "line": 45, + "col": 15 + }, + "end": { + "line": 45, + "col": 36 + } + }, + "pc": 0 + }, + { + "teal": 159, + "source": { + "start": { + "line": 45, + "col": 15 + }, + "end": { + "line": 45, + "col": 36 + } + }, + "pc": 0 + }, + { + "teal": 162, + "source": { + "start": { + "line": 45, + "col": 2 + }, + "end": { + "line": 58, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 163, + "source": { + "start": { + "line": 45, + "col": 2 + }, + "end": { + "line": 58, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 164, + "source": { + "start": { + "line": 45, + "col": 2 + }, + "end": { + "line": 58, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 166, + "source": { + "start": { + "line": 45, + "col": 2 + }, + "end": { + "line": 58, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 167, + "source": { + "start": { + "line": 45, + "col": 2 + }, + "end": { + "line": 58, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 171, + "source": { + "start": { + "line": 46, + "col": 26 + }, + "end": { + "line": 46, + "col": 56 + } + }, + "pc": 0 + }, + { + "teal": 172, + "source": { + "start": { + "line": 46, + "col": 34 + }, + "end": { + "line": 46, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 173, + "source": { + "start": { + "line": 46, + "col": 26 + }, + "end": { + "line": 46, + "col": 56 + } + }, + "pc": 0 + }, + { + "teal": 174, + "source": { + "start": { + "line": 46, + "col": 26 + }, + "end": { + "line": 46, + "col": 56 + } + }, + "pc": 0 + }, + { + "teal": 179, + "source": { + "start": { + "line": 49, + "col": 11 + }, + "end": { + "line": 49, + "col": 26 + } + }, + "pc": 0 + }, + { + "teal": 180, + "source": { + "start": { + "line": 49, + "col": 11 + }, + "end": { + "line": 49, + "col": 26 + } + }, + "pc": 0 + }, + { + "teal": 181, + "source": { + "start": { + "line": 49, + "col": 37 + }, + "end": { + "line": 49, + "col": 38 + } + }, + "pc": 0 + }, + { + "teal": 182, + "source": { + "start": { + "line": 49, + "col": 33 + }, + "end": { + "line": 49, + "col": 36 + } + }, + "pc": 0 + }, + { + "teal": 183, + "source": { + "start": { + "line": 49, + "col": 11 + }, + "end": { + "line": 49, + "col": 38 + } + }, + "pc": 0 + }, + { + "teal": 189, + "source": { + "start": { + "line": 52, + "col": 14 + }, + "end": { + "line": 52, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 190, + "source": { + "start": { + "line": 52, + "col": 23 + }, + "end": { + "line": 52, + "col": 54 + } + }, + "pc": 0 + }, + { + "teal": 191, + "source": { + "start": { + "line": 52, + "col": 38 + }, + "end": { + "line": 52, + "col": 46 + } + }, + "pc": 0 + }, + { + "teal": 192, + "source": { + "start": { + "line": 52, + "col": 38 + }, + "end": { + "line": 52, + "col": 46 + } + }, + "pc": 0 + }, + { + "teal": 193, + "source": { + "start": { + "line": 52, + "col": 47 + }, + "end": { + "line": 52, + "col": 54 + } + }, + "pc": 0 + }, + { + "teal": 194, + "source": { + "start": { + "line": 52, + "col": 23 + }, + "end": { + "line": 52, + "col": 54 + } + }, + "pc": 0 + }, + { + "teal": 195, + "source": { + "start": { + "line": 52, + "col": 23 + }, + "end": { + "line": 52, + "col": 54 + } + }, + "pc": 0 + }, + { + "teal": 200, + "source": { + "start": { + "line": 55, + "col": 4 + }, + "end": { + "line": 55, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 201, + "source": { + "start": { + "line": 55, + "col": 4 + }, + "end": { + "line": 55, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 202, + "source": { + "start": { + "line": 55, + "col": 30 + }, + "end": { + "line": 55, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 203, + "source": { + "start": { + "line": 55, + "col": 4 + }, + "end": { + "line": 55, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 207, + "source": { + "start": { + "line": 56, + "col": 4 + }, + "end": { + "line": 56, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 208, + "source": { + "start": { + "line": 56, + "col": 4 + }, + "end": { + "line": 56, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 209, + "source": { + "start": { + "line": 56, + "col": 54 + }, + "end": { + "line": 56, + "col": 60 + } + }, + "pc": 0 + }, + { + "teal": 210, + "source": { + "start": { + "line": 56, + "col": 52 + }, + "end": { + "line": 56, + "col": 53 + } + }, + "pc": 0 + }, + { + "teal": 211, + "source": { + "start": { + "line": 56, + "col": 4 + }, + "end": { + "line": 56, + "col": 19 + } + }, + "pc": 0 + }, + { + "teal": 215, + "source": { + "start": { + "line": 57, + "col": 4 + }, + "end": { + "line": 57, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 216, + "source": { + "start": { + "line": 57, + "col": 4 + }, + "end": { + "line": 57, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 217, + "source": { + "start": { + "line": 57, + "col": 4 + }, + "end": { + "line": 57, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 218, + "source": { + "start": { + "line": 45, + "col": 2 + }, + "end": { + "line": 58, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 220, + "source": { + "start": { + "line": 60, + "col": 2 + }, + "end": { + "line": 65, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 221, + "source": { + "start": { + "line": 60, + "col": 2 + }, + "end": { + "line": 65, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 228, + "source": { + "start": { + "line": 61, + "col": 4 + }, + "end": { + "line": 64, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 229, + "source": { + "start": { + "line": 61, + "col": 4 + }, + "end": { + "line": 64, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 230, + "source": { + "start": { + "line": 61, + "col": 4 + }, + "end": { + "line": 64, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 234, + "source": { + "start": { + "line": 62, + "col": 16 + }, + "end": { + "line": 62, + "col": 24 + } + }, + "pc": 0 + }, + { + "teal": 235, + "source": { + "start": { + "line": 62, + "col": 6 + }, + "end": { + "line": 62, + "col": 24 + } + }, + "pc": 0 + }, + { + "teal": 239, + "source": { + "start": { + "line": 63, + "col": 14 + }, + "end": { + "line": 63, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 240, + "source": { + "start": { + "line": 63, + "col": 6 + }, + "end": { + "line": 63, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 243, + "source": { + "start": { + "line": 61, + "col": 4 + }, + "end": { + "line": 64, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 244, + "source": { + "start": { + "line": 61, + "col": 4 + }, + "end": { + "line": 64, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 247, + "source": { + "start": { + "line": 61, + "col": 4 + }, + "end": { + "line": 64, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 248, + "source": { + "start": { + "line": 60, + "col": 2 + }, + "end": { + "line": 65, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 251, + "source": { + "start": { + "line": 67, + "col": 2 + }, + "end": { + "line": 67, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 253, + "source": { + "start": { + "line": 67, + "col": 2 + }, + "end": { + "line": 67, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 254, + "source": { + "start": { + "line": 67, + "col": 2 + }, + "end": { + "line": 67, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 255, + "source": { + "start": { + "line": 67, + "col": 2 + }, + "end": { + "line": 67, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 257, + "source": { + "start": { + "line": 67, + "col": 2 + }, + "end": { + "line": 67, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 258, + "source": { + "start": { + "line": 67, + "col": 2 + }, + "end": { + "line": 67, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 259, + "source": { + "start": { + "line": 67, + "col": 2 + }, + "end": { + "line": 67, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 264, + "source": { + "start": { + "line": 70, + "col": 2 + }, + "end": { + "line": 86, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 266, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 267, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 268, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 269, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 270, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 271, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 272, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 273, + "source": { + "start": { + "line": 70, + "col": 6 + }, + "end": { + "line": 70, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 276, + "source": { + "start": { + "line": 70, + "col": 2 + }, + "end": { + "line": 86, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 277, + "source": { + "start": { + "line": 70, + "col": 2 + }, + "end": { + "line": 86, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 278, + "source": { + "start": { + "line": 70, + "col": 2 + }, + "end": { + "line": 86, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 280, + "source": { + "start": { + "line": 70, + "col": 2 + }, + "end": { + "line": 86, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 281, + "source": { + "start": { + "line": 70, + "col": 2 + }, + "end": { + "line": 86, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 286, + "source": { + "start": { + "line": 72, + "col": 11 + }, + "end": { + "line": 72, + "col": 18 + } + }, + "pc": 0 + }, + { + "teal": 287, + "source": { + "start": { + "line": 72, + "col": 37 + }, + "end": { + "line": 72, + "col": 52 + } + }, + "pc": 0 + }, + { + "teal": 288, + "source": { + "start": { + "line": 72, + "col": 37 + }, + "end": { + "line": 72, + "col": 52 + } + }, + "pc": 0 + }, + { + "teal": 289, + "source": { + "start": { + "line": 72, + "col": 35 + }, + "end": { + "line": 72, + "col": 36 + } + }, + "pc": 0 + }, + { + "teal": 290, + "source": { + "start": { + "line": 72, + "col": 11 + }, + "end": { + "line": 72, + "col": 58 + } + }, + "pc": 0 + }, + { + "teal": 299, + "source": { + "start": { + "line": 75, + "col": 14 + }, + "end": { + "line": 75, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 300, + "source": { + "start": { + "line": 76, + "col": 6 + }, + "end": { + "line": 76, + "col": 29 + } + }, + "pc": 0 + }, + { + "teal": 301, + "source": { + "start": { + "line": 76, + "col": 23 + }, + "end": { + "line": 76, + "col": 29 + } + }, + "pc": 0 + }, + { + "teal": 302, + "source": { + "start": { + "line": 76, + "col": 6 + }, + "end": { + "line": 76, + "col": 29 + } + }, + "pc": 0 + }, + { + "teal": 303, + "source": { + "start": { + "line": 76, + "col": 6 + }, + "end": { + "line": 76, + "col": 29 + } + }, + "pc": 0 + }, + { + "teal": 306, + "source": { + "start": { + "line": 75, + "col": 14 + }, + "end": { + "line": 75, + "col": 21 + } + }, + "pc": 0 + }, + { + "teal": 307, + "source": { + "start": { + "line": 77, + "col": 6 + }, + "end": { + "line": 77, + "col": 53 + } + }, + "pc": 0 + }, + { + "teal": 308, + "source": { + "start": { + "line": 77, + "col": 29 + }, + "end": { + "line": 77, + "col": 45 + } + }, + "pc": 0 + }, + { + "teal": 309, + "source": { + "start": { + "line": 77, + "col": 29 + }, + "end": { + "line": 77, + "col": 45 + } + }, + "pc": 0 + }, + { + "teal": 310, + "source": { + "start": { + "line": 77, + "col": 16 + }, + "end": { + "line": 77, + "col": 51 + } + }, + "pc": 0 + }, + { + "teal": 311, + "source": { + "start": { + "line": 77, + "col": 16 + }, + "end": { + "line": 77, + "col": 51 + } + }, + "pc": 0 + }, + { + "teal": 316, + "source": { + "start": { + "line": 81, + "col": 4 + }, + "end": { + "line": 81, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 317, + "source": { + "start": { + "line": 81, + "col": 4 + }, + "end": { + "line": 81, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 318, + "source": { + "start": { + "line": 81, + "col": 37 + }, + "end": { + "line": 81, + "col": 43 + } + }, + "pc": 0 + }, + { + "teal": 319, + "source": { + "start": { + "line": 81, + "col": 4 + }, + "end": { + "line": 81, + "col": 20 + } + }, + "pc": 0 + }, + { + "teal": 323, + "source": { + "start": { + "line": 82, + "col": 4 + }, + "end": { + "line": 82, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 324, + "source": { + "start": { + "line": 82, + "col": 4 + }, + "end": { + "line": 82, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 325, + "source": { + "start": { + "line": 82, + "col": 40 + }, + "end": { + "line": 82, + "col": 46 + } + }, + "pc": 0 + }, + { + "teal": 326, + "source": { + "start": { + "line": 82, + "col": 4 + }, + "end": { + "line": 82, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 331, + "source": { + "start": { + "line": 85, + "col": 34 + }, + "end": { + "line": 85, + "col": 40 + } + }, + "pc": 0 + }, + { + "teal": 332, + "source": { + "start": { + "line": 85, + "col": 4 + }, + "end": { + "line": 85, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 333, + "source": { + "start": { + "line": 85, + "col": 4 + }, + "end": { + "line": 85, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 334, + "source": { + "start": { + "line": 85, + "col": 58 + }, + "end": { + "line": 85, + "col": 64 + } + }, + "pc": 0 + }, + { + "teal": 335, + "source": { + "start": { + "line": 85, + "col": 4 + }, + "end": { + "line": 85, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 336, + "source": { + "start": { + "line": 70, + "col": 2 + }, + "end": { + "line": 86, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 339, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 340, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 343, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 344, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 345, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 347, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 348, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 352, + "source": { + "start": { + "line": 89, + "col": 27 + }, + "end": { + "line": 89, + "col": 64 + } + }, + "pc": 0 + }, + { + "teal": 353, + "source": { + "start": { + "line": 89, + "col": 27 + }, + "end": { + "line": 89, + "col": 64 + } + }, + "pc": 0 + }, + { + "teal": 354, + "source": { + "start": { + "line": 89, + "col": 27 + }, + "end": { + "line": 89, + "col": 64 + } + }, + "pc": 0 + }, + { + "teal": 355, + "source": { + "start": { + "line": 89, + "col": 10 + }, + "end": { + "line": 89, + "col": 70 + } + }, + "pc": 0 + }, + { + "teal": 359, + "source": { + "start": { + "line": 90, + "col": 17 + }, + "end": { + "line": 90, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 360, + "source": { + "start": { + "line": 90, + "col": 8 + }, + "end": { + "line": 90, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 366, + "source": { + "start": { + "line": 93, + "col": 17 + }, + "end": { + "line": 93, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 367, + "source": { + "start": { + "line": 93, + "col": 28 + }, + "end": { + "line": 93, + "col": 47 + } + }, + "pc": 0 + }, + { + "teal": 368, + "source": { + "start": { + "line": 93, + "col": 28 + }, + "end": { + "line": 93, + "col": 47 + } + }, + "pc": 0 + }, + { + "teal": 369, + "source": { + "start": { + "line": 93, + "col": 24 + }, + "end": { + "line": 93, + "col": 27 + } + }, + "pc": 0 + }, + { + "teal": 370, + "source": { + "start": { + "line": 93, + "col": 4 + }, + "end": { + "line": 93, + "col": 96 + } + }, + "pc": 0 + }, + { + "teal": 375, + "source": { + "start": { + "line": 93, + "col": 55 + }, + "end": { + "line": 93, + "col": 61 + } + }, + "pc": 0 + }, + { + "teal": 376, + "source": { + "start": { + "line": 93, + "col": 73 + }, + "end": { + "line": 93, + "col": 89 + } + }, + "pc": 0 + }, + { + "teal": 377, + "source": { + "start": { + "line": 93, + "col": 73 + }, + "end": { + "line": 93, + "col": 89 + } + }, + "pc": 0 + }, + { + "teal": 378, + "source": { + "start": { + "line": 93, + "col": 71 + }, + "end": { + "line": 93, + "col": 72 + } + }, + "pc": 0 + }, + { + "teal": 379, + "source": { + "start": { + "line": 93, + "col": 55 + }, + "end": { + "line": 93, + "col": 95 + } + }, + "pc": 0 + }, + { + "teal": 381, + "source": { + "start": { + "line": 93, + "col": 4 + }, + "end": { + "line": 93, + "col": 96 + } + }, + "pc": 0 + }, + { + "teal": 384, + "source": { + "start": { + "line": 95, + "col": 30 + }, + "end": { + "line": 95, + "col": 36 + } + }, + "pc": 0 + }, + { + "teal": 385, + "source": { + "start": { + "line": 95, + "col": 22 + }, + "end": { + "line": 95, + "col": 28 + } + }, + "pc": 0 + }, + { + "teal": 386, + "source": { + "start": { + "line": 95, + "col": 4 + }, + "end": { + "line": 95, + "col": 12 + } + }, + "pc": 0 + }, + { + "teal": 390, + "source": { + "start": { + "line": 96, + "col": 34 + }, + "end": { + "line": 96, + "col": 40 + } + }, + "pc": 0 + }, + { + "teal": 391, + "source": { + "start": { + "line": 96, + "col": 4 + }, + "end": { + "line": 96, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 392, + "source": { + "start": { + "line": 96, + "col": 4 + }, + "end": { + "line": 96, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 393, + "source": { + "start": { + "line": 96, + "col": 67 + }, + "end": { + "line": 96, + "col": 73 + } + }, + "pc": 0 + }, + { + "teal": 394, + "source": { + "start": { + "line": 96, + "col": 65 + }, + "end": { + "line": 96, + "col": 66 + } + }, + "pc": 0 + }, + { + "teal": 395, + "source": { + "start": { + "line": 96, + "col": 4 + }, + "end": { + "line": 96, + "col": 41 + } + }, + "pc": 0 + }, + { + "teal": 396, + "source": { + "start": { + "line": 88, + "col": 2 + }, + "end": { + "line": 97, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 399, + "source": { + "start": { + "line": 99, + "col": 2 + }, + "end": { + "line": 109, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 401, + "source": { + "start": { + "line": 99, + "col": 14 + }, + "end": { + "line": 99, + "col": 26 + } + }, + "pc": 0 + }, + { + "teal": 402, + "source": { + "start": { + "line": 99, + "col": 14 + }, + "end": { + "line": 99, + "col": 26 + } + }, + "pc": 0 + }, + { + "teal": 403, + "source": { + "start": { + "line": 99, + "col": 14 + }, + "end": { + "line": 99, + "col": 26 + } + }, + "pc": 0 + }, + { + "teal": 406, + "source": { + "start": { + "line": 99, + "col": 2 + }, + "end": { + "line": 109, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 407, + "source": { + "start": { + "line": 99, + "col": 2 + }, + "end": { + "line": 109, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 408, + "source": { + "start": { + "line": 99, + "col": 2 + }, + "end": { + "line": 109, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 410, + "source": { + "start": { + "line": 99, + "col": 2 + }, + "end": { + "line": 109, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 411, + "source": { + "start": { + "line": 99, + "col": 2 + }, + "end": { + "line": 109, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 415, + "source": { + "start": { + "line": 100, + "col": 11 + }, + "end": { + "line": 100, + "col": 18 + } + }, + "pc": 0 + }, + { + "teal": 416, + "source": { + "start": { + "line": 100, + "col": 37 + }, + "end": { + "line": 100, + "col": 52 + } + }, + "pc": 0 + }, + { + "teal": 417, + "source": { + "start": { + "line": 100, + "col": 37 + }, + "end": { + "line": 100, + "col": 52 + } + }, + "pc": 0 + }, + { + "teal": 418, + "source": { + "start": { + "line": 100, + "col": 35 + }, + "end": { + "line": 100, + "col": 36 + } + }, + "pc": 0 + }, + { + "teal": 419, + "source": { + "start": { + "line": 100, + "col": 11 + }, + "end": { + "line": 100, + "col": 58 + } + }, + "pc": 0 + }, + { + "teal": 429, + "source": { + "start": { + "line": 103, + "col": 4 + }, + "end": { + "line": 108, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 430, + "source": { + "start": { + "line": 103, + "col": 4 + }, + "end": { + "line": 108, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 431, + "source": { + "start": { + "line": 103, + "col": 4 + }, + "end": { + "line": 108, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 435, + "source": { + "start": { + "line": 104, + "col": 21 + }, + "end": { + "line": 104, + "col": 40 + } + }, + "pc": 0 + }, + { + "teal": 436, + "source": { + "start": { + "line": 104, + "col": 21 + }, + "end": { + "line": 104, + "col": 40 + } + }, + "pc": 0 + }, + { + "teal": 437, + "source": { + "start": { + "line": 104, + "col": 6 + }, + "end": { + "line": 104, + "col": 46 + } + }, + "pc": 0 + }, + { + "teal": 441, + "source": { + "start": { + "line": 105, + "col": 17 + }, + "end": { + "line": 105, + "col": 22 + } + }, + "pc": 0 + }, + { + "teal": 442, + "source": { + "start": { + "line": 105, + "col": 6 + }, + "end": { + "line": 105, + "col": 22 + } + }, + "pc": 0 + }, + { + "teal": 446, + "source": { + "start": { + "line": 106, + "col": 19 + }, + "end": { + "line": 106, + "col": 30 + } + }, + "pc": 0 + }, + { + "teal": 447, + "source": { + "start": { + "line": 106, + "col": 19 + }, + "end": { + "line": 106, + "col": 30 + } + }, + "pc": 0 + }, + { + "teal": 448, + "source": { + "start": { + "line": 106, + "col": 6 + }, + "end": { + "line": 106, + "col": 36 + } + }, + "pc": 0 + }, + { + "teal": 452, + "source": { + "start": { + "line": 107, + "col": 20 + }, + "end": { + "line": 107, + "col": 39 + } + }, + "pc": 0 + }, + { + "teal": 453, + "source": { + "start": { + "line": 107, + "col": 20 + }, + "end": { + "line": 107, + "col": 39 + } + }, + "pc": 0 + }, + { + "teal": 454, + "source": { + "start": { + "line": 107, + "col": 6 + }, + "end": { + "line": 107, + "col": 45 + } + }, + "pc": 0 + }, + { + "teal": 457, + "source": { + "start": { + "line": 103, + "col": 4 + }, + "end": { + "line": 108, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 458, + "source": { + "start": { + "line": 103, + "col": 4 + }, + "end": { + "line": 108, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 461, + "source": { + "start": { + "line": 103, + "col": 4 + }, + "end": { + "line": 108, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 462, + "source": { + "start": { + "line": 99, + "col": 2 + }, + "end": { + "line": 109, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 465, + "source": { + "start": { + "line": 111, + "col": 2 + }, + "end": { + "line": 117, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 467, + "source": { + "start": { + "line": 111, + "col": 2 + }, + "end": { + "line": 117, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 468, + "source": { + "start": { + "line": 111, + "col": 2 + }, + "end": { + "line": 117, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 469, + "source": { + "start": { + "line": 111, + "col": 2 + }, + "end": { + "line": 117, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 471, + "source": { + "start": { + "line": 111, + "col": 2 + }, + "end": { + "line": 117, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 472, + "source": { + "start": { + "line": 111, + "col": 2 + }, + "end": { + "line": 117, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 480, + "source": { + "start": { + "line": 112, + "col": 4 + }, + "end": { + "line": 116, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 481, + "source": { + "start": { + "line": 112, + "col": 4 + }, + "end": { + "line": 116, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 482, + "source": { + "start": { + "line": 112, + "col": 4 + }, + "end": { + "line": 116, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 486, + "source": { + "start": { + "line": 113, + "col": 16 + }, + "end": { + "line": 113, + "col": 23 + } + }, + "pc": 0 + }, + { + "teal": 487, + "source": { + "start": { + "line": 113, + "col": 6 + }, + "end": { + "line": 113, + "col": 38 + } + }, + "pc": 0 + }, + { + "teal": 491, + "source": { + "start": { + "line": 114, + "col": 24 + }, + "end": { + "line": 114, + "col": 31 + } + }, + "pc": 0 + }, + { + "teal": 492, + "source": { + "start": { + "line": 114, + "col": 6 + }, + "end": { + "line": 114, + "col": 46 + } + }, + "pc": 0 + }, + { + "teal": 496, + "source": { + "start": { + "line": 115, + "col": 14 + }, + "end": { + "line": 115, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 497, + "source": { + "start": { + "line": 115, + "col": 6 + }, + "end": { + "line": 115, + "col": 15 + } + }, + "pc": 0 + }, + { + "teal": 500, + "source": { + "start": { + "line": 112, + "col": 4 + }, + "end": { + "line": 116, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 501, + "source": { + "start": { + "line": 112, + "col": 4 + }, + "end": { + "line": 116, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 504, + "source": { + "start": { + "line": 112, + "col": 4 + }, + "end": { + "line": 116, + "col": 6 + } + }, + "pc": 0 + }, + { + "teal": 505, + "source": { + "start": { + "line": 111, + "col": 2 + }, + "end": { + "line": 117, + "col": 3 + } + }, + "pc": 0 + }, + { + "teal": 507, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 508, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 509, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 510, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 511, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 513, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 514, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 515, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 516, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 517, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 518, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 519, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 520, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 521, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 523, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 524, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 525, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 526, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 527, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 529, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 530, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 531, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 532, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 533, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + }, + { + "teal": 1, + "source": { + "start": { + "line": 4, + "col": 0 + }, + "end": { + "line": 118, + "col": 1 + } + }, + "pc": 0 + } +] \ No newline at end of file diff --git a/examples/abi_routing/algopy.log b/examples/abi_routing/algopy.log new file mode 100644 index 0000000000..083e63d9ab --- /dev/null +++ b/examples/abi_routing/algopy.log @@ -0,0 +1,1234 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug abi_routing +debug: Building AWST for __init__.py +debug: Building AWST for abi_routing +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for abi_routing/contract.py +debug: Sealing block@0: // L30 +debug: Terminated block@0: // L30 +debug: Sealing block@0: // L46 +debug: Terminated block@0: // L46 +debug: Sealing block@0: // L59 +debug: Terminated block@0: // L59 +debug: Sealing block@0: // L77 +debug: Terminated block@0: // L77 +debug: Sealing block@0: // L94 +debug: Terminated block@0: // L94 +debug: Sealing block@0: // L103 +debug: Terminated block@0: // L103 +debug: Sealing block@0: // L107 +debug: Terminated block@0: // L107 +debug: Sealing block@0: // L111 +debug: Terminated block@0: // L111 +debug: Sealing block@0: // L115 +debug: Terminated block@0: // L115 +debug: Sealing block@0: // L119 +debug: Terminated block@0: // L119 +debug: Sealing block@0: // L135 +debug: Terminated block@0: // L135 +debug: Sealing block@0: // L73 +debug: Terminated block@0: // L73 +debug: Sealing block@0: // L22 +debug: Terminated block@0: // L22 +debug: Sealing block@0: // L21 +debug: Terminated block@0: // L21 +debug: Sealing block@None: // on_create_L22 +debug: Terminated block@1: // on_create_L22 +debug: Sealing block@2: // entrypoint_L22 +debug: Terminated block@2: // entrypoint_L22 +debug: Sealing block@None: // abi_routing_L21 +debug: Sealing block@None: // bare_routing_L21 +debug: Terminated block@3: // abi_routing_L21 +debug: Sealing block@None: // switch_case_default_L21 +debug: Sealing block@None: // noop_with_uint64_route_L29 +debug: Sealing block@None: // all_the_things_route_L34 +debug: Sealing block@None: // mixed_oca_route_L50 +debug: Sealing block@None: // opt_into_asset_route_L76 +debug: Sealing block@None: // with_transactions_route_L93 +debug: Sealing block@None: // compare_assets_route_L102 +debug: Sealing block@None: // get_address_route_L106 +debug: Sealing block@None: // get_asset_route_L110 +debug: Sealing block@None: // get_application_route_L114 +debug: Sealing block@None: // get_an_int_route_L118 +debug: Sealing block@None: // method_with_default_args_route_L122 +debug: Terminated block@4: // noop_with_uint64_route_L29 +debug: Terminated block@5: // all_the_things_route_L34 +debug: Terminated block@6: // mixed_oca_route_L50 +debug: Terminated block@7: // opt_into_asset_route_L76 +debug: Terminated block@8: // with_transactions_route_L93 +debug: Terminated block@9: // compare_assets_route_L102 +debug: Terminated block@10: // get_address_route_L106 +debug: Terminated block@11: // get_asset_route_L110 +debug: Terminated block@12: // get_application_route_L114 +debug: Terminated block@13: // get_an_int_route_L118 +debug: Terminated block@14: // method_with_default_args_route_L122 +debug: Terminated block@15: // switch_case_default_L21 +debug: Sealing block@16: // switch_case_next_L21 +debug: Terminated block@16: // switch_case_next_L21 +debug: Terminated block@17: // bare_routing_L21 +debug: Sealing block@None: // reject_bare_on_completion_L21 +debug: Sealing block@None: // bare_abi_config_L73 +debug: Terminated block@18: // bare_abi_config_L73 +debug: Terminated block@19: // reject_bare_on_completion_L21 +debug: Sealing block@None: // switch_case_next_L21 +debug: Sealing block@20: // after_if_else_L21 +debug: Terminated block@20: // after_if_else_L21 +debug: Sealing block@0: // L21 +debug: Terminated block@0: // L21 +debug: Output IR to /examples/abi_routing/out/contract_Reference.ssa.ir +info: Optimizing examples.abi_routing.contract.Reference at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.abi_routing.contract.Reference.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%35#0, maybe_value%32#0 +debug: Replacing {maybe_value%32#0} with awst_tmp%35#0 made 1 modifications +debug: Found equivalence set: tmp%37#0, maybe_value_did_exist%33#0 +debug: Replacing {maybe_value_did_exist%33#0} with tmp%37#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Switch switch tmp%92#0 {0u => block@18, 1u => block@18, 2u => block@18, 4u => block@18, 5u => block@18, * => block@19} simplified to goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@16: // switch_case_next_L21 with block@15: // switch_case_default_L21 in block@20: // after_if_else_L21 +debug: Merged linear block@16: // switch_case_next_L21 into block@15: // switch_case_default_L21 +debug: Merged linear block@20: // after_if_else_L21 into block@15: // switch_case_default_L21 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.noop_with_uint64 +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.full_abi_config +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.mixed_oca +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.opt_into_asset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.with_transactions +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.compare_assets +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_address +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_asset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_app +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_a_int +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.method_with_default_args +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded 0u * 1u to 0u +debug: Folded 1u * 1u to 1u +debug: Folded 2u * 1u to 2u +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable item_index%8#0 +debug: Removing unused variable item_index%11#0 +debug: Removing unused variable item_index%14#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.bare_abi_config +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/abi_routing/out/contract_Reference.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.abi_routing.contract.Reference.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.noop_with_uint64 +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.full_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.mixed_oca +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.opt_into_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.with_transactions +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.compare_assets +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_address +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_app +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_a_int +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.method_with_default_args +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.bare_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#1 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/abi_routing/out/contract_Reference.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.abi_routing.contract.Reference.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.noop_with_uint64 +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.full_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.mixed_oca +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.opt_into_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.with_transactions +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.compare_assets +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_address +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_app +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_a_int +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.method_with_default_args +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.bare_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x07, 0x08) to b'/x07/x08' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#2 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/abi_routing/out/contract_Reference.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine examples.abi_routing.contract.Reference.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.noop_with_uint64 +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.full_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.mixed_oca +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.opt_into_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.with_transactions +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.compare_assets +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_address +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_app +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_a_int +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.method_with_default_args +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.bare_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x0708, 0x09) to b'/x07/x08/t' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/abi_routing/out/contract_Reference.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.abi_routing.contract.Reference.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.noop_with_uint64 +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.full_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.mixed_oca +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.opt_into_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.with_transactions +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.compare_assets +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_address +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_app +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.get_a_int +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.method_with_default_args +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.bare_abi_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.abi_routing.contract.Reference.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 5, ending loop +debug: Output IR to /examples/abi_routing/out/contract_Reference.cssa.ir +debug: Removing Phis from examples.abi_routing.contract.Reference.approval_program +debug: Removing Phis from examples.abi_routing.contract.Reference.noop_with_uint64 +debug: Removing Phis from examples.abi_routing.contract.Reference.full_abi_config +debug: Removing Phis from examples.abi_routing.contract.Reference.mixed_oca +debug: Removing Phis from examples.abi_routing.contract.Reference.opt_into_asset +debug: Removing Phis from examples.abi_routing.contract.Reference.with_transactions +debug: Removing Phis from examples.abi_routing.contract.Reference.compare_assets +debug: Removing Phis from examples.abi_routing.contract.Reference.get_address +debug: Removing Phis from examples.abi_routing.contract.Reference.get_asset +debug: Removing Phis from examples.abi_routing.contract.Reference.get_app +debug: Removing Phis from examples.abi_routing.contract.Reference.get_a_int +debug: Removing Phis from examples.abi_routing.contract.Reference.method_with_default_args +debug: Removing Phis from examples.abi_routing.contract.Reference.bare_abi_config +debug: Removing Phis from examples.abi_routing.contract.Reference.__init__ +debug: Removing Phis from examples.abi_routing.contract.Reference.clear_state_program +debug: Output IR to /examples/abi_routing/out/contract_Reference.post_ssa.ir +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.approval_program +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.noop_with_uint64 +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.full_abi_config +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.mixed_oca +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.opt_into_asset +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.with_transactions +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.compare_assets +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.get_address +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.get_asset +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.get_app +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.get_a_int +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.method_with_default_args +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.bare_abi_config +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.__init__ +debug: Sequentializing parallel copies in examples.abi_routing.contract.Reference.clear_state_program +debug: Output IR to /examples/abi_routing/out/contract_Reference.parallel_copies.ir +debug: Coalescing local variables in examples.abi_routing.contract.Reference.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.noop_with_uint64 using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.full_abi_config using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.mixed_oca using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.opt_into_asset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.with_transactions using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.compare_assets using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.get_address using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.get_asset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.get_app using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.get_a_int using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.method_with_default_args using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.bare_abi_config using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.abi_routing.contract.Reference.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/abi_routing/out/contract_Reference.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@3.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_abi_routing@3.ops[14]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_noop_with_uint64_route@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_noop_with_uint64_route@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_noop_with_uint64_route@4.ops[5]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_noop_with_uint64_route@4.ops[7]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_noop_with_uint64_route@4.ops[10]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_noop_with_uint64_route@4.ops[12]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_noop_with_uint64_route@4.ops[15]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_noop_with_uint64_route@4.ops[17]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_noop_with_uint64_route@4.ops[23]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_noop_with_uint64_route@4.ops[25]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_noop_with_uint64_route@4.ops[19]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_noop_with_uint64_route@4.ops[22]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_all_the_things_route@5.ops[1]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_all_the_things_route@5.ops[3]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_all_the_things_route@5.ops[9]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_all_the_things_route@5.ops[11]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_all_the_things_route@5.ops[5]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_all_the_things_route@5.ops[8]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_mixed_oca_route@6.ops[5]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_mixed_oca_route@6.ops[7]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_mixed_oca_route@6.ops[10]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_mixed_oca_route@6.ops[12]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_mixed_oca_route@6.ops[15]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_mixed_oca_route@6.ops[17]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_mixed_oca_route@6.ops[20]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_mixed_oca_route@6.ops[22]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_mixed_oca_route@6.ops[28]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_mixed_oca_route@6.ops[30]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_mixed_oca_route@6.ops[1]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_mixed_oca_route@6.ops[4]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_mixed_oca_route@6.ops[25]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_mixed_oca_route@6.ops[28]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@7.ops[1]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@7.ops[3]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@7.ops[5]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@7.ops[7]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@7.ops[10]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@7.ops[12]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@7.ops[15]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@7.ops[17]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@7.ops[19]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@7.ops[21]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_opt_into_asset_route@7.ops[23]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_opt_into_asset_route@7.ops[25]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[1]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[3]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[5]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[7]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[10]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[12]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[15]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[17]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[19]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[21]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[27]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[29]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[32]: 'store awst_tmp%35#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[34]: 'load awst_tmp%35#0' with 'load awst_tmp%35#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[36]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[38]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[41]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[43]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[46]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[51]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[35]: 'store awst_tmp%35#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[51]: 'load awst_tmp%35#0' with 'load awst_tmp%35#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[25]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[51]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_with_transactions_route@8.ops[23]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_with_transactions_route@8.ops[51]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[1]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[3]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[5]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[7]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[10]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[12]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[15]: 'store tmp%42#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[17]: 'load tmp%42#0' with 'load tmp%42#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[19]: 'store tmp%43#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[21]: 'load tmp%43#0' with 'load tmp%43#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[25]: 'store tmp%45#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[27]: 'load tmp%45#0' with 'load tmp%45#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[29]: 'store tmp%46#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[31]: 'load tmp%46#0' with 'load tmp%46#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[33]: 'store tmp%47#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[36]: 'load tmp%47#0' with 'load tmp%47#0 from l-stack (no copy)' +debug: Inserted main_compare_assets_route@9.ops[23]: 'store tmp%44#0 to l-stack (copy)' +debug: Replaced main_compare_assets_route@9.ops[36]: 'load tmp%44#0' with 'load tmp%44#0 from l-stack (no copy)' +debug: Inserted main_get_address_route@10.ops[1]: 'store tmp%48#0 to l-stack (copy)' +debug: Replaced main_get_address_route@10.ops[3]: 'load tmp%48#0' with 'load tmp%48#0 from l-stack (no copy)' +debug: Inserted main_get_address_route@10.ops[5]: 'store tmp%49#0 to l-stack (copy)' +debug: Replaced main_get_address_route@10.ops[7]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' +debug: Inserted main_get_address_route@10.ops[10]: 'store tmp%50#0 to l-stack (copy)' +debug: Replaced main_get_address_route@10.ops[12]: 'load tmp%50#0' with 'load tmp%50#0 from l-stack (no copy)' +debug: Inserted main_get_address_route@10.ops[19]: 'store tmp%52#0 to l-stack (copy)' +debug: Replaced main_get_address_route@10.ops[21]: 'load tmp%52#0' with 'load tmp%52#0 from l-stack (no copy)' +debug: Inserted main_get_address_route@10.ops[15]: 'store tmp%51#0 to l-stack (copy)' +debug: Replaced main_get_address_route@10.ops[18]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' +debug: Inserted main_get_asset_route@11.ops[1]: 'store tmp%53#0 to l-stack (copy)' +debug: Replaced main_get_asset_route@11.ops[3]: 'load tmp%53#0' with 'load tmp%53#0 from l-stack (no copy)' +debug: Inserted main_get_asset_route@11.ops[5]: 'store tmp%54#0 to l-stack (copy)' +debug: Replaced main_get_asset_route@11.ops[7]: 'load tmp%54#0' with 'load tmp%54#0 from l-stack (no copy)' +debug: Inserted main_get_asset_route@11.ops[10]: 'store tmp%55#0 to l-stack (copy)' +debug: Replaced main_get_asset_route@11.ops[12]: 'load tmp%55#0' with 'load tmp%55#0 from l-stack (no copy)' +debug: Inserted main_get_asset_route@11.ops[19]: 'store tmp%57#0 to l-stack (copy)' +debug: Replaced main_get_asset_route@11.ops[21]: 'load tmp%57#0' with 'load tmp%57#0 from l-stack (no copy)' +debug: Inserted main_get_asset_route@11.ops[15]: 'store tmp%56#0 to l-stack (copy)' +debug: Replaced main_get_asset_route@11.ops[18]: 'load tmp%56#0' with 'load tmp%56#0 from l-stack (no copy)' +debug: Inserted main_get_application_route@12.ops[1]: 'store tmp%58#0 to l-stack (copy)' +debug: Replaced main_get_application_route@12.ops[3]: 'load tmp%58#0' with 'load tmp%58#0 from l-stack (no copy)' +debug: Inserted main_get_application_route@12.ops[5]: 'store tmp%59#0 to l-stack (copy)' +debug: Replaced main_get_application_route@12.ops[7]: 'load tmp%59#0' with 'load tmp%59#0 from l-stack (no copy)' +debug: Inserted main_get_application_route@12.ops[10]: 'store tmp%60#0 to l-stack (copy)' +debug: Replaced main_get_application_route@12.ops[12]: 'load tmp%60#0' with 'load tmp%60#0 from l-stack (no copy)' +debug: Inserted main_get_application_route@12.ops[19]: 'store tmp%62#0 to l-stack (copy)' +debug: Replaced main_get_application_route@12.ops[21]: 'load tmp%62#0' with 'load tmp%62#0 from l-stack (no copy)' +debug: Inserted main_get_application_route@12.ops[15]: 'store tmp%61#0 to l-stack (copy)' +debug: Replaced main_get_application_route@12.ops[18]: 'load tmp%61#0' with 'load tmp%61#0 from l-stack (no copy)' +debug: Inserted main_get_an_int_route@13.ops[1]: 'store tmp%63#0 to l-stack (copy)' +debug: Replaced main_get_an_int_route@13.ops[3]: 'load tmp%63#0' with 'load tmp%63#0 from l-stack (no copy)' +debug: Inserted main_get_an_int_route@13.ops[5]: 'store tmp%64#0 to l-stack (copy)' +debug: Replaced main_get_an_int_route@13.ops[7]: 'load tmp%64#0' with 'load tmp%64#0 from l-stack (no copy)' +debug: Inserted main_get_an_int_route@13.ops[10]: 'store tmp%65#0 to l-stack (copy)' +debug: Replaced main_get_an_int_route@13.ops[12]: 'load tmp%65#0' with 'load tmp%65#0 from l-stack (no copy)' +debug: Inserted main_get_an_int_route@13.ops[19]: 'store tmp%67#0 to l-stack (copy)' +debug: Replaced main_get_an_int_route@13.ops[21]: 'load tmp%67#0' with 'load tmp%67#0 from l-stack (no copy)' +debug: Inserted main_get_an_int_route@13.ops[15]: 'store tmp%66#0 to l-stack (copy)' +debug: Replaced main_get_an_int_route@13.ops[18]: 'load tmp%66#0' with 'load tmp%66#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[1]: 'store tmp%68#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[3]: 'load tmp%68#0' with 'load tmp%68#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[5]: 'store tmp%69#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[7]: 'load tmp%69#0' with 'load tmp%69#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[10]: 'store tmp%70#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[12]: 'load tmp%70#0' with 'load tmp%70#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[15]: 'store tmp%71#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[17]: 'load tmp%71#0' with 'load tmp%71#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[19]: 'store tmp%72#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[21]: 'load tmp%72#0' with 'load tmp%72#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[25]: 'store tmp%74#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[27]: 'load tmp%74#0' with 'load tmp%74#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[29]: 'store tmp%75#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[31]: 'load tmp%75#0' with 'load tmp%75#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[35]: 'store tmp%77#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[37]: 'load tmp%77#0' with 'load tmp%77#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[39]: 'store tmp%78#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[41]: 'load tmp%78#0' with 'load tmp%78#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[45]: 'store tmp%80#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[47]: 'load tmp%80#0' with 'load tmp%80#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[49]: 'store tmp%81#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[51]: 'load tmp%81#0' with 'load tmp%81#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[55]: 'store tmp%83#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[57]: 'load tmp%83#0' with 'load tmp%83#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[59]: 'store tmp%84#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[61]: 'load tmp%84#0' with 'load tmp%84#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[65]: 'store tmp%86#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[67]: 'load tmp%86#0' with 'load tmp%86#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[69]: 'store tmp%87#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[71]: 'load tmp%87#0' with 'load tmp%87#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[79]: 'store tmp%91#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%91#0' with 'load tmp%91#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[77]: 'store tmp%90#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%90#0' with 'load tmp%90#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[75]: 'store tmp%89#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%89#0' with 'load tmp%89#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[73]: 'store tmp%88#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%88#0' with 'load tmp%88#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[63]: 'store tmp%85#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%85#0' with 'load tmp%85#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[53]: 'store tmp%82#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%82#0' with 'load tmp%82#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[43]: 'store tmp%79#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[33]: 'store tmp%76#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%76#0' with 'load tmp%76#0 from l-stack (no copy)' +debug: Inserted main_method_with_default_args_route@14.ops[23]: 'store tmp%73#0 to l-stack (copy)' +debug: Replaced main_method_with_default_args_route@14.ops[89]: 'load tmp%73#0' with 'load tmp%73#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@17.ops[1]: 'store tmp%92#0 to l-stack (copy)' +debug: Replaced main_bare_routing@17.ops[3]: 'load tmp%92#0' with 'load tmp%92#0 from l-stack (no copy)' +debug: Inserted main_bare_abi_config@18.ops[1]: 'store tmp%93#0 to l-stack (copy)' +debug: Replaced main_bare_abi_config@18.ops[3]: 'load tmp%93#0' with 'load tmp%93#0 from l-stack (no copy)' +debug: Inserted main_bare_abi_config@18.ops[5]: 'store tmp%94#0 to l-stack (copy)' +debug: Replaced main_bare_abi_config@18.ops[7]: 'load tmp%94#0' with 'load tmp%94#0 from l-stack (no copy)' +debug: Found 4 edge set/s for examples.abi_routing.contract.Reference.approval_program +debug: Simplified uncover 3; uncover 3; uncover 3; uncover 3 to +debug: Simplified uncover 8; uncover 8; uncover 8; uncover 8; uncover 8; uncover 8; uncover 8; uncover 8; uncover 8 to +debug: Inserted noop_with_uint64_block@0.ops[6]: 'store result#0 to l-stack (copy)' +debug: Replaced noop_with_uint64_block@0.ops[8]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted noop_with_uint64_block@0.ops[10]: 'store val_as_bytes%1#0 to l-stack (copy)' +debug: Replaced noop_with_uint64_block@0.ops[12]: 'load val_as_bytes%1#0' with 'load val_as_bytes%1#0 from l-stack (no copy)' +debug: Inserted noop_with_uint64_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced noop_with_uint64_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted noop_with_uint64_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced noop_with_uint64_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted full_abi_config_block@0.ops[6]: 'store result#0 to l-stack (copy)' +debug: Replaced full_abi_config_block@0.ops[8]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted full_abi_config_block@0.ops[10]: 'store val_as_bytes%1#0 to l-stack (copy)' +debug: Replaced full_abi_config_block@0.ops[12]: 'load val_as_bytes%1#0' with 'load val_as_bytes%1#0 from l-stack (no copy)' +debug: Inserted full_abi_config_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced full_abi_config_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted full_abi_config_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced full_abi_config_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted mixed_oca_block@0.ops[6]: 'store result#0 to l-stack (copy)' +debug: Replaced mixed_oca_block@0.ops[8]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted mixed_oca_block@0.ops[10]: 'store val_as_bytes%1#0 to l-stack (copy)' +debug: Replaced mixed_oca_block@0.ops[12]: 'load val_as_bytes%1#0' with 'load val_as_bytes%1#0 from l-stack (no copy)' +debug: Inserted mixed_oca_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced mixed_oca_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted mixed_oca_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced mixed_oca_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[7]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[20]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[22]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[33]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[35]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[3]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[15]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[18]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted opt_into_asset_block@0.ops[18]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced opt_into_asset_block@0.ops[22]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[10]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[16]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[18]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[21]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[23]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[33]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[35]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[39]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[41]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[44]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[46]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[30]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[33]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[9]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted with_transactions_block@0.ops[29]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced with_transactions_block@0.ops[34]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted compare_assets_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced compare_assets_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted get_address_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced get_address_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[19]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[21]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[28]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[30]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[35]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[37]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[42]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[44]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[50]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[52]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[55]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[57]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[63]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[65]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[68]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[70]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[76]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[78]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[81]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[83]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[87]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[89]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[92]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[94]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[98]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[100]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[103]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[105]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[15]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[18]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted method_with_default_args_block@0.ops[25]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced method_with_default_args_block@0.ops[28]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted __init___block@0.ops[10]: 'store new_state_value%1#0 to l-stack (copy)' +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/contract.approval.teal +info: Writing abi_routing/out/contract.approval.debug.teal +info: Writing abi_routing/out/contract.clear.teal +info: Writing abi_routing/out/contract.clear.debug.teal +info: Writing abi_routing/out/application.json +>> exit code = 0 \ No newline at end of file diff --git a/examples/abi_routing/contract.py b/examples/abi_routing/contract.py new file mode 100644 index 0000000000..d10f2e962c --- /dev/null +++ b/examples/abi_routing/contract.py @@ -0,0 +1,157 @@ +import typing + +from algopy import ( + Account, + Application, + ARC4Contract, + Asset, + CreateInnerTransaction, + Global, + PaymentTransaction, + Transaction, + TransactionType, + UInt64, + arc4, + log, +) + +Bytes3: typing.TypeAlias = arc4.StaticArray[arc4.Byte, typing.Literal[3]] + + +class Reference(ARC4Contract): + def __init__(self) -> None: + self.asa = Asset(123) + self.an_int = UInt64(2) + self.some_bytes = Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) + self.creator = Transaction.sender() + self.app = Application(123) + + @arc4.abimethod + def noop_with_uint64(self, a: arc4.UInt64) -> arc4.UInt8: + result = 1 + a.decode() + return arc4.UInt8.encode(result) + + @arc4.abimethod( + allow_actions=[ + "NoOp", + "OptIn", + "CloseOut", + "UpdateApplication", + "DeleteApplication", + ], + name="all_the_things", + create="allow", + readonly=True, + ) + def full_abi_config(self, a: arc4.UInt64) -> arc4.UInt8: + result = UInt64(1) + a.decode() + return arc4.UInt8.encode(result) + + @arc4.abimethod( + allow_actions=[ + "NoOp", + "CloseOut", + "DeleteApplication", + ], + create=False, + readonly=True, + ) + def mixed_oca(self, a: arc4.UInt64) -> arc4.UInt8: + result = UInt64(1) + a.decode() + return arc4.UInt8.encode(result) + + @arc4.baremethod( + allow_actions=[ + "NoOp", + "OptIn", + "CloseOut", + "UpdateApplication", + "DeleteApplication", + ], + create=True, + ) + def bare_abi_config(self) -> None: + log(b"Hello World") + + @arc4.abimethod + def opt_into_asset(self, asset: Asset) -> None: + # Only allow app creator to opt the app account into a ASA + assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" + # Verify a ASA hasn't already been opted into + assert not self.asa, "ASA already opted in" + # Save ASA ID in global state + self.asa = asset + + # Submit opt-in transaction: 0 asset transfer to self + CreateInnerTransaction.begin() + CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) + CreateInnerTransaction.set_fee(UInt64(0)) # cover fee with outer txn + CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) + CreateInnerTransaction.set_xfer_asset(asset.asset_id) + CreateInnerTransaction.submit() + + @arc4.abimethod + def with_transactions( + self, asset: Asset, an_int: arc4.UInt64, pay: PaymentTransaction, another_int: arc4.UInt64 + ) -> None: + assert self.asa == asset, "is correct asset" + assert an_int.decode() == 1, "is correct int" + assert pay.receiver == Global.current_application_address(), "is payment to app" + assert another_int.decode() == 2, "is correct int" + + @arc4.abimethod + def compare_assets(self, asset_a: Asset, asset_b: Asset) -> None: + assert asset_a == asset_b, "asset a == b" + + @arc4.abimethod(readonly=True) + def get_address(self) -> arc4.Address: + return arc4.Address.from_bytes(Global.zero_address().bytes) + + @arc4.abimethod(readonly=True) + def get_asset(self) -> arc4.UInt64: + return arc4.UInt64(456) + + @arc4.abimethod(readonly=True, name="get_application") + def get_app(self) -> arc4.UInt64: + return arc4.UInt64(456) + + @arc4.abimethod(readonly=True, name="get_an_int") + def get_a_int(self) -> arc4.UInt64: + return arc4.UInt64(3) + + @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: Asset, + asset_from_function: Asset, + account_from_storage: Account, + account_from_function: Account, + application_from_storage: Application, + application_from_function: Application, + bytes_from_storage: Bytes3, + int_from_storage: arc4.UInt64, + int_from_function: arc4.UInt64, + ) -> None: + assert asset_from_storage == Asset(123), "wrong asset from storage" + assert asset_from_function == Asset(456), "wrong asset from function" + assert account_from_storage == Global.creator_address(), "wrong account from storage" + assert account_from_function == Global.zero_address(), "wrong account from function" + assert application_from_storage == Application(123), "wrong application from storage" + assert application_from_function == Application(456), "wrong application from function" + assert bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" + assert bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" + assert bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" + assert int_from_storage.decode() == 2, "wrong int from storage" + assert int_from_function.decode() == 3, "wrong int from function" diff --git a/examples/abi_routing/out/application.json b/examples/abi_routing/out/application.json new file mode 100644 index 0000000000..08109d3c70 --- /dev/null +++ b/examples/abi_routing/out/application.json @@ -0,0 +1,351 @@ +{ + "hints": { + "noop_with_uint64(uint64)uint8": { + "call_config": { + "no_op": "CALL" + } + }, + "all_the_things(uint64)uint8": { + "read_only": true, + "call_config": { + "no_op": "ALL", + "opt_in": "ALL", + "close_out": "ALL", + "update_application": "ALL", + "delete_application": "ALL" + } + }, + "mixed_oca(uint64)uint8": { + "read_only": true, + "call_config": { + "no_op": "CALL", + "close_out": "CALL", + "delete_application": "CALL" + } + }, + "opt_into_asset(asset)void": { + "call_config": { + "no_op": "CALL" + } + }, + "with_transactions(asset,uint64,pay,uint64)void": { + "call_config": { + "no_op": "CALL" + } + }, + "compare_assets(asset,asset)void": { + "call_config": { + "no_op": "CALL" + } + }, + "get_address()address": { + "read_only": true, + "call_config": { + "no_op": "CALL" + } + }, + "get_asset()uint64": { + "read_only": true, + "call_config": { + "no_op": "CALL" + } + }, + "get_application()uint64": { + "read_only": true, + "call_config": { + "no_op": "CALL" + } + }, + "get_an_int()uint64": { + "read_only": true, + "call_config": { + "no_op": "CALL" + } + }, + "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void": { + "default_arguments": { + "asset_from_storage": { + "source": "global-state", + "data": "asa" + }, + "asset_from_function": { + "source": "abi-method", + "data": { + "name": "get_asset", + "args": [], + "returns": { + "type": "uint64" + } + } + }, + "account_from_storage": { + "source": "global-state", + "data": "creator" + }, + "account_from_function": { + "source": "abi-method", + "data": { + "name": "get_address", + "args": [], + "returns": { + "type": "address" + } + } + }, + "application_from_storage": { + "source": "global-state", + "data": "app" + }, + "application_from_function": { + "source": "abi-method", + "data": { + "name": "get_application", + "args": [], + "returns": { + "type": "uint64" + } + } + }, + "bytes_from_storage": { + "source": "global-state", + "data": "some_bytes" + }, + "int_from_storage": { + "source": "global-state", + "data": "an_int" + }, + "int_from_function": { + "source": "abi-method", + "data": { + "name": "get_an_int", + "args": [], + "returns": { + "type": "uint64" + } + } + } + }, + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmFiaV9yb3V0aW5nLmNvbnRyYWN0LlJlZmVyZW5jZS5hcHByb3ZhbF9wcm9ncmFtKCkgLT4gdWludDY0OgptYWluX2Jsb2NrQDA6CiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBibnogbWFpbl9lbnRyeXBvaW50QDIKCm1haW5fb25fY3JlYXRlQDE6CiAgICAgICAgY2FsbHN1YiBfX2luaXRfXwoKbWFpbl9lbnRyeXBvaW50QDI6CiAgICAgICAgdHhuIE51bUFwcEFyZ3MKICAgICAgICBieiBtYWluX2JhcmVfcm91dGluZ0AxNwoKbWFpbl9hYmlfcm91dGluZ0AzOgogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDAKICAgICAgICBtZXRob2QgIm5vb3Bfd2l0aF91aW50NjQodWludDY0KXVpbnQ4IgogICAgICAgIG1ldGhvZCAiYWxsX3RoZV90aGluZ3ModWludDY0KXVpbnQ4IgogICAgICAgIG1ldGhvZCAibWl4ZWRfb2NhKHVpbnQ2NCl1aW50OCIKICAgICAgICBtZXRob2QgIm9wdF9pbnRvX2Fzc2V0KGFzc2V0KXZvaWQiCiAgICAgICAgbWV0aG9kICJ3aXRoX3RyYW5zYWN0aW9ucyhhc3NldCx1aW50NjQscGF5LHVpbnQ2NCl2b2lkIgogICAgICAgIG1ldGhvZCAiY29tcGFyZV9hc3NldHMoYXNzZXQsYXNzZXQpdm9pZCIKICAgICAgICBtZXRob2QgImdldF9hZGRyZXNzKClhZGRyZXNzIgogICAgICAgIG1ldGhvZCAiZ2V0X2Fzc2V0KCl1aW50NjQiCiAgICAgICAgbWV0aG9kICJnZXRfYXBwbGljYXRpb24oKXVpbnQ2NCIKICAgICAgICBtZXRob2QgImdldF9hbl9pbnQoKXVpbnQ2NCIKICAgICAgICBtZXRob2QgIm1ldGhvZF93aXRoX2RlZmF1bHRfYXJncyhhc3NldCxhc3NldCxhY2NvdW50LGFjY291bnQsYXBwbGljYXRpb24sYXBwbGljYXRpb24sYnl0ZVszXSx1aW50NjQsdWludDY0KXZvaWQiCiAgICAgICAgdW5jb3ZlciAxMQogICAgICAgIG1hdGNoIG1haW5fbm9vcF93aXRoX3VpbnQ2NF9yb3V0ZUA0IG1haW5fYWxsX3RoZV90aGluZ3Nfcm91dGVANSBtYWluX21peGVkX29jYV9yb3V0ZUA2IG1haW5fb3B0X2ludG9fYXNzZXRfcm91dGVANyBtYWluX3dpdGhfdHJhbnNhY3Rpb25zX3JvdXRlQDggbWFpbl9jb21wYXJlX2Fzc2V0c19yb3V0ZUA5IG1haW5fZ2V0X2FkZHJlc3Nfcm91dGVAMTAgbWFpbl9nZXRfYXNzZXRfcm91dGVAMTEgbWFpbl9nZXRfYXBwbGljYXRpb25fcm91dGVAMTIgbWFpbl9nZXRfYW5faW50X3JvdXRlQDEzIG1haW5fbWV0aG9kX3dpdGhfZGVmYXVsdF9hcmdzX3JvdXRlQDE0CiAgICAgICAgYiBtYWluX3N3aXRjaF9jYXNlX2RlZmF1bHRAMTUKCm1haW5fbm9vcF93aXRoX3VpbnQ2NF9yb3V0ZUA0OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgICAgIGNhbGxzdWIgbm9vcF93aXRoX3VpbnQ2NAogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9hbGxfdGhlX3RoaW5nc19yb3V0ZUA1OgogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBjYWxsc3ViIGZ1bGxfYWJpX2NvbmZpZwogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9taXhlZF9vY2Ffcm91dGVANjoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgaW50IDEKICAgICAgICBzd2FwCiAgICAgICAgc2hsCiAgICAgICAgaW50IDM3CiAgICAgICAgJgogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgb25lIG9mIE5vT3AsIENsb3NlT3V0LCBEZWxldGVBcHBsaWNhdGlvbgogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBjYWxsc3ViIG1peGVkX29jYQogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9vcHRfaW50b19hc3NldF9yb3V0ZUA3OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBc3NldHMKICAgICAgICBjYWxsc3ViIG9wdF9pbnRvX2Fzc2V0CiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fd2l0aF90cmFuc2FjdGlvbnNfcm91dGVAODoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXNzZXRzCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMgogICAgICAgIHR4biBHcm91cEluZGV4CiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZHVwCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBpbnQgcGF5CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBwYXkKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAzCiAgICAgICAgY2FsbHN1YiB3aXRoX3RyYW5zYWN0aW9ucwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2NvbXBhcmVfYXNzZXRzX3JvdXRlQDk6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICAgICAgYnRvaQogICAgICAgIHR4bmFzIEFzc2V0cwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDIKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXNzZXRzCiAgICAgICAgY2FsbHN1YiBjb21wYXJlX2Fzc2V0cwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2dldF9hZGRyZXNzX3JvdXRlQDEwOgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgY2FsbHN1YiBnZXRfYWRkcmVzcwogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9nZXRfYXNzZXRfcm91dGVAMTE6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICBjYWxsc3ViIGdldF9hc3NldAogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9nZXRfYXBwbGljYXRpb25fcm91dGVAMTI6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICBjYWxsc3ViIGdldF9hcHAKICAgICAgICBieXRlIDB4MTUxZjdjNzUKICAgICAgICBzd2FwCiAgICAgICAgY29uY2F0CiAgICAgICAgbG9nCiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fZ2V0X2FuX2ludF9yb3V0ZUAxMzoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIGNhbGxzdWIgZ2V0X2FfaW50CiAgICAgICAgYnl0ZSAweDE1MWY3Yzc1CiAgICAgICAgc3dhcAogICAgICAgIGNvbmNhdAogICAgICAgIGxvZwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX21ldGhvZF93aXRoX2RlZmF1bHRfYXJnc19yb3V0ZUAxNDoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXNzZXRzCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMgogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBc3NldHMKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAzCiAgICAgICAgYnRvaQogICAgICAgIHR4bmFzIEFjY291bnRzCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgNAogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBY2NvdW50cwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDUKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXBwbGljYXRpb25zCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgNgogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBcHBsaWNhdGlvbnMKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA3CiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgOAogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDkKICAgICAgICBjYWxsc3ViIG1ldGhvZF93aXRoX2RlZmF1bHRfYXJncwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX3N3aXRjaF9jYXNlX2RlZmF1bHRAMTU6CiAgICAgICAgZXJyIC8vIHJlamVjdCB0cmFuc2FjdGlvbgoKbWFpbl9iYXJlX3JvdXRpbmdAMTc6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgIHN3aXRjaCBtYWluX2JhcmVfYWJpX2NvbmZpZ0AxOCBtYWluX2JhcmVfYWJpX2NvbmZpZ0AxOCBtYWluX2JhcmVfYWJpX2NvbmZpZ0AxOCBtYWluX3JlamVjdF9iYXJlX29uX2NvbXBsZXRpb25AMTkgbWFpbl9iYXJlX2FiaV9jb25maWdAMTggbWFpbl9iYXJlX2FiaV9jb25maWdAMTgKICAgICAgICBiIG1haW5fcmVqZWN0X2JhcmVfb25fY29tcGxldGlvbkAxOQoKbWFpbl9iYXJlX2FiaV9jb25maWdAMTg6CiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIGlzIGNyZWF0aW5nCiAgICAgICAgY2FsbHN1YiBiYXJlX2FiaV9jb25maWcKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9yZWplY3RfYmFyZV9vbl9jb21wbGV0aW9uQDE5OgogICAgICAgIGVyciAvLyByZWplY3QgdHJhbnNhY3Rpb24KCgovLyBleGFtcGxlcy5hYmlfcm91dGluZy5jb250cmFjdC5SZWZlcmVuY2Uubm9vcF93aXRoX3VpbnQ2NChhIzA6IGJ5dGVzKSAtPiBieXRlczoKbm9vcF93aXRoX3VpbnQ2NDoKICAgICAgICBwcm90byAxIDEKCm5vb3Bfd2l0aF91aW50NjRfYmxvY2tAMDoKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBidG9pCiAgICAgICAgaW50IDEKICAgICAgICArCiAgICAgICAgaXRvYgogICAgICAgIGV4dHJhY3QgNyAxCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYWJpX3JvdXRpbmcuY29udHJhY3QuUmVmZXJlbmNlLmZ1bGxfYWJpX2NvbmZpZyhhIzA6IGJ5dGVzKSAtPiBieXRlczoKZnVsbF9hYmlfY29uZmlnOgogICAgICAgIHByb3RvIDEgMQoKZnVsbF9hYmlfY29uZmlnX2Jsb2NrQDA6CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgYnRvaQogICAgICAgIGludCAxCiAgICAgICAgKwogICAgICAgIGl0b2IKICAgICAgICBleHRyYWN0IDcgMQogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFiaV9yb3V0aW5nLmNvbnRyYWN0LlJlZmVyZW5jZS5taXhlZF9vY2EoYSMwOiBieXRlcykgLT4gYnl0ZXM6Cm1peGVkX29jYToKICAgICAgICBwcm90byAxIDEKCm1peGVkX29jYV9ibG9ja0AwOgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGJ0b2kKICAgICAgICBpbnQgMQogICAgICAgICsKICAgICAgICBpdG9iCiAgICAgICAgZXh0cmFjdCA3IDEKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hYmlfcm91dGluZy5jb250cmFjdC5SZWZlcmVuY2Uub3B0X2ludG9fYXNzZXQoYXNzZXQjMDogdWludDY0KSAtPiB2b2lkOgpvcHRfaW50b19hc3NldDoKICAgICAgICBwcm90byAxIDAKCm9wdF9pbnRvX2Fzc2V0X2Jsb2NrQDA6CiAgICAgICAgdHhuIFNlbmRlcgogICAgICAgIGdsb2JhbCBDcmVhdG9yQWRkcmVzcwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIE9ubHkgY3JlYXRvciBjYW4gb3B0IGluIHRvIEFTQQogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNhIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gQVNBIGFscmVhZHkgb3B0ZWQgaW4KICAgICAgICBieXRlICJhc2EiCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBpdHhuX2JlZ2luCiAgICAgICAgaW50IGF4ZmVyCiAgICAgICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgICAgIGludCAwCiAgICAgICAgaXR4bl9maWVsZCBGZWUKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgIGl0eG5fZmllbGQgQXNzZXRSZWNlaXZlcgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGl0eG5fZmllbGQgWGZlckFzc2V0CiAgICAgICAgaXR4bl9zdWJtaXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hYmlfcm91dGluZy5jb250cmFjdC5SZWZlcmVuY2Uud2l0aF90cmFuc2FjdGlvbnMoYXNzZXQjMDogdWludDY0LCBhbl9pbnQjMDogYnl0ZXMsIHBheSMwOiB1aW50NjQsIGFub3RoZXJfaW50IzA6IGJ5dGVzKSAtPiB2b2lkOgp3aXRoX3RyYW5zYWN0aW9uczoKICAgICAgICBwcm90byA0IDAKCndpdGhfdHJhbnNhY3Rpb25zX2Jsb2NrQDA6CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhc2EiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gaXMgY29ycmVjdCBhc3NldAogICAgICAgIGZyYW1lX2RpZyAtMwogICAgICAgIGJ0b2kKICAgICAgICBpbnQgMQogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIGlzIGNvcnJlY3QgaW50CiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgZ3R4bnMgUmVjZWl2ZXIKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIGlzIHBheW1lbnQgdG8gYXBwCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgYnRvaQogICAgICAgIGludCAyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gaXMgY29ycmVjdCBpbnQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hYmlfcm91dGluZy5jb250cmFjdC5SZWZlcmVuY2UuY29tcGFyZV9hc3NldHMoYXNzZXRfYSMwOiB1aW50NjQsIGFzc2V0X2IjMDogdWludDY0KSAtPiB2b2lkOgpjb21wYXJlX2Fzc2V0czoKICAgICAgICBwcm90byAyIDAKCmNvbXBhcmVfYXNzZXRzX2Jsb2NrQDA6CiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXQgYSA9PSBiCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYWJpX3JvdXRpbmcuY29udHJhY3QuUmVmZXJlbmNlLmdldF9hZGRyZXNzKCkgLT4gYnl0ZXM6CmdldF9hZGRyZXNzOgogICAgICAgIHByb3RvIDAgMQoKZ2V0X2FkZHJlc3NfYmxvY2tAMDoKICAgICAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hYmlfcm91dGluZy5jb250cmFjdC5SZWZlcmVuY2UuZ2V0X2Fzc2V0KCkgLT4gYnl0ZXM6CmdldF9hc3NldDoKICAgICAgICBwcm90byAwIDEKCmdldF9hc3NldF9ibG9ja0AwOgogICAgICAgIGJ5dGUgMHgwMDAwMDAwMDAwMDAwMWM4CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYWJpX3JvdXRpbmcuY29udHJhY3QuUmVmZXJlbmNlLmdldF9hcHAoKSAtPiBieXRlczoKZ2V0X2FwcDoKICAgICAgICBwcm90byAwIDEKCmdldF9hcHBfYmxvY2tAMDoKICAgICAgICBieXRlIDB4MDAwMDAwMDAwMDAwMDFjOAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFiaV9yb3V0aW5nLmNvbnRyYWN0LlJlZmVyZW5jZS5nZXRfYV9pbnQoKSAtPiBieXRlczoKZ2V0X2FfaW50OgogICAgICAgIHByb3RvIDAgMQoKZ2V0X2FfaW50X2Jsb2NrQDA6CiAgICAgICAgYnl0ZSAweDAwMDAwMDAwMDAwMDAwMDMKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hYmlfcm91dGluZy5jb250cmFjdC5SZWZlcmVuY2UubWV0aG9kX3dpdGhfZGVmYXVsdF9hcmdzKGFzc2V0X2Zyb21fc3RvcmFnZSMwOiB1aW50NjQsIGFzc2V0X2Zyb21fZnVuY3Rpb24jMDogdWludDY0LCBhY2NvdW50X2Zyb21fc3RvcmFnZSMwOiBieXRlcywgYWNjb3VudF9mcm9tX2Z1bmN0aW9uIzA6IGJ5dGVzLCBhcHBsaWNhdGlvbl9mcm9tX3N0b3JhZ2UjMDogdWludDY0LCBhcHBsaWNhdGlvbl9mcm9tX2Z1bmN0aW9uIzA6IHVpbnQ2NCwgYnl0ZXNfZnJvbV9zdG9yYWdlIzA6IGJ5dGVzLCBpbnRfZnJvbV9zdG9yYWdlIzA6IGJ5dGVzLCBpbnRfZnJvbV9mdW5jdGlvbiMwOiBieXRlcykgLT4gdm9pZDoKbWV0aG9kX3dpdGhfZGVmYXVsdF9hcmdzOgogICAgICAgIHByb3RvIDkgMAoKbWV0aG9kX3dpdGhfZGVmYXVsdF9hcmdzX2Jsb2NrQDA6CiAgICAgICAgZnJhbWVfZGlnIC05CiAgICAgICAgaW50IDEyMwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIHdyb25nIGFzc2V0IGZyb20gc3RvcmFnZQogICAgICAgIGZyYW1lX2RpZyAtOAogICAgICAgIGludCA0NTYKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB3cm9uZyBhc3NldCBmcm9tIGZ1bmN0aW9uCiAgICAgICAgZ2xvYmFsIENyZWF0b3JBZGRyZXNzCiAgICAgICAgZnJhbWVfZGlnIC03CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gd3JvbmcgYWNjb3VudCBmcm9tIHN0b3JhZ2UKICAgICAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICAgICBmcmFtZV9kaWcgLTYKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB3cm9uZyBhY2NvdW50IGZyb20gZnVuY3Rpb24KICAgICAgICBmcmFtZV9kaWcgLTUKICAgICAgICBpbnQgMTIzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gd3JvbmcgYXBwbGljYXRpb24gZnJvbSBzdG9yYWdlCiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgaW50IDQ1NgogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIHdyb25nIGFwcGxpY2F0aW9uIGZyb20gZnVuY3Rpb24KICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBpbnQgMAogICAgICAgIGludCAxCiAgICAgICAgZXh0cmFjdDMKICAgICAgICBieXRlIDB4MDcKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB3cm9uZyAwdGggYnl0ZSBmcm9tIHN0b3JhZ2UKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBpbnQgMQogICAgICAgIGludCAxCiAgICAgICAgZXh0cmFjdDMKICAgICAgICBieXRlIDB4MDgKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB3cm9uZyAxc3QgYnl0ZSBmcm9tIHN0b3JhZ2UKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBpbnQgMgogICAgICAgIGludCAxCiAgICAgICAgZXh0cmFjdDMKICAgICAgICBieXRlIDB4MDkKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB3cm9uZyAybmQgYnl0ZSBmcm9tIHN0b3JhZ2UKICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICBidG9pCiAgICAgICAgaW50IDIKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB3cm9uZyBpbnQgZnJvbSBzdG9yYWdlCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgYnRvaQogICAgICAgIGludCAzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gd3JvbmcgaW50IGZyb20gZnVuY3Rpb24KICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hYmlfcm91dGluZy5jb250cmFjdC5SZWZlcmVuY2UuYmFyZV9hYmlfY29uZmlnKCkgLT4gdm9pZDoKYmFyZV9hYmlfY29uZmlnOgogICAgICAgIHByb3RvIDAgMAoKYmFyZV9hYmlfY29uZmlnX2Jsb2NrQDA6CiAgICAgICAgYnl0ZSAiSGVsbG8gV29ybGQiCiAgICAgICAgbG9nCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYWJpX3JvdXRpbmcuY29udHJhY3QuUmVmZXJlbmNlLl9faW5pdF9fKCkgLT4gdm9pZDoKX19pbml0X186CiAgICAgICAgcHJvdG8gMCAwCgpfX2luaXRfX19ibG9ja0AwOgogICAgICAgIGJ5dGUgImFzYSIKICAgICAgICBpbnQgMTIzCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJhbl9pbnQiCiAgICAgICAgaW50IDIKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGJ5dGUgInNvbWVfYnl0ZXMiCiAgICAgICAgYnl0ZSAweDA3MDgwOQogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgdHhuIFNlbmRlcgogICAgICAgIGJ5dGUgImNyZWF0b3IiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgYnl0ZSAiYXBwIgogICAgICAgIGludCAxMjMKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIHJldHN1YgoK", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmFiaV9yb3V0aW5nLmNvbnRyYWN0LlJlZmVyZW5jZS5jbGVhcl9zdGF0ZV9wcm9ncmFtKCkgLT4gdWludDY0OgptYWluX2Jsb2NrQDA6CiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCg==" + }, + "state": { + "global": { + "num_byte_slices": 2, + "num_uints": 3 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "an_int": { + "type": "uint64", + "key": "an_int" + }, + "app": { + "type": "uint64", + "key": "app" + }, + "asa": { + "type": "uint64", + "key": "asa" + }, + "creator": { + "type": "bytes", + "key": "creator" + }, + "some_bytes": { + "type": "bytes", + "key": "some_bytes" + } + }, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "Reference", + "methods": [ + { + "name": "noop_with_uint64", + "args": [ + { + "type": "uint64", + "name": "a" + } + ], + "returns": { + "type": "uint8" + } + }, + { + "name": "all_the_things", + "args": [ + { + "type": "uint64", + "name": "a" + } + ], + "returns": { + "type": "uint8" + } + }, + { + "name": "mixed_oca", + "args": [ + { + "type": "uint64", + "name": "a" + } + ], + "returns": { + "type": "uint8" + } + }, + { + "name": "opt_into_asset", + "args": [ + { + "type": "asset", + "name": "asset" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "with_transactions", + "args": [ + { + "type": "asset", + "name": "asset" + }, + { + "type": "uint64", + "name": "an_int" + }, + { + "type": "pay", + "name": "pay" + }, + { + "type": "uint64", + "name": "another_int" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "compare_assets", + "args": [ + { + "type": "asset", + "name": "asset_a" + }, + { + "type": "asset", + "name": "asset_b" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "get_address", + "args": [], + "returns": { + "type": "address" + } + }, + { + "name": "get_asset", + "args": [], + "returns": { + "type": "uint64" + } + }, + { + "name": "get_application", + "args": [], + "returns": { + "type": "uint64" + } + }, + { + "name": "get_an_int", + "args": [], + "returns": { + "type": "uint64" + } + }, + { + "name": "method_with_default_args", + "args": [ + { + "type": "asset", + "name": "asset_from_storage" + }, + { + "type": "asset", + "name": "asset_from_function" + }, + { + "type": "account", + "name": "account_from_storage" + }, + { + "type": "account", + "name": "account_from_function" + }, + { + "type": "application", + "name": "application_from_storage" + }, + { + "type": "application", + "name": "application_from_function" + }, + { + "type": "byte[3]", + "name": "bytes_from_storage" + }, + { + "type": "uint64", + "name": "int_from_storage" + }, + { + "type": "uint64", + "name": "int_from_function" + } + ], + "returns": { + "type": "void" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE", + "opt_in": "CREATE", + "close_out": "CREATE", + "update_application": "CREATE", + "delete_application": "CREATE" + } +} \ No newline at end of file diff --git a/examples/abi_routing/out/contract.approval.debug.teal b/examples/abi_routing/out/contract.approval.debug.teal new file mode 100644 index 0000000000..9787107e12 --- /dev/null +++ b/examples/abi_routing/out/contract.approval.debug.teal @@ -0,0 +1,486 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.abi_routing.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + bz main_bare_routing@17 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + // Implicit fall through to main_abi_routing@3 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + method "noop_with_uint64(uint64)uint8" // tmp%2#0,method<"noop_with_uint64(uint64)uint8"> arc4.abimethod File "abi_routing/contract.py", line 29 + method "all_the_things(uint64)uint8" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8"> arc4.abimethod( File "abi_routing/contract.py", line 34 + method "mixed_oca(uint64)uint8" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8"> arc4.abimethod( File "abi_routing/contract.py", line 50 + method "opt_into_asset(asset)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void"> arc4.abimethod File "abi_routing/contract.py", line 76 + method "with_transactions(asset,uint64,pay,uint64)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void"> arc4.abimethod File "abi_routing/contract.py", line 93 + method "compare_assets(asset,asset)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void"> arc4.abimethod File "abi_routing/contract.py", line 102 + method "get_address()address" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address"> arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + method "get_asset()uint64" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64"> arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + method "get_application()uint64" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64"> arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + method "get_an_int()uint64" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64">,method<"get_an_int()uint64"> arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64">,method<"get_an_int()uint64">,method<"method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void"> arc4.abimethod( File "abi_routing/contract.py", line 122 + uncover 11 // load tmp%2#0 from l-stack (no copy) method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64">,method<"get_an_int()uint64">,method<"method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void">,tmp%2#0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + match main_noop_with_uint64_route@4 main_all_the_things_route@5 main_mixed_oca_route@6 main_opt_into_asset_route@7 main_with_transactions_route@8 main_compare_assets_route@9 main_get_address_route@10 main_get_asset_route@11 main_get_application_route@12 main_get_an_int_route@13 main_method_with_default_args_route@14 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + b main_switch_case_default@15 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_noop_with_uint64_route@4: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 29 + ! // {!} arc4.abimethod File "abi_routing/contract.py", line 29 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 29 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 29 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 29 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub noop_with_uint64 // {noop_with_uint64} arc4.abimethod File "abi_routing/contract.py", line 29 + byte 0x151f7c75 // tmp%7#0,0x151f7c75 arc4.abimethod File "abi_routing/contract.py", line 29 + swap // load tmp%7#0 from l-stack (no copy) 0x151f7c75,tmp%7#0 arc4.abimethod File "abi_routing/contract.py", line 29 + concat // {concat} arc4.abimethod File "abi_routing/contract.py", line 29 + log // arc4.abimethod File "abi_routing/contract.py", line 29 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 29 + return // arc4.abimethod File "abi_routing/contract.py", line 29 + +main_all_the_things_route@5: + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub full_abi_config // {full_abi_config} arc4.abimethod( File "abi_routing/contract.py", line 34 + byte 0x151f7c75 // tmp%10#0,0x151f7c75 arc4.abimethod( File "abi_routing/contract.py", line 34 + swap // load tmp%10#0 from l-stack (no copy) 0x151f7c75,tmp%10#0 arc4.abimethod( File "abi_routing/contract.py", line 34 + concat // {concat} arc4.abimethod( File "abi_routing/contract.py", line 34 + log // arc4.abimethod( File "abi_routing/contract.py", line 34 + int 1 // 1 arc4.abimethod( File "abi_routing/contract.py", line 34 + return // arc4.abimethod( File "abi_routing/contract.py", line 34 + +main_mixed_oca_route@6: + txn OnCompletion // {txn} arc4.abimethod( File "abi_routing/contract.py", line 50 + int 1 // tmp%12#0,1 arc4.abimethod( File "abi_routing/contract.py", line 50 + swap // load tmp%12#0 from l-stack (no copy) 1,tmp%12#0 arc4.abimethod( File "abi_routing/contract.py", line 50 + shl // {shl} arc4.abimethod( File "abi_routing/contract.py", line 50 + int 37 // tmp%13#0,37 arc4.abimethod( File "abi_routing/contract.py", line 50 + & // {&} arc4.abimethod( File "abi_routing/contract.py", line 50 + assert // OnCompletion is one of NoOp, CloseOut, DeleteApplication // arc4.abimethod( File "abi_routing/contract.py", line 50 + txn ApplicationID // {txn} arc4.abimethod( File "abi_routing/contract.py", line 50 + assert // is not creating // arc4.abimethod( File "abi_routing/contract.py", line 50 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub mixed_oca // {mixed_oca} arc4.abimethod( File "abi_routing/contract.py", line 50 + byte 0x151f7c75 // tmp%17#0,0x151f7c75 arc4.abimethod( File "abi_routing/contract.py", line 50 + swap // load tmp%17#0 from l-stack (no copy) 0x151f7c75,tmp%17#0 arc4.abimethod( File "abi_routing/contract.py", line 50 + concat // {concat} arc4.abimethod( File "abi_routing/contract.py", line 50 + log // arc4.abimethod( File "abi_routing/contract.py", line 50 + int 1 // 1 arc4.abimethod( File "abi_routing/contract.py", line 50 + return // arc4.abimethod( File "abi_routing/contract.py", line 50 + +main_opt_into_asset_route@7: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 76 + ! // {!} arc4.abimethod File "abi_routing/contract.py", line 76 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 76 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 76 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 76 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub opt_into_asset // arc4.abimethod File "abi_routing/contract.py", line 76 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 76 + return // arc4.abimethod File "abi_routing/contract.py", line 76 + +main_with_transactions_route@8: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 93 + ! // {!} arc4.abimethod File "abi_routing/contract.py", line 93 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 93 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 93 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 93 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 2 // tmp%30#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txn GroupIndex // tmp%30#0,tmp%31#0,{txn} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int 1 // tmp%30#0,tmp%31#0,tmp%34#0,1 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + - // tmp%30#0,tmp%31#0,{-} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + dup // load awst_tmp%35#0 from l-stack (copy) tmp%30#0,tmp%31#0,awst_tmp%35#0,awst_tmp%35#0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + gtxns TypeEnum // tmp%30#0,tmp%31#0,awst_tmp%35#0,{gtxns} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int pay // tmp%30#0,tmp%31#0,awst_tmp%35#0,tmp%36#0,pay class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + == // tmp%30#0,tmp%31#0,awst_tmp%35#0,{==} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + assert // transaction type is pay // tmp%30#0,tmp%31#0,awst_tmp%35#0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 3 // tmp%30#0,tmp%31#0,awst_tmp%35#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub with_transactions // arc4.abimethod File "abi_routing/contract.py", line 93 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 93 + return // arc4.abimethod File "abi_routing/contract.py", line 93 + +main_compare_assets_route@9: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 102 + ! // {!} arc4.abimethod File "abi_routing/contract.py", line 102 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 102 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 102 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 102 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 2 // tmp%44#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%44#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // tmp%44#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub compare_assets // arc4.abimethod File "abi_routing/contract.py", line 102 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 102 + return // arc4.abimethod File "abi_routing/contract.py", line 102 + +main_get_address_route@10: + txn OnCompletion // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + ! // {!} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + txn ApplicationID // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + assert // is not creating // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + callsub get_address // {get_address} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + byte 0x151f7c75 // tmp%51#0,0x151f7c75 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + swap // load tmp%51#0 from l-stack (no copy) 0x151f7c75,tmp%51#0 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + concat // {concat} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + log // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + int 1 // 1 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + return // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + +main_get_asset_route@11: + txn OnCompletion // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + ! // {!} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + txn ApplicationID // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + assert // is not creating // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + callsub get_asset // {get_asset} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + byte 0x151f7c75 // tmp%56#0,0x151f7c75 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + swap // load tmp%56#0 from l-stack (no copy) 0x151f7c75,tmp%56#0 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + concat // {concat} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + log // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + int 1 // 1 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + return // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + +main_get_application_route@12: + txn OnCompletion // {txn} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + ! // {!} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + txn ApplicationID // {txn} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + assert // is not creating // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + callsub get_app // {get_app} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + byte 0x151f7c75 // tmp%61#0,0x151f7c75 arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + swap // load tmp%61#0 from l-stack (no copy) 0x151f7c75,tmp%61#0 arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + concat // {concat} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + log // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + int 1 // 1 arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + return // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + +main_get_an_int_route@13: + txn OnCompletion // {txn} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + ! // {!} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + txn ApplicationID // {txn} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + assert // is not creating // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + callsub get_a_int // {get_a_int} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + byte 0x151f7c75 // tmp%66#0,0x151f7c75 arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + swap // load tmp%66#0 from l-stack (no copy) 0x151f7c75,tmp%66#0 arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + concat // {concat} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + log // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + int 1 // 1 arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + return // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + +main_method_with_default_args_route@14: + txn OnCompletion // {txn} arc4.abimethod( File "abi_routing/contract.py", line 122 + ! // {!} arc4.abimethod( File "abi_routing/contract.py", line 122 + assert // OnCompletion is NoOp // arc4.abimethod( File "abi_routing/contract.py", line 122 + txn ApplicationID // {txn} arc4.abimethod( File "abi_routing/contract.py", line 122 + assert // is not creating // arc4.abimethod( File "abi_routing/contract.py", line 122 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 2 // tmp%73#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // tmp%73#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 3 // tmp%73#0,tmp%76#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Accounts // tmp%73#0,tmp%76#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 4 // tmp%73#0,tmp%76#0,tmp%79#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,tmp%79#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Accounts // tmp%73#0,tmp%76#0,tmp%79#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 5 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Applications // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 6 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Applications // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 7 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,tmp%88#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 8 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,tmp%88#0,tmp%89#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 9 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,tmp%88#0,tmp%89#0,tmp%90#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub method_with_default_args // arc4.abimethod( File "abi_routing/contract.py", line 122 + int 1 // 1 arc4.abimethod( File "abi_routing/contract.py", line 122 + return // arc4.abimethod( File "abi_routing/contract.py", line 122 + +main_switch_case_default@15: + err // reject transaction // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_bare_routing@17: + txn OnCompletion // {txn} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + switch main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 main_reject_bare_on_completion@19 main_bare_abi_config@18 main_bare_abi_config@18 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + b main_reject_bare_on_completion@19 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_bare_abi_config@18: + txn ApplicationID // {txn} arc4.baremethod( File "abi_routing/contract.py", line 63 + ! // {!} arc4.baremethod( File "abi_routing/contract.py", line 63 + assert // is creating // arc4.baremethod( File "abi_routing/contract.py", line 63 + callsub bare_abi_config // def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + int 1 // 1 def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + return // def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + +main_reject_bare_on_completion@19: + err // reject transaction // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + + +// examples.abi_routing.contract.Reference.noop_with_uint64(a#0: bytes) -> bytes: +noop_with_uint64: + proto 1 1 // (𝕡) a#0 | def noop_with_uint64(self, a: arc4.UInt64) -> arc4.UInt8: File "abi_routing/contract.py", line 30 + +noop_with_uint64_block@0: + frame_dig -1 // load a#0 from parameters (𝕡) a#0 | a#0 a: arc4.UInt64 File "abi_routing/contract.py", line 30 + btoi // (𝕡) a#0 | {btoi} a.decode() File "abi_routing/contract.py", line 31 + int 1 // (𝕡) a#0 | tmp%0#0,1 1 File "abi_routing/contract.py", line 31 + + // (𝕡) a#0 | {+} 1 + a.decode() File "abi_routing/contract.py", line 31 + itob // (𝕡) a#0 | {itob} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 32 + extract 7 1 // (𝕡) a#0 | {extract} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 32 + retsub // tmp%2#0 return arc4.UInt8.encode(result) File "abi_routing/contract.py", line 32 + + +// examples.abi_routing.contract.Reference.full_abi_config(a#0: bytes) -> bytes: +full_abi_config: + proto 1 1 // (𝕡) a#0 | def full_abi_config(self, a: arc4.UInt64) -> arc4.UInt8: File "abi_routing/contract.py", line 46 + +full_abi_config_block@0: + frame_dig -1 // load a#0 from parameters (𝕡) a#0 | a#0 a: arc4.UInt64 File "abi_routing/contract.py", line 46 + btoi // (𝕡) a#0 | {btoi} a.decode() File "abi_routing/contract.py", line 47 + int 1 // (𝕡) a#0 | tmp%0#0,1 1 File "abi_routing/contract.py", line 47 + + // (𝕡) a#0 | {+} UInt64(1) + a.decode() File "abi_routing/contract.py", line 47 + itob // (𝕡) a#0 | {itob} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 48 + extract 7 1 // (𝕡) a#0 | {extract} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 48 + retsub // tmp%2#0 return arc4.UInt8.encode(result) File "abi_routing/contract.py", line 48 + + +// examples.abi_routing.contract.Reference.mixed_oca(a#0: bytes) -> bytes: +mixed_oca: + proto 1 1 // (𝕡) a#0 | def mixed_oca(self, a: arc4.UInt64) -> arc4.UInt8: File "abi_routing/contract.py", line 59 + +mixed_oca_block@0: + frame_dig -1 // load a#0 from parameters (𝕡) a#0 | a#0 a: arc4.UInt64 File "abi_routing/contract.py", line 59 + btoi // (𝕡) a#0 | {btoi} a.decode() File "abi_routing/contract.py", line 60 + int 1 // (𝕡) a#0 | tmp%0#0,1 1 File "abi_routing/contract.py", line 60 + + // (𝕡) a#0 | {+} UInt64(1) + a.decode() File "abi_routing/contract.py", line 60 + itob // (𝕡) a#0 | {itob} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 61 + extract 7 1 // (𝕡) a#0 | {extract} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 61 + retsub // tmp%2#0 return arc4.UInt8.encode(result) File "abi_routing/contract.py", line 61 + + +// examples.abi_routing.contract.Reference.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "abi_routing/contract.py", line 77 + +opt_into_asset_block@0: + txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "abi_routing/contract.py", line 79 + global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "abi_routing/contract.py", line 79 + == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "abi_routing/contract.py", line 79 + assert // Only creator can opt in to ASA // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "abi_routing/contract.py", line 79 + int 0 // (𝕡) asset#0 | 0 self.asa File "abi_routing/contract.py", line 81 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "abi_routing/contract.py", line 81 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "abi_routing/contract.py", line 81 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "abi_routing/contract.py", line 81 + ! // (𝕡) asset#0 | {!} not self.asa File "abi_routing/contract.py", line 81 + assert // ASA already opted in // (𝕡) asset#0 | assert not self.asa, "ASA already opted in" File "abi_routing/contract.py", line 81 + byte "asa" // (𝕡) asset#0 | "asa" self.asa File "abi_routing/contract.py", line 83 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "abi_routing/contract.py", line 77 + app_global_put // (𝕡) asset#0 | self.asa = asset File "abi_routing/contract.py", line 83 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "abi_routing/contract.py", line 86 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "abi_routing/contract.py", line 87 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "abi_routing/contract.py", line 87 + int 0 // (𝕡) asset#0 | 0 0 File "abi_routing/contract.py", line 88 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "abi_routing/contract.py", line 88 + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "abi_routing/contract.py", line 89 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "abi_routing/contract.py", line 89 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "abi_routing/contract.py", line 77 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "abi_routing/contract.py", line 90 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "abi_routing/contract.py", line 91 + retsub // + + +// examples.abi_routing.contract.Reference.with_transactions(asset#0: uint64, an_int#0: bytes, pay#0: uint64, another_int#0: bytes) -> void: +with_transactions: + proto 4 0 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | def with_transactions( File "abi_routing/contract.py", line 94 + +with_transactions_block@0: + int 0 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | 0 self.asa File "abi_routing/contract.py", line 97 + byte "asa" // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | 0,"asa" self.asa File "abi_routing/contract.py", line 97 + app_global_get_ex // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "abi_routing/contract.py", line 97 + assert // check value exists // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | app_global_get_ex_value%0#0 self.asa File "abi_routing/contract.py", line 97 + frame_dig -4 // load asset#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | app_global_get_ex_value%0#0,asset#0 asset: Asset File "abi_routing/contract.py", line 95 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} self.asa == asset, "is correct asset" File "abi_routing/contract.py", line 97 + assert // is correct asset // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert self.asa == asset, "is correct asset" File "abi_routing/contract.py", line 97 + frame_dig -3 // load an_int#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | an_int#0 an_int: arc4.UInt64 File "abi_routing/contract.py", line 95 + btoi // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {btoi} an_int.decode() File "abi_routing/contract.py", line 98 + int 1 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | tmp%3#0,1 1 File "abi_routing/contract.py", line 98 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} an_int.decode() == 1, "is correct int" File "abi_routing/contract.py", line 98 + assert // is correct int // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert an_int.decode() == 1, "is correct int" File "abi_routing/contract.py", line 98 + frame_dig -2 // load pay#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | pay#0 pay: PaymentTransaction File "abi_routing/contract.py", line 95 + gtxns Receiver // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {gtxns} pay.receiver File "abi_routing/contract.py", line 99 + global CurrentApplicationAddress // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | tmp%5#0,{global} Global.current_application_address() File "abi_routing/contract.py", line 99 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} pay.receiver == Global.current_application_address(), "is payment to app" File "abi_routing/contract.py", line 99 + assert // is payment to app // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert pay.receiver == Global.current_application_address(), "is payment to app" File "abi_routing/contract.py", line 99 + frame_dig -1 // load another_int#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | another_int#0 another_int: arc4.UInt64 File "abi_routing/contract.py", line 95 + btoi // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {btoi} another_int.decode() File "abi_routing/contract.py", line 100 + int 2 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | tmp%8#0,2 2 File "abi_routing/contract.py", line 100 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} another_int.decode() == 2, "is correct int" File "abi_routing/contract.py", line 100 + assert // is correct int // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert another_int.decode() == 2, "is correct int" File "abi_routing/contract.py", line 100 + retsub // + + +// examples.abi_routing.contract.Reference.compare_assets(asset_a#0: uint64, asset_b#0: uint64) -> void: +compare_assets: + proto 2 0 // (𝕡) asset_a#0,asset_b#0 | def compare_assets(self, asset_a: Asset, asset_b: Asset) -> None: File "abi_routing/contract.py", line 103 + +compare_assets_block@0: + frame_dig -2 // load asset_a#0 from parameters (𝕡) asset_a#0,asset_b#0 | asset_a#0 asset_a: Asset File "abi_routing/contract.py", line 103 + frame_dig -1 // load asset_b#0 from parameters (𝕡) asset_a#0,asset_b#0 | asset_a#0,asset_b#0 asset_b: Asset File "abi_routing/contract.py", line 103 + == // (𝕡) asset_a#0,asset_b#0 | {==} asset_a == asset_b, "asset a == b" File "abi_routing/contract.py", line 104 + assert // asset a == b // (𝕡) asset_a#0,asset_b#0 | assert asset_a == asset_b, "asset a == b" File "abi_routing/contract.py", line 104 + retsub // + + +// examples.abi_routing.contract.Reference.get_address() -> bytes: +get_address: + proto 0 1 // def get_address(self) -> arc4.Address: File "abi_routing/contract.py", line 107 + +get_address_block@0: + global ZeroAddress // {global} Global.zero_address() File "abi_routing/contract.py", line 108 + retsub // tmp%0#0 return arc4.Address.from_bytes(Global.zero_address().bytes) File "abi_routing/contract.py", line 108 + + +// examples.abi_routing.contract.Reference.get_asset() -> bytes: +get_asset: + proto 0 1 // def get_asset(self) -> arc4.UInt64: File "abi_routing/contract.py", line 111 + +get_asset_block@0: + byte 0x00000000000001c8 // 0x00000000000001c8 456 File "abi_routing/contract.py", line 112 + retsub // 0x00000000000001c8 return arc4.UInt64(456) File "abi_routing/contract.py", line 112 + + +// examples.abi_routing.contract.Reference.get_app() -> bytes: +get_app: + proto 0 1 // def get_app(self) -> arc4.UInt64: File "abi_routing/contract.py", line 115 + +get_app_block@0: + byte 0x00000000000001c8 // 0x00000000000001c8 456 File "abi_routing/contract.py", line 116 + retsub // 0x00000000000001c8 return arc4.UInt64(456) File "abi_routing/contract.py", line 116 + + +// examples.abi_routing.contract.Reference.get_a_int() -> bytes: +get_a_int: + proto 0 1 // def get_a_int(self) -> arc4.UInt64: File "abi_routing/contract.py", line 119 + +get_a_int_block@0: + byte 0x0000000000000003 // 0x0000000000000003 3 File "abi_routing/contract.py", line 120 + retsub // 0x0000000000000003 return arc4.UInt64(3) File "abi_routing/contract.py", line 120 + + +// examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage#0: uint64, asset_from_function#0: uint64, account_from_storage#0: bytes, account_from_function#0: bytes, application_from_storage#0: uint64, application_from_function#0: uint64, bytes_from_storage#0: bytes, int_from_storage#0: bytes, int_from_function#0: bytes) -> void: +method_with_default_args: + proto 9 0 // (𝕡) 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 | def method_with_default_args( File "abi_routing/contract.py", line 135 + +method_with_default_args_block@0: + frame_dig -9 // load asset_from_storage#0 from parameters (𝕡) 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 | asset_from_storage#0 asset_from_storage: Asset File "abi_routing/contract.py", line 137 + int 123 // (𝕡) 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 | asset_from_storage#0,123 123 File "abi_routing/contract.py", line 147 + == // (𝕡) 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 | {==} asset_from_storage == Asset(123), "wrong asset from storage" File "abi_routing/contract.py", line 147 + assert // wrong asset from storage // (𝕡) 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 | assert asset_from_storage == Asset(123), "wrong asset from storage" File "abi_routing/contract.py", line 147 + frame_dig -8 // load asset_from_function#0 from parameters (𝕡) 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 | asset_from_function#0 asset_from_function: Asset File "abi_routing/contract.py", line 138 + int 456 // (𝕡) 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 | asset_from_function#0,456 456 File "abi_routing/contract.py", line 148 + == // (𝕡) 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 | {==} asset_from_function == Asset(456), "wrong asset from function" File "abi_routing/contract.py", line 148 + assert // wrong asset from function // (𝕡) 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 | assert asset_from_function == Asset(456), "wrong asset from function" File "abi_routing/contract.py", line 148 + global CreatorAddress // (𝕡) 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 | {global} Global.creator_address() File "abi_routing/contract.py", line 149 + frame_dig -7 // load account_from_storage#0 from parameters (𝕡) 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%2#0,account_from_storage#0 account_from_storage: Account File "abi_routing/contract.py", line 139 + == // (𝕡) 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 | {==} account_from_storage == Global.creator_address(), "wrong account from storage" File "abi_routing/contract.py", line 149 + assert // wrong account from storage // (𝕡) 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 | assert account_from_storage == Global.creator_address(), "wrong account from storage" File "abi_routing/contract.py", line 149 + global ZeroAddress // (𝕡) 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 | {global} Global.zero_address() File "abi_routing/contract.py", line 150 + frame_dig -6 // load account_from_function#0 from parameters (𝕡) 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%4#0,account_from_function#0 account_from_function: Account File "abi_routing/contract.py", line 140 + == // (𝕡) 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 | {==} account_from_function == Global.zero_address(), "wrong account from function" File "abi_routing/contract.py", line 150 + assert // wrong account from function // (𝕡) 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 | assert account_from_function == Global.zero_address(), "wrong account from function" File "abi_routing/contract.py", line 150 + frame_dig -5 // load application_from_storage#0 from parameters (𝕡) 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 | application_from_storage#0 application_from_storage: Application File "abi_routing/contract.py", line 141 + int 123 // (𝕡) 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 | application_from_storage#0,123 123 File "abi_routing/contract.py", line 151 + == // (𝕡) 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 | {==} application_from_storage == Application(123), "wrong application from storage" File "abi_routing/contract.py", line 151 + assert // wrong application from storage // (𝕡) 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 | assert application_from_storage == Application(123), "wrong application from storage" File "abi_routing/contract.py", line 151 + frame_dig -4 // load application_from_function#0 from parameters (𝕡) 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 | application_from_function#0 application_from_function: Application File "abi_routing/contract.py", line 142 + int 456 // (𝕡) 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 | application_from_function#0,456 456 File "abi_routing/contract.py", line 152 + == // (𝕡) 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 | {==} application_from_function == Application(456), "wrong application from function" File "abi_routing/contract.py", line 152 + assert // wrong application from function // (𝕡) 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 | assert application_from_function == Application(456), "wrong application from function" File "abi_routing/contract.py", line 152 + frame_dig -3 // load bytes_from_storage#0 from parameters (𝕡) 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 | bytes_from_storage#0 bytes_from_storage: Bytes3 File "abi_routing/contract.py", line 143 + int 0 // (𝕡) 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 | bytes_from_storage#0,0 0 File "abi_routing/contract.py", line 153 + int 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 | bytes_from_storage#0,0,1 bytes_from_storage[0] File "abi_routing/contract.py", line 153 + extract3 // (𝕡) 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 | {extract3} bytes_from_storage[0] File "abi_routing/contract.py", line 153 + 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 File "abi_routing/contract.py", line 153 + == // (𝕡) 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 | {==} bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" File "abi_routing/contract.py", line 153 + assert // wrong 0th byte from storage // (𝕡) 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 | assert bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" File "abi_routing/contract.py", line 153 + frame_dig -3 // load bytes_from_storage#0 from parameters (𝕡) 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 | bytes_from_storage#0 bytes_from_storage: Bytes3 File "abi_routing/contract.py", line 143 + int 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 | bytes_from_storage#0,1 bytes_from_storage[1] File "abi_routing/contract.py", line 154 + int 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 | bytes_from_storage#0,1,1 bytes_from_storage[1] File "abi_routing/contract.py", line 154 + extract3 // (𝕡) 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 | {extract3} bytes_from_storage[1] File "abi_routing/contract.py", line 154 + 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 File "abi_routing/contract.py", line 154 + == // (𝕡) 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 | {==} bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" File "abi_routing/contract.py", line 154 + assert // wrong 1st byte from storage // (𝕡) 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 | assert bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" File "abi_routing/contract.py", line 154 + frame_dig -3 // load bytes_from_storage#0 from parameters (𝕡) 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 | bytes_from_storage#0 bytes_from_storage: Bytes3 File "abi_routing/contract.py", line 143 + int 2 // (𝕡) 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 | bytes_from_storage#0,2 2 File "abi_routing/contract.py", line 155 + int 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 | bytes_from_storage#0,2,1 bytes_from_storage[2] File "abi_routing/contract.py", line 155 + extract3 // (𝕡) 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 | {extract3} bytes_from_storage[2] File "abi_routing/contract.py", line 155 + 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 File "abi_routing/contract.py", line 155 + == // (𝕡) 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 | {==} bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" File "abi_routing/contract.py", line 155 + assert // wrong 2nd byte from storage // (𝕡) 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 | assert bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" File "abi_routing/contract.py", line 155 + frame_dig -2 // load int_from_storage#0 from parameters (𝕡) 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 | int_from_storage#0 int_from_storage: arc4.UInt64 File "abi_routing/contract.py", line 144 + btoi // (𝕡) 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 | {btoi} int_from_storage.decode() File "abi_routing/contract.py", line 156 + int 2 // (𝕡) 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%17#0,2 2 File "abi_routing/contract.py", line 156 + == // (𝕡) 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 | {==} int_from_storage.decode() == 2, "wrong int from storage" File "abi_routing/contract.py", line 156 + assert // wrong int from storage // (𝕡) 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 | assert int_from_storage.decode() == 2, "wrong int from storage" File "abi_routing/contract.py", line 156 + frame_dig -1 // load int_from_function#0 from parameters (𝕡) 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 | int_from_function#0 int_from_function: arc4.UInt64 File "abi_routing/contract.py", line 145 + btoi // (𝕡) 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 | {btoi} int_from_function.decode() File "abi_routing/contract.py", line 157 + int 3 // (𝕡) 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%19#0,3 3 File "abi_routing/contract.py", line 157 + == // (𝕡) 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 | {==} int_from_function.decode() == 3, "wrong int from function" File "abi_routing/contract.py", line 157 + assert // wrong int from function // (𝕡) 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 | assert int_from_function.decode() == 3, "wrong int from function" File "abi_routing/contract.py", line 157 + retsub // + + +// examples.abi_routing.contract.Reference.bare_abi_config() -> void: +bare_abi_config: + proto 0 0 // def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + +bare_abi_config_block@0: + byte "Hello World" // "Hello World" b"Hello World" File "abi_routing/contract.py", line 74 + log // log(b"Hello World") File "abi_routing/contract.py", line 74 + retsub // + + +// examples.abi_routing.contract.Reference.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "abi_routing/contract.py", line 22 + +__init___block@0: + byte "asa" // "asa" self.asa File "abi_routing/contract.py", line 23 + int 123 // "asa",123 123 File "abi_routing/contract.py", line 23 + app_global_put // self.asa = Asset(123) File "abi_routing/contract.py", line 23 + byte "an_int" // "an_int" self.an_int File "abi_routing/contract.py", line 24 + int 2 // "an_int",2 2 File "abi_routing/contract.py", line 24 + app_global_put // self.an_int = UInt64(2) File "abi_routing/contract.py", line 24 + byte "some_bytes" // "some_bytes" self.some_bytes File "abi_routing/contract.py", line 25 + byte 0x070809 // "some_bytes",0x070809 Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + app_global_put // self.some_bytes = Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + txn Sender // {txn} Transaction.sender() File "abi_routing/contract.py", line 26 + byte "creator" // new_state_value%1#0,"creator" self.creator File "abi_routing/contract.py", line 26 + swap // load new_state_value%1#0 from l-stack (no copy) "creator",new_state_value%1#0 Transaction.sender() File "abi_routing/contract.py", line 26 + app_global_put // self.creator = Transaction.sender() File "abi_routing/contract.py", line 26 + byte "app" // "app" self.app File "abi_routing/contract.py", line 27 + int 123 // "app",123 123 File "abi_routing/contract.py", line 27 + app_global_put // self.app = Application(123) File "abi_routing/contract.py", line 27 + retsub // + diff --git a/examples/abi_routing/out/contract.approval.teal b/examples/abi_routing/out/contract.approval.teal new file mode 100644 index 0000000000..2d584c0a47 --- /dev/null +++ b/examples/abi_routing/out/contract.approval.teal @@ -0,0 +1,481 @@ +#pragma version 8 + +// examples.abi_routing.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_bare_routing@17 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "noop_with_uint64(uint64)uint8" + method "all_the_things(uint64)uint8" + method "mixed_oca(uint64)uint8" + method "opt_into_asset(asset)void" + method "with_transactions(asset,uint64,pay,uint64)void" + method "compare_assets(asset,asset)void" + method "get_address()address" + method "get_asset()uint64" + method "get_application()uint64" + method "get_an_int()uint64" + method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" + uncover 11 + match main_noop_with_uint64_route@4 main_all_the_things_route@5 main_mixed_oca_route@6 main_opt_into_asset_route@7 main_with_transactions_route@8 main_compare_assets_route@9 main_get_address_route@10 main_get_asset_route@11 main_get_application_route@12 main_get_an_int_route@13 main_method_with_default_args_route@14 + b main_switch_case_default@15 + +main_noop_with_uint64_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub noop_with_uint64 + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_all_the_things_route@5: + txna ApplicationArgs 1 + callsub full_abi_config + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_mixed_oca_route@6: + txn OnCompletion + int 1 + swap + shl + int 37 + & + assert // OnCompletion is one of NoOp, CloseOut, DeleteApplication + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub mixed_oca + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_opt_into_asset_route@7: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + callsub opt_into_asset + int 1 + return + +main_with_transactions_route@8: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + txna ApplicationArgs 3 + callsub with_transactions + int 1 + return + +main_compare_assets_route@9: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + callsub compare_assets + int 1 + return + +main_get_address_route@10: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_address + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_get_asset_route@11: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_asset + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_get_application_route@12: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_app + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_get_an_int_route@13: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_a_int + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_method_with_default_args_route@14: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + txna ApplicationArgs 3 + btoi + txnas Accounts + txna ApplicationArgs 4 + btoi + txnas Accounts + txna ApplicationArgs 5 + btoi + txnas Applications + txna ApplicationArgs 6 + btoi + txnas Applications + txna ApplicationArgs 7 + txna ApplicationArgs 8 + txna ApplicationArgs 9 + callsub method_with_default_args + int 1 + return + +main_switch_case_default@15: + err // reject transaction + +main_bare_routing@17: + txn OnCompletion + switch main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 main_reject_bare_on_completion@19 main_bare_abi_config@18 main_bare_abi_config@18 + b main_reject_bare_on_completion@19 + +main_bare_abi_config@18: + txn ApplicationID + ! + assert // is creating + callsub bare_abi_config + int 1 + return + +main_reject_bare_on_completion@19: + err // reject transaction + + +// examples.abi_routing.contract.Reference.noop_with_uint64(a#0: bytes) -> bytes: +noop_with_uint64: + proto 1 1 + +noop_with_uint64_block@0: + frame_dig -1 + btoi + int 1 + + + itob + extract 7 1 + retsub + + +// examples.abi_routing.contract.Reference.full_abi_config(a#0: bytes) -> bytes: +full_abi_config: + proto 1 1 + +full_abi_config_block@0: + frame_dig -1 + btoi + int 1 + + + itob + extract 7 1 + retsub + + +// examples.abi_routing.contract.Reference.mixed_oca(a#0: bytes) -> bytes: +mixed_oca: + proto 1 1 + +mixed_oca_block@0: + frame_dig -1 + btoi + int 1 + + + itob + extract 7 1 + retsub + + +// examples.abi_routing.contract.Reference.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 + +opt_into_asset_block@0: + txn Sender + global CreatorAddress + == + assert // Only creator can opt in to ASA + int 0 + byte "asa" + app_global_get_ex + assert // check value exists + ! + assert // ASA already opted in + byte "asa" + frame_dig -1 + app_global_put + itxn_begin + int axfer + itxn_field TypeEnum + int 0 + itxn_field Fee + global CurrentApplicationAddress + itxn_field AssetReceiver + frame_dig -1 + itxn_field XferAsset + itxn_submit + retsub + + +// examples.abi_routing.contract.Reference.with_transactions(asset#0: uint64, an_int#0: bytes, pay#0: uint64, another_int#0: bytes) -> void: +with_transactions: + proto 4 0 + +with_transactions_block@0: + int 0 + byte "asa" + app_global_get_ex + assert // check value exists + frame_dig -4 + == + assert // is correct asset + frame_dig -3 + btoi + int 1 + == + assert // is correct int + frame_dig -2 + gtxns Receiver + global CurrentApplicationAddress + == + assert // is payment to app + frame_dig -1 + btoi + int 2 + == + assert // is correct int + retsub + + +// examples.abi_routing.contract.Reference.compare_assets(asset_a#0: uint64, asset_b#0: uint64) -> void: +compare_assets: + proto 2 0 + +compare_assets_block@0: + frame_dig -2 + frame_dig -1 + == + assert // asset a == b + retsub + + +// examples.abi_routing.contract.Reference.get_address() -> bytes: +get_address: + proto 0 1 + +get_address_block@0: + global ZeroAddress + retsub + + +// examples.abi_routing.contract.Reference.get_asset() -> bytes: +get_asset: + proto 0 1 + +get_asset_block@0: + byte 0x00000000000001c8 + retsub + + +// examples.abi_routing.contract.Reference.get_app() -> bytes: +get_app: + proto 0 1 + +get_app_block@0: + byte 0x00000000000001c8 + retsub + + +// examples.abi_routing.contract.Reference.get_a_int() -> bytes: +get_a_int: + proto 0 1 + +get_a_int_block@0: + byte 0x0000000000000003 + retsub + + +// examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage#0: uint64, asset_from_function#0: uint64, account_from_storage#0: bytes, account_from_function#0: bytes, application_from_storage#0: uint64, application_from_function#0: uint64, bytes_from_storage#0: bytes, int_from_storage#0: bytes, int_from_function#0: bytes) -> void: +method_with_default_args: + proto 9 0 + +method_with_default_args_block@0: + frame_dig -9 + int 123 + == + assert // wrong asset from storage + frame_dig -8 + int 456 + == + assert // wrong asset from function + global CreatorAddress + frame_dig -7 + == + assert // wrong account from storage + global ZeroAddress + frame_dig -6 + == + assert // wrong account from function + frame_dig -5 + int 123 + == + assert // wrong application from storage + frame_dig -4 + int 456 + == + assert // wrong application from function + frame_dig -3 + int 0 + int 1 + extract3 + byte 0x07 + == + assert // wrong 0th byte from storage + frame_dig -3 + int 1 + int 1 + extract3 + byte 0x08 + == + assert // wrong 1st byte from storage + frame_dig -3 + int 2 + int 1 + extract3 + byte 0x09 + == + assert // wrong 2nd byte from storage + frame_dig -2 + btoi + int 2 + == + assert // wrong int from storage + frame_dig -1 + btoi + int 3 + == + assert // wrong int from function + retsub + + +// examples.abi_routing.contract.Reference.bare_abi_config() -> void: +bare_abi_config: + proto 0 0 + +bare_abi_config_block@0: + byte "Hello World" + log + retsub + + +// examples.abi_routing.contract.Reference.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "asa" + int 123 + app_global_put + byte "an_int" + int 2 + app_global_put + byte "some_bytes" + byte 0x070809 + app_global_put + txn Sender + byte "creator" + swap + app_global_put + byte "app" + int 123 + app_global_put + retsub + diff --git a/examples/abi_routing/out/contract.approval_unoptimized.debug.teal b/examples/abi_routing/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..21f01ace5f --- /dev/null +++ b/examples/abi_routing/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,523 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.abi_routing.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + bz main_bare_routing@17 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + // Implicit fall through to main_abi_routing@3 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + method "noop_with_uint64(uint64)uint8" // tmp%2#0,method<"noop_with_uint64(uint64)uint8"> arc4.abimethod File "abi_routing/contract.py", line 29 + method "all_the_things(uint64)uint8" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8"> arc4.abimethod( File "abi_routing/contract.py", line 34 + method "mixed_oca(uint64)uint8" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8"> arc4.abimethod( File "abi_routing/contract.py", line 50 + method "opt_into_asset(asset)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void"> arc4.abimethod File "abi_routing/contract.py", line 76 + method "with_transactions(asset,uint64,pay,uint64)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void"> arc4.abimethod File "abi_routing/contract.py", line 93 + method "compare_assets(asset,asset)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void"> arc4.abimethod File "abi_routing/contract.py", line 102 + method "get_address()address" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address"> arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + method "get_asset()uint64" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64"> arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + method "get_application()uint64" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64"> arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + method "get_an_int()uint64" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64">,method<"get_an_int()uint64"> arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" // tmp%2#0,method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64">,method<"get_an_int()uint64">,method<"method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void"> arc4.abimethod( File "abi_routing/contract.py", line 122 + uncover 11 // load tmp%2#0 from l-stack (no copy) method<"noop_with_uint64(uint64)uint8">,method<"all_the_things(uint64)uint8">,method<"mixed_oca(uint64)uint8">,method<"opt_into_asset(asset)void">,method<"with_transactions(asset,uint64,pay,uint64)void">,method<"compare_assets(asset,asset)void">,method<"get_address()address">,method<"get_asset()uint64">,method<"get_application()uint64">,method<"get_an_int()uint64">,method<"method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void">,tmp%2#0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + match main_noop_with_uint64_route@4 main_all_the_things_route@5 main_mixed_oca_route@6 main_opt_into_asset_route@7 main_with_transactions_route@8 main_compare_assets_route@9 main_get_address_route@10 main_get_asset_route@11 main_get_application_route@12 main_get_an_int_route@13 main_method_with_default_args_route@14 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + b main_switch_case_default@15 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_noop_with_uint64_route@4: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 29 + int NoOp // tmp%3#0,NoOp arc4.abimethod File "abi_routing/contract.py", line 29 + == // {==} arc4.abimethod File "abi_routing/contract.py", line 29 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 29 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 29 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 29 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub noop_with_uint64 // {noop_with_uint64} arc4.abimethod File "abi_routing/contract.py", line 29 + byte 0x151f7c75 // tmp%7#0,0x151f7c75 arc4.abimethod File "abi_routing/contract.py", line 29 + swap // load tmp%7#0 from l-stack (no copy) 0x151f7c75,tmp%7#0 arc4.abimethod File "abi_routing/contract.py", line 29 + concat // {concat} arc4.abimethod File "abi_routing/contract.py", line 29 + log // arc4.abimethod File "abi_routing/contract.py", line 29 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 29 + return // arc4.abimethod File "abi_routing/contract.py", line 29 + +main_all_the_things_route@5: + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub full_abi_config // {full_abi_config} arc4.abimethod( File "abi_routing/contract.py", line 34 + byte 0x151f7c75 // tmp%10#0,0x151f7c75 arc4.abimethod( File "abi_routing/contract.py", line 34 + swap // load tmp%10#0 from l-stack (no copy) 0x151f7c75,tmp%10#0 arc4.abimethod( File "abi_routing/contract.py", line 34 + concat // {concat} arc4.abimethod( File "abi_routing/contract.py", line 34 + log // arc4.abimethod( File "abi_routing/contract.py", line 34 + int 1 // 1 arc4.abimethod( File "abi_routing/contract.py", line 34 + return // arc4.abimethod( File "abi_routing/contract.py", line 34 + +main_mixed_oca_route@6: + txn OnCompletion // {txn} arc4.abimethod( File "abi_routing/contract.py", line 50 + int 1 // tmp%12#0,1 arc4.abimethod( File "abi_routing/contract.py", line 50 + swap // load tmp%12#0 from l-stack (no copy) 1,tmp%12#0 arc4.abimethod( File "abi_routing/contract.py", line 50 + shl // {shl} arc4.abimethod( File "abi_routing/contract.py", line 50 + int 37 // tmp%13#0,37 arc4.abimethod( File "abi_routing/contract.py", line 50 + & // {&} arc4.abimethod( File "abi_routing/contract.py", line 50 + assert // OnCompletion is one of NoOp, CloseOut, DeleteApplication // arc4.abimethod( File "abi_routing/contract.py", line 50 + txn ApplicationID // {txn} arc4.abimethod( File "abi_routing/contract.py", line 50 + assert // is not creating // arc4.abimethod( File "abi_routing/contract.py", line 50 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub mixed_oca // {mixed_oca} arc4.abimethod( File "abi_routing/contract.py", line 50 + byte 0x151f7c75 // tmp%17#0,0x151f7c75 arc4.abimethod( File "abi_routing/contract.py", line 50 + swap // load tmp%17#0 from l-stack (no copy) 0x151f7c75,tmp%17#0 arc4.abimethod( File "abi_routing/contract.py", line 50 + concat // {concat} arc4.abimethod( File "abi_routing/contract.py", line 50 + log // arc4.abimethod( File "abi_routing/contract.py", line 50 + int 1 // 1 arc4.abimethod( File "abi_routing/contract.py", line 50 + return // arc4.abimethod( File "abi_routing/contract.py", line 50 + +main_opt_into_asset_route@7: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 76 + int NoOp // tmp%19#0,NoOp arc4.abimethod File "abi_routing/contract.py", line 76 + == // {==} arc4.abimethod File "abi_routing/contract.py", line 76 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 76 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 76 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 76 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub opt_into_asset // arc4.abimethod File "abi_routing/contract.py", line 76 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 76 + return // arc4.abimethod File "abi_routing/contract.py", line 76 + +main_with_transactions_route@8: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 93 + int NoOp // tmp%25#0,NoOp arc4.abimethod File "abi_routing/contract.py", line 93 + == // {==} arc4.abimethod File "abi_routing/contract.py", line 93 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 93 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 93 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 93 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 2 // tmp%30#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txn GroupIndex // tmp%30#0,tmp%31#0,{txn} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int 1 // tmp%30#0,tmp%31#0,tmp%34#0,1 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + - // tmp%30#0,tmp%31#0,{-} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + dup // load awst_tmp%35#0 from l-stack (copy) tmp%30#0,tmp%31#0,awst_tmp%35#0,awst_tmp%35#0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + gtxns TypeEnum // tmp%30#0,tmp%31#0,awst_tmp%35#0,{gtxns} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int pay // tmp%30#0,tmp%31#0,awst_tmp%35#0,tmp%36#0,pay class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + == // tmp%30#0,tmp%31#0,awst_tmp%35#0,{==} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + assert // transaction type is pay // tmp%30#0,tmp%31#0,maybe_value%32#0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 3 // tmp%30#0,tmp%31#0,maybe_value%32#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub with_transactions // arc4.abimethod File "abi_routing/contract.py", line 93 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 93 + return // arc4.abimethod File "abi_routing/contract.py", line 93 + +main_compare_assets_route@9: + txn OnCompletion // {txn} arc4.abimethod File "abi_routing/contract.py", line 102 + int NoOp // tmp%39#0,NoOp arc4.abimethod File "abi_routing/contract.py", line 102 + == // {==} arc4.abimethod File "abi_routing/contract.py", line 102 + assert // OnCompletion is NoOp // arc4.abimethod File "abi_routing/contract.py", line 102 + txn ApplicationID // {txn} arc4.abimethod File "abi_routing/contract.py", line 102 + assert // is not creating // arc4.abimethod File "abi_routing/contract.py", line 102 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 2 // tmp%44#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%44#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // tmp%44#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub compare_assets // arc4.abimethod File "abi_routing/contract.py", line 102 + int 1 // 1 arc4.abimethod File "abi_routing/contract.py", line 102 + return // arc4.abimethod File "abi_routing/contract.py", line 102 + +main_get_address_route@10: + txn OnCompletion // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + int NoOp // tmp%48#0,NoOp arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + == // {==} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + txn ApplicationID // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + assert // is not creating // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + callsub get_address // {get_address} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + byte 0x151f7c75 // tmp%51#0,0x151f7c75 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + swap // load tmp%51#0 from l-stack (no copy) 0x151f7c75,tmp%51#0 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + concat // {concat} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + log // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + int 1 // 1 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + return // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 106 + +main_get_asset_route@11: + txn OnCompletion // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + int NoOp // tmp%53#0,NoOp arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + == // {==} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + txn ApplicationID // {txn} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + assert // is not creating // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + callsub get_asset // {get_asset} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + byte 0x151f7c75 // tmp%56#0,0x151f7c75 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + swap // load tmp%56#0 from l-stack (no copy) 0x151f7c75,tmp%56#0 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + concat // {concat} arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + log // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + int 1 // 1 arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + return // arc4.abimethod(readonly=True) File "abi_routing/contract.py", line 110 + +main_get_application_route@12: + txn OnCompletion // {txn} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + int NoOp // tmp%58#0,NoOp arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + == // {==} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + txn ApplicationID // {txn} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + assert // is not creating // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + callsub get_app // {get_app} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + byte 0x151f7c75 // tmp%61#0,0x151f7c75 arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + swap // load tmp%61#0 from l-stack (no copy) 0x151f7c75,tmp%61#0 arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + concat // {concat} arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + log // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + int 1 // 1 arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + return // arc4.abimethod(readonly=True, name="get_application") File "abi_routing/contract.py", line 114 + +main_get_an_int_route@13: + txn OnCompletion // {txn} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + int NoOp // tmp%63#0,NoOp arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + == // {==} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + txn ApplicationID // {txn} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + assert // is not creating // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + callsub get_a_int // {get_a_int} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + byte 0x151f7c75 // tmp%66#0,0x151f7c75 arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + swap // load tmp%66#0 from l-stack (no copy) 0x151f7c75,tmp%66#0 arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + concat // {concat} arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + log // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + int 1 // 1 arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + return // arc4.abimethod(readonly=True, name="get_an_int") File "abi_routing/contract.py", line 118 + +main_method_with_default_args_route@14: + txn OnCompletion // {txn} arc4.abimethod( File "abi_routing/contract.py", line 122 + int NoOp // tmp%68#0,NoOp arc4.abimethod( File "abi_routing/contract.py", line 122 + == // {==} arc4.abimethod( File "abi_routing/contract.py", line 122 + assert // OnCompletion is NoOp // arc4.abimethod( File "abi_routing/contract.py", line 122 + txn ApplicationID // {txn} arc4.abimethod( File "abi_routing/contract.py", line 122 + assert // is not creating // arc4.abimethod( File "abi_routing/contract.py", line 122 + txna ApplicationArgs 1 // {txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // {btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // {txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 2 // tmp%73#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Assets // tmp%73#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 3 // tmp%73#0,tmp%76#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Accounts // tmp%73#0,tmp%76#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 4 // tmp%73#0,tmp%76#0,tmp%79#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,tmp%79#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Accounts // tmp%73#0,tmp%76#0,tmp%79#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 5 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Applications // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 6 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + btoi // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,{btoi} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txnas Applications // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,{txnas} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 7 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,tmp%88#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 8 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,tmp%88#0,tmp%89#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + txna ApplicationArgs 9 // tmp%73#0,tmp%76#0,tmp%79#0,tmp%82#0,tmp%85#0,tmp%88#0,tmp%89#0,tmp%90#0,{txna} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + callsub method_with_default_args // arc4.abimethod( File "abi_routing/contract.py", line 122 + int 1 // 1 arc4.abimethod( File "abi_routing/contract.py", line 122 + return // arc4.abimethod( File "abi_routing/contract.py", line 122 + +main_switch_case_default@15: + // Implicit fall through to main_switch_case_next@16 // + +main_switch_case_next@16: + b main_after_if_else@20 // + +main_bare_routing@17: + txn OnCompletion // {txn} class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int 0 // tmp%92#0,0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int 1 // tmp%92#0,0,1 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int 2 // tmp%92#0,0,1,2 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int 4 // tmp%92#0,0,1,2,4 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + int 5 // tmp%92#0,0,1,2,4,5 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + uncover 5 // load tmp%92#0 from l-stack (no copy) 0,1,2,4,5,tmp%92#0 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + match main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + b main_reject_bare_on_completion@19 // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_bare_abi_config@18: + txn ApplicationID // {txn} arc4.baremethod( File "abi_routing/contract.py", line 63 + ! // {!} arc4.baremethod( File "abi_routing/contract.py", line 63 + assert // is creating // arc4.baremethod( File "abi_routing/contract.py", line 63 + callsub bare_abi_config // def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + int 1 // 1 def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + return // def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + +main_reject_bare_on_completion@19: + err // reject transaction // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + +main_after_if_else@20: + err // reject transaction // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + + +// examples.abi_routing.contract.Reference.noop_with_uint64(a#0: bytes) -> bytes: +noop_with_uint64: + proto 1 1 // (𝕡) a#0 | def noop_with_uint64(self, a: arc4.UInt64) -> arc4.UInt8: File "abi_routing/contract.py", line 30 + +noop_with_uint64_block@0: + frame_dig -1 // load a#0 from parameters (𝕡) a#0 | a#0 a: arc4.UInt64 File "abi_routing/contract.py", line 30 + btoi // (𝕡) a#0 | {btoi} a.decode() File "abi_routing/contract.py", line 31 + int 1 // (𝕡) a#0 | tmp%0#0,1 1 File "abi_routing/contract.py", line 31 + + // (𝕡) a#0 | {+} 1 + a.decode() File "abi_routing/contract.py", line 31 + itob // (𝕡) a#0 | {itob} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 32 + extract 7 1 // (𝕡) a#0 | {extract} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 32 + retsub // tmp%2#0 return arc4.UInt8.encode(result) File "abi_routing/contract.py", line 32 + + +// examples.abi_routing.contract.Reference.full_abi_config(a#0: bytes) -> bytes: +full_abi_config: + proto 1 1 // (𝕡) a#0 | def full_abi_config(self, a: arc4.UInt64) -> arc4.UInt8: File "abi_routing/contract.py", line 46 + +full_abi_config_block@0: + frame_dig -1 // load a#0 from parameters (𝕡) a#0 | a#0 a: arc4.UInt64 File "abi_routing/contract.py", line 46 + btoi // (𝕡) a#0 | {btoi} a.decode() File "abi_routing/contract.py", line 47 + int 1 // (𝕡) a#0 | tmp%0#0,1 1 File "abi_routing/contract.py", line 47 + + // (𝕡) a#0 | {+} UInt64(1) + a.decode() File "abi_routing/contract.py", line 47 + itob // (𝕡) a#0 | {itob} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 48 + extract 7 1 // (𝕡) a#0 | {extract} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 48 + retsub // tmp%2#0 return arc4.UInt8.encode(result) File "abi_routing/contract.py", line 48 + + +// examples.abi_routing.contract.Reference.mixed_oca(a#0: bytes) -> bytes: +mixed_oca: + proto 1 1 // (𝕡) a#0 | def mixed_oca(self, a: arc4.UInt64) -> arc4.UInt8: File "abi_routing/contract.py", line 59 + +mixed_oca_block@0: + frame_dig -1 // load a#0 from parameters (𝕡) a#0 | a#0 a: arc4.UInt64 File "abi_routing/contract.py", line 59 + btoi // (𝕡) a#0 | {btoi} a.decode() File "abi_routing/contract.py", line 60 + int 1 // (𝕡) a#0 | tmp%0#0,1 1 File "abi_routing/contract.py", line 60 + + // (𝕡) a#0 | {+} UInt64(1) + a.decode() File "abi_routing/contract.py", line 60 + itob // (𝕡) a#0 | {itob} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 61 + extract 7 1 // (𝕡) a#0 | {extract} arc4.UInt8.encode(result) File "abi_routing/contract.py", line 61 + retsub // tmp%2#0 return arc4.UInt8.encode(result) File "abi_routing/contract.py", line 61 + + +// examples.abi_routing.contract.Reference.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "abi_routing/contract.py", line 77 + +opt_into_asset_block@0: + txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "abi_routing/contract.py", line 79 + global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "abi_routing/contract.py", line 79 + == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "abi_routing/contract.py", line 79 + assert // Only creator can opt in to ASA // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "abi_routing/contract.py", line 79 + int 0 // (𝕡) asset#0 | 0 self.asa File "abi_routing/contract.py", line 81 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "abi_routing/contract.py", line 81 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "abi_routing/contract.py", line 81 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "abi_routing/contract.py", line 81 + ! // (𝕡) asset#0 | {!} not self.asa File "abi_routing/contract.py", line 81 + assert // ASA already opted in // (𝕡) asset#0 | assert not self.asa, "ASA already opted in" File "abi_routing/contract.py", line 81 + byte "asa" // (𝕡) asset#0 | "asa" self.asa File "abi_routing/contract.py", line 83 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "abi_routing/contract.py", line 77 + app_global_put // (𝕡) asset#0 | self.asa = asset File "abi_routing/contract.py", line 83 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "abi_routing/contract.py", line 86 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "abi_routing/contract.py", line 87 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "abi_routing/contract.py", line 87 + int 0 // (𝕡) asset#0 | 0 0 File "abi_routing/contract.py", line 88 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "abi_routing/contract.py", line 88 + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "abi_routing/contract.py", line 89 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "abi_routing/contract.py", line 89 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "abi_routing/contract.py", line 77 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "abi_routing/contract.py", line 90 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "abi_routing/contract.py", line 91 + retsub // + + +// examples.abi_routing.contract.Reference.with_transactions(asset#0: uint64, an_int#0: bytes, pay#0: uint64, another_int#0: bytes) -> void: +with_transactions: + proto 4 0 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | def with_transactions( File "abi_routing/contract.py", line 94 + +with_transactions_block@0: + int 0 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | 0 self.asa File "abi_routing/contract.py", line 97 + byte "asa" // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | 0,"asa" self.asa File "abi_routing/contract.py", line 97 + app_global_get_ex // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "abi_routing/contract.py", line 97 + assert // check value exists // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | app_global_get_ex_value%0#0 self.asa File "abi_routing/contract.py", line 97 + frame_dig -4 // load asset#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | app_global_get_ex_value%0#0,asset#0 asset: Asset File "abi_routing/contract.py", line 95 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} self.asa == asset, "is correct asset" File "abi_routing/contract.py", line 97 + assert // is correct asset // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert self.asa == asset, "is correct asset" File "abi_routing/contract.py", line 97 + frame_dig -3 // load an_int#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | an_int#0 an_int: arc4.UInt64 File "abi_routing/contract.py", line 95 + btoi // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {btoi} an_int.decode() File "abi_routing/contract.py", line 98 + int 1 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | tmp%3#0,1 1 File "abi_routing/contract.py", line 98 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} an_int.decode() == 1, "is correct int" File "abi_routing/contract.py", line 98 + assert // is correct int // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert an_int.decode() == 1, "is correct int" File "abi_routing/contract.py", line 98 + frame_dig -2 // load pay#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | pay#0 pay: PaymentTransaction File "abi_routing/contract.py", line 95 + gtxns Receiver // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {gtxns} pay.receiver File "abi_routing/contract.py", line 99 + global CurrentApplicationAddress // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | tmp%5#0,{global} Global.current_application_address() File "abi_routing/contract.py", line 99 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} pay.receiver == Global.current_application_address(), "is payment to app" File "abi_routing/contract.py", line 99 + assert // is payment to app // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert pay.receiver == Global.current_application_address(), "is payment to app" File "abi_routing/contract.py", line 99 + frame_dig -1 // load another_int#0 from parameters (𝕡) asset#0,an_int#0,pay#0,another_int#0 | another_int#0 another_int: arc4.UInt64 File "abi_routing/contract.py", line 95 + btoi // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {btoi} another_int.decode() File "abi_routing/contract.py", line 100 + int 2 // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | tmp%8#0,2 2 File "abi_routing/contract.py", line 100 + == // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | {==} another_int.decode() == 2, "is correct int" File "abi_routing/contract.py", line 100 + assert // is correct int // (𝕡) asset#0,an_int#0,pay#0,another_int#0 | assert another_int.decode() == 2, "is correct int" File "abi_routing/contract.py", line 100 + retsub // + + +// examples.abi_routing.contract.Reference.compare_assets(asset_a#0: uint64, asset_b#0: uint64) -> void: +compare_assets: + proto 2 0 // (𝕡) asset_a#0,asset_b#0 | def compare_assets(self, asset_a: Asset, asset_b: Asset) -> None: File "abi_routing/contract.py", line 103 + +compare_assets_block@0: + frame_dig -2 // load asset_a#0 from parameters (𝕡) asset_a#0,asset_b#0 | asset_a#0 asset_a: Asset File "abi_routing/contract.py", line 103 + frame_dig -1 // load asset_b#0 from parameters (𝕡) asset_a#0,asset_b#0 | asset_a#0,asset_b#0 asset_b: Asset File "abi_routing/contract.py", line 103 + == // (𝕡) asset_a#0,asset_b#0 | {==} asset_a == asset_b, "asset a == b" File "abi_routing/contract.py", line 104 + assert // asset a == b // (𝕡) asset_a#0,asset_b#0 | assert asset_a == asset_b, "asset a == b" File "abi_routing/contract.py", line 104 + retsub // + + +// examples.abi_routing.contract.Reference.get_address() -> bytes: +get_address: + proto 0 1 // def get_address(self) -> arc4.Address: File "abi_routing/contract.py", line 107 + +get_address_block@0: + global ZeroAddress // {global} Global.zero_address() File "abi_routing/contract.py", line 108 + retsub // tmp%0#0 return arc4.Address.from_bytes(Global.zero_address().bytes) File "abi_routing/contract.py", line 108 + + +// examples.abi_routing.contract.Reference.get_asset() -> bytes: +get_asset: + proto 0 1 // def get_asset(self) -> arc4.UInt64: File "abi_routing/contract.py", line 111 + +get_asset_block@0: + byte 0x00000000000001c8 // 0x00000000000001c8 456 File "abi_routing/contract.py", line 112 + retsub // 0x00000000000001c8 return arc4.UInt64(456) File "abi_routing/contract.py", line 112 + + +// examples.abi_routing.contract.Reference.get_app() -> bytes: +get_app: + proto 0 1 // def get_app(self) -> arc4.UInt64: File "abi_routing/contract.py", line 115 + +get_app_block@0: + byte 0x00000000000001c8 // 0x00000000000001c8 456 File "abi_routing/contract.py", line 116 + retsub // 0x00000000000001c8 return arc4.UInt64(456) File "abi_routing/contract.py", line 116 + + +// examples.abi_routing.contract.Reference.get_a_int() -> bytes: +get_a_int: + proto 0 1 // def get_a_int(self) -> arc4.UInt64: File "abi_routing/contract.py", line 119 + +get_a_int_block@0: + byte 0x0000000000000003 // 0x0000000000000003 3 File "abi_routing/contract.py", line 120 + retsub // 0x0000000000000003 return arc4.UInt64(3) File "abi_routing/contract.py", line 120 + + +// examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage#0: uint64, asset_from_function#0: uint64, account_from_storage#0: bytes, account_from_function#0: bytes, application_from_storage#0: uint64, application_from_function#0: uint64, bytes_from_storage#0: bytes, int_from_storage#0: bytes, int_from_function#0: bytes) -> void: +method_with_default_args: + proto 9 0 // (𝕡) 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 | def method_with_default_args( File "abi_routing/contract.py", line 135 + +method_with_default_args_block@0: + frame_dig -9 // load asset_from_storage#0 from parameters (𝕡) 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 | asset_from_storage#0 asset_from_storage: Asset File "abi_routing/contract.py", line 137 + int 123 // (𝕡) 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 | asset_from_storage#0,123 123 File "abi_routing/contract.py", line 147 + == // (𝕡) 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 | {==} asset_from_storage == Asset(123), "wrong asset from storage" File "abi_routing/contract.py", line 147 + assert // wrong asset from storage // (𝕡) 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 | assert asset_from_storage == Asset(123), "wrong asset from storage" File "abi_routing/contract.py", line 147 + frame_dig -8 // load asset_from_function#0 from parameters (𝕡) 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 | asset_from_function#0 asset_from_function: Asset File "abi_routing/contract.py", line 138 + int 456 // (𝕡) 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 | asset_from_function#0,456 456 File "abi_routing/contract.py", line 148 + == // (𝕡) 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 | {==} asset_from_function == Asset(456), "wrong asset from function" File "abi_routing/contract.py", line 148 + assert // wrong asset from function // (𝕡) 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 | assert asset_from_function == Asset(456), "wrong asset from function" File "abi_routing/contract.py", line 148 + global CreatorAddress // (𝕡) 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 | {global} Global.creator_address() File "abi_routing/contract.py", line 149 + frame_dig -7 // load account_from_storage#0 from parameters (𝕡) 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%2#0,account_from_storage#0 account_from_storage: Account File "abi_routing/contract.py", line 139 + == // (𝕡) 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 | {==} account_from_storage == Global.creator_address(), "wrong account from storage" File "abi_routing/contract.py", line 149 + assert // wrong account from storage // (𝕡) 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 | assert account_from_storage == Global.creator_address(), "wrong account from storage" File "abi_routing/contract.py", line 149 + global ZeroAddress // (𝕡) 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 | {global} Global.zero_address() File "abi_routing/contract.py", line 150 + frame_dig -6 // load account_from_function#0 from parameters (𝕡) 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%4#0,account_from_function#0 account_from_function: Account File "abi_routing/contract.py", line 140 + == // (𝕡) 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 | {==} account_from_function == Global.zero_address(), "wrong account from function" File "abi_routing/contract.py", line 150 + assert // wrong account from function // (𝕡) 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 | assert account_from_function == Global.zero_address(), "wrong account from function" File "abi_routing/contract.py", line 150 + frame_dig -5 // load application_from_storage#0 from parameters (𝕡) 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 | application_from_storage#0 application_from_storage: Application File "abi_routing/contract.py", line 141 + int 123 // (𝕡) 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 | application_from_storage#0,123 123 File "abi_routing/contract.py", line 151 + == // (𝕡) 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 | {==} application_from_storage == Application(123), "wrong application from storage" File "abi_routing/contract.py", line 151 + assert // wrong application from storage // (𝕡) 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 | assert application_from_storage == Application(123), "wrong application from storage" File "abi_routing/contract.py", line 151 + frame_dig -4 // load application_from_function#0 from parameters (𝕡) 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 | application_from_function#0 application_from_function: Application File "abi_routing/contract.py", line 142 + int 456 // (𝕡) 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 | application_from_function#0,456 456 File "abi_routing/contract.py", line 152 + == // (𝕡) 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 | {==} application_from_function == Application(456), "wrong application from function" File "abi_routing/contract.py", line 152 + assert // wrong application from function // (𝕡) 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 | assert application_from_function == Application(456), "wrong application from function" File "abi_routing/contract.py", line 152 + int 0 // (𝕡) 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 | 0 0 File "abi_routing/contract.py", line 153 + int 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 | 0,1 bytes_from_storage[0] File "abi_routing/contract.py", line 153 + * // (𝕡) 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 | {*} bytes_from_storage[0] File "abi_routing/contract.py", line 153 + frame_dig -3 // load bytes_from_storage#0 from parameters (𝕡) 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 | item_index%8#0,bytes_from_storage#0 bytes_from_storage: Bytes3 File "abi_routing/contract.py", line 143 + swap // load item_index%8#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 | bytes_from_storage#0,item_index%8#0 bytes_from_storage[0] File "abi_routing/contract.py", line 153 + int 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 | bytes_from_storage#0,item_index%8#0,1 bytes_from_storage[0] File "abi_routing/contract.py", line 153 + extract3 // (𝕡) 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 | {extract3} bytes_from_storage[0] File "abi_routing/contract.py", line 153 + 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 File "abi_routing/contract.py", line 153 + == // (𝕡) 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 | {==} bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" File "abi_routing/contract.py", line 153 + assert // wrong 0th byte from storage // (𝕡) 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 | assert bytes_from_storage[0] == arc4.Byte(7), "wrong 0th byte from storage" File "abi_routing/contract.py", line 153 + int 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 | 1 1 File "abi_routing/contract.py", line 154 + int 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 | 1,1 bytes_from_storage[1] File "abi_routing/contract.py", line 154 + * // (𝕡) 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 | {*} bytes_from_storage[1] File "abi_routing/contract.py", line 154 + frame_dig -3 // load bytes_from_storage#0 from parameters (𝕡) 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 | item_index%11#0,bytes_from_storage#0 bytes_from_storage: Bytes3 File "abi_routing/contract.py", line 143 + swap // load item_index%11#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 | bytes_from_storage#0,item_index%11#0 bytes_from_storage[1] File "abi_routing/contract.py", line 154 + int 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 | bytes_from_storage#0,item_index%11#0,1 bytes_from_storage[1] File "abi_routing/contract.py", line 154 + extract3 // (𝕡) 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 | {extract3} bytes_from_storage[1] File "abi_routing/contract.py", line 154 + 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 File "abi_routing/contract.py", line 154 + == // (𝕡) 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 | {==} bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" File "abi_routing/contract.py", line 154 + assert // wrong 1st byte from storage // (𝕡) 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 | assert bytes_from_storage[1] == arc4.Byte(8), "wrong 1st byte from storage" File "abi_routing/contract.py", line 154 + int 2 // (𝕡) 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 | 2 2 File "abi_routing/contract.py", line 155 + int 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 | 2,1 bytes_from_storage[2] File "abi_routing/contract.py", line 155 + * // (𝕡) 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 | {*} bytes_from_storage[2] File "abi_routing/contract.py", line 155 + frame_dig -3 // load bytes_from_storage#0 from parameters (𝕡) 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 | item_index%14#0,bytes_from_storage#0 bytes_from_storage: Bytes3 File "abi_routing/contract.py", line 143 + swap // load item_index%14#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 | bytes_from_storage#0,item_index%14#0 bytes_from_storage[2] File "abi_routing/contract.py", line 155 + int 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 | bytes_from_storage#0,item_index%14#0,1 bytes_from_storage[2] File "abi_routing/contract.py", line 155 + extract3 // (𝕡) 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 | {extract3} bytes_from_storage[2] File "abi_routing/contract.py", line 155 + 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 File "abi_routing/contract.py", line 155 + == // (𝕡) 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 | {==} bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" File "abi_routing/contract.py", line 155 + assert // wrong 2nd byte from storage // (𝕡) 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 | assert bytes_from_storage[2] == arc4.Byte(9), "wrong 2nd byte from storage" File "abi_routing/contract.py", line 155 + frame_dig -2 // load int_from_storage#0 from parameters (𝕡) 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 | int_from_storage#0 int_from_storage: arc4.UInt64 File "abi_routing/contract.py", line 144 + btoi // (𝕡) 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 | {btoi} int_from_storage.decode() File "abi_routing/contract.py", line 156 + int 2 // (𝕡) 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%17#0,2 2 File "abi_routing/contract.py", line 156 + == // (𝕡) 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 | {==} int_from_storage.decode() == 2, "wrong int from storage" File "abi_routing/contract.py", line 156 + assert // wrong int from storage // (𝕡) 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 | assert int_from_storage.decode() == 2, "wrong int from storage" File "abi_routing/contract.py", line 156 + frame_dig -1 // load int_from_function#0 from parameters (𝕡) 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 | int_from_function#0 int_from_function: arc4.UInt64 File "abi_routing/contract.py", line 145 + btoi // (𝕡) 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 | {btoi} int_from_function.decode() File "abi_routing/contract.py", line 157 + int 3 // (𝕡) 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%19#0,3 3 File "abi_routing/contract.py", line 157 + == // (𝕡) 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 | {==} int_from_function.decode() == 3, "wrong int from function" File "abi_routing/contract.py", line 157 + assert // wrong int from function // (𝕡) 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 | assert int_from_function.decode() == 3, "wrong int from function" File "abi_routing/contract.py", line 157 + retsub // + + +// examples.abi_routing.contract.Reference.bare_abi_config() -> void: +bare_abi_config: + proto 0 0 // def bare_abi_config(self) -> None: File "abi_routing/contract.py", line 73 + +bare_abi_config_block@0: + byte "Hello World" // "Hello World" b"Hello World" File "abi_routing/contract.py", line 74 + log // log(b"Hello World") File "abi_routing/contract.py", line 74 + retsub // + + +// examples.abi_routing.contract.Reference.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "abi_routing/contract.py", line 22 + +__init___block@0: + byte "asa" // "asa" self.asa File "abi_routing/contract.py", line 23 + int 123 // "asa",123 123 File "abi_routing/contract.py", line 23 + app_global_put // self.asa = Asset(123) File "abi_routing/contract.py", line 23 + byte "an_int" // "an_int" self.an_int File "abi_routing/contract.py", line 24 + int 2 // "an_int",2 2 File "abi_routing/contract.py", line 24 + app_global_put // self.an_int = UInt64(2) File "abi_routing/contract.py", line 24 + byte 0x // 0x Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + byte 0x07 // array_data%0#0,0x07 7 File "abi_routing/contract.py", line 25 + concat // {concat} Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + byte 0x08 // array_data%0#0,0x08 8 File "abi_routing/contract.py", line 25 + concat // {concat} Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + byte 0x09 // array_data%0#0,0x09 9 File "abi_routing/contract.py", line 25 + concat // {concat} Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + byte "some_bytes" // array_data%0#0,"some_bytes" self.some_bytes File "abi_routing/contract.py", line 25 + swap // load array_data%0#0 from l-stack (no copy) "some_bytes",array_data%0#0 Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + app_global_put // self.some_bytes = Bytes3(arc4.Byte(7), arc4.Byte(8), arc4.Byte(9)) File "abi_routing/contract.py", line 25 + txn Sender // {txn} Transaction.sender() File "abi_routing/contract.py", line 26 + byte "creator" // new_state_value%1#0,"creator" self.creator File "abi_routing/contract.py", line 26 + swap // load new_state_value%1#0 from l-stack (no copy) "creator",new_state_value%1#0 Transaction.sender() File "abi_routing/contract.py", line 26 + app_global_put // self.creator = Transaction.sender() File "abi_routing/contract.py", line 26 + byte "app" // "app" self.app File "abi_routing/contract.py", line 27 + int 123 // "app",123 123 File "abi_routing/contract.py", line 27 + app_global_put // self.app = Application(123) File "abi_routing/contract.py", line 27 + retsub // + diff --git a/examples/abi_routing/out/contract.approval_unoptimized.teal b/examples/abi_routing/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..901481f9fe --- /dev/null +++ b/examples/abi_routing/out/contract.approval_unoptimized.teal @@ -0,0 +1,517 @@ +#pragma version 8 + +// examples.abi_routing.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_bare_routing@17 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "noop_with_uint64(uint64)uint8" + method "all_the_things(uint64)uint8" + method "mixed_oca(uint64)uint8" + method "opt_into_asset(asset)void" + method "with_transactions(asset,uint64,pay,uint64)void" + method "compare_assets(asset,asset)void" + method "get_address()address" + method "get_asset()uint64" + method "get_application()uint64" + method "get_an_int()uint64" + method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" + uncover 11 + match main_noop_with_uint64_route@4 main_all_the_things_route@5 main_mixed_oca_route@6 main_opt_into_asset_route@7 main_with_transactions_route@8 main_compare_assets_route@9 main_get_address_route@10 main_get_asset_route@11 main_get_application_route@12 main_get_an_int_route@13 main_method_with_default_args_route@14 + b main_switch_case_default@15 + +main_noop_with_uint64_route@4: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub noop_with_uint64 + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_all_the_things_route@5: + txna ApplicationArgs 1 + callsub full_abi_config + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_mixed_oca_route@6: + txn OnCompletion + int 1 + swap + shl + int 37 + & + assert // OnCompletion is one of NoOp, CloseOut, DeleteApplication + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub mixed_oca + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_opt_into_asset_route@7: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + callsub opt_into_asset + int 1 + return + +main_with_transactions_route@8: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + txna ApplicationArgs 3 + callsub with_transactions + int 1 + return + +main_compare_assets_route@9: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + callsub compare_assets + int 1 + return + +main_get_address_route@10: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_address + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_get_asset_route@11: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_asset + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_get_application_route@12: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_app + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_get_an_int_route@13: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub get_a_int + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_method_with_default_args_route@14: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + txna ApplicationArgs 3 + btoi + txnas Accounts + txna ApplicationArgs 4 + btoi + txnas Accounts + txna ApplicationArgs 5 + btoi + txnas Applications + txna ApplicationArgs 6 + btoi + txnas Applications + txna ApplicationArgs 7 + txna ApplicationArgs 8 + txna ApplicationArgs 9 + callsub method_with_default_args + int 1 + return + +main_switch_case_default@15: + +main_switch_case_next@16: + b main_after_if_else@20 + +main_bare_routing@17: + txn OnCompletion + int 0 + int 1 + int 2 + int 4 + int 5 + uncover 5 + match main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 main_bare_abi_config@18 + b main_reject_bare_on_completion@19 + +main_bare_abi_config@18: + txn ApplicationID + ! + assert // is creating + callsub bare_abi_config + int 1 + return + +main_reject_bare_on_completion@19: + err // reject transaction + +main_after_if_else@20: + err // reject transaction + + +// examples.abi_routing.contract.Reference.noop_with_uint64(a#0: bytes) -> bytes: +noop_with_uint64: + proto 1 1 + +noop_with_uint64_block@0: + frame_dig -1 + btoi + int 1 + + + itob + extract 7 1 + retsub + + +// examples.abi_routing.contract.Reference.full_abi_config(a#0: bytes) -> bytes: +full_abi_config: + proto 1 1 + +full_abi_config_block@0: + frame_dig -1 + btoi + int 1 + + + itob + extract 7 1 + retsub + + +// examples.abi_routing.contract.Reference.mixed_oca(a#0: bytes) -> bytes: +mixed_oca: + proto 1 1 + +mixed_oca_block@0: + frame_dig -1 + btoi + int 1 + + + itob + extract 7 1 + retsub + + +// examples.abi_routing.contract.Reference.opt_into_asset(asset#0: uint64) -> void: +opt_into_asset: + proto 1 0 + +opt_into_asset_block@0: + txn Sender + global CreatorAddress + == + assert // Only creator can opt in to ASA + int 0 + byte "asa" + app_global_get_ex + assert // check value exists + ! + assert // ASA already opted in + byte "asa" + frame_dig -1 + app_global_put + itxn_begin + int axfer + itxn_field TypeEnum + int 0 + itxn_field Fee + global CurrentApplicationAddress + itxn_field AssetReceiver + frame_dig -1 + itxn_field XferAsset + itxn_submit + retsub + + +// examples.abi_routing.contract.Reference.with_transactions(asset#0: uint64, an_int#0: bytes, pay#0: uint64, another_int#0: bytes) -> void: +with_transactions: + proto 4 0 + +with_transactions_block@0: + int 0 + byte "asa" + app_global_get_ex + assert // check value exists + frame_dig -4 + == + assert // is correct asset + frame_dig -3 + btoi + int 1 + == + assert // is correct int + frame_dig -2 + gtxns Receiver + global CurrentApplicationAddress + == + assert // is payment to app + frame_dig -1 + btoi + int 2 + == + assert // is correct int + retsub + + +// examples.abi_routing.contract.Reference.compare_assets(asset_a#0: uint64, asset_b#0: uint64) -> void: +compare_assets: + proto 2 0 + +compare_assets_block@0: + frame_dig -2 + frame_dig -1 + == + assert // asset a == b + retsub + + +// examples.abi_routing.contract.Reference.get_address() -> bytes: +get_address: + proto 0 1 + +get_address_block@0: + global ZeroAddress + retsub + + +// examples.abi_routing.contract.Reference.get_asset() -> bytes: +get_asset: + proto 0 1 + +get_asset_block@0: + byte 0x00000000000001c8 + retsub + + +// examples.abi_routing.contract.Reference.get_app() -> bytes: +get_app: + proto 0 1 + +get_app_block@0: + byte 0x00000000000001c8 + retsub + + +// examples.abi_routing.contract.Reference.get_a_int() -> bytes: +get_a_int: + proto 0 1 + +get_a_int_block@0: + byte 0x0000000000000003 + retsub + + +// examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage#0: uint64, asset_from_function#0: uint64, account_from_storage#0: bytes, account_from_function#0: bytes, application_from_storage#0: uint64, application_from_function#0: uint64, bytes_from_storage#0: bytes, int_from_storage#0: bytes, int_from_function#0: bytes) -> void: +method_with_default_args: + proto 9 0 + +method_with_default_args_block@0: + frame_dig -9 + int 123 + == + assert // wrong asset from storage + frame_dig -8 + int 456 + == + assert // wrong asset from function + global CreatorAddress + frame_dig -7 + == + assert // wrong account from storage + global ZeroAddress + frame_dig -6 + == + assert // wrong account from function + frame_dig -5 + int 123 + == + assert // wrong application from storage + frame_dig -4 + int 456 + == + assert // wrong application from function + int 0 + int 1 + * + frame_dig -3 + swap + int 1 + extract3 + byte 0x07 + == + assert // wrong 0th byte from storage + int 1 + int 1 + * + frame_dig -3 + swap + int 1 + extract3 + byte 0x08 + == + assert // wrong 1st byte from storage + int 2 + int 1 + * + frame_dig -3 + swap + int 1 + extract3 + byte 0x09 + == + assert // wrong 2nd byte from storage + frame_dig -2 + btoi + int 2 + == + assert // wrong int from storage + frame_dig -1 + btoi + int 3 + == + assert // wrong int from function + retsub + + +// examples.abi_routing.contract.Reference.bare_abi_config() -> void: +bare_abi_config: + proto 0 0 + +bare_abi_config_block@0: + byte "Hello World" + log + retsub + + +// examples.abi_routing.contract.Reference.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "asa" + int 123 + app_global_put + byte "an_int" + int 2 + app_global_put + byte 0x + byte 0x07 + concat + byte 0x08 + concat + byte 0x09 + concat + byte "some_bytes" + swap + app_global_put + txn Sender + byte "creator" + swap + app_global_put + byte "app" + int 123 + app_global_put + retsub + diff --git a/examples/abi_routing/out/contract.awst b/examples/abi_routing/out/contract.awst new file mode 100644 index 0000000000..3370a3becf --- /dev/null +++ b/examples/abi_routing/out/contract.awst @@ -0,0 +1,103 @@ +contract Reference +{ + globals { + ['asa']: algopy.Asset + ['an_int']: algopy.UInt64 + ['some_bytes']: algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]] + ['creator']: algopy.Account + ['app']: algopy.Application + } + + constructor() + { + this.globals['asa']: algopy.Asset = reinterpret_cast(123u) + this.globals['an_int']: algopy.UInt64 = 2u + this.globals['some_bytes']: algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]] = arc4_array_encode([7arc4u8, 8arc4u8, 9arc4u8], algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]]) + this.globals['creator']: algopy.Account = txn() + this.globals['app']: algopy.Application = reinterpret_cast(123u) + } + + abimethod noop_with_uint64(a: algopy.arc4.UIntN[typing.Literal[64]]): algopy.arc4.UIntN[typing.Literal[8]] + { + result: algopy.UInt64 = 1u + arc4_decode(a, algopy.UInt64) + return arc4_encode(result, algopy.arc4.UIntN[typing.Literal[8]]) + } + + abimethod[name_override=all_the_things] full_abi_config(a: algopy.arc4.UIntN[typing.Literal[64]]): algopy.arc4.UIntN[typing.Literal[8]] + { + result: algopy.UInt64 = 1u + arc4_decode(a, algopy.UInt64) + return arc4_encode(result, algopy.arc4.UIntN[typing.Literal[8]]) + } + + abimethod mixed_oca(a: algopy.arc4.UIntN[typing.Literal[64]]): algopy.arc4.UIntN[typing.Literal[8]] + { + result: algopy.UInt64 = 1u + arc4_decode(a, algopy.UInt64) + return arc4_encode(result, algopy.arc4.UIntN[typing.Literal[8]]) + } + + abimethod bare_abi_config(): None + { + log('Hello World') + } + + abimethod opt_into_asset(asset: algopy.Asset): None + { + assert(txn() == global(), comment="Only creator can opt in to ASA") + assert(!(reinterpret_cast(this.globals['asa'])), comment="ASA already opted in") + this.globals['asa']: algopy.Asset = asset + itxn_begin() + itxn_field(axfer) + itxn_field(0u) + itxn_field(global()) + itxn_field(reinterpret_cast(asset)) + itxn_submit() + } + + abimethod with_transactions(asset: algopy.Asset, an_int: algopy.arc4.UIntN[typing.Literal[64]], pay: algopy.PaymentTransaction, another_int: algopy.arc4.UIntN[typing.Literal[64]]): None + { + assert(this.globals['asa'] == asset, comment="is correct asset") + assert(arc4_decode(an_int, algopy.UInt64) == 1u, comment="is correct int") + assert(gtxns(pay) == global(), comment="is payment to app") + assert(arc4_decode(another_int, algopy.UInt64) == 2u, comment="is correct int") + } + + abimethod compare_assets(asset_a: algopy.Asset, asset_b: algopy.Asset): None + { + assert(asset_a == asset_b, comment="asset a == b") + } + + abimethod get_address(): algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[8]], typing.Literal[32]] + { + return reinterpret_cast(reinterpret_cast(global())) + } + + abimethod get_asset(): algopy.arc4.UIntN[typing.Literal[64]] + { + return 456arc4u64 + } + + abimethod[name_override=get_application] get_app(): algopy.arc4.UIntN[typing.Literal[64]] + { + return 456arc4u64 + } + + abimethod[name_override=get_an_int] get_a_int(): algopy.arc4.UIntN[typing.Literal[64]] + { + return 3arc4u64 + } + + abimethod method_with_default_args(asset_from_storage: algopy.Asset, asset_from_function: algopy.Asset, account_from_storage: algopy.Account, account_from_function: algopy.Account, application_from_storage: algopy.Application, application_from_function: algopy.Application, bytes_from_storage: algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[8]], typing.Literal[3]], int_from_storage: algopy.arc4.UIntN[typing.Literal[64]], int_from_function: algopy.arc4.UIntN[typing.Literal[64]]): 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") + assert(account_from_storage == global(), comment="wrong account from storage") + assert(account_from_function == global(), comment="wrong account from function") + assert(application_from_storage == reinterpret_cast(123u), comment="wrong application from storage") + assert(application_from_function == reinterpret_cast(456u), comment="wrong application from function") + assert(reinterpret_cast(bytes_from_storage[0u]) == reinterpret_cast(7arc4u8), comment="wrong 0th byte from storage") + assert(reinterpret_cast(bytes_from_storage[1u]) == reinterpret_cast(8arc4u8), comment="wrong 1st byte from storage") + assert(reinterpret_cast(bytes_from_storage[2u]) == reinterpret_cast(9arc4u8), comment="wrong 2nd byte from storage") + assert(arc4_decode(int_from_storage, algopy.UInt64) == 2u, comment="wrong int from storage") + assert(arc4_decode(int_from_function, algopy.UInt64) == 3u, comment="wrong int from function") + } +} \ No newline at end of file diff --git a/examples/abi_routing/out/contract.clear.debug.teal b/examples/abi_routing/out/contract.clear.debug.teal new file mode 100644 index 0000000000..c8bace7215 --- /dev/null +++ b/examples/abi_routing/out/contract.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.abi_routing.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + return // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + diff --git a/examples/abi_routing/out/contract.clear.teal b/examples/abi_routing/out/contract.clear.teal new file mode 100644 index 0000000000..dc5eeb7e78 --- /dev/null +++ b/examples/abi_routing/out/contract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.abi_routing.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/abi_routing/out/contract.clear_unoptimized.debug.teal b/examples/abi_routing/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..c8bace7215 --- /dev/null +++ b/examples/abi_routing/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.abi_routing.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + return // class Reference(ARC4Contract): File "abi_routing/contract.py", line 21 + diff --git a/examples/abi_routing/out/contract.clear_unoptimized.teal b/examples/abi_routing/out/contract.clear_unoptimized.teal new file mode 100644 index 0000000000..dc5eeb7e78 --- /dev/null +++ b/examples/abi_routing/out/contract.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.abi_routing.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/abi_routing/out/contract_Reference.cssa.ir b/examples/abi_routing/out/contract_Reference.cssa.ir new file mode 100644 index 0000000000..21025c3df2 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.cssa.ir @@ -0,0 +1,307 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + (app_global_put "some_bytes" 0x070809) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.final.ir b/examples/abi_routing/out/contract_Reference.final.ir new file mode 100644 index 0000000000..21025c3df2 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.final.ir @@ -0,0 +1,307 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + (app_global_put "some_bytes" 0x070809) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.final_unoptimized.ir b/examples/abi_routing/out/contract_Reference.final_unoptimized.ir new file mode 100644 index 0000000000..6e68e2a111 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.final_unoptimized.ir @@ -0,0 +1,320 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (== tmp%19#0 NoOp) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (== tmp%25#0 NoOp) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + let maybe_value_did_exist%33#0: uint64 = tmp%37#0 + let maybe_value%32#0: uint64 = awst_tmp%35#0 + (assert maybe_value_did_exist%33#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, maybe_value%32#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (== tmp%39#0 NoOp) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (== tmp%48#0 NoOp) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (== tmp%53#0 NoOp) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (== tmp%58#0 NoOp) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (== tmp%63#0 NoOp) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (== tmp%68#0 NoOp) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + goto block@16 + block@16: // switch_case_next_L21 + goto block@20 + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + switch tmp%92#0 {0u => block@18, 1u => block@18, 2u => block@18, 4u => block@18, 5u => block@18, * => block@19} + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + block@20: // after_if_else_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let item_index%8#0: uint64 = (* 0u 1u) + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 item_index%8#0 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let item_index%11#0: uint64 = (* 1u 1u) + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 item_index%11#0 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let item_index%14#0: uint64 = (* 2u 1u) + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 item_index%14#0 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + let array_data%0#0: bytes = 0x + let array_data%0#0: bytes = (concat array_data%0#0 0x07) + let array_data%0#0: bytes = (concat array_data%0#0 0x08) + let array_data%0#0: bytes = (concat array_data%0#0 0x09) + (app_global_put "some_bytes" array_data%0#0) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.parallel_copies.ir b/examples/abi_routing/out/contract_Reference.parallel_copies.ir new file mode 100644 index 0000000000..21025c3df2 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.parallel_copies.ir @@ -0,0 +1,307 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + (app_global_put "some_bytes" 0x070809) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.post_ssa.ir b/examples/abi_routing/out/contract_Reference.post_ssa.ir new file mode 100644 index 0000000000..21025c3df2 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.post_ssa.ir @@ -0,0 +1,307 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + (app_global_put "some_bytes" 0x070809) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.ssa.ir b/examples/abi_routing/out/contract_Reference.ssa.ir new file mode 100644 index 0000000000..ada85f035c --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.ssa.ir @@ -0,0 +1,319 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (== tmp%19#0 NoOp) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (== tmp%25#0 NoOp) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + let (maybe_value%32#0: uint64, maybe_value_did_exist%33#0: uint64) = (awst_tmp%35#0, tmp%37#0) + (assert maybe_value_did_exist%33#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, maybe_value%32#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (== tmp%39#0 NoOp) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (== tmp%48#0 NoOp) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (== tmp%53#0 NoOp) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (== tmp%58#0 NoOp) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (== tmp%63#0 NoOp) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (== tmp%68#0 NoOp) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + goto block@16 + block@16: // switch_case_next_L21 + goto block@20 + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + switch tmp%92#0 {0u => block@18, 1u => block@18, 2u => block@18, 4u => block@18, 5u => block@18, * => block@19} + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + block@20: // after_if_else_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let item_index%8#0: uint64 = (* 0u 1u) + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 item_index%8#0 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let item_index%11#0: uint64 = (* 1u 1u) + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 item_index%11#0 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let item_index%14#0: uint64 = (* 2u 1u) + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 item_index%14#0 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + let array_data%0#0: bytes = 0x + let array_data%0#1: bytes = (concat array_data%0#0 0x07) + let array_data%0#2: bytes = (concat array_data%0#1 0x08) + let array_data%0#3: bytes = (concat array_data%0#2 0x09) + (app_global_put "some_bytes" array_data%0#3) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.ssa.opt_pass_1.ir b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..c8a7fddb27 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_1.ir @@ -0,0 +1,310 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + let array_data%0#1: bytes = (concat 0x 0x07) + let array_data%0#2: bytes = (concat array_data%0#1 0x08) + let array_data%0#3: bytes = (concat array_data%0#2 0x09) + (app_global_put "some_bytes" array_data%0#3) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.ssa.opt_pass_2.ir b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..03c8d8e0e4 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_2.ir @@ -0,0 +1,309 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + let array_data%0#2: bytes = (concat 0x07 0x08) + let array_data%0#3: bytes = (concat array_data%0#2 0x09) + (app_global_put "some_bytes" array_data%0#3) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.ssa.opt_pass_3.ir b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..d1ef6c993c --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_3.ir @@ -0,0 +1,308 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + let array_data%0#3: bytes = (concat 0x0708 0x09) + (app_global_put "some_bytes" array_data%0#3) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_routing/out/contract_Reference.ssa.opt_pass_4.ir b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..21025c3df2 --- /dev/null +++ b/examples/abi_routing/out/contract_Reference.ssa.opt_pass_4.ir @@ -0,0 +1,307 @@ +contract examples.abi_routing.contract.Reference: + program approval: + subroutine examples.abi_routing.contract.Reference.approval_program() -> uint64: + block@0: // L21 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L22 + examples.abi_routing.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L22 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@17 + block@3: // abi_routing_L21 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "noop_with_uint64(uint64)uint8" => block@4, method "all_the_things(uint64)uint8" => block@5, method "mixed_oca(uint64)uint8" => block@6, method "opt_into_asset(asset)void" => block@7, method "with_transactions(asset,uint64,pay,uint64)void" => block@8, method "compare_assets(asset,asset)void" => block@9, method "get_address()address" => block@10, method "get_asset()uint64" => block@11, method "get_application()uint64" => block@12, method "get_an_int()uint64" => block@13, method "method_with_default_args(asset,asset,account,account,application,application,byte[3],uint64,uint64)void" => block@14, * => block@15} + block@4: // noop_with_uint64_route_L29 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: bytes = examples.abi_routing.contract.Reference.noop_with_uint64(tmp%6#0) + let tmp%8#0: bytes = (concat 0x151f7c75 tmp%7#0) + (log tmp%8#0) + return 1u + block@5: // all_the_things_route_L34 + let tmp%9#0: bytes = (txna ApplicationArgs 1) + let tmp%10#0: bytes = examples.abi_routing.contract.Reference.full_abi_config(tmp%9#0) + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@6: // mixed_oca_route_L50 + let tmp%12#0: uint64 = (txn OnCompletion) + let tmp%13#0: uint64 = (shl 1u tmp%12#0) + let tmp%14#0: uint64 = (& tmp%13#0 37u) + (assert tmp%14#0) // OnCompletion is one of NoOp, CloseOut, DeleteApplication + let tmp%15#0: uint64 = (txn ApplicationID) + (assert tmp%15#0) // is not creating + let tmp%16#0: bytes = (txna ApplicationArgs 1) + let tmp%17#0: bytes = examples.abi_routing.contract.Reference.mixed_oca(tmp%16#0) + let tmp%18#0: bytes = (concat 0x151f7c75 tmp%17#0) + (log tmp%18#0) + return 1u + block@7: // opt_into_asset_route_L76 + let tmp%19#0: uint64 = (txn OnCompletion) + let tmp%20#0: uint64 = (! tmp%19#0) + (assert tmp%20#0) // OnCompletion is NoOp + let tmp%21#0: uint64 = (txn ApplicationID) + (assert tmp%21#0) // is not creating + let tmp%22#0: bytes = (txna ApplicationArgs 1) + let tmp%23#0: uint64 = (btoi tmp%22#0) + let tmp%24#0: uint64 = ((txnas Assets) tmp%23#0) + examples.abi_routing.contract.Reference.opt_into_asset(tmp%24#0) + return 1u + block@8: // with_transactions_route_L93 + let tmp%25#0: uint64 = (txn OnCompletion) + let tmp%26#0: uint64 = (! tmp%25#0) + (assert tmp%26#0) // OnCompletion is NoOp + let tmp%27#0: uint64 = (txn ApplicationID) + (assert tmp%27#0) // is not creating + let tmp%28#0: bytes = (txna ApplicationArgs 1) + let tmp%29#0: uint64 = (btoi tmp%28#0) + let tmp%30#0: uint64 = ((txnas Assets) tmp%29#0) + let tmp%31#0: bytes = (txna ApplicationArgs 2) + let tmp%34#0: uint64 = (txn GroupIndex) + let awst_tmp%35#0: uint64 = (- tmp%34#0 1u) + let tmp%36#0: uint64 = ((gtxns TypeEnum) awst_tmp%35#0) + let tmp%37#0: uint64 = (== tmp%36#0 pay) + (assert tmp%37#0) // transaction type is pay + let tmp%38#0: bytes = (txna ApplicationArgs 3) + examples.abi_routing.contract.Reference.with_transactions(tmp%30#0, tmp%31#0, awst_tmp%35#0, tmp%38#0) + return 1u + block@9: // compare_assets_route_L102 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%42#0: bytes = (txna ApplicationArgs 1) + let tmp%43#0: uint64 = (btoi tmp%42#0) + let tmp%44#0: uint64 = ((txnas Assets) tmp%43#0) + let tmp%45#0: bytes = (txna ApplicationArgs 2) + let tmp%46#0: uint64 = (btoi tmp%45#0) + let tmp%47#0: uint64 = ((txnas Assets) tmp%46#0) + examples.abi_routing.contract.Reference.compare_assets(tmp%44#0, tmp%47#0) + return 1u + block@10: // get_address_route_L106 + let tmp%48#0: uint64 = (txn OnCompletion) + let tmp%49#0: uint64 = (! tmp%48#0) + (assert tmp%49#0) // OnCompletion is NoOp + let tmp%50#0: uint64 = (txn ApplicationID) + (assert tmp%50#0) // is not creating + let tmp%51#0: bytes = examples.abi_routing.contract.Reference.get_address() + let tmp%52#0: bytes = (concat 0x151f7c75 tmp%51#0) + (log tmp%52#0) + return 1u + block@11: // get_asset_route_L110 + let tmp%53#0: uint64 = (txn OnCompletion) + let tmp%54#0: uint64 = (! tmp%53#0) + (assert tmp%54#0) // OnCompletion is NoOp + let tmp%55#0: uint64 = (txn ApplicationID) + (assert tmp%55#0) // is not creating + let tmp%56#0: bytes = examples.abi_routing.contract.Reference.get_asset() + let tmp%57#0: bytes = (concat 0x151f7c75 tmp%56#0) + (log tmp%57#0) + return 1u + block@12: // get_application_route_L114 + let tmp%58#0: uint64 = (txn OnCompletion) + let tmp%59#0: uint64 = (! tmp%58#0) + (assert tmp%59#0) // OnCompletion is NoOp + let tmp%60#0: uint64 = (txn ApplicationID) + (assert tmp%60#0) // is not creating + let tmp%61#0: bytes = examples.abi_routing.contract.Reference.get_app() + let tmp%62#0: bytes = (concat 0x151f7c75 tmp%61#0) + (log tmp%62#0) + return 1u + block@13: // get_an_int_route_L118 + let tmp%63#0: uint64 = (txn OnCompletion) + let tmp%64#0: uint64 = (! tmp%63#0) + (assert tmp%64#0) // OnCompletion is NoOp + let tmp%65#0: uint64 = (txn ApplicationID) + (assert tmp%65#0) // is not creating + let tmp%66#0: bytes = examples.abi_routing.contract.Reference.get_a_int() + let tmp%67#0: bytes = (concat 0x151f7c75 tmp%66#0) + (log tmp%67#0) + return 1u + block@14: // method_with_default_args_route_L122 + let tmp%68#0: uint64 = (txn OnCompletion) + let tmp%69#0: uint64 = (! tmp%68#0) + (assert tmp%69#0) // OnCompletion is NoOp + let tmp%70#0: uint64 = (txn ApplicationID) + (assert tmp%70#0) // is not creating + let tmp%71#0: bytes = (txna ApplicationArgs 1) + let tmp%72#0: uint64 = (btoi tmp%71#0) + let tmp%73#0: uint64 = ((txnas Assets) tmp%72#0) + let tmp%74#0: bytes = (txna ApplicationArgs 2) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 3) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: bytes = ((txnas Accounts) tmp%78#0) + let tmp%80#0: bytes = (txna ApplicationArgs 4) + let tmp%81#0: uint64 = (btoi tmp%80#0) + let tmp%82#0: bytes = ((txnas Accounts) tmp%81#0) + let tmp%83#0: bytes = (txna ApplicationArgs 5) + let tmp%84#0: uint64 = (btoi tmp%83#0) + let tmp%85#0: uint64 = ((txnas Applications) tmp%84#0) + let tmp%86#0: bytes = (txna ApplicationArgs 6) + let tmp%87#0: uint64 = (btoi tmp%86#0) + let tmp%88#0: uint64 = ((txnas Applications) tmp%87#0) + let tmp%89#0: bytes = (txna ApplicationArgs 7) + let tmp%90#0: bytes = (txna ApplicationArgs 8) + let tmp%91#0: bytes = (txna ApplicationArgs 9) + examples.abi_routing.contract.Reference.method_with_default_args(tmp%73#0, tmp%76#0, tmp%79#0, tmp%82#0, tmp%85#0, tmp%88#0, tmp%89#0, tmp%90#0, tmp%91#0) + return 1u + block@15: // switch_case_default_L21 + fail // reject transaction + block@17: // bare_routing_L21 + let tmp%92#0: uint64 = (txn OnCompletion) + goto [block@18, block@18, block@18, block@19, block@18, block@18, ...block@19][tmp%92#0] + block@18: // bare_abi_config_L73 + let tmp%93#0: uint64 = (txn ApplicationID) + let tmp%94#0: uint64 = (! tmp%93#0) + (assert tmp%94#0) // is creating + examples.abi_routing.contract.Reference.bare_abi_config() + return 1u + block@19: // reject_bare_on_completion_L21 + fail // reject transaction + + subroutine examples.abi_routing.contract.Reference.noop_with_uint64(a: bytes) -> bytes: + block@0: // L30 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.full_abi_config(a: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.mixed_oca(a: bytes) -> bytes: + block@0: // L59 + let tmp%0#0: uint64 = (btoi a#0) + let result#0: uint64 = (+ 1u tmp%0#0) + let val_as_bytes%1#0: bytes = (itob result#0) + let tmp%2#0: bytes = ((extract 7 1) val_as_bytes%1#0) + return tmp%2#0 + + subroutine examples.abi_routing.contract.Reference.opt_into_asset(asset: uint64) -> void: + block@0: // L77 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = (global CreatorAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Only creator can opt in to ASA + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (! app_global_get_ex_value%3#0) + (assert tmp%5#0) // ASA already opted in + (app_global_put "asa" asset#0) + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field Fee) 0u) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + ((itxn_field AssetReceiver) tmp%6#0) + ((itxn_field XferAsset) asset#0) + itxn_submit + return + + subroutine examples.abi_routing.contract.Reference.with_transactions(asset: uint64, an_int: bytes, pay: uint64, another_int: bytes) -> void: + block@0: // L94 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) + (assert tmp%2#0) // is correct asset + let tmp%3#0: uint64 = (btoi an_int#0) + let tmp%4#0: uint64 = (== tmp%3#0 1u) + (assert tmp%4#0) // is correct int + let tmp%5#0: bytes = ((gtxns Receiver) pay#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // is payment to app + let tmp%8#0: uint64 = (btoi another_int#0) + let tmp%9#0: uint64 = (== tmp%8#0 2u) + (assert tmp%9#0) // is correct int + return + + subroutine examples.abi_routing.contract.Reference.compare_assets(asset_a: uint64, asset_b: uint64) -> void: + block@0: // L103 + let tmp%0#0: uint64 = (== asset_a#0 asset_b#0) + (assert tmp%0#0) // asset a == b + return + + subroutine examples.abi_routing.contract.Reference.get_address() -> bytes: + block@0: // L107 + let tmp%0#0: bytes = (global ZeroAddress) + return tmp%0#0 + + subroutine examples.abi_routing.contract.Reference.get_asset() -> bytes: + block@0: // L111 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_app() -> bytes: + block@0: // L115 + return 0x00000000000001c8 + + subroutine examples.abi_routing.contract.Reference.get_a_int() -> bytes: + block@0: // L119 + return 0x0000000000000003 + + subroutine examples.abi_routing.contract.Reference.method_with_default_args(asset_from_storage: uint64, asset_from_function: uint64, account_from_storage: bytes, account_from_function: bytes, application_from_storage: uint64, application_from_function: uint64, bytes_from_storage: bytes, int_from_storage: bytes, int_from_function: bytes) -> void: + block@0: // L135 + let tmp%0#0: uint64 = (== asset_from_storage#0 123u) + (assert tmp%0#0) // wrong asset from storage + let tmp%1#0: uint64 = (== asset_from_function#0 456u) + (assert tmp%1#0) // wrong asset from function + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== account_from_storage#0 tmp%2#0) + (assert tmp%3#0) // wrong account from storage + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (== account_from_function#0 tmp%4#0) + (assert tmp%5#0) // wrong account from function + let tmp%6#0: uint64 = (== application_from_storage#0 123u) + (assert tmp%6#0) // wrong application from storage + let tmp%7#0: uint64 = (== application_from_function#0 456u) + (assert tmp%7#0) // wrong application from function + let tmp%9#0: bytes = (extract3 bytes_from_storage#0 0u 1u) + let tmp%10#0: uint64 = (== tmp%9#0 0x07) + (assert tmp%10#0) // wrong 0th byte from storage + let tmp%12#0: bytes = (extract3 bytes_from_storage#0 1u 1u) + let tmp%13#0: uint64 = (== tmp%12#0 0x08) + (assert tmp%13#0) // wrong 1st byte from storage + let tmp%15#0: bytes = (extract3 bytes_from_storage#0 2u 1u) + let tmp%16#0: uint64 = (== tmp%15#0 0x09) + (assert tmp%16#0) // wrong 2nd byte from storage + let tmp%17#0: uint64 = (btoi int_from_storage#0) + let tmp%18#0: uint64 = (== tmp%17#0 2u) + (assert tmp%18#0) // wrong int from storage + let tmp%19#0: uint64 = (btoi int_from_function#0) + let tmp%20#0: uint64 = (== tmp%19#0 3u) + (assert tmp%20#0) // wrong int from function + return + + subroutine examples.abi_routing.contract.Reference.bare_abi_config() -> void: + block@0: // L73 + (log "Hello World") + return + + subroutine examples.abi_routing.contract.Reference.__init__() -> void: + block@0: // L22 + (app_global_put "asa" 123u) + (app_global_put "an_int" 2u) + (app_global_put "some_bytes" 0x070809) + let new_state_value%1#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%1#0) + (app_global_put "app" 123u) + return + + program clear-state: + subroutine examples.abi_routing.contract.Reference.clear_state_program() -> uint64: + block@0: // L21 + return 1u \ No newline at end of file diff --git a/examples/abi_types/algopy.log b/examples/abi_types/algopy.log deleted file mode 100644 index 877e2a7ab4..0000000000 --- a/examples/abi_types/algopy.log +++ /dev/null @@ -1,235 +0,0 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 abi_types -info: Building AWST for __init__.py -info: Building AWST for abi_types -info: Building AWST for abi_types/contract.py -debug: Sealing block@0: // L21 -debug: Terminated block@0: // L21 -debug: Sealing block@0: // L69 -debug: Terminated block@0: // L69 -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.ssa.ir -info: Optimizing examples.abi_types.contract.AbiTypesContract at level 1 -debug: Begin optimization pass 1/100 -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.approval_program -debug: Splitting parallel copies prior to optimization -debug: Optimizer: Arithmetic Simplification -debug: Folded len("/x00/x05Hello") to 7 -debug: Folded len("/x00/x05World") to 7 -debug: Folded len("/x00/x04Ping") to 6 -debug: Folded len("/x00/x04Pong") to 6 -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Found equivalence set: array_data%20#2, dynamic_uint8_array#0 -debug: Replacing {array_data%20#2} with dynamic_uint8_array#0 made 1 modifications -debug: Found equivalence set: array_data%21#1, aliased_dynamic#0 -debug: Replacing {array_data%21#1} with aliased_dynamic#0 made 1 modifications -debug: Found equivalence set: array_data%22#4, dynamic_string_array#0 -debug: Replacing {array_data%22#4} with dynamic_string_array#0 made 1 modifications -debug: Found equivalence set: array_data%30#3, static_uint8_array#0 -debug: Replacing {array_data%30#3} with static_uint8_array#0 made 1 modifications -debug: Found equivalence set: value_as_uint16%34#0, array_data%35#0 -debug: Replacing {array_data%35#0} with value_as_uint16%34#0 made 1 modifications -debug: Found equivalence set: array_data%35#3, static_string_array#0 -debug: Replacing {array_data%35#3} with static_string_array#0 made 1 modifications -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable some_bytes#0 -debug: Removing unused variable uint8#0 -debug: Removing unused variable test_bytes#0 -debug: Removing unused variable array_data%20#0 -debug: Removing unused variable array_data%21#0 -debug: Removing unused variable array_data%22#0 -debug: Removing unused variable next_offset%23#0 -debug: Removing unused variable element_length%26#0 -debug: Removing unused variable element_length%29#0 -debug: Removing unused variable array_data%30#0 -debug: Removing unused variable array_data%31#0 -debug: Removing unused variable aliased_static#0 -debug: Removing unused variable next_offset%32#0 -debug: Removing unused variable element_length%36#0 -debug: Removing unused variable element_length%39#0 -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program -debug: Splitting parallel copies prior to optimization -debug: Optimizer: Arithmetic Simplification -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_1.ir -debug: Begin optimization pass 2/100 -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.approval_program -debug: Optimizer: Arithmetic Simplification -debug: Folded len("Hello World!") to 12 -debug: Folded 4 + 7 to 11 -debug: Folded 4 + 6 to 10 -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable length%0#0 -debug: Removing unused variable next_offset%23#1 -debug: Removing unused variable next_offset%32#1 -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program -debug: Optimizer: Arithmetic Simplification -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_2.ir -debug: Begin optimization pass 3/100 -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.approval_program -debug: Optimizer: Arithmetic Simplification -debug: Folded 11 + 7 to 18 -debug: Folded 10 + 6 to 16 -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Remove Unused Variables -debug: Removing unused variable next_offset%23#2 -debug: Removing unused variable next_offset%32#2 -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program -debug: Optimizer: Arithmetic Simplification -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_3.ir -debug: Begin optimization pass 4/100 -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.approval_program -debug: Optimizer: Arithmetic Simplification -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: Optimizing subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program -debug: Optimizer: Arithmetic Simplification -debug: Optimizer: Constant Replacer -debug: Optimizer: Copy Propagation -debug: Optimizer: Remove Unused Variables -debug: Optimizer: Simplify Conditional Branches -debug: Optimizer: Remove Linear Jump -debug: Optimizer: Remove Empty Blocks -debug: Optimizer: Remove Unreachable Blocks -debug: No optimizations performed in pass 4, ending loop -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.cssa.ir -debug: Removing Phis from examples.abi_types.contract.AbiTypesContract.approval_program -debug: Removing Phis from examples.abi_types.contract.AbiTypesContract.clear_state_program -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.post_ssa.ir -debug: Sequentializing parallel copies in examples.abi_types.contract.AbiTypesContract.approval_program -debug: Sequentializing parallel copies in examples.abi_types.contract.AbiTypesContract.clear_state_program -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.parallel_copies.ir -debug: Coalescing local variables in examples.abi_types.contract.AbiTypesContract.approval_program using strategy RootOperandGrouping -debug: Coalescing array_data%22#1 with [array_data%22#2, array_data%22#3] -debug: Coalescing array_data%30#1 with [array_data%30#2] -debug: Coalescing array_data%35#1 with [array_data%35#2] -debug: Coalescing resulted in 8 replacement/s -debug: Coalescing local variables in examples.abi_types.contract.AbiTypesContract.clear_state_program using strategy RootOperandGrouping -debug: Coalescing resulted in 0 replacement/s -debug: Output IR to /examples/abi_types/out/contract_AbiTypesContract.final.ir -debug: Inserted main_block@0.ops[2]: 'store value_as_bytes%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[4]: 'load value_as_bytes%1#0 from scratch' with 'load value_as_bytes%1#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[6]: 'store value_as_uint16%2#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[8]: 'load value_as_uint16%2#0 from scratch' with 'load value_as_uint16%2#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[11]: 'store some_bytes_as_string#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[13]: 'load some_bytes_as_string#0 from scratch' with 'load some_bytes_as_string#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[19]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[21]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[29]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[31]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[36]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[38]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[42]: 'store val_as_bytes%7#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[44]: 'load val_as_bytes%7#0 from scratch' with 'load val_as_bytes%7#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[48]: 'store int8_encoded#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[50]: 'load int8_encoded#0 from scratch' with 'load int8_encoded#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[57]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[59]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[64]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[66]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[69]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[71]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[77]: 'store integer_bytes%11#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[79]: 'load integer_bytes%11#0 from scratch' with 'load integer_bytes%11#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[81]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[83]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[86]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[88]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[93]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[95]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[98]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[100]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[105]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[107]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[110]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[112]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[117]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[119]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[122]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[124]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[129]: 'store array_data%20#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[131]: 'load array_data%20#1 from scratch' with 'load array_data%20#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[141]: 'store value_as_bytes%24#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[143]: 'load value_as_bytes%24#0 from scratch' with 'load value_as_bytes%24#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[152]: 'store value_as_bytes%27#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[154]: 'load value_as_bytes%27#0 from scratch' with 'load value_as_bytes%27#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[160]: 'store array_data%22#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[162]: 'load array_data%22#1 from scratch' with 'load array_data%22#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[165]: 'store array_data%22#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[167]: 'load array_data%22#1 from scratch' with 'load array_data%22#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[174]: 'store array_data%30#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[176]: 'load array_data%30#1 from scratch' with 'load array_data%30#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[179]: 'store array_data%30#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[181]: 'load array_data%30#1 from scratch' with 'load array_data%30#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[187]: 'store value_as_bytes%33#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[189]: 'load value_as_bytes%33#0 from scratch' with 'load value_as_bytes%33#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[194]: 'store value_as_bytes%37#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[196]: 'load value_as_bytes%37#0 from scratch' with 'load value_as_bytes%37#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[202]: 'store array_data%35#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[204]: 'load array_data%35#1 from scratch' with 'load array_data%35#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[207]: 'store array_data%35#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[209]: 'load array_data%35#1 from scratch' with 'load array_data%35#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[25]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[28]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[54]: 'store int8_decoded#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[57]: 'load int8_decoded#0 from scratch' with 'load int8_decoded#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[147]: 'store value_as_uint16%25#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[150]: 'load value_as_uint16%25#0 from scratch' with 'load value_as_uint16%25#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[159]: 'store value_as_uint16%28#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[162]: 'load value_as_uint16%28#0 from scratch' with 'load value_as_uint16%28#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[202]: 'store value_as_uint16%38#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[205]: 'load value_as_uint16%38#0 from scratch' with 'load value_as_uint16%38#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[14]: 'store some_bytes_as_string#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[18]: 'load some_bytes_as_string#0 from scratch' with 'load some_bytes_as_string#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[19]: 'store some_bytes_as_string#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[25]: 'load some_bytes_as_string#0 from scratch' with 'load some_bytes_as_string#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[154]: 'store array_data%22#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[164]: 'load array_data%22#1 from scratch' with 'load array_data%22#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[198]: 'store value_as_uint16%34#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[208]: 'load value_as_uint16%34#0 from scratch' with 'load value_as_uint16%34#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[16]: 'store some_bytes_as_bytes_again#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[38]: 'load some_bytes_as_bytes_again#0 from scratch' with 'load some_bytes_as_bytes_again#0 from l-stack (no copy)' -info: Writing /examples/abi_types/out/contract.approval.teal -info: Writing /examples/abi_types/out/contract.approval.debug.teal -info: Writing /examples/abi_types/out/contract.clear.teal -info: Writing /examples/abi_types/out/contract.clear.debug.teal ->> exit code = 0 \ No newline at end of file diff --git a/examples/abi_types/contract.py b/examples/abi_types/contract.py deleted file mode 100644 index 7f5f1cb0f3..0000000000 --- a/examples/abi_types/contract.py +++ /dev/null @@ -1,70 +0,0 @@ -import typing -import typing as t - -from algopy import Bytes, Contract, UInt64 -from algopy.arc4 import ( - DynamicArray, - StaticArray, - String, - UInt8, - UInt16, - UInt32, - UInt64 as ABIUInt64, - UIntN, -) - -AliasedDynamicArray: typing.TypeAlias = DynamicArray[UInt8] -AliasedStaticArray: typing.TypeAlias = StaticArray[UInt8, t.Literal[1]] - - -class AbiTypesContract(Contract): - def approval_program(self) -> bool: - some_bytes = Bytes(b"Hello World!") - - some_bytes_as_string = String.encode(some_bytes) - - some_bytes_as_bytes_again = some_bytes_as_string.decode() - - assert ( - some_bytes != some_bytes_as_string.bytes - ), "Original bytes should not match encoded bytes" - - assert ( - some_bytes == some_bytes_as_string.bytes[2:] - ), "Original bytes should match encoded if we strip the length header" - - assert some_bytes == some_bytes_as_bytes_again - - uint8 = UInt64(255) - - int8_encoded = UInt8.encode(uint8) - - int8_decoded = int8_encoded.decode() - - assert uint8 == int8_decoded - - test_bytes = Bytes.from_hex("7FFFFFFFFFFFFFFF00") - assert UInt8.from_bytes(test_bytes).decode() == 2**8 - 1 - 2**7 - assert UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() == 2**24 - 1 - 2**23 - assert UInt16.from_bytes(test_bytes).decode() == 2**16 - 1 - 2**15 - assert UInt32.from_bytes(test_bytes).decode() == 2**32 - 1 - 2**31 - assert ABIUInt64.from_bytes(test_bytes).decode() == 2**64 - 1 - 2**63 - - dynamic_uint8_array = DynamicArray[UInt8](UInt8(1), UInt8(2)) - - aliased_dynamic = AliasedDynamicArray(UInt8(1)) - - dynamic_string_array = DynamicArray[String](String("Hello"), String("World")) - - static_uint8_array = StaticArray[UInt8, t.Literal[4]]( - UInt8(1), UInt8(10), UInt8(255), UInt8(128) - ) - - aliased_static = AliasedStaticArray(UInt8(1)) - - static_string_array = StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) - - return True - - def clear_state_program(self) -> bool: - return True diff --git a/examples/abi_types/out/abi_types.O0.log b/examples/abi_types/out/abi_types.O0.log deleted file mode 100644 index 9f4c9babe2..0000000000 --- a/examples/abi_types/out/abi_types.O0.log +++ /dev/null @@ -1,139 +0,0 @@ -PC Teal Stack -1 -5 -42 byte "Hello World!" SGVsbG8gV29ybGQh -56 dup SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -57 len SGVsbG8gV29ybGQh, 12 -58 itob SGVsbG8gV29ybGQh, AAAAAAAAAAw= -59 extract 6 2 SGVsbG8gV29ybGQh, AAw= -62 dig 1 SGVsbG8gV29ybGQh, AAw=, SGVsbG8gV29ybGQh -64 concat SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -65 dup SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, AAxIZWxsbyBXb3JsZCE= -66 extract 2 0 SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh -69 cover 2 SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -71 dig 1 SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh -73 dig 1 SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -75 != SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, 1 -76 assert SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -77 extract 2 0 SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -80 dig 1 SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -82 == SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, 1 -83 assert SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -84 == 1 -85 assert -86 int 255 255 -89 dup 255, 255 -90 itob 255, AAAAAAAAAP8= -91 int 7 255, AAAAAAAAAP8=, 7 -93 int 8 255, AAAAAAAAAP8=, 7, 8 -95 substring3 255, /w== -96 int 0 255, /w==, 0 -97 getbyte 255, 255 -98 == 1 -99 assert -100 byte 0x7fffffffffffffff00 f/////////8A -111 dup f/////////8A, f/////////8A -112 int 0 f/////////8A, f/////////8A, 0 -113 getbyte f/////////8A, 127 -114 int 127 f/////////8A, 127, 127 -116 == f/////////8A, 1 -117 assert f/////////8A -118 dup f/////////8A, f/////////8A -119 int 0 f/////////8A, f/////////8A, 0 -120 int 3 f/////////8A, f/////////8A, 0, 3 -122 extract3 f/////////8A, f/// -123 btoi f/////////8A, 8388607 -124 int 8388607 f/////////8A, 8388607, 8388607 -129 == f/////////8A, 1 -130 assert f/////////8A -131 dup f/////////8A, f/////////8A -132 int 0 f/////////8A, f/////////8A, 0 -133 extract_uint16 f/////////8A, 32767 -134 int 32767 f/////////8A, 32767, 32767 -138 == f/////////8A, 1 -139 assert f/////////8A -140 dup f/////////8A, f/////////8A -141 int 0 f/////////8A, f/////////8A, 0 -142 extract_uint32 f/////////8A, 2147483647 -143 int 2147483647 f/////////8A, 2147483647, 2147483647 -149 == f/////////8A, 1 -150 assert f/////////8A -151 int 0 f/////////8A, 0 -152 extract_uint64 9223372036854775807 -153 int 9223372036854775807 9223372036854775807, 9223372036854775807 -163 == 1 -164 assert -165 byte 0x0002 AAI= -166 byte 0x01 AAI=, AQ== -167 concat AAIB -168 byte 0x02 AAIB, Ag== -171 concat AAIBAg== -172 pop -173 byte 0x0001 AAE= -177 byte 0x01 AAE=, AQ== -178 concat AAEB -179 pop -180 byte 0x0002 AAI= -181 int 4 AAI=, 4 -182 dup AAI=, 4, 4 -183 itob AAI=, 4, AAAAAAAAAAQ= -184 extract 6 2 AAI=, 4, AAQ= -187 uncover 2 4, AAQ=, AAI= -189 uncover 1 4, AAI=, AAQ= -191 concat 4, AAIABA== -192 cover 1 AAIABA==, 4 -194 byte "\x00\x05Hello" AAIABA==, 4, AAVIZWxsbw== -195 len AAIABA==, 4, 7 -196 + AAIABA==, 11 -197 dup AAIABA==, 11, 11 -198 itob AAIABA==, 11, AAAAAAAAAAs= -199 extract 6 2 AAIABA==, 11, AAs= -202 uncover 2 11, AAs=, AAIABA== -204 uncover 1 11, AAIABA==, AAs= -206 concat 11, AAIABAAL -207 byte "\x00\x05World" 11, AAIABAAL, AAVXb3JsZA== -208 len 11, AAIABAAL, 7 -209 uncover 2 AAIABAAL, 7, 11 -211 + AAIABAAL, 18 -212 pop AAIABAAL -213 byte "\x00\x05Hello" AAIABAAL, AAVIZWxsbw== -214 concat AAIABAALAAVIZWxsbw== -215 byte "\x00\x05World" AAIABAALAAVIZWxsbw==, AAVXb3JsZA== -216 concat AAIABAALAAVIZWxsbwAFV29ybGQ= -217 pop -218 byte 0x01 AQ== -219 byte 0x0a AQ==, Cg== -222 concat AQo= -223 byte 0xff AQo=, /w== -226 concat AQr/ -227 byte 0x80 AQr/, gA== -230 concat AQr/gA== -231 pop -232 byte 0x01 AQ== -233 pop -234 int 4 4 -235 dup 4, 4 -236 itob 4, AAAAAAAAAAQ= -237 extract 6 2 4, AAQ= -240 cover 1 AAQ=, 4 -242 byte "\x00\x04Ping" AAQ=, 4, AARQaW5n -244 len AAQ=, 4, 6 -245 + AAQ=, 10 -246 dup AAQ=, 10, 10 -247 itob AAQ=, 10, AAAAAAAAAAo= -248 extract 6 2 AAQ=, 10, AAo= -251 uncover 2 10, AAo=, AAQ= -253 uncover 1 10, AAQ=, AAo= -255 concat 10, AAQACg== -256 byte "\x00\x04Pong" 10, AAQACg==, AARQb25n -258 len 10, AAQACg==, 6 -259 uncover 2 AAQACg==, 6, 10 -261 + AAQACg==, 16 -262 pop AAQACg== -263 byte "\x00\x04Ping" AAQACg==, AARQaW5n -265 concat AAQACgAEUGluZw== -266 byte "\x00\x04Pong" AAQACgAEUGluZw==, AARQb25n -268 concat AAQACgAEUGluZwAEUG9uZw== -269 pop -270 int 1 1 -272 return 1 \ No newline at end of file diff --git a/examples/abi_types/out/abi_types.O1.log b/examples/abi_types/out/abi_types.O1.log deleted file mode 100644 index ff770b7612..0000000000 --- a/examples/abi_types/out/abi_types.O1.log +++ /dev/null @@ -1,111 +0,0 @@ -PC Teal Stack -1 -7 -37 int 12 12 -39 itob AAAAAAAAAAw= -40 extract 6 2 AAw= -43 byte "Hello World!" AAw=, SGVsbG8gV29ybGQh -44 concat AAxIZWxsbyBXb3JsZCE= -45 dup AAxIZWxsbyBXb3JsZCE=, AAxIZWxsbyBXb3JsZCE= -46 extract 2 0 AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh -49 cover 1 SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -51 byte "Hello World!" SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh -52 dig 1 SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -54 != SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, 1 -55 assert SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -56 extract 2 0 SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -59 byte "Hello World!" SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -60 == SGVsbG8gV29ybGQh, 1 -61 assert SGVsbG8gV29ybGQh -62 byte "Hello World!" SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -63 == 1 -64 assert -65 int 255 255 -66 itob AAAAAAAAAP8= -67 int 7 AAAAAAAAAP8=, 7 -69 int 8 AAAAAAAAAP8=, 7, 8 -71 substring3 /w== -72 int 0 /w==, 0 -73 getbyte 255 -74 int 255 255, 255 -75 == 1 -76 assert -77 byte 0x7fffffffffffffff00 f/////////8A -78 int 0 f/////////8A, 0 -79 getbyte 127 -80 int 127 127, 127 -82 == 1 -83 assert -84 byte 0x7fffffffffffffff00 f/////////8A -85 int 0 f/////////8A, 0 -86 int 3 f/////////8A, 0, 3 -88 extract3 f/// -89 btoi 8388607 -90 int 8388607 8388607, 8388607 -95 == 1 -96 assert -97 byte 0x7fffffffffffffff00 f/////////8A -98 int 0 f/////////8A, 0 -99 extract_uint16 32767 -100 int 32767 32767, 32767 -104 == 1 -105 assert -106 byte 0x7fffffffffffffff00 f/////////8A -107 int 0 f/////////8A, 0 -108 extract_uint32 2147483647 -109 int 2147483647 2147483647, 2147483647 -115 == 1 -116 assert -117 byte 0x7fffffffffffffff00 f/////////8A -118 int 0 f/////////8A, 0 -119 extract_uint64 9223372036854775807 -120 int 9223372036854775807 9223372036854775807, 9223372036854775807 -130 == 1 -131 assert -132 byte 0x0002 AAI= -133 byte 0x01 AAI=, AQ== -134 concat AAIB -135 byte 0x02 AAIB, Ag== -138 concat AAIBAg== -139 pop -140 byte 0x0001 AAE= -144 byte 0x01 AAE=, AQ== -145 concat AAEB -146 pop -147 int 4 4 -148 itob AAAAAAAAAAQ= -149 extract 6 2 AAQ= -152 byte 0x0002 AAQ=, AAI= -153 uncover 1 AAI=, AAQ= -155 concat AAIABA== -156 int 11 AAIABA==, 11 -158 itob AAIABA==, AAAAAAAAAAs= -159 extract 6 2 AAIABA==, AAs= -162 concat AAIABAAL -163 byte "\x00\x05Hello" AAIABAAL, AAVIZWxsbw== -172 concat AAIABAALAAVIZWxsbw== -173 byte "\x00\x05World" AAIABAALAAVIZWxsbw==, AAVXb3JsZA== -182 concat AAIABAALAAVIZWxsbwAFV29ybGQ= -183 pop -184 byte 0x01 AQ== -185 byte 0x0a AQ==, Cg== -188 concat AQo= -189 byte 0xff AQo=, /w== -192 concat AQr/ -193 byte 0x80 AQr/, gA== -196 concat AQr/gA== -197 pop -198 int 4 4 -199 itob AAAAAAAAAAQ= -200 extract 6 2 AAQ= -203 int 10 AAQ=, 10 -205 itob AAQ=, AAAAAAAAAAo= -206 extract 6 2 AAQ=, AAo= -209 concat AAQACg== -210 byte "\x00\x04Ping" AAQACg==, AARQaW5n -218 concat AAQACgAEUGluZw== -219 byte "\x00\x04Pong" AAQACgAEUGluZw==, AARQb25n -227 concat AAQACgAEUGluZwAEUG9uZw== -228 pop -229 int 1 1 -231 return 1 \ No newline at end of file diff --git a/examples/abi_types/out/abi_types.O2.log b/examples/abi_types/out/abi_types.O2.log deleted file mode 100644 index ff770b7612..0000000000 --- a/examples/abi_types/out/abi_types.O2.log +++ /dev/null @@ -1,111 +0,0 @@ -PC Teal Stack -1 -7 -37 int 12 12 -39 itob AAAAAAAAAAw= -40 extract 6 2 AAw= -43 byte "Hello World!" AAw=, SGVsbG8gV29ybGQh -44 concat AAxIZWxsbyBXb3JsZCE= -45 dup AAxIZWxsbyBXb3JsZCE=, AAxIZWxsbyBXb3JsZCE= -46 extract 2 0 AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh -49 cover 1 SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -51 byte "Hello World!" SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh -52 dig 1 SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -54 != SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE=, 1 -55 assert SGVsbG8gV29ybGQh, AAxIZWxsbyBXb3JsZCE= -56 extract 2 0 SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -59 byte "Hello World!" SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -60 == SGVsbG8gV29ybGQh, 1 -61 assert SGVsbG8gV29ybGQh -62 byte "Hello World!" SGVsbG8gV29ybGQh, SGVsbG8gV29ybGQh -63 == 1 -64 assert -65 int 255 255 -66 itob AAAAAAAAAP8= -67 int 7 AAAAAAAAAP8=, 7 -69 int 8 AAAAAAAAAP8=, 7, 8 -71 substring3 /w== -72 int 0 /w==, 0 -73 getbyte 255 -74 int 255 255, 255 -75 == 1 -76 assert -77 byte 0x7fffffffffffffff00 f/////////8A -78 int 0 f/////////8A, 0 -79 getbyte 127 -80 int 127 127, 127 -82 == 1 -83 assert -84 byte 0x7fffffffffffffff00 f/////////8A -85 int 0 f/////////8A, 0 -86 int 3 f/////////8A, 0, 3 -88 extract3 f/// -89 btoi 8388607 -90 int 8388607 8388607, 8388607 -95 == 1 -96 assert -97 byte 0x7fffffffffffffff00 f/////////8A -98 int 0 f/////////8A, 0 -99 extract_uint16 32767 -100 int 32767 32767, 32767 -104 == 1 -105 assert -106 byte 0x7fffffffffffffff00 f/////////8A -107 int 0 f/////////8A, 0 -108 extract_uint32 2147483647 -109 int 2147483647 2147483647, 2147483647 -115 == 1 -116 assert -117 byte 0x7fffffffffffffff00 f/////////8A -118 int 0 f/////////8A, 0 -119 extract_uint64 9223372036854775807 -120 int 9223372036854775807 9223372036854775807, 9223372036854775807 -130 == 1 -131 assert -132 byte 0x0002 AAI= -133 byte 0x01 AAI=, AQ== -134 concat AAIB -135 byte 0x02 AAIB, Ag== -138 concat AAIBAg== -139 pop -140 byte 0x0001 AAE= -144 byte 0x01 AAE=, AQ== -145 concat AAEB -146 pop -147 int 4 4 -148 itob AAAAAAAAAAQ= -149 extract 6 2 AAQ= -152 byte 0x0002 AAQ=, AAI= -153 uncover 1 AAI=, AAQ= -155 concat AAIABA== -156 int 11 AAIABA==, 11 -158 itob AAIABA==, AAAAAAAAAAs= -159 extract 6 2 AAIABA==, AAs= -162 concat AAIABAAL -163 byte "\x00\x05Hello" AAIABAAL, AAVIZWxsbw== -172 concat AAIABAALAAVIZWxsbw== -173 byte "\x00\x05World" AAIABAALAAVIZWxsbw==, AAVXb3JsZA== -182 concat AAIABAALAAVIZWxsbwAFV29ybGQ= -183 pop -184 byte 0x01 AQ== -185 byte 0x0a AQ==, Cg== -188 concat AQo= -189 byte 0xff AQo=, /w== -192 concat AQr/ -193 byte 0x80 AQr/, gA== -196 concat AQr/gA== -197 pop -198 int 4 4 -199 itob AAAAAAAAAAQ= -200 extract 6 2 AAQ= -203 int 10 AAQ=, 10 -205 itob AAQ=, AAAAAAAAAAo= -206 extract 6 2 AAQ=, AAo= -209 concat AAQACg== -210 byte "\x00\x04Ping" AAQACg==, AARQaW5n -218 concat AAQACgAEUGluZw== -219 byte "\x00\x04Pong" AAQACgAEUGluZw==, AARQb25n -227 concat AAQACgAEUGluZwAEUG9uZw== -228 pop -229 int 1 1 -231 return 1 \ No newline at end of file diff --git a/examples/abi_types/out/contract.approval.debug.teal b/examples/abi_types/out/contract.approval.debug.teal deleted file mode 100644 index 854e051227..0000000000 --- a/examples/abi_types/out/contract.approval.debug.teal +++ /dev/null @@ -1,115 +0,0 @@ -// Op // Op Description Stack (out) Source code Source line - -#pragma version 8 - -// examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: -main_block@0: - int 12 // 12 String.encode(some_bytes) File "abi_types/contract.py", line 24 - itob // {itob} String.encode(some_bytes) File "abi_types/contract.py", line 24 - extract 6 2 // {extract} String.encode(some_bytes) File "abi_types/contract.py", line 24 - byte "Hello World!" // value_as_uint16%2#0,"Hello World!" b"Hello World!" File "abi_types/contract.py", line 22 - concat // {concat} String.encode(some_bytes) File "abi_types/contract.py", line 24 - dup // load some_bytes_as_string#0 from l-stack (copy) some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "abi_types/contract.py", line 24 - extract 2 0 // some_bytes_as_string#0,{extract} some_bytes_as_string.decode() File "abi_types/contract.py", line 26 - cover 1 // store some_bytes_as_bytes_again#0 to l-stack (no copy) some_bytes_as_bytes_again#0,some_bytes_as_string#0 some_bytes_as_bytes_again File "abi_types/contract.py", line 26 - byte "Hello World!" // some_bytes_as_bytes_again#0,some_bytes_as_string#0,"Hello World!" b"Hello World!" File "abi_types/contract.py", line 22 - dig 1 // load some_bytes_as_string#0 from l-stack (copy) some_bytes_as_bytes_again#0,some_bytes_as_string#0,"Hello World!",some_bytes_as_string#0 some_bytes_as_string File "abi_types/contract.py", line 24 - != // some_bytes_as_bytes_again#0,some_bytes_as_string#0,{!=} some_bytes != some_bytes_as_string.bytes File "abi_types/contract.py", line 29 - assert // some_bytes_as_bytes_again#0,some_bytes_as_string#0 assert ( File "abi_types/contract.py", line 28 - extract 2 0 // some_bytes_as_bytes_again#0,{extract} some_bytes_as_string.bytes[2:] File "abi_types/contract.py", line 33 - byte "Hello World!" // some_bytes_as_bytes_again#0,tmp%4#0,"Hello World!" b"Hello World!" File "abi_types/contract.py", line 22 - == // some_bytes_as_bytes_again#0,{==} some_bytes == some_bytes_as_string.bytes[2:] File "abi_types/contract.py", line 33 - assert // some_bytes_as_bytes_again#0 assert ( File "abi_types/contract.py", line 32 - byte "Hello World!" // some_bytes_as_bytes_again#0,"Hello World!" b"Hello World!" File "abi_types/contract.py", line 22 - == // {==} some_bytes == some_bytes_as_bytes_again File "abi_types/contract.py", line 36 - assert // assert some_bytes == some_bytes_as_bytes_again File "abi_types/contract.py", line 36 - int 255 // 255 255 File "abi_types/contract.py", line 38 - itob // {itob} UInt8.encode(uint8) File "abi_types/contract.py", line 40 - int 7 // val_as_bytes%7#0,7 UInt8.encode(uint8) File "abi_types/contract.py", line 40 - int 8 // val_as_bytes%7#0,7,8 UInt8.encode(uint8) File "abi_types/contract.py", line 40 - substring3 // {substring3} UInt8.encode(uint8) File "abi_types/contract.py", line 40 - int 0 // int8_encoded#0,0 int8_encoded.decode() File "abi_types/contract.py", line 42 - getbyte // {getbyte} int8_encoded.decode() File "abi_types/contract.py", line 42 - int 255 // int8_decoded#0,255 255 File "abi_types/contract.py", line 38 - == // {==} uint8 == int8_decoded File "abi_types/contract.py", line 44 - assert // assert uint8 == int8_decoded File "abi_types/contract.py", line 44 - byte 0x7fffffffffffffff00 // 0x7fffffffffffffff00 Bytes.from_hex("7FFFFFFFFFFFFFFF00") File "abi_types/contract.py", line 46 - int 0 // 0x7fffffffffffffff00,0 UInt8.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 47 - getbyte // {getbyte} UInt8.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 47 - int 127 // tmp%9#0,127 2**8 - 1 - 2**7 File "abi_types/contract.py", line 47 - == // {==} UInt8.from_bytes(test_bytes).decode() == 2**8 - 1 - 2**7 File "abi_types/contract.py", line 47 - assert // assert UInt8.from_bytes(test_bytes).decode() == 2**8 - 1 - 2**7 File "abi_types/contract.py", line 47 - byte 0x7fffffffffffffff00 // 0x7fffffffffffffff00 Bytes.from_hex("7FFFFFFFFFFFFFFF00") File "abi_types/contract.py", line 46 - int 0 // 0x7fffffffffffffff00,0 UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - int 3 // 0x7fffffffffffffff00,0,3 UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - extract3 // {extract3} UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - btoi // {btoi} UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - int 8388607 // tmp%12#0,8388607 2**24 - 1 - 2**23 File "abi_types/contract.py", line 48 - == // {==} UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() == 2**24 - 1 - 2**23 File "abi_types/contract.py", line 48 - assert // assert UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() == 2**24 - 1 - 2**23 File "abi_types/contract.py", line 48 - byte 0x7fffffffffffffff00 // 0x7fffffffffffffff00 Bytes.from_hex("7FFFFFFFFFFFFFFF00") File "abi_types/contract.py", line 46 - int 0 // 0x7fffffffffffffff00,0 UInt16.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 49 - extract_uint16 // {extract_uint16} UInt16.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 49 - int 32767 // tmp%14#0,32767 2**16 - 1 - 2**15 File "abi_types/contract.py", line 49 - == // {==} UInt16.from_bytes(test_bytes).decode() == 2**16 - 1 - 2**15 File "abi_types/contract.py", line 49 - assert // assert UInt16.from_bytes(test_bytes).decode() == 2**16 - 1 - 2**15 File "abi_types/contract.py", line 49 - byte 0x7fffffffffffffff00 // 0x7fffffffffffffff00 Bytes.from_hex("7FFFFFFFFFFFFFFF00") File "abi_types/contract.py", line 46 - int 0 // 0x7fffffffffffffff00,0 UInt32.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 50 - extract_uint32 // {extract_uint32} UInt32.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 50 - int 2147483647 // tmp%16#0,2147483647 2**32 - 1 - 2**31 File "abi_types/contract.py", line 50 - == // {==} UInt32.from_bytes(test_bytes).decode() == 2**32 - 1 - 2**31 File "abi_types/contract.py", line 50 - assert // assert UInt32.from_bytes(test_bytes).decode() == 2**32 - 1 - 2**31 File "abi_types/contract.py", line 50 - byte 0x7fffffffffffffff00 // 0x7fffffffffffffff00 Bytes.from_hex("7FFFFFFFFFFFFFFF00") File "abi_types/contract.py", line 46 - int 0 // 0x7fffffffffffffff00,0 ABIUInt64.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 51 - extract_uint64 // {extract_uint64} ABIUInt64.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 51 - int 9223372036854775807 // tmp%18#0,9223372036854775807 2**64 - 1 - 2**63 File "abi_types/contract.py", line 51 - == // {==} ABIUInt64.from_bytes(test_bytes).decode() == 2**64 - 1 - 2**63 File "abi_types/contract.py", line 51 - assert // assert ABIUInt64.from_bytes(test_bytes).decode() == 2**64 - 1 - 2**63 File "abi_types/contract.py", line 51 - byte 0x0002 // 0x0002 DynamicArray[UInt8](UInt8(1), UInt8(2)) File "abi_types/contract.py", line 53 - byte 0x01 // 0x0002,0x01 1 File "abi_types/contract.py", line 53 - concat // {concat} DynamicArray[UInt8](UInt8(1), UInt8(2)) File "abi_types/contract.py", line 53 - byte 0x02 // array_data%20#1,0x02 2 File "abi_types/contract.py", line 53 - concat // {concat} DynamicArray[UInt8](UInt8(1), UInt8(2)) File "abi_types/contract.py", line 53 - pop // dynamic_uint8_array File "abi_types/contract.py", line 53 - byte 0x0001 // 0x0001 AliasedDynamicArray(UInt8(1)) File "abi_types/contract.py", line 55 - byte 0x01 // 0x0001,0x01 1 File "abi_types/contract.py", line 55 - concat // {concat} AliasedDynamicArray(UInt8(1)) File "abi_types/contract.py", line 55 - pop // aliased_dynamic File "abi_types/contract.py", line 55 - int 4 // 4 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - itob // {itob} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - extract 6 2 // {extract} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte 0x0002 // value_as_uint16%25#0,0x0002 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - uncover 1 // load value_as_uint16%25#0 from l-stack (no copy) 0x0002,value_as_uint16%25#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - concat // {concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - int 11 // array_data%22#1,11 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - itob // array_data%22#1,{itob} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - extract 6 2 // array_data%22#1,{extract} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - concat // {concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte "\x00\x05Hello" // array_data%22#1,"\x00\x05Hello" "Hello" File "abi_types/contract.py", line 57 - concat // {concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte "\x00\x05World" // array_data%22#1,"\x00\x05World" "World" File "abi_types/contract.py", line 57 - concat // {concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - pop // dynamic_string_array File "abi_types/contract.py", line 57 - byte 0x01 // 0x01 1 File "abi_types/contract.py", line 60 - byte 0x0a // 0x01,0x0a 10 File "abi_types/contract.py", line 60 - concat // {concat} StaticArray[UInt8, t.Literal[4]]( File "abi_types/contract.py", line 59 - byte 0xff // array_data%30#1,0xff 255 File "abi_types/contract.py", line 60 - concat // {concat} StaticArray[UInt8, t.Literal[4]]( File "abi_types/contract.py", line 59 - byte 0x80 // array_data%30#1,0x80 128 File "abi_types/contract.py", line 60 - concat // {concat} StaticArray[UInt8, t.Literal[4]]( File "abi_types/contract.py", line 59 - pop // static_uint8_array File "abi_types/contract.py", line 59 - int 4 // 4 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - itob // {itob} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - extract 6 2 // {extract} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - int 10 // value_as_uint16%34#0,10 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - itob // value_as_uint16%34#0,{itob} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - extract 6 2 // value_as_uint16%34#0,{extract} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - concat // {concat} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - byte "\x00\x04Ping" // array_data%35#1,"\x00\x04Ping" "Ping" File "abi_types/contract.py", line 65 - concat // {concat} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - byte "\x00\x04Pong" // array_data%35#1,"\x00\x04Pong" "Pong" File "abi_types/contract.py", line 65 - concat // {concat} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - pop // static_string_array File "abi_types/contract.py", line 65 - int 1 // 1 True File "abi_types/contract.py", line 67 - return // return True File "abi_types/contract.py", line 67 - diff --git a/examples/abi_types/out/contract.approval.teal b/examples/abi_types/out/contract.approval.teal deleted file mode 100644 index bb0e7ca382..0000000000 --- a/examples/abi_types/out/contract.approval.teal +++ /dev/null @@ -1,113 +0,0 @@ -#pragma version 8 - -// examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: -main_block@0: - int 12 - itob - extract 6 2 - byte "Hello World!" - concat - dup - extract 2 0 - cover 1 - byte "Hello World!" - dig 1 - != - assert - extract 2 0 - byte "Hello World!" - == - assert - byte "Hello World!" - == - assert - int 255 - itob - int 7 - int 8 - substring3 - int 0 - getbyte - int 255 - == - assert - byte 0x7fffffffffffffff00 - int 0 - getbyte - int 127 - == - assert - byte 0x7fffffffffffffff00 - int 0 - int 3 - extract3 - btoi - int 8388607 - == - assert - byte 0x7fffffffffffffff00 - int 0 - extract_uint16 - int 32767 - == - assert - byte 0x7fffffffffffffff00 - int 0 - extract_uint32 - int 2147483647 - == - assert - byte 0x7fffffffffffffff00 - int 0 - extract_uint64 - int 9223372036854775807 - == - assert - byte 0x0002 - byte 0x01 - concat - byte 0x02 - concat - pop - byte 0x0001 - byte 0x01 - concat - pop - int 4 - itob - extract 6 2 - byte 0x0002 - uncover 1 - concat - int 11 - itob - extract 6 2 - concat - byte "\x00\x05Hello" - concat - byte "\x00\x05World" - concat - pop - byte 0x01 - byte 0x0a - concat - byte 0xff - concat - byte 0x80 - concat - pop - int 4 - itob - extract 6 2 - int 10 - itob - extract 6 2 - concat - byte "\x00\x04Ping" - concat - byte "\x00\x04Pong" - concat - pop - int 1 - return - diff --git a/examples/abi_types/out/contract.approval_unoptimized.debug.teal b/examples/abi_types/out/contract.approval_unoptimized.debug.teal deleted file mode 100644 index dad7421b63..0000000000 --- a/examples/abi_types/out/contract.approval_unoptimized.debug.teal +++ /dev/null @@ -1,143 +0,0 @@ -// Op // Op Description Stack (out) Source code Source line - -#pragma version 8 - -// examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: -main_block@0: - byte "Hello World!" // "Hello World!" b"Hello World!" File "abi_types/contract.py", line 22 - dup // load some_bytes#0 from l-stack (copy) some_bytes#0,some_bytes#0 some_bytes File "abi_types/contract.py", line 22 - len // some_bytes#0,{len} String.encode(some_bytes) File "abi_types/contract.py", line 24 - itob // some_bytes#0,{itob} String.encode(some_bytes) File "abi_types/contract.py", line 24 - extract 6 2 // some_bytes#0,{extract} String.encode(some_bytes) File "abi_types/contract.py", line 24 - dig 1 // load some_bytes#0 from l-stack (copy) some_bytes#0,value_as_uint16%2#0,some_bytes#0 some_bytes File "abi_types/contract.py", line 22 - concat // some_bytes#0,{concat} String.encode(some_bytes) File "abi_types/contract.py", line 24 - dup // load some_bytes_as_string#0 from l-stack (copy) some_bytes#0,some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "abi_types/contract.py", line 24 - extract 2 0 // some_bytes#0,some_bytes_as_string#0,{extract} some_bytes_as_string.decode() File "abi_types/contract.py", line 26 - cover 2 // store some_bytes_as_bytes_again#0 to l-stack (no copy) some_bytes_as_bytes_again#0,some_bytes#0,some_bytes_as_string#0 some_bytes_as_bytes_again File "abi_types/contract.py", line 26 - dig 1 // load some_bytes#0 from l-stack (copy) some_bytes_as_bytes_again#0,some_bytes#0,some_bytes_as_string#0,some_bytes#0 some_bytes File "abi_types/contract.py", line 22 - dig 1 // load some_bytes_as_string#0 from l-stack (copy) some_bytes_as_bytes_again#0,some_bytes#0,some_bytes_as_string#0,some_bytes#0,some_bytes_as_string#0 some_bytes_as_string File "abi_types/contract.py", line 24 - != // some_bytes_as_bytes_again#0,some_bytes#0,some_bytes_as_string#0,{!=} some_bytes != some_bytes_as_string.bytes File "abi_types/contract.py", line 29 - assert // some_bytes_as_bytes_again#0,some_bytes#0,some_bytes_as_string#0 assert ( File "abi_types/contract.py", line 28 - extract 2 0 // some_bytes_as_bytes_again#0,some_bytes#0,{extract} some_bytes_as_string.bytes[2:] File "abi_types/contract.py", line 33 - dig 1 // load some_bytes#0 from l-stack (copy) some_bytes_as_bytes_again#0,some_bytes#0,tmp%4#0,some_bytes#0 some_bytes File "abi_types/contract.py", line 22 - == // some_bytes_as_bytes_again#0,some_bytes#0,{==} some_bytes == some_bytes_as_string.bytes[2:] File "abi_types/contract.py", line 33 - assert // some_bytes_as_bytes_again#0,some_bytes#0 assert ( File "abi_types/contract.py", line 32 - == // {==} some_bytes == some_bytes_as_bytes_again File "abi_types/contract.py", line 36 - assert // assert some_bytes == some_bytes_as_bytes_again File "abi_types/contract.py", line 36 - int 255 // 255 255 File "abi_types/contract.py", line 38 - dup // load uint8#0 from l-stack (copy) uint8#0,uint8#0 uint8 File "abi_types/contract.py", line 38 - itob // uint8#0,{itob} UInt8.encode(uint8) File "abi_types/contract.py", line 40 - int 7 // uint8#0,val_as_bytes%7#0,7 UInt8.encode(uint8) File "abi_types/contract.py", line 40 - int 8 // uint8#0,val_as_bytes%7#0,7,8 UInt8.encode(uint8) File "abi_types/contract.py", line 40 - substring3 // uint8#0,{substring3} UInt8.encode(uint8) File "abi_types/contract.py", line 40 - int 0 // uint8#0,int8_encoded#0,0 int8_encoded.decode() File "abi_types/contract.py", line 42 - getbyte // uint8#0,{getbyte} int8_encoded.decode() File "abi_types/contract.py", line 42 - == // {==} uint8 == int8_decoded File "abi_types/contract.py", line 44 - assert // assert uint8 == int8_decoded File "abi_types/contract.py", line 44 - byte 0x7fffffffffffffff00 // 0x7fffffffffffffff00 Bytes.from_hex("7FFFFFFFFFFFFFFF00") File "abi_types/contract.py", line 46 - dup // load test_bytes#0 from l-stack (copy) test_bytes#0,test_bytes#0 test_bytes File "abi_types/contract.py", line 46 - int 0 // test_bytes#0,test_bytes#0,0 UInt8.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 47 - getbyte // test_bytes#0,{getbyte} UInt8.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 47 - int 127 // test_bytes#0,tmp%9#0,127 2**8 - 1 - 2**7 File "abi_types/contract.py", line 47 - == // test_bytes#0,{==} UInt8.from_bytes(test_bytes).decode() == 2**8 - 1 - 2**7 File "abi_types/contract.py", line 47 - assert // test_bytes#0 assert UInt8.from_bytes(test_bytes).decode() == 2**8 - 1 - 2**7 File "abi_types/contract.py", line 47 - dup // load test_bytes#0 from l-stack (copy) test_bytes#0,test_bytes#0 test_bytes File "abi_types/contract.py", line 46 - int 0 // test_bytes#0,test_bytes#0,0 UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - int 3 // test_bytes#0,test_bytes#0,0,3 UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - extract3 // test_bytes#0,{extract3} UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - btoi // test_bytes#0,{btoi} UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() File "abi_types/contract.py", line 48 - int 8388607 // test_bytes#0,tmp%12#0,8388607 2**24 - 1 - 2**23 File "abi_types/contract.py", line 48 - == // test_bytes#0,{==} UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() == 2**24 - 1 - 2**23 File "abi_types/contract.py", line 48 - assert // test_bytes#0 assert UIntN[typing.Literal[24]].from_bytes(test_bytes).decode() == 2**24 - 1 - 2**23 File "abi_types/contract.py", line 48 - dup // load test_bytes#0 from l-stack (copy) test_bytes#0,test_bytes#0 test_bytes File "abi_types/contract.py", line 46 - int 0 // test_bytes#0,test_bytes#0,0 UInt16.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 49 - extract_uint16 // test_bytes#0,{extract_uint16} UInt16.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 49 - int 32767 // test_bytes#0,tmp%14#0,32767 2**16 - 1 - 2**15 File "abi_types/contract.py", line 49 - == // test_bytes#0,{==} UInt16.from_bytes(test_bytes).decode() == 2**16 - 1 - 2**15 File "abi_types/contract.py", line 49 - assert // test_bytes#0 assert UInt16.from_bytes(test_bytes).decode() == 2**16 - 1 - 2**15 File "abi_types/contract.py", line 49 - dup // load test_bytes#0 from l-stack (copy) test_bytes#0,test_bytes#0 test_bytes File "abi_types/contract.py", line 46 - int 0 // test_bytes#0,test_bytes#0,0 UInt32.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 50 - extract_uint32 // test_bytes#0,{extract_uint32} UInt32.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 50 - int 2147483647 // test_bytes#0,tmp%16#0,2147483647 2**32 - 1 - 2**31 File "abi_types/contract.py", line 50 - == // test_bytes#0,{==} UInt32.from_bytes(test_bytes).decode() == 2**32 - 1 - 2**31 File "abi_types/contract.py", line 50 - assert // test_bytes#0 assert UInt32.from_bytes(test_bytes).decode() == 2**32 - 1 - 2**31 File "abi_types/contract.py", line 50 - int 0 // test_bytes#0,0 ABIUInt64.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 51 - extract_uint64 // {extract_uint64} ABIUInt64.from_bytes(test_bytes).decode() File "abi_types/contract.py", line 51 - int 9223372036854775807 // tmp%18#0,9223372036854775807 2**64 - 1 - 2**63 File "abi_types/contract.py", line 51 - == // {==} ABIUInt64.from_bytes(test_bytes).decode() == 2**64 - 1 - 2**63 File "abi_types/contract.py", line 51 - assert // assert ABIUInt64.from_bytes(test_bytes).decode() == 2**64 - 1 - 2**63 File "abi_types/contract.py", line 51 - byte 0x0002 // 0x0002 DynamicArray[UInt8](UInt8(1), UInt8(2)) File "abi_types/contract.py", line 53 - byte 0x01 // array_data%20#0,0x01 1 File "abi_types/contract.py", line 53 - concat // {concat} DynamicArray[UInt8](UInt8(1), UInt8(2)) File "abi_types/contract.py", line 53 - byte 0x02 // array_data%20#0,0x02 2 File "abi_types/contract.py", line 53 - concat // {concat} DynamicArray[UInt8](UInt8(1), UInt8(2)) File "abi_types/contract.py", line 53 - pop // DynamicArray[UInt8](UInt8(1), UInt8(2)) File "abi_types/contract.py", line 53 - byte 0x0001 // 0x0001 AliasedDynamicArray(UInt8(1)) File "abi_types/contract.py", line 55 - byte 0x01 // array_data%21#0,0x01 1 File "abi_types/contract.py", line 55 - concat // {concat} AliasedDynamicArray(UInt8(1)) File "abi_types/contract.py", line 55 - pop // AliasedDynamicArray(UInt8(1)) File "abi_types/contract.py", line 55 - byte 0x0002 // 0x0002 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - int 4 // array_data%22#0,4 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - dup // load next_offset%23#0 from l-stack (copy) array_data%22#0,next_offset%23#0,next_offset%23#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - itob // array_data%22#0,next_offset%23#0,{itob} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - extract 6 2 // array_data%22#0,next_offset%23#0,{extract} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - uncover 2 // load array_data%22#0 from l-stack (no copy) next_offset%23#0,value_as_uint16%25#0,array_data%22#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - uncover 1 // load value_as_uint16%25#0 from l-stack (no copy) next_offset%23#0,array_data%22#0,value_as_uint16%25#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - concat // next_offset%23#0,{concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - cover 1 // store array_data%22#0 to l-stack (no copy) array_data%22#0,next_offset%23#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte "\x00\x05Hello" // array_data%22#0,next_offset%23#0,"\x00\x05Hello" "Hello" File "abi_types/contract.py", line 57 - len // array_data%22#0,next_offset%23#0,{len} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - + // array_data%22#0,{+} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - dup // load next_offset%23#0 from l-stack (copy) array_data%22#0,next_offset%23#0,next_offset%23#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - itob // array_data%22#0,next_offset%23#0,{itob} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - extract 6 2 // array_data%22#0,next_offset%23#0,{extract} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - uncover 2 // load array_data%22#0 from l-stack (no copy) next_offset%23#0,value_as_uint16%28#0,array_data%22#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - uncover 1 // load value_as_uint16%28#0 from l-stack (no copy) next_offset%23#0,array_data%22#0,value_as_uint16%28#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - concat // next_offset%23#0,{concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte "\x00\x05World" // next_offset%23#0,array_data%22#0,"\x00\x05World" "World" File "abi_types/contract.py", line 57 - len // next_offset%23#0,array_data%22#0,{len} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - uncover 2 // load next_offset%23#0 from l-stack (no copy) array_data%22#0,element_length%29#0,next_offset%23#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - + // array_data%22#0,{+} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - pop // array_data%22#0 DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte "\x00\x05Hello" // array_data%22#0,"\x00\x05Hello" "Hello" File "abi_types/contract.py", line 57 - concat // {concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte "\x00\x05World" // array_data%22#0,"\x00\x05World" "World" File "abi_types/contract.py", line 57 - concat // {concat} DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - pop // DynamicArray[String](String("Hello"), String("World")) File "abi_types/contract.py", line 57 - byte 0x01 // 0x01 1 File "abi_types/contract.py", line 60 - byte 0x0a // array_data%30#0,0x0a 10 File "abi_types/contract.py", line 60 - concat // {concat} StaticArray[UInt8, t.Literal[4]]( File "abi_types/contract.py", line 59 - byte 0xff // array_data%30#0,0xff 255 File "abi_types/contract.py", line 60 - concat // {concat} StaticArray[UInt8, t.Literal[4]]( File "abi_types/contract.py", line 59 - byte 0x80 // array_data%30#0,0x80 128 File "abi_types/contract.py", line 60 - concat // {concat} StaticArray[UInt8, t.Literal[4]]( File "abi_types/contract.py", line 59 - pop // StaticArray[UInt8, t.Literal[4]]( File "abi_types/contract.py", line 59 - byte 0x01 // 0x01 1 File "abi_types/contract.py", line 63 - pop // AliasedStaticArray(UInt8(1)) File "abi_types/contract.py", line 63 - int 4 // 4 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - dup // load next_offset%32#0 from l-stack (copy) next_offset%32#0,next_offset%32#0 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - itob // next_offset%32#0,{itob} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - extract 6 2 // next_offset%32#0,{extract} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - cover 1 // store array_data%35#0 to l-stack (no copy) array_data%35#0,next_offset%32#0 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - byte "\x00\x04Ping" // array_data%35#0,next_offset%32#0,"\x00\x04Ping" "Ping" File "abi_types/contract.py", line 65 - len // array_data%35#0,next_offset%32#0,{len} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - + // array_data%35#0,{+} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - dup // load next_offset%32#0 from l-stack (copy) array_data%35#0,next_offset%32#0,next_offset%32#0 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - itob // array_data%35#0,next_offset%32#0,{itob} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - extract 6 2 // array_data%35#0,next_offset%32#0,{extract} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - uncover 2 // load array_data%35#0 from l-stack (no copy) next_offset%32#0,value_as_uint16%38#0,array_data%35#0 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - uncover 1 // load value_as_uint16%38#0 from l-stack (no copy) next_offset%32#0,array_data%35#0,value_as_uint16%38#0 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - concat // next_offset%32#0,{concat} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - byte "\x00\x04Pong" // next_offset%32#0,array_data%35#0,"\x00\x04Pong" "Pong" File "abi_types/contract.py", line 65 - len // next_offset%32#0,array_data%35#0,{len} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - uncover 2 // load next_offset%32#0 from l-stack (no copy) array_data%35#0,element_length%39#0,next_offset%32#0 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - + // array_data%35#0,{+} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - pop // array_data%35#0 StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - byte "\x00\x04Ping" // array_data%35#0,"\x00\x04Ping" "Ping" File "abi_types/contract.py", line 65 - concat // {concat} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - byte "\x00\x04Pong" // array_data%35#0,"\x00\x04Pong" "Pong" File "abi_types/contract.py", line 65 - concat // {concat} StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - pop // StaticArray[String, t.Literal[2]](String("Ping"), String("Pong")) File "abi_types/contract.py", line 65 - int 1 // 1 True File "abi_types/contract.py", line 67 - return // return True File "abi_types/contract.py", line 67 - diff --git a/examples/abi_types/out/contract.approval_unoptimized.teal b/examples/abi_types/out/contract.approval_unoptimized.teal deleted file mode 100644 index 53fc9c2572..0000000000 --- a/examples/abi_types/out/contract.approval_unoptimized.teal +++ /dev/null @@ -1,141 +0,0 @@ -#pragma version 8 - -// examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: -main_block@0: - byte "Hello World!" - dup - len - itob - extract 6 2 - dig 1 - concat - dup - extract 2 0 - cover 2 - dig 1 - dig 1 - != - assert - extract 2 0 - dig 1 - == - assert - == - assert - int 255 - dup - itob - int 7 - int 8 - substring3 - int 0 - getbyte - == - assert - byte 0x7fffffffffffffff00 - dup - int 0 - getbyte - int 127 - == - assert - dup - int 0 - int 3 - extract3 - btoi - int 8388607 - == - assert - dup - int 0 - extract_uint16 - int 32767 - == - assert - dup - int 0 - extract_uint32 - int 2147483647 - == - assert - int 0 - extract_uint64 - int 9223372036854775807 - == - assert - byte 0x0002 - byte 0x01 - concat - byte 0x02 - concat - pop - byte 0x0001 - byte 0x01 - concat - pop - byte 0x0002 - int 4 - dup - itob - extract 6 2 - uncover 2 - uncover 1 - concat - cover 1 - byte "\x00\x05Hello" - len - + - dup - itob - extract 6 2 - uncover 2 - uncover 1 - concat - byte "\x00\x05World" - len - uncover 2 - + - pop - byte "\x00\x05Hello" - concat - byte "\x00\x05World" - concat - pop - byte 0x01 - byte 0x0a - concat - byte 0xff - concat - byte 0x80 - concat - pop - byte 0x01 - pop - int 4 - dup - itob - extract 6 2 - cover 1 - byte "\x00\x04Ping" - len - + - dup - itob - extract 6 2 - uncover 2 - uncover 1 - concat - byte "\x00\x04Pong" - len - uncover 2 - + - pop - byte "\x00\x04Ping" - concat - byte "\x00\x04Pong" - concat - pop - int 1 - return - diff --git a/examples/abi_types/out/contract.awst b/examples/abi_types/out/contract.awst deleted file mode 100644 index ffeff2cab6..0000000000 --- a/examples/abi_types/out/contract.awst +++ /dev/null @@ -1,34 +0,0 @@ -contract AbiTypesContract -{ - approval_program(): bool - { - some_bytes: algopy.Bytes = 'Hello World!' - some_bytes_as_string: algopy.arc4.String = abi_encode(some_bytes, algopy.arc4.String) - some_bytes_as_bytes_again: algopy.Bytes = abi_decode(some_bytes_as_string, algopy.Bytes) - assert(some_bytes != reinterpret_cast(some_bytes_as_string), comment="Original bytes should not match encoded bytes") - assert(some_bytes == reinterpret_cast(some_bytes_as_string)[2u:], comment="Original bytes should match encoded if we strip the length header") - assert(some_bytes == some_bytes_as_bytes_again) - uint8: algopy.UInt64 = 255u - int8_encoded: algopy.arc4.UIntN = abi_encode(uint8, algopy.arc4.UIntN) - int8_decoded: algopy.UInt64 = abi_decode(int8_encoded, algopy.UInt64) - assert(uint8 == int8_decoded) - test_bytes: algopy.Bytes = Bytes.from_base16("7FFFFFFFFFFFFFFF00") - assert(abi_decode(reinterpret_cast(test_bytes), algopy.UInt64) == 127u) - assert(abi_decode(reinterpret_cast(test_bytes), algopy.UInt64) == 8388607u) - assert(abi_decode(reinterpret_cast(test_bytes), algopy.UInt64) == 32767u) - assert(abi_decode(reinterpret_cast(test_bytes), algopy.UInt64) == 2147483647u) - assert(abi_decode(reinterpret_cast(test_bytes), algopy.UInt64) == 9223372036854775807u) - dynamic_uint8_array: algopy.arc4.DynamicArray = new algopy.arc4.UIntN[](abi_constant('\x01', algopy.arc4.UIntN), abi_constant('\x02', algopy.arc4.UIntN)) - aliased_dynamic: algopy.arc4.DynamicArray = new algopy.arc4.UIntN[](abi_constant('\x01', algopy.arc4.UIntN)) - dynamic_string_array: algopy.arc4.DynamicArray = new algopy.arc4.String[](abi_constant('\x00\x05Hello', algopy.arc4.String), abi_constant('\x00\x05World', algopy.arc4.String)) - static_uint8_array: algopy.arc4.StaticArray = new algopy.arc4.UIntN[4](abi_constant('\x01', algopy.arc4.UIntN), abi_constant('\n', algopy.arc4.UIntN), abi_constant('\xff', algopy.arc4.UIntN), abi_constant('\x80', algopy.arc4.UIntN)) - aliased_static: algopy.arc4.StaticArray = new algopy.arc4.UIntN[1](abi_constant('\x01', algopy.arc4.UIntN)) - static_string_array: algopy.arc4.StaticArray = new algopy.arc4.String[2](abi_constant('\x00\x04Ping', algopy.arc4.String), abi_constant('\x00\x04Pong', algopy.arc4.String)) - return true - } - - clear_state_program(): bool - { - return true - } -} \ No newline at end of file diff --git a/examples/abi_types/out/contract.clear.debug.teal b/examples/abi_types/out/contract.clear.debug.teal deleted file mode 100644 index 27c31b8c6a..0000000000 --- a/examples/abi_types/out/contract.clear.debug.teal +++ /dev/null @@ -1,9 +0,0 @@ -// Op // Stack (out) Source code Source line - -#pragma version 8 - -// examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: -main_block@0: - int 1 // 1 True File "abi_types/contract.py", line 70 - return // return True File "abi_types/contract.py", line 70 - diff --git a/examples/abi_types/out/contract.clear_unoptimized.debug.teal b/examples/abi_types/out/contract.clear_unoptimized.debug.teal deleted file mode 100644 index 27c31b8c6a..0000000000 --- a/examples/abi_types/out/contract.clear_unoptimized.debug.teal +++ /dev/null @@ -1,9 +0,0 @@ -// Op // Stack (out) Source code Source line - -#pragma version 8 - -// examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: -main_block@0: - int 1 // 1 True File "abi_types/contract.py", line 70 - return // return True File "abi_types/contract.py", line 70 - diff --git a/examples/abi_types/out/contract_AbiTypesContract.cssa.ir b/examples/abi_types/out/contract_AbiTypesContract.cssa.ir deleted file mode 100644 index 749df9bd6a..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.cssa.ir +++ /dev/null @@ -1,63 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let value_as_bytes%1#0: bytes = (itob 12u) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== "Hello World!" tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let val_as_bytes%7#0: bytes = (itob 255u) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== 255u int8_decoded#0) - (assert tmp%8#0) - let tmp%9#0: uint64 = (getbyte 0x7fffffffffffffff00 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 0x7fffffffffffffff00 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 0x7fffffffffffffff00 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 0x7fffffffffffffff00 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 0x7fffffffffffffff00 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#1: bytes = (concat 0x0002 0x01) - let dynamic_uint8_array#0: bytes = (concat array_data%20#1 0x02) - let aliased_dynamic#0: bytes = (concat 0x0001 0x01) - let value_as_bytes%24#0: bytes = (itob 4u) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat 0x0002 value_as_uint16%25#0) - let value_as_bytes%27#0: bytes = (itob 11u) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#2: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let array_data%22#3: bytes = (concat array_data%22#2 "\x00\x05Hello") - let dynamic_string_array#0: bytes = (concat array_data%22#3 "\x00\x05World") - let array_data%30#1: bytes = (concat 0x01 0x0a) - let array_data%30#2: bytes = (concat array_data%30#1 0xff) - let static_uint8_array#0: bytes = (concat array_data%30#2 0x80) - let value_as_bytes%33#0: bytes = (itob 4u) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let value_as_bytes%37#0: bytes = (itob 10u) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat value_as_uint16%34#0 value_as_uint16%38#0) - let array_data%35#2: bytes = (concat array_data%35#1 "\x00\x04Ping") - let static_string_array#0: bytes = (concat array_data%35#2 "\x00\x04Pong") - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.final.ir b/examples/abi_types/out/contract_AbiTypesContract.final.ir deleted file mode 100644 index 467d9cefa2..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.final.ir +++ /dev/null @@ -1,63 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let value_as_bytes%1#0: bytes = (itob 12u) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== "Hello World!" tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let val_as_bytes%7#0: bytes = (itob 255u) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== 255u int8_decoded#0) - (assert tmp%8#0) - let tmp%9#0: uint64 = (getbyte 0x7fffffffffffffff00 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 0x7fffffffffffffff00 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 0x7fffffffffffffff00 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 0x7fffffffffffffff00 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 0x7fffffffffffffff00 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#1: bytes = (concat 0x0002 0x01) - let dynamic_uint8_array#0: bytes = (concat array_data%20#1 0x02) - let aliased_dynamic#0: bytes = (concat 0x0001 0x01) - let value_as_bytes%24#0: bytes = (itob 4u) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat 0x0002 value_as_uint16%25#0) - let value_as_bytes%27#0: bytes = (itob 11u) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#1: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let array_data%22#1: bytes = (concat array_data%22#1 "\x00\x05Hello") - let dynamic_string_array#0: bytes = (concat array_data%22#1 "\x00\x05World") - let array_data%30#1: bytes = (concat 0x01 0x0a) - let array_data%30#1: bytes = (concat array_data%30#1 0xff) - let static_uint8_array#0: bytes = (concat array_data%30#1 0x80) - let value_as_bytes%33#0: bytes = (itob 4u) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let value_as_bytes%37#0: bytes = (itob 10u) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat value_as_uint16%34#0 value_as_uint16%38#0) - let array_data%35#1: bytes = (concat array_data%35#1 "\x00\x04Ping") - let static_string_array#0: bytes = (concat array_data%35#1 "\x00\x04Pong") - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.final_unoptimized.ir b/examples/abi_types/out/contract_AbiTypesContract.final_unoptimized.ir deleted file mode 100644 index 6d9a83aca6..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.final_unoptimized.ir +++ /dev/null @@ -1,89 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let some_bytes#0: bytes = "Hello World!" - let length%0#0: uint64 = (len some_bytes#0) - let value_as_bytes%1#0: bytes = (itob length%0#0) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 some_bytes#0) - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= some_bytes#0 some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== some_bytes#0 tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== some_bytes#0 some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let uint8#0: uint64 = 255u - let val_as_bytes%7#0: bytes = (itob uint8#0) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== uint8#0 int8_decoded#0) - (assert tmp%8#0) - let test_bytes#0: bytes = 0x7fffffffffffffff00 - let tmp%9#0: uint64 = (getbyte test_bytes#0 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 test_bytes#0 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 test_bytes#0 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 test_bytes#0 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 test_bytes#0 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#0: bytes = 0x0002 - let array_data%20#0: bytes = (concat array_data%20#0 0x01) - let array_data%20#0: bytes = (concat array_data%20#0 0x02) - let dynamic_uint8_array#0: bytes = array_data%20#0 - let array_data%21#0: bytes = 0x0001 - let array_data%21#0: bytes = (concat array_data%21#0 0x01) - let aliased_dynamic#0: bytes = array_data%21#0 - let array_data%22#0: bytes = 0x0002 - let next_offset%23#0: uint64 = 4u - let value_as_bytes%24#0: bytes = (itob next_offset%23#0) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#0: bytes = (concat array_data%22#0 value_as_uint16%25#0) - let element_length%26#0: uint64 = (len "\x00\x05Hello") - let next_offset%23#0: uint64 = (+ next_offset%23#0 element_length%26#0) - let value_as_bytes%27#0: bytes = (itob next_offset%23#0) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#0: bytes = (concat array_data%22#0 value_as_uint16%28#0) - let element_length%29#0: uint64 = (len "\x00\x05World") - let next_offset%23#0: uint64 = (+ next_offset%23#0 element_length%29#0) - let array_data%22#0: bytes = (concat array_data%22#0 "\x00\x05Hello") - let array_data%22#0: bytes = (concat array_data%22#0 "\x00\x05World") - let dynamic_string_array#0: bytes = array_data%22#0 - let array_data%30#0: bytes = 0x01 - let array_data%30#0: bytes = (concat array_data%30#0 0x0a) - let array_data%30#0: bytes = (concat array_data%30#0 0xff) - let array_data%30#0: bytes = (concat array_data%30#0 0x80) - let static_uint8_array#0: bytes = array_data%30#0 - let array_data%31#0: bytes = 0x01 - let aliased_static#0: bytes = array_data%31#0 - let next_offset%32#0: uint64 = 4u - let value_as_bytes%33#0: bytes = (itob next_offset%32#0) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let array_data%35#0: bytes = value_as_uint16%34#0 - let element_length%36#0: uint64 = (len "\x00\x04Ping") - let next_offset%32#0: uint64 = (+ next_offset%32#0 element_length%36#0) - let value_as_bytes%37#0: bytes = (itob next_offset%32#0) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#0: bytes = (concat array_data%35#0 value_as_uint16%38#0) - let element_length%39#0: uint64 = (len "\x00\x04Pong") - let next_offset%32#0: uint64 = (+ next_offset%32#0 element_length%39#0) - let array_data%35#0: bytes = (concat array_data%35#0 "\x00\x04Ping") - let array_data%35#0: bytes = (concat array_data%35#0 "\x00\x04Pong") - let static_string_array#0: bytes = array_data%35#0 - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.parallel_copies.ir b/examples/abi_types/out/contract_AbiTypesContract.parallel_copies.ir deleted file mode 100644 index 749df9bd6a..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.parallel_copies.ir +++ /dev/null @@ -1,63 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let value_as_bytes%1#0: bytes = (itob 12u) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== "Hello World!" tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let val_as_bytes%7#0: bytes = (itob 255u) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== 255u int8_decoded#0) - (assert tmp%8#0) - let tmp%9#0: uint64 = (getbyte 0x7fffffffffffffff00 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 0x7fffffffffffffff00 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 0x7fffffffffffffff00 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 0x7fffffffffffffff00 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 0x7fffffffffffffff00 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#1: bytes = (concat 0x0002 0x01) - let dynamic_uint8_array#0: bytes = (concat array_data%20#1 0x02) - let aliased_dynamic#0: bytes = (concat 0x0001 0x01) - let value_as_bytes%24#0: bytes = (itob 4u) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat 0x0002 value_as_uint16%25#0) - let value_as_bytes%27#0: bytes = (itob 11u) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#2: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let array_data%22#3: bytes = (concat array_data%22#2 "\x00\x05Hello") - let dynamic_string_array#0: bytes = (concat array_data%22#3 "\x00\x05World") - let array_data%30#1: bytes = (concat 0x01 0x0a) - let array_data%30#2: bytes = (concat array_data%30#1 0xff) - let static_uint8_array#0: bytes = (concat array_data%30#2 0x80) - let value_as_bytes%33#0: bytes = (itob 4u) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let value_as_bytes%37#0: bytes = (itob 10u) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat value_as_uint16%34#0 value_as_uint16%38#0) - let array_data%35#2: bytes = (concat array_data%35#1 "\x00\x04Ping") - let static_string_array#0: bytes = (concat array_data%35#2 "\x00\x04Pong") - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.post_ssa.ir b/examples/abi_types/out/contract_AbiTypesContract.post_ssa.ir deleted file mode 100644 index 749df9bd6a..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.post_ssa.ir +++ /dev/null @@ -1,63 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let value_as_bytes%1#0: bytes = (itob 12u) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== "Hello World!" tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let val_as_bytes%7#0: bytes = (itob 255u) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== 255u int8_decoded#0) - (assert tmp%8#0) - let tmp%9#0: uint64 = (getbyte 0x7fffffffffffffff00 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 0x7fffffffffffffff00 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 0x7fffffffffffffff00 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 0x7fffffffffffffff00 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 0x7fffffffffffffff00 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#1: bytes = (concat 0x0002 0x01) - let dynamic_uint8_array#0: bytes = (concat array_data%20#1 0x02) - let aliased_dynamic#0: bytes = (concat 0x0001 0x01) - let value_as_bytes%24#0: bytes = (itob 4u) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat 0x0002 value_as_uint16%25#0) - let value_as_bytes%27#0: bytes = (itob 11u) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#2: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let array_data%22#3: bytes = (concat array_data%22#2 "\x00\x05Hello") - let dynamic_string_array#0: bytes = (concat array_data%22#3 "\x00\x05World") - let array_data%30#1: bytes = (concat 0x01 0x0a) - let array_data%30#2: bytes = (concat array_data%30#1 0xff) - let static_uint8_array#0: bytes = (concat array_data%30#2 0x80) - let value_as_bytes%33#0: bytes = (itob 4u) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let value_as_bytes%37#0: bytes = (itob 10u) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat value_as_uint16%34#0 value_as_uint16%38#0) - let array_data%35#2: bytes = (concat array_data%35#1 "\x00\x04Ping") - let static_string_array#0: bytes = (concat array_data%35#2 "\x00\x04Pong") - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.ssa.ir b/examples/abi_types/out/contract_AbiTypesContract.ssa.ir deleted file mode 100644 index dec562a433..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.ssa.ir +++ /dev/null @@ -1,89 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let some_bytes#0: bytes = "Hello World!" - let length%0#0: uint64 = (len some_bytes#0) - let value_as_bytes%1#0: bytes = (itob length%0#0) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 some_bytes#0) - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= some_bytes#0 some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== some_bytes#0 tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== some_bytes#0 some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let uint8#0: uint64 = 255u - let val_as_bytes%7#0: bytes = (itob uint8#0) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== uint8#0 int8_decoded#0) - (assert tmp%8#0) - let test_bytes#0: bytes = 0x7fffffffffffffff00 - let tmp%9#0: uint64 = (getbyte test_bytes#0 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 test_bytes#0 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 test_bytes#0 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 test_bytes#0 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 test_bytes#0 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#0: bytes = 0x0002 - let array_data%20#1: bytes = (concat array_data%20#0 0x01) - let array_data%20#2: bytes = (concat array_data%20#1 0x02) - let dynamic_uint8_array#0: bytes = array_data%20#2 - let array_data%21#0: bytes = 0x0001 - let array_data%21#1: bytes = (concat array_data%21#0 0x01) - let aliased_dynamic#0: bytes = array_data%21#1 - let array_data%22#0: bytes = 0x0002 - let next_offset%23#0: uint64 = 4u - let value_as_bytes%24#0: bytes = (itob next_offset%23#0) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat array_data%22#0 value_as_uint16%25#0) - let element_length%26#0: uint64 = (len "\x00\x05Hello") - let next_offset%23#1: uint64 = (+ next_offset%23#0 element_length%26#0) - let value_as_bytes%27#0: bytes = (itob next_offset%23#1) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#2: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let element_length%29#0: uint64 = (len "\x00\x05World") - let next_offset%23#2: uint64 = (+ next_offset%23#1 element_length%29#0) - let array_data%22#3: bytes = (concat array_data%22#2 "\x00\x05Hello") - let array_data%22#4: bytes = (concat array_data%22#3 "\x00\x05World") - let dynamic_string_array#0: bytes = array_data%22#4 - let array_data%30#0: bytes = 0x01 - let array_data%30#1: bytes = (concat array_data%30#0 0x0a) - let array_data%30#2: bytes = (concat array_data%30#1 0xff) - let array_data%30#3: bytes = (concat array_data%30#2 0x80) - let static_uint8_array#0: bytes = array_data%30#3 - let array_data%31#0: bytes = 0x01 - let aliased_static#0: bytes = array_data%31#0 - let next_offset%32#0: uint64 = 4u - let value_as_bytes%33#0: bytes = (itob next_offset%32#0) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let array_data%35#0: bytes = value_as_uint16%34#0 - let element_length%36#0: uint64 = (len "\x00\x04Ping") - let next_offset%32#1: uint64 = (+ next_offset%32#0 element_length%36#0) - let value_as_bytes%37#0: bytes = (itob next_offset%32#1) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat array_data%35#0 value_as_uint16%38#0) - let element_length%39#0: uint64 = (len "\x00\x04Pong") - let next_offset%32#2: uint64 = (+ next_offset%32#1 element_length%39#0) - let array_data%35#2: bytes = (concat array_data%35#1 "\x00\x04Ping") - let array_data%35#3: bytes = (concat array_data%35#2 "\x00\x04Pong") - let static_string_array#0: bytes = array_data%35#3 - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_1.ir b/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_1.ir deleted file mode 100644 index 060d08d505..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_1.ir +++ /dev/null @@ -1,68 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let length%0#0: uint64 = (len "Hello World!") - let value_as_bytes%1#0: bytes = (itob length%0#0) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== "Hello World!" tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let val_as_bytes%7#0: bytes = (itob 255u) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== 255u int8_decoded#0) - (assert tmp%8#0) - let tmp%9#0: uint64 = (getbyte 0x7fffffffffffffff00 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 0x7fffffffffffffff00 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 0x7fffffffffffffff00 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 0x7fffffffffffffff00 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 0x7fffffffffffffff00 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#1: bytes = (concat 0x0002 0x01) - let dynamic_uint8_array#0: bytes = (concat array_data%20#1 0x02) - let aliased_dynamic#0: bytes = (concat 0x0001 0x01) - let value_as_bytes%24#0: bytes = (itob 4u) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat 0x0002 value_as_uint16%25#0) - let next_offset%23#1: uint64 = (+ 4u 7u) - let value_as_bytes%27#0: bytes = (itob next_offset%23#1) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#2: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let next_offset%23#2: uint64 = (+ next_offset%23#1 7u) - let array_data%22#3: bytes = (concat array_data%22#2 "\x00\x05Hello") - let dynamic_string_array#0: bytes = (concat array_data%22#3 "\x00\x05World") - let array_data%30#1: bytes = (concat 0x01 0x0a) - let array_data%30#2: bytes = (concat array_data%30#1 0xff) - let static_uint8_array#0: bytes = (concat array_data%30#2 0x80) - let value_as_bytes%33#0: bytes = (itob 4u) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let next_offset%32#1: uint64 = (+ 4u 6u) - let value_as_bytes%37#0: bytes = (itob next_offset%32#1) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat value_as_uint16%34#0 value_as_uint16%38#0) - let next_offset%32#2: uint64 = (+ next_offset%32#1 6u) - let array_data%35#2: bytes = (concat array_data%35#1 "\x00\x04Ping") - let static_string_array#0: bytes = (concat array_data%35#2 "\x00\x04Pong") - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_2.ir b/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_2.ir deleted file mode 100644 index 7a3d194df1..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_2.ir +++ /dev/null @@ -1,65 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let value_as_bytes%1#0: bytes = (itob 12u) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== "Hello World!" tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let val_as_bytes%7#0: bytes = (itob 255u) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== 255u int8_decoded#0) - (assert tmp%8#0) - let tmp%9#0: uint64 = (getbyte 0x7fffffffffffffff00 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 0x7fffffffffffffff00 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 0x7fffffffffffffff00 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 0x7fffffffffffffff00 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 0x7fffffffffffffff00 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#1: bytes = (concat 0x0002 0x01) - let dynamic_uint8_array#0: bytes = (concat array_data%20#1 0x02) - let aliased_dynamic#0: bytes = (concat 0x0001 0x01) - let value_as_bytes%24#0: bytes = (itob 4u) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat 0x0002 value_as_uint16%25#0) - let value_as_bytes%27#0: bytes = (itob 11u) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#2: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let next_offset%23#2: uint64 = (+ 11u 7u) - let array_data%22#3: bytes = (concat array_data%22#2 "\x00\x05Hello") - let dynamic_string_array#0: bytes = (concat array_data%22#3 "\x00\x05World") - let array_data%30#1: bytes = (concat 0x01 0x0a) - let array_data%30#2: bytes = (concat array_data%30#1 0xff) - let static_uint8_array#0: bytes = (concat array_data%30#2 0x80) - let value_as_bytes%33#0: bytes = (itob 4u) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let value_as_bytes%37#0: bytes = (itob 10u) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat value_as_uint16%34#0 value_as_uint16%38#0) - let next_offset%32#2: uint64 = (+ 10u 6u) - let array_data%35#2: bytes = (concat array_data%35#1 "\x00\x04Ping") - let static_string_array#0: bytes = (concat array_data%35#2 "\x00\x04Pong") - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_3.ir b/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_3.ir deleted file mode 100644 index 749df9bd6a..0000000000 --- a/examples/abi_types/out/contract_AbiTypesContract.ssa.opt_pass_3.ir +++ /dev/null @@ -1,63 +0,0 @@ -contract examples.abi_types.contract.AbiTypesContract: - program approval: - subroutine examples.abi_types.contract.AbiTypesContract.approval_program() -> uint64: - block@0: // L21 - let value_as_bytes%1#0: bytes = (itob 12u) - let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) - let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") - let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) - (assert tmp%3#0) // Original bytes should not match encoded bytes - let tmp%4#0: bytes = ((extract 2 0) some_bytes_as_string#0) - let tmp%5#0: uint64 = (== "Hello World!" tmp%4#0) - (assert tmp%5#0) // Original bytes should match encoded if we strip the length header - let tmp%6#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) - (assert tmp%6#0) - let val_as_bytes%7#0: bytes = (itob 255u) - let int8_encoded#0: bytes = (substring3 val_as_bytes%7#0 7u 8u) - let int8_decoded#0: uint64 = (getbyte int8_encoded#0 0u) - let tmp%8#0: uint64 = (== 255u int8_decoded#0) - (assert tmp%8#0) - let tmp%9#0: uint64 = (getbyte 0x7fffffffffffffff00 0u) - let tmp%10#0: uint64 = (== tmp%9#0 127u) - (assert tmp%10#0) - let integer_bytes%11#0: bytes = (extract3 0x7fffffffffffffff00 0u 3u) - let tmp%12#0: uint64 = (btoi integer_bytes%11#0) - let tmp%13#0: uint64 = (== tmp%12#0 8388607u) - (assert tmp%13#0) - let tmp%14#0: uint64 = (extract_uint16 0x7fffffffffffffff00 0u) - let tmp%15#0: uint64 = (== tmp%14#0 32767u) - (assert tmp%15#0) - let tmp%16#0: uint64 = (extract_uint32 0x7fffffffffffffff00 0u) - let tmp%17#0: uint64 = (== tmp%16#0 2147483647u) - (assert tmp%17#0) - let tmp%18#0: uint64 = (extract_uint64 0x7fffffffffffffff00 0u) - let tmp%19#0: uint64 = (== tmp%18#0 9223372036854775807u) - (assert tmp%19#0) - let array_data%20#1: bytes = (concat 0x0002 0x01) - let dynamic_uint8_array#0: bytes = (concat array_data%20#1 0x02) - let aliased_dynamic#0: bytes = (concat 0x0001 0x01) - let value_as_bytes%24#0: bytes = (itob 4u) - let value_as_uint16%25#0: bytes = ((extract 6 2) value_as_bytes%24#0) - let array_data%22#1: bytes = (concat 0x0002 value_as_uint16%25#0) - let value_as_bytes%27#0: bytes = (itob 11u) - let value_as_uint16%28#0: bytes = ((extract 6 2) value_as_bytes%27#0) - let array_data%22#2: bytes = (concat array_data%22#1 value_as_uint16%28#0) - let array_data%22#3: bytes = (concat array_data%22#2 "\x00\x05Hello") - let dynamic_string_array#0: bytes = (concat array_data%22#3 "\x00\x05World") - let array_data%30#1: bytes = (concat 0x01 0x0a) - let array_data%30#2: bytes = (concat array_data%30#1 0xff) - let static_uint8_array#0: bytes = (concat array_data%30#2 0x80) - let value_as_bytes%33#0: bytes = (itob 4u) - let value_as_uint16%34#0: bytes = ((extract 6 2) value_as_bytes%33#0) - let value_as_bytes%37#0: bytes = (itob 10u) - let value_as_uint16%38#0: bytes = ((extract 6 2) value_as_bytes%37#0) - let array_data%35#1: bytes = (concat value_as_uint16%34#0 value_as_uint16%38#0) - let array_data%35#2: bytes = (concat array_data%35#1 "\x00\x04Ping") - let static_string_array#0: bytes = (concat array_data%35#2 "\x00\x04Pong") - return 1u - - program clear-state: - subroutine examples.abi_types.contract.AbiTypesContract.clear_state_program() -> uint64: - block@0: // L69 - return 1u \ No newline at end of file diff --git a/examples/address_constant.algopy.log b/examples/address_constant.algopy.log index 42817734b7..95d716e31d 100644 --- a/examples/address_constant.algopy.log +++ b/examples/address_constant.algopy.log @@ -1,6 +1,7 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 address_constant.py -info: Building AWST for __init__.py -info: Building AWST for address_constant.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug address_constant.py +debug: Building AWST for __init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for address_constant.py debug: Sealing block@0: // L7 debug: Terminated block@0: // L7 debug: Sealing block@0: // L18 @@ -15,6 +16,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: sender#0, sender_bytes#0 debug: Replacing {sender_bytes#0} with sender#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable some_address#0 debug: Removing unused variable some_address#1 @@ -27,6 +29,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -38,6 +41,7 @@ debug: Optimizing subroutine examples.address_constant.AddressConstantContract.a debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -47,6 +51,7 @@ debug: Optimizing subroutine examples.address_constant.AddressConstantContract.c debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -66,15 +71,15 @@ debug: Coalescing local variables in examples.address_constant.AddressConstantCo debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/out/address_constant_AddressConstantContract.final.ir debug: Inserted main_block@0.ops[1]: 'store sender#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load sender#0 from scratch' with 'load sender#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load sender#0' with 'load sender#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[6]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[8]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[8]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[11]: 'store is_some_address#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[13]: 'load is_some_address#0 from scratch' with 'load is_some_address#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[13]: 'load is_some_address#0' with 'load is_some_address#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[15]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[17]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' -info: Writing /examples/out/address_constant.approval.teal -info: Writing /examples/out/address_constant.approval.debug.teal -info: Writing /examples/out/address_constant.clear.teal -info: Writing /examples/out/address_constant.clear.debug.teal +debug: Replaced main_block@0.ops[17]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +info: Writing out/address_constant.approval.teal +info: Writing out/address_constant.approval.debug.teal +info: Writing out/address_constant.clear.teal +info: Writing out/address_constant.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/address_constant.py b/examples/address_constant.py index 6e52cbd9a9..b63046e714 100644 --- a/examples/address_constant.py +++ b/examples/address_constant.py @@ -1,12 +1,12 @@ -from algopy import Address, Contract, Transaction, log +from algopy import Account, Contract, Transaction, log SOME_ADDRESS = "VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA" class AddressConstantContract(Contract): def approval_program(self) -> bool: - some_address = Address(SOME_ADDRESS) - some_address = Address.from_bytes(some_address.bytes) + some_address = Account(SOME_ADDRESS) + some_address = Account.from_bytes(some_address.bytes) sender = Transaction.sender() sender_bytes = sender.bytes diff --git a/examples/algopy.log b/examples/algopy.log new file mode 100644 index 0000000000..30a36cd14d --- /dev/null +++ b/examples/algopy.log @@ -0,0 +1,127 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug . +typing_interactions.py:11 info: Revealed type is "algopy._primitives.UInt64" +typing_interactions.py:12 info: Revealed type is "tuple[algopy._primitives.UInt64, algopy._primitives.Bytes]" +debug: Building AWST for with_reentrancy +debug: Building AWST for voting +debug: Building AWST for unssa +debug: Building AWST for undefined_phi_args +debug: Building AWST for unary +debug: Building AWST for transaction +debug: Building AWST for stubs +debug: Building AWST for string_ops +debug: Building AWST for nested_loops +debug: Building AWST for local_storage +debug: Building AWST for koopman +debug: Building AWST for enumeration +debug: Building AWST for edverify +debug: Building AWST for conditional_execution +debug: Building AWST for chained_assignment +debug: Building AWST for callsub +debug: Building AWST for calculator +debug: Building AWST for bytes_ops +debug: Building AWST for boolean_binary_ops +debug: Building AWST for biguint_binary_ops +debug: Building AWST for augmented_assignment +debug: Building AWST for aug_ass_wit_side_efex +debug: Building AWST for asset +debug: Building AWST for arc4_types +debug: Building AWST for application +debug: Building AWST for amm +debug: Building AWST for abi_routing +debug: Building AWST for TEALScript +debug: Building AWST for TEALScript/auction +debug: Building AWST for non_utf8.py +debug: Building AWST for ssa2/__init__.py +debug: Building AWST for ssa/__init__.py +debug: Building AWST for simplish/__init__.py +debug: Building AWST for simple/__init__.py +debug: Building AWST for mylib/__init__.py +debug: Building AWST for module_consts/constants3.py +debug: Building AWST for module_consts/constants2.py +debug: Building AWST for module_consts/constants.py +debug: Building AWST for module_consts/__init__.py +debug: Building AWST for less_simple/__init__.py +debug: Building AWST for everything/constants.py +debug: Building AWST for everything/__init__.py +debug: Building AWST for contains/__init__.py +debug: Building AWST for conditional_expressions/__init__.py +debug: Building AWST for __init__.py +debug: Building AWST for module_consts/constants4.py +debug: Building AWST for embedded algopy lib at /src/wyvern/lib_embedded/_algopy_.py +debug: Building AWST for with_structs.py +debug: Building AWST for unreachable.py +debug: Building AWST for typing_interactions.py +typing_interactions.py:11 info: algopy type is "uint64" +typing_interactions.py:12 info: algopy type is "tuple" +typing_interactions.py:13 warning: use of typing.assert_type has no effect on compilation +typing_interactions.py:13 warning: expression result is ignored +typing_interactions.py:15 warning: use of typing.cast, output may be invalid or insecure TEAL +typing_interactions.py:15 error: Unsupported comparison == between types +debug: Building AWST for tuple_support.py +debug: Building AWST for byte_constants.py +debug: Building AWST for address_constant.py +debug: Building AWST for with_reentrancy/contract.py +with_reentrancy/contract.py:9 warning: expression result is ignored +debug: Building AWST for voting/voting.py +debug: Building AWST for unssa/contract.py +unssa/contract.py:6 warning: expression result is ignored +unssa/contract.py:13 warning: expression result is ignored +unssa/contract.py:15 warning: expression result is ignored +debug: Building AWST for undefined_phi_args/baddie.py +debug: Building AWST for unary/contract.py +debug: Building AWST for transaction/contract.py +debug: Building AWST for stubs/uint64.py +debug: Building AWST for stubs/bytes.py +debug: Building AWST for stubs/biguint.py +debug: Building AWST for string_ops/contract.py +debug: Building AWST for ssa2/contract.py +debug: Building AWST for ssa/contract.py +debug: Building AWST for simplish/base_class.py +debug: Building AWST for simple/subs.py +debug: Building AWST for simple/pkg_a/pkg_1/subs.py +debug: Building AWST for nested_loops/contract.py +debug: Building AWST for mylib/simple_functions.py +debug: Building AWST for module_consts/contract.py +debug: Building AWST for local_storage/local_storage_with_offsets.py +debug: Building AWST for local_storage/local_storage_contract.py +debug: Building AWST for less_simple/contract.py +debug: Building AWST for koopman/contract.py +debug: Building AWST for everything/my_base.py +debug: Building AWST for enumeration/contract.py +debug: Building AWST for edverify/contract.py +debug: Building AWST for contains/contract.py +debug: Building AWST for conditional_expressions/contract.py +debug: Building AWST for conditional_execution/contract.py +conditional_execution/contract.py:11 warning: expression result is ignored +conditional_execution/contract.py:17 warning: expression result is ignored +conditional_execution/contract.py:23 warning: expression result is ignored +conditional_execution/contract.py:29 warning: expression result is ignored +conditional_execution/contract.py:35 warning: expression result is ignored +conditional_execution/contract.py:41 warning: expression result is ignored +conditional_execution/contract.py:47 warning: expression result is ignored +debug: Building AWST for chained_assignment/contract.py +debug: Building AWST for callsub/contract.py +debug: Building AWST for calculator/contract.py +debug: Building AWST for bytes_ops/contract.py +debug: Building AWST for boolean_binary_ops/contract.py +debug: Building AWST for biguint_binary_ops/contract.py +debug: Building AWST for augmented_assignment/contract.py +debug: Building AWST for aug_ass_wit_side_efex/lol.py +debug: Building AWST for asset/contract.py +debug: Building AWST for arc4_types/tuples.py +debug: Building AWST for arc4_types/structs.py +debug: Building AWST for arc4_types/string.py +debug: Building AWST for arc4_types/numeric.py +debug: Building AWST for arc4_types/bool.py +debug: Building AWST for arc4_types/array.py +debug: Building AWST for application/contract.py +debug: Building AWST for amm/contract.py +debug: Building AWST for abi_routing/contract.py +debug: Building AWST for TEALScript/auction/contract.py +debug: Building AWST for simplish/contract.py +debug: Building AWST for simple/pkg_a/pkg_1/__init__.py +debug: Building AWST for everything/contract.py +debug: Building AWST for simple/pkg_a/__init__.py +debug: Building AWST for simple/contract.py +error: Build failed +>> exit code = 1 \ No newline at end of file diff --git a/examples/amm/algopy.log b/examples/amm/algopy.log index 8288e8ef28..284dba5e94 100644 --- a/examples/amm/algopy.log +++ b/examples/amm/algopy.log @@ -1,17 +1,1576 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 amm -info: Building AWST for __init__.py -info: Building AWST for amm -info: Building AWST for amm/contract.py -amm/contract.py:48 warning: TODO: @abimethod config handling -amm/contract.py:52 warning: TODO: @abimethod config handling -amm/contract.py:52 error: Unsupported type: algopy.arc4.Account -amm/contract.py:57 warning: TODO: @abimethod config handling -amm/contract.py:57 error: Unsupported type: algopy.arc4.PaymentTransaction -amm/contract.py:89 warning: TODO: @abimethod config handling -amm/contract.py:91 error: Unsupported type: algopy.arc4.AssetTransferTransaction -amm/contract.py:142 warning: TODO: @abimethod config handling -amm/contract.py:142 error: Unsupported type: algopy.arc4.AssetTransferTransaction -amm/contract.py:182 warning: TODO: @abimethod config handling -amm/contract.py:182 error: Unsupported type: algopy.arc4.AssetTransferTransaction -error: Build failed ->> exit code = 1 \ No newline at end of file +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug amm +debug: Building AWST for __init__.py +debug: Building AWST for amm +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for amm/contract.py +debug: Sealing block@0: // L52 +debug: Terminated block@0: // L52 +debug: Sealing block@0: // L271 +debug: Terminated block@0: // L271 +debug: Sealing block@0: // L58 +debug: Terminated block@0: // L58 +debug: Sealing block@0: // L277 +debug: Terminated block@0: // L277 +debug: Sealing block@0: // L294 +debug: Terminated block@0: // L294 +debug: Sealing block@0: // L367 +debug: Terminated block@0: // L367 +debug: Sealing block@0: // L96 +debug: Terminated block@0: // L96 +debug: Sealing block@0: // L260 +debug: Terminated block@0: // L260 +debug: Sealing block@0: // L302 +debug: Terminated block@0: // L302 +debug: Sealing block@0: // L306 +debug: Terminated block@0: // L306 +debug: Sealing block@0: // L310 +debug: Terminated block@0: // L310 +debug: Sealing block@0: // L333 +debug: Terminated block@0: // L333 +debug: Sealing block@None: // and_contd_L341 +debug: Terminated block@1: // and_contd_L341 +debug: Sealing block@None: // bool_true_L341 +debug: Sealing block@None: // bool_false_L341 +debug: Terminated block@2: // bool_true_L341 +debug: Terminated block@3: // bool_false_L341 +debug: Sealing block@4: // bool_merge_L341 +debug: Created Phi assignment: let and_result%2#2: uint64 = undefined while trying to resolve 'and_result%2' in block@4: // bool_merge_L341 +debug: Added and_result%2#0 to Phi node: let and_result%2#2: uint64 = φ(and_result%2#0 <- block@2) in block@2: // bool_true_L341 +debug: Added and_result%2#1 to Phi node: let and_result%2#2: uint64 = φ(and_result%2#0 <- block@2, and_result%2#1 <- block@3) in block@3: // bool_false_L341 +debug: Terminated block@4: // bool_merge_L341 +debug: Sealing block@None: // if_body_L342 +debug: Sealing block@None: // else_body_L342 +debug: Created Phi assignment: let a_amount#1: uint64 = undefined while trying to resolve 'a_amount' in block@4: // bool_merge_L341 +debug: Added a_amount#0 to Phi node: let a_amount#1: uint64 = φ(a_amount#0 <- block@2) in block@2: // bool_true_L341 +debug: Created Phi assignment: let a_amount#2: uint64 = undefined while trying to resolve 'a_amount' in block@3: // bool_false_L341 +debug: Added a_amount#0 to Phi node: let a_amount#2: uint64 = φ(a_amount#0 <- block@0) in block@0: // L333 +debug: Added a_amount#0 to Phi node: let a_amount#2: uint64 = φ(a_amount#0 <- block@0, a_amount#0 <- block@1) in block@1: // and_contd_L341 +debug: Replacing trivial Phi node: let a_amount#2: uint64 = φ(a_amount#0 <- block@0, a_amount#0 <- block@1) (a_amount#2) with a_amount#0 +debug: Deleting Phi assignment: let a_amount#2: uint64 = φ(a_amount#0 <- block@0, a_amount#0 <- block@1) +debug: Replaced trivial Phi node: let a_amount#2: uint64 = φ(a_amount#0 <- block@0, a_amount#0 <- block@1) (a_amount#2) with a_amount#0 in current definition for 1 blocks +debug: Added a_amount#0 to Phi node: let a_amount#1: uint64 = φ(a_amount#0 <- block@2, a_amount#0 <- block@3) in block@3: // bool_false_L341 +debug: Replacing trivial Phi node: let a_amount#1: uint64 = φ(a_amount#0 <- block@2, a_amount#0 <- block@3) (a_amount#1) with a_amount#0 +debug: Deleting Phi assignment: let a_amount#1: uint64 = φ(a_amount#0 <- block@2, a_amount#0 <- block@3) +debug: Replaced trivial Phi node: let a_amount#1: uint64 = φ(a_amount#0 <- block@2, a_amount#0 <- block@3) (a_amount#1) with a_amount#0 in current definition for 1 blocks +debug: Created Phi assignment: let b_amount#1: uint64 = undefined while trying to resolve 'b_amount' in block@4: // bool_merge_L341 +debug: Added b_amount#0 to Phi node: let b_amount#1: uint64 = φ(b_amount#0 <- block@2) in block@2: // bool_true_L341 +debug: Created Phi assignment: let b_amount#2: uint64 = undefined while trying to resolve 'b_amount' in block@3: // bool_false_L341 +debug: Added b_amount#0 to Phi node: let b_amount#2: uint64 = φ(b_amount#0 <- block@0) in block@0: // L333 +debug: Added b_amount#0 to Phi node: let b_amount#2: uint64 = φ(b_amount#0 <- block@0, b_amount#0 <- block@1) in block@1: // and_contd_L341 +debug: Replacing trivial Phi node: let b_amount#2: uint64 = φ(b_amount#0 <- block@0, b_amount#0 <- block@1) (b_amount#2) with b_amount#0 +debug: Deleting Phi assignment: let b_amount#2: uint64 = φ(b_amount#0 <- block@0, b_amount#0 <- block@1) +debug: Replaced trivial Phi node: let b_amount#2: uint64 = φ(b_amount#0 <- block@0, b_amount#0 <- block@1) (b_amount#2) with b_amount#0 in current definition for 1 blocks +debug: Added b_amount#0 to Phi node: let b_amount#1: uint64 = φ(b_amount#0 <- block@2, b_amount#0 <- block@3) in block@3: // bool_false_L341 +debug: Replacing trivial Phi node: let b_amount#1: uint64 = φ(b_amount#0 <- block@2, b_amount#0 <- block@3) (b_amount#1) with b_amount#0 +debug: Deleting Phi assignment: let b_amount#1: uint64 = φ(b_amount#0 <- block@2, b_amount#0 <- block@3) +debug: Replaced trivial Phi node: let b_amount#1: uint64 = φ(b_amount#0 <- block@2, b_amount#0 <- block@3) (b_amount#1) with b_amount#0 in current definition for 1 blocks +debug: Terminated block@5: // if_body_L342 +debug: Sealing block@6: // after_if_else_L342 +debug: Created Phi assignment: let pool_balance#1: uint64 = undefined while trying to resolve 'pool_balance' in block@4: // bool_merge_L341 +debug: Added pool_balance#0 to Phi node: let pool_balance#1: uint64 = φ(pool_balance#0 <- block@2) in block@2: // bool_true_L341 +debug: Created Phi assignment: let pool_balance#2: uint64 = undefined while trying to resolve 'pool_balance' in block@3: // bool_false_L341 +debug: Added pool_balance#0 to Phi node: let pool_balance#2: uint64 = φ(pool_balance#0 <- block@0) in block@0: // L333 +debug: Added pool_balance#0 to Phi node: let pool_balance#2: uint64 = φ(pool_balance#0 <- block@0, pool_balance#0 <- block@1) in block@1: // and_contd_L341 +debug: Replacing trivial Phi node: let pool_balance#2: uint64 = φ(pool_balance#0 <- block@0, pool_balance#0 <- block@1) (pool_balance#2) with pool_balance#0 +debug: Deleting Phi assignment: let pool_balance#2: uint64 = φ(pool_balance#0 <- block@0, pool_balance#0 <- block@1) +debug: Replaced trivial Phi node: let pool_balance#2: uint64 = φ(pool_balance#0 <- block@0, pool_balance#0 <- block@1) (pool_balance#2) with pool_balance#0 in current definition for 1 blocks +debug: Added pool_balance#0 to Phi node: let pool_balance#1: uint64 = φ(pool_balance#0 <- block@2, pool_balance#0 <- block@3) in block@3: // bool_false_L341 +debug: Replacing trivial Phi node: let pool_balance#1: uint64 = φ(pool_balance#0 <- block@2, pool_balance#0 <- block@3) (pool_balance#1) with pool_balance#0 +debug: Deleting Phi assignment: let pool_balance#1: uint64 = φ(pool_balance#0 <- block@2, pool_balance#0 <- block@3) +debug: Replaced trivial Phi node: let pool_balance#1: uint64 = φ(pool_balance#0 <- block@2, pool_balance#0 <- block@3) (pool_balance#1) with pool_balance#0 in current definition for 1 blocks +debug: Created Phi assignment: let a_balance#1: uint64 = undefined while trying to resolve 'a_balance' in block@4: // bool_merge_L341 +debug: Added a_balance#0 to Phi node: let a_balance#1: uint64 = φ(a_balance#0 <- block@2) in block@2: // bool_true_L341 +debug: Created Phi assignment: let a_balance#2: uint64 = undefined while trying to resolve 'a_balance' in block@3: // bool_false_L341 +debug: Added a_balance#0 to Phi node: let a_balance#2: uint64 = φ(a_balance#0 <- block@0) in block@0: // L333 +debug: Added a_balance#0 to Phi node: let a_balance#2: uint64 = φ(a_balance#0 <- block@0, a_balance#0 <- block@1) in block@1: // and_contd_L341 +debug: Replacing trivial Phi node: let a_balance#2: uint64 = φ(a_balance#0 <- block@0, a_balance#0 <- block@1) (a_balance#2) with a_balance#0 +debug: Deleting Phi assignment: let a_balance#2: uint64 = φ(a_balance#0 <- block@0, a_balance#0 <- block@1) +debug: Replaced trivial Phi node: let a_balance#2: uint64 = φ(a_balance#0 <- block@0, a_balance#0 <- block@1) (a_balance#2) with a_balance#0 in current definition for 1 blocks +debug: Added a_balance#0 to Phi node: let a_balance#1: uint64 = φ(a_balance#0 <- block@2, a_balance#0 <- block@3) in block@3: // bool_false_L341 +debug: Replacing trivial Phi node: let a_balance#1: uint64 = φ(a_balance#0 <- block@2, a_balance#0 <- block@3) (a_balance#1) with a_balance#0 +debug: Deleting Phi assignment: let a_balance#1: uint64 = φ(a_balance#0 <- block@2, a_balance#0 <- block@3) +debug: Replaced trivial Phi node: let a_balance#1: uint64 = φ(a_balance#0 <- block@2, a_balance#0 <- block@3) (a_balance#1) with a_balance#0 in current definition for 1 blocks +debug: Created Phi assignment: let b_balance#1: uint64 = undefined while trying to resolve 'b_balance' in block@4: // bool_merge_L341 +debug: Added b_balance#0 to Phi node: let b_balance#1: uint64 = φ(b_balance#0 <- block@2) in block@2: // bool_true_L341 +debug: Created Phi assignment: let b_balance#2: uint64 = undefined while trying to resolve 'b_balance' in block@3: // bool_false_L341 +debug: Added b_balance#0 to Phi node: let b_balance#2: uint64 = φ(b_balance#0 <- block@0) in block@0: // L333 +debug: Added b_balance#0 to Phi node: let b_balance#2: uint64 = φ(b_balance#0 <- block@0, b_balance#0 <- block@1) in block@1: // and_contd_L341 +debug: Replacing trivial Phi node: let b_balance#2: uint64 = φ(b_balance#0 <- block@0, b_balance#0 <- block@1) (b_balance#2) with b_balance#0 +debug: Deleting Phi assignment: let b_balance#2: uint64 = φ(b_balance#0 <- block@0, b_balance#0 <- block@1) +debug: Replaced trivial Phi node: let b_balance#2: uint64 = φ(b_balance#0 <- block@0, b_balance#0 <- block@1) (b_balance#2) with b_balance#0 in current definition for 1 blocks +debug: Added b_balance#0 to Phi node: let b_balance#1: uint64 = φ(b_balance#0 <- block@2, b_balance#0 <- block@3) in block@3: // bool_false_L341 +debug: Replacing trivial Phi node: let b_balance#1: uint64 = φ(b_balance#0 <- block@2, b_balance#0 <- block@3) (b_balance#1) with b_balance#0 +debug: Deleting Phi assignment: let b_balance#1: uint64 = φ(b_balance#0 <- block@2, b_balance#0 <- block@3) +debug: Replaced trivial Phi node: let b_balance#1: uint64 = φ(b_balance#0 <- block@2, b_balance#0 <- block@3) (b_balance#1) with b_balance#0 in current definition for 1 blocks +debug: Terminated block@6: // after_if_else_L342 +debug: Sealing block@None: // if_body_L347 +debug: Sealing block@None: // else_body_L347 +debug: Terminated block@7: // if_body_L347 +debug: Terminated block@8: // else_body_L347 +debug: Sealing block@None: // after_if_else_L347 +debug: Sealing block@0: // L264 +debug: Terminated block@0: // L264 +debug: Sealing block@0: // L162 +debug: Terminated block@0: // L162 +debug: Sealing block@0: // L354 +debug: Terminated block@0: // L354 +debug: Sealing block@0: // L218 +debug: Terminated block@0: // L218 +debug: Sealing block@None: // switch_case_default_L239 +debug: Sealing block@None: // switch_case_0_L241 +debug: Sealing block@None: // switch_case_1_L245 +debug: Terminated block@1: // switch_case_0_L241 +debug: Terminated block@2: // switch_case_1_L245 +debug: Terminated block@3: // switch_case_default_L239 +debug: Sealing block@4: // switch_case_next_L239 +debug: Created Phi assignment: let swap_xfer#1: uint64 = undefined while trying to resolve 'swap_xfer' in block@4: // switch_case_next_L239 +debug: Added swap_xfer#0 to Phi node: let swap_xfer#1: uint64 = φ(swap_xfer#0 <- block@1) in block@1: // switch_case_0_L241 +debug: Added swap_xfer#0 to Phi node: let swap_xfer#1: uint64 = φ(swap_xfer#0 <- block@1, swap_xfer#0 <- block@2) in block@2: // switch_case_1_L245 +debug: Replacing trivial Phi node: let swap_xfer#1: uint64 = φ(swap_xfer#0 <- block@1, swap_xfer#0 <- block@2) (swap_xfer#1) with swap_xfer#0 +debug: Deleting Phi assignment: let swap_xfer#1: uint64 = φ(swap_xfer#0 <- block@1, swap_xfer#0 <- block@2) +debug: Replaced trivial Phi node: let swap_xfer#1: uint64 = φ(swap_xfer#0 <- block@1, swap_xfer#0 <- block@2) (swap_xfer#1) with swap_xfer#0 in current definition for 1 blocks +debug: Created Phi assignment: let in_supply#2: uint64 = undefined while trying to resolve 'in_supply' in block@4: // switch_case_next_L239 +debug: Added in_supply#0 to Phi node: let in_supply#2: uint64 = φ(in_supply#0 <- block@1) in block@1: // switch_case_0_L241 +debug: Added in_supply#1 to Phi node: let in_supply#2: uint64 = φ(in_supply#0 <- block@1, in_supply#1 <- block@2) in block@2: // switch_case_1_L245 +debug: Created Phi assignment: let out_supply#2: uint64 = undefined while trying to resolve 'out_supply' in block@4: // switch_case_next_L239 +debug: Added out_supply#0 to Phi node: let out_supply#2: uint64 = φ(out_supply#0 <- block@1) in block@1: // switch_case_0_L241 +debug: Added out_supply#1 to Phi node: let out_supply#2: uint64 = φ(out_supply#0 <- block@1, out_supply#1 <- block@2) in block@2: // switch_case_1_L245 +debug: Created Phi assignment: let out_asset#2: uint64 = undefined while trying to resolve 'out_asset' in block@4: // switch_case_next_L239 +debug: Added out_asset#0 to Phi node: let out_asset#2: uint64 = φ(out_asset#0 <- block@1) in block@1: // switch_case_0_L241 +debug: Added out_asset#1 to Phi node: let out_asset#2: uint64 = φ(out_asset#0 <- block@1, out_asset#1 <- block@2) in block@2: // switch_case_1_L245 +debug: Terminated block@4: // switch_case_next_L239 +debug: Sealing block@0: // L360 +debug: Terminated block@0: // L360 +debug: Sealing block@0: // L48 +debug: Terminated block@0: // L48 +debug: Sealing block@0: // L32 +debug: Terminated block@0: // L32 +debug: Sealing block@0: // L31 +debug: Terminated block@0: // L31 +debug: Sealing block@None: // on_create_L32 +debug: Terminated block@1: // on_create_L32 +debug: Sealing block@2: // entrypoint_L32 +debug: Terminated block@2: // entrypoint_L32 +debug: Sealing block@None: // abi_routing_L31 +debug: Sealing block@None: // bare_routing_L31 +debug: Terminated block@3: // abi_routing_L31 +debug: Sealing block@None: // switch_case_default_L31 +debug: Sealing block@None: // set_governor_route_L51 +debug: Sealing block@None: // bootstrap_route_L57 +debug: Sealing block@None: // mint_route_L89 +debug: Sealing block@None: // burn_route_L155 +debug: Sealing block@None: // swap_route_L212 +debug: Terminated block@4: // set_governor_route_L51 +debug: Terminated block@5: // bootstrap_route_L57 +debug: Terminated block@6: // mint_route_L89 +debug: Terminated block@7: // burn_route_L155 +debug: Terminated block@8: // swap_route_L212 +debug: Terminated block@9: // switch_case_default_L31 +debug: Sealing block@10: // switch_case_next_L31 +debug: Terminated block@10: // switch_case_next_L31 +debug: Terminated block@11: // bare_routing_L31 +debug: Sealing block@None: // reject_bare_on_completion_L31 +debug: Sealing block@None: // create_L48 +debug: Terminated block@12: // create_L48 +debug: Terminated block@13: // reject_bare_on_completion_L31 +debug: Sealing block@None: // switch_case_next_L31 +debug: Sealing block@14: // after_if_else_L31 +debug: Terminated block@14: // after_if_else_L31 +debug: Sealing block@0: // L31 +debug: Terminated block@0: // L31 +debug: Output IR to /examples/amm/out/contract_ConstantProductAMM.ssa.ir +info: Optimizing examples.amm.contract.ConstantProductAMM at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%15#0, maybe_value%12#0 +debug: Replacing {maybe_value%12#0} with awst_tmp%15#0 made 1 modifications +debug: Found equivalence set: tmp%17#0, maybe_value_did_exist%13#0 +debug: Replacing {maybe_value_did_exist%13#0} with tmp%17#0 made 1 modifications +debug: Found equivalence set: awst_tmp%32#0, maybe_value%29#0 +debug: Replacing {maybe_value%29#0} with awst_tmp%32#0 made 1 modifications +debug: Found equivalence set: tmp%34#0, maybe_value_did_exist%30#0 +debug: Replacing {maybe_value_did_exist%30#0} with tmp%34#0 made 1 modifications +debug: Found equivalence set: awst_tmp%15#1, maybe_value%35#0 +debug: Replacing {maybe_value%35#0} with awst_tmp%15#1 made 1 modifications +debug: Found equivalence set: tmp%39#0, maybe_value_did_exist%36#0 +debug: Replacing {maybe_value_did_exist%36#0} with tmp%39#0 made 1 modifications +debug: Found equivalence set: awst_tmp%15#2, maybe_value%52#0 +debug: Replacing {maybe_value%52#0} with awst_tmp%15#2 made 1 modifications +debug: Found equivalence set: tmp%56#0, maybe_value_did_exist%53#0 +debug: Replacing {maybe_value_did_exist%53#0} with tmp%56#0 made 1 modifications +debug: Found equivalence set: awst_tmp%15#3, maybe_value%69#0 +debug: Replacing {maybe_value%69#0} with awst_tmp%15#3 made 1 modifications +debug: Found equivalence set: tmp%73#0, maybe_value_did_exist%70#0 +debug: Replacing {maybe_value_did_exist%70#0} with tmp%73#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Switch switch tmp%80#0 {0u => block@12, * => block@13} simplified to goto [block@12, ...block@13][tmp%80#0] +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@10: // switch_case_next_L31 with block@9: // switch_case_default_L31 in block@14: // after_if_else_L31 +debug: Merged linear block@10: // switch_case_next_L31 into block@9: // switch_case_default_L31 +debug: Merged linear block@14: // after_if_else_L31 into block@9: // switch_case_default_L31 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.set_governor +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._check_is_governor +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.bootstrap +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._create_pool_token +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._do_opt_in +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.do_asset_transfer +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.mint +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_a_balance +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_b_balance +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_mint +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: and_result%2#2, is_initial_mint#0 +debug: Replacing {and_result%2#2} with is_initial_mint#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._update_ratio +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.burn +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_burn +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.swap +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: app_global_get_ex_value%16#0, out_asset#0 +debug: Replacing {app_global_get_ex_value%16#0} with out_asset#0 made 1 modifications +debug: Found equivalence set: app_global_get_ex_value%18#0, out_asset#1 +debug: Replacing {app_global_get_ex_value%18#0} with out_asset#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_swap +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.create +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: GotoNth goto [block@12, ...block@13][tmp%80#0] simplified to goto tmp%80#0 ? block@13 : block@12 +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.set_governor +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._check_is_governor +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.bootstrap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._create_pool_token +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._do_opt_in +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.do_asset_transfer +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.mint +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_a_balance +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_b_balance +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_mint +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._update_ratio +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.burn +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_burn +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.swap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_swap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.create +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.set_governor +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._check_is_governor +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.bootstrap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._create_pool_token +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._do_opt_in +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.do_asset_transfer +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.mint +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_a_balance +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._current_b_balance +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_mint +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM._update_ratio +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.burn +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_burn +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.swap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.tokens_to_swap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.create +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.amm.contract.ConstantProductAMM.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 3, ending loop +debug: Output IR to /examples/amm/out/contract_ConstantProductAMM.cssa.ir +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.approval_program +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.set_governor +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._check_is_governor +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.bootstrap +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._create_pool_token +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._do_opt_in +debug: Removing Phis from examples.amm.contract.do_asset_transfer +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.mint +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._check_bootstrapped +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._current_pool_balance +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._current_a_balance +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._current_b_balance +debug: Removing Phis from examples.amm.contract.tokens_to_mint +debug: Removing Phis from examples.amm.contract.ConstantProductAMM._update_ratio +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.burn +debug: Removing Phis from examples.amm.contract.tokens_to_burn +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.swap +debug: Removing Phis from examples.amm.contract.tokens_to_swap +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.create +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.__init__ +debug: Removing Phis from examples.amm.contract.ConstantProductAMM.clear_state_program +debug: Output IR to /examples/amm/out/contract_ConstantProductAMM.post_ssa.ir +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.approval_program +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.set_governor +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._check_is_governor +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.bootstrap +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._create_pool_token +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._do_opt_in +debug: Sequentializing parallel copies in examples.amm.contract.do_asset_transfer +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.mint +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._check_bootstrapped +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._current_pool_balance +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._current_a_balance +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._current_b_balance +debug: Sequentializing parallel copies in examples.amm.contract.tokens_to_mint +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM._update_ratio +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.burn +debug: Sequentializing parallel copies in examples.amm.contract.tokens_to_burn +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.swap +debug: loc: {out_asset#5=None, out_supply#5=None, in_supply#5=None, out_asset#0=out_asset#0, out_supply#0=out_supply#0, in_supply#0=in_supply#0} +debug: pred: {out_asset#5=out_asset#0, out_supply#5=out_supply#0, in_supply#5=in_supply#0} +debug: ready: out_asset#5, out_supply#5, in_supply#5 +debug: to_do: out_asset#5, out_supply#5, in_supply#5 +debug: * avail in_supply#5 +debug: * avail in_supply#0 +debug: * avail out_supply#5 +debug: * avail out_supply#0 +debug: * avail out_asset#5 +debug: * avail out_asset#0 +debug: * to_do in_supply#5 +debug: * to_do out_supply#5 +debug: * to_do out_asset#5 +debug: loc: {out_asset#5=None, out_supply#5=None, in_supply#5=None, out_asset#1=out_asset#1, out_supply#1=out_supply#1, in_supply#1=in_supply#1} +debug: pred: {out_asset#5=out_asset#1, out_supply#5=out_supply#1, in_supply#5=in_supply#1} +debug: ready: out_asset#5, out_supply#5, in_supply#5 +debug: to_do: out_asset#5, out_supply#5, in_supply#5 +debug: * avail in_supply#5 +debug: * avail in_supply#1 +debug: * avail out_supply#5 +debug: * avail out_supply#1 +debug: * avail out_asset#5 +debug: * avail out_asset#1 +debug: * to_do in_supply#5 +debug: * to_do out_supply#5 +debug: * to_do out_asset#5 +debug: loc: {out_asset#2=None, out_supply#2=None, in_supply#2=None, out_asset#5=out_asset#5, out_supply#5=out_supply#5, in_supply#5=in_supply#5} +debug: pred: {out_asset#2=out_asset#5, out_supply#2=out_supply#5, in_supply#2=in_supply#5} +debug: ready: out_asset#2, out_supply#2, in_supply#2 +debug: to_do: out_asset#2, out_supply#2, in_supply#2 +debug: * avail in_supply#2 +debug: * avail in_supply#5 +debug: * avail out_supply#2 +debug: * avail out_supply#5 +debug: * avail out_asset#2 +debug: * avail out_asset#5 +debug: * to_do in_supply#2 +debug: * to_do out_supply#2 +debug: * to_do out_asset#2 +debug: Sequentializing parallel copies in examples.amm.contract.tokens_to_swap +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.create +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.__init__ +debug: Sequentializing parallel copies in examples.amm.contract.ConstantProductAMM.clear_state_program +debug: Output IR to /examples/amm/out/contract_ConstantProductAMM.parallel_copies.ir +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.approval_program using strategy RootOperandGrouping +debug: Coalescing awst_tmp%15#0 with [awst_tmp%15#1, awst_tmp%15#2, awst_tmp%15#3] +debug: Coalescing resulted in 9 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.set_governor using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._check_is_governor using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.bootstrap using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._create_pool_token using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._do_opt_in using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.do_asset_transfer using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.mint using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._check_bootstrapped using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._current_pool_balance using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._current_a_balance using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._current_b_balance using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.tokens_to_mint using strategy RootOperandGrouping +debug: Coalescing and_result%2#0 with [and_result%2#1] +debug: Coalescing is_initial_mint#0 with [is_initial_mint#1] +debug: Coalescing resulted in 5 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM._update_ratio using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.burn using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.tokens_to_burn using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.swap using strategy RootOperandGrouping +debug: Coalescing in_supply#0 with [in_supply#5, in_supply#1, in_supply#2] +debug: Coalescing out_supply#0 with [out_supply#5, out_supply#1, out_supply#2] +debug: Coalescing out_asset#0 with [out_asset#5, out_asset#1, out_asset#2] +debug: Coalescing resulted in 21 replacement/s +debug: Coalescing local variables in examples.amm.contract.tokens_to_swap using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.create using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.amm.contract.ConstantProductAMM.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/amm/out/contract_ConstantProductAMM.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@3.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_abi_routing@3.ops[8]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_set_governor_route@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_set_governor_route@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_set_governor_route@4.ops[5]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_set_governor_route@4.ops[7]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_set_governor_route@4.ops[10]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_set_governor_route@4.ops[12]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_set_governor_route@4.ops[15]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_set_governor_route@4.ops[17]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_set_governor_route@4.ops[19]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_set_governor_route@4.ops[21]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_set_governor_route@4.ops[23]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_set_governor_route@4.ops[25]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[1]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[3]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[5]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[7]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[10]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[12]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[15]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[17]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[20]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[22]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[24]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[26]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[29]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[31]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[34]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[36]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[38]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[40]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[44]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[46]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[48]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[50]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[61]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[63]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[57]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[60]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[52]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[56]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[42]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[56]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[23]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[56]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[1]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[3]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[5]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[7]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[10]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[12]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[15]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[17]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[20]: 'store awst_tmp%32#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[22]: 'load awst_tmp%32#0' with 'load awst_tmp%32#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[24]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[26]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[29]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[31]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[34]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[36]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[39]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[41]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[43]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[45]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[48]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[50]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[53]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[55]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[57]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[59]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[63]: 'store tmp%43#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[65]: 'load tmp%43#0' with 'load tmp%43#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[67]: 'store tmp%44#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[69]: 'load tmp%44#0' with 'load tmp%44#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[73]: 'store tmp%46#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[75]: 'load tmp%46#0' with 'load tmp%46#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[77]: 'store tmp%47#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[79]: 'load tmp%47#0' with 'load tmp%47#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[81]: 'store tmp%48#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[87]: 'load tmp%48#0' with 'load tmp%48#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[71]: 'store tmp%45#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[87]: 'load tmp%45#0' with 'load tmp%45#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[61]: 'store tmp%42#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[87]: 'load tmp%42#0' with 'load tmp%42#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[42]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[87]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_mint_route@6.ops[23]: 'store awst_tmp%32#0 to l-stack (copy)' +debug: Replaced main_mint_route@6.ops[87]: 'load awst_tmp%32#0' with 'load awst_tmp%32#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[1]: 'store tmp%49#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[3]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[5]: 'store tmp%50#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[7]: 'load tmp%50#0' with 'load tmp%50#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[10]: 'store tmp%51#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[12]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[15]: 'store tmp%54#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[17]: 'load tmp%54#0' with 'load tmp%54#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[20]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[22]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[24]: 'store tmp%55#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[26]: 'load tmp%55#0' with 'load tmp%55#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[29]: 'store tmp%56#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[31]: 'load tmp%56#0' with 'load tmp%56#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[34]: 'store tmp%57#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[36]: 'load tmp%57#0' with 'load tmp%57#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[38]: 'store tmp%58#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[40]: 'load tmp%58#0' with 'load tmp%58#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[44]: 'store tmp%60#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[46]: 'load tmp%60#0' with 'load tmp%60#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[48]: 'store tmp%61#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[50]: 'load tmp%61#0' with 'load tmp%61#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[54]: 'store tmp%63#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[56]: 'load tmp%63#0' with 'load tmp%63#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[58]: 'store tmp%64#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[60]: 'load tmp%64#0' with 'load tmp%64#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[62]: 'store tmp%65#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[67]: 'load tmp%65#0' with 'load tmp%65#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[52]: 'store tmp%62#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[67]: 'load tmp%62#0' with 'load tmp%62#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[42]: 'store tmp%59#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[67]: 'load tmp%59#0' with 'load tmp%59#0 from l-stack (no copy)' +debug: Inserted main_burn_route@7.ops[23]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_burn_route@7.ops[67]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[1]: 'store tmp%66#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[3]: 'load tmp%66#0' with 'load tmp%66#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[5]: 'store tmp%67#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[7]: 'load tmp%67#0' with 'load tmp%67#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[10]: 'store tmp%68#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[12]: 'load tmp%68#0' with 'load tmp%68#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[15]: 'store tmp%71#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[17]: 'load tmp%71#0' with 'load tmp%71#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[20]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[22]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[24]: 'store tmp%72#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[26]: 'load tmp%72#0' with 'load tmp%72#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[29]: 'store tmp%73#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[31]: 'load tmp%73#0' with 'load tmp%73#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[34]: 'store tmp%74#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[36]: 'load tmp%74#0' with 'load tmp%74#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[38]: 'store tmp%75#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[40]: 'load tmp%75#0' with 'load tmp%75#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[44]: 'store tmp%77#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[46]: 'load tmp%77#0' with 'load tmp%77#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[48]: 'store tmp%78#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[50]: 'load tmp%78#0' with 'load tmp%78#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[52]: 'store tmp%79#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[56]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[42]: 'store tmp%76#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[56]: 'load tmp%76#0' with 'load tmp%76#0 from l-stack (no copy)' +debug: Inserted main_swap_route@8.ops[23]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced main_swap_route@8.ops[56]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@11.ops[1]: 'store tmp%80#0 to l-stack (copy)' +debug: Replaced main_bare_routing@11.ops[3]: 'load tmp%80#0' with 'load tmp%80#0 from l-stack (no copy)' +debug: Inserted main_create@12.ops[1]: 'store tmp%81#0 to l-stack (copy)' +debug: Replaced main_create@12.ops[3]: 'load tmp%81#0' with 'load tmp%81#0 from l-stack (no copy)' +debug: Inserted main_create@12.ops[5]: 'store tmp%82#0 to l-stack (copy)' +debug: Replaced main_create@12.ops[7]: 'load tmp%82#0' with 'load tmp%82#0 from l-stack (no copy)' +debug: Found 4 edge set/s for examples.amm.contract.ConstantProductAMM.approval_program +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Simplified uncover 4; uncover 4; uncover 4; uncover 4; uncover 4 to +debug: Simplified uncover 3; uncover 3; uncover 3; uncover 3 to +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Inserted _check_is_governor_block@0.ops[12]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced _check_is_governor_block@0.ops[14]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted _check_is_governor_block@0.ops[5]: 'store app_global_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced _check_is_governor_block@0.ops[8]: 'load app_global_get_ex_did_exist%2#0' with 'load app_global_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted _check_is_governor_block@0.ops[7]: 'store app_global_get_ex_value%1#0 to l-stack (copy)' +debug: Replaced _check_is_governor_block@0.ops[12]: 'load app_global_get_ex_value%1#0' with 'load app_global_get_ex_value%1#0 from l-stack (no copy)' +debug: Inserted _check_is_governor_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced _check_is_governor_block@0.ops[12]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[9]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[11]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[15]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[17]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[20]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[22]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[32]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[34]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[38]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[40]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[43]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[45]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[50]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[52]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[92]: 'store val_as_bytes%18#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[94]: 'load val_as_bytes%18#0' with 'load val_as_bytes%18#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[29]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[32]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[63]: 'store new_state_value%11#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[66]: 'load new_state_value%11#0' with 'load new_state_value%11#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[71]: 'store app_global_get_ex_did_exist%13#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[74]: 'load app_global_get_ex_did_exist%13#0' with 'load app_global_get_ex_did_exist%13#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[81]: 'store app_global_get_ex_did_exist%15#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[84]: 'load app_global_get_ex_did_exist%15#0' with 'load app_global_get_ex_did_exist%15#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[91]: 'store app_global_get_ex_did_exist%17#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[94]: 'load app_global_get_ex_did_exist%17#0' with 'load app_global_get_ex_did_exist%17#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[9]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[28]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[33]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[75]: 'store app_global_get_ex_value%12#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[79]: 'load app_global_get_ex_value%12#0' with 'load app_global_get_ex_value%12#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[86]: 'store app_global_get_ex_value%14#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[90]: 'load app_global_get_ex_value%14#0' with 'load app_global_get_ex_value%14#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[97]: 'store app_global_get_ex_value%16#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[101]: 'load app_global_get_ex_value%16#0' with 'load app_global_get_ex_value%16#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[19]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[21]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[41]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[43]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[52]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[54]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[57]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[59]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[65]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[67]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[6]: 'store app_global_get_ex_did_exist%3#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[9]: 'load app_global_get_ex_did_exist%3#0' with 'load app_global_get_ex_did_exist%3#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[13]: 'store maybe_value_did_exist%1#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[16]: 'load maybe_value_did_exist%1#0' with 'load maybe_value_did_exist%1#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[30]: 'store app_global_get_ex_did_exist%9#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[33]: 'load app_global_get_ex_did_exist%9#0' with 'load app_global_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[37]: 'store maybe_value_did_exist%7#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[40]: 'load maybe_value_did_exist%7#0' with 'load maybe_value_did_exist%7#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[8]: 'store app_global_get_ex_value%2#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[12]: 'load app_global_get_ex_value%2#0' with 'load app_global_get_ex_value%2#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[33]: 'store app_global_get_ex_value%8#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[37]: 'load app_global_get_ex_value%8#0' with 'load app_global_get_ex_value%8#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[16]: 'store maybe_value%0#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[21]: 'load maybe_value%0#0' with 'load maybe_value%0#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[42]: 'store maybe_value%6#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[47]: 'load maybe_value%6#0' with 'load maybe_value%6#0 from l-stack (no copy)' +debug: Inserted _create_pool_token_block@0.ops[28]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced _create_pool_token_block@0.ops[47]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted _do_opt_in_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced _do_opt_in_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[13]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[25]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[27]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[39]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[41]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[51]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[53]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[63]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[65]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[75]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[77]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[92]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[94]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[98]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[100]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[103]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[105]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[115]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[117]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[132]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[134]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[138]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[140]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[143]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[145]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[165]: 'store to_mint#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[167]: 'load to_mint#0' with 'load to_mint#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[170]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[172]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[4]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[7]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[19]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[22]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[34]: 'store app_global_get_ex_did_exist%7#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[37]: 'load app_global_get_ex_did_exist%7#0' with 'load app_global_get_ex_did_exist%7#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[50]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[53]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[63]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[66]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[76]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[79]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[91]: 'store app_global_get_ex_did_exist%20#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[94]: 'load app_global_get_ex_did_exist%20#0' with 'load app_global_get_ex_did_exist%20#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[118]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[121]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[133]: 'store app_global_get_ex_did_exist%29#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[136]: 'load app_global_get_ex_did_exist%29#0' with 'load app_global_get_ex_did_exist%29#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[188]: 'store app_global_get_ex_did_exist%41#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[191]: 'load app_global_get_ex_did_exist%41#0' with 'load app_global_get_ex_did_exist%41#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[48]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[53]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[62]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[67]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[76]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[81]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[119]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[124]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[6]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[11]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[22]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[27]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[38]: 'store app_global_get_ex_value%6#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[43]: 'load app_global_get_ex_value%6#0' with 'load app_global_get_ex_value%6#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[99]: 'store app_global_get_ex_value%19#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[104]: 'load app_global_get_ex_value%19#0' with 'load app_global_get_ex_value%19#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[143]: 'store app_global_get_ex_value%28#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[148]: 'load app_global_get_ex_value%28#0' with 'load app_global_get_ex_value%28#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[199]: 'store app_global_get_ex_value%40#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[204]: 'load app_global_get_ex_value%40#0' with 'load app_global_get_ex_value%40#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[176]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[182]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[173]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[182]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[93]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[104]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[138]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[149]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[197]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[208]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[172]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[184]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[170]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[184]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[168]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[184]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted mint_block@0.ops[193]: 'store to_mint#0 to l-stack (copy)' +debug: Replaced mint_block@0.ops[214]: 'load to_mint#0' with 'load to_mint#0 from l-stack (no copy)' +debug: Simplified uncover 4; uncover 4; uncover 4; uncover 4; uncover 4 to +debug: Inserted _check_bootstrapped_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced _check_bootstrapped_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted _check_bootstrapped_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced _check_bootstrapped_block@0.ops[9]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted _current_pool_balance_block@0.ops[5]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced _current_pool_balance_block@0.ops[8]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted _current_pool_balance_block@0.ops[13]: 'store maybe_value_did_exist%1#0 to l-stack (copy)' +debug: Replaced _current_pool_balance_block@0.ops[16]: 'load maybe_value_did_exist%1#0' with 'load maybe_value_did_exist%1#0 from l-stack (no copy)' +debug: Inserted _current_pool_balance_block@0.ops[15]: 'store maybe_value%0#0 to l-stack (copy)' +debug: Replaced _current_pool_balance_block@0.ops[19]: 'load maybe_value%0#0' with 'load maybe_value%0#0 from l-stack (no copy)' +debug: Inserted _current_pool_balance_block@0.ops[7]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced _current_pool_balance_block@0.ops[12]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted _current_pool_balance_block@0.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced _current_pool_balance_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted _current_a_balance_block@0.ops[5]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced _current_a_balance_block@0.ops[8]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted _current_a_balance_block@0.ops[13]: 'store maybe_value_did_exist%1#0 to l-stack (copy)' +debug: Replaced _current_a_balance_block@0.ops[16]: 'load maybe_value_did_exist%1#0' with 'load maybe_value_did_exist%1#0 from l-stack (no copy)' +debug: Inserted _current_a_balance_block@0.ops[15]: 'store maybe_value%0#0 to l-stack (copy)' +debug: Replaced _current_a_balance_block@0.ops[19]: 'load maybe_value%0#0' with 'load maybe_value%0#0 from l-stack (no copy)' +debug: Inserted _current_a_balance_block@0.ops[7]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced _current_a_balance_block@0.ops[12]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted _current_a_balance_block@0.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced _current_a_balance_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted _current_b_balance_block@0.ops[5]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced _current_b_balance_block@0.ops[8]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted _current_b_balance_block@0.ops[13]: 'store maybe_value_did_exist%1#0 to l-stack (copy)' +debug: Replaced _current_b_balance_block@0.ops[16]: 'load maybe_value_did_exist%1#0' with 'load maybe_value_did_exist%1#0 from l-stack (no copy)' +debug: Inserted _current_b_balance_block@0.ops[15]: 'store maybe_value%0#0 to l-stack (copy)' +debug: Replaced _current_b_balance_block@0.ops[19]: 'load maybe_value%0#0' with 'load maybe_value%0#0 from l-stack (no copy)' +debug: Inserted _current_b_balance_block@0.ops[7]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced _current_b_balance_block@0.ops[12]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted _current_b_balance_block@0.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced _current_b_balance_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_and_contd@1.ops[3]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_and_contd@1.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_bool_true@2.ops[1]: 'store and_result%2#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_bool_true@2.ops[3]: 'load and_result%2#0' with 'load and_result%2#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_bool_false@3.ops[1]: 'store and_result%2#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_bool_false@3.ops[3]: 'load and_result%2#0' with 'load and_result%2#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_if_body@5.ops[3]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_if_body@5.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_if_body@5.ops[7]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_if_body@5.ops[9]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_if_body@5.ops[12]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_if_body@5.ops[14]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_after_if_else@6.ops[31]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_after_if_else@6.ops[33]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_after_if_else@6.ops[11]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_after_if_else@6.ops[14]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_after_if_else@6.ops[24]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_after_if_else@6.ops[27]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_after_if_else@6.ops[29]: 'store b_ratio#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_after_if_else@6.ops[32]: 'load b_ratio#0' with 'load b_ratio#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_after_if_else@6.ops[7]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_after_if_else@6.ops[14]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_after_if_else@6.ops[21]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_after_if_else@6.ops[28]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_after_if_else@6.ops[17]: 'store a_ratio#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_after_if_else@6.ops[34]: 'load a_ratio#0' with 'load a_ratio#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_if_body@7.ops[3]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_if_body@7.ops[5]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_if_body@7.ops[8]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_if_body@7.ops[10]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_else_body@8.ops[3]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_else_body@8.ops[5]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted tokens_to_mint_else_body@8.ops[8]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced tokens_to_mint_else_body@8.ops[10]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Found 4 edge set/s for examples.amm.contract.tokens_to_mint +debug: Allocated 2 variable/s to x-stack: is_initial_mint#0, issued#0 +debug: shared x-stack for tokens_to_mint_bool_true@2 -> tokens_to_mint_bool_merge@4: is_initial_mint#0 +debug: shared x-stack for tokens_to_mint_bool_false@3 -> tokens_to_mint_bool_merge@4: is_initial_mint#0 +debug: shared x-stack for tokens_to_mint_after_if_else@6 -> tokens_to_mint_if_body@7: issued#0 +debug: shared x-stack for tokens_to_mint_after_if_else@6 -> tokens_to_mint_else_body@8: issued#0 +debug: examples.amm.contract.tokens_to_mint f-stack entry: ['a_ratio#0', 'b_ratio#0'] +debug: examples.amm.contract.tokens_to_mint f-stack on first store: [] +debug: Inserted _update_ratio_block@0.ops[7]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced _update_ratio_block@0.ops[9]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted _update_ratio_block@0.ops[12]: 'store new_state_value%1#0 to l-stack (copy)' +debug: Replaced _update_ratio_block@0.ops[15]: 'load new_state_value%1#0' with 'load new_state_value%1#0 from l-stack (no copy)' +debug: Inserted _update_ratio_block@0.ops[1]: 'store a_balance#0 to l-stack (copy)' +debug: Replaced _update_ratio_block@0.ops[5]: 'load a_balance#0' with 'load a_balance#0 from l-stack (no copy)' +debug: Inserted _update_ratio_block@0.ops[4]: 'store b_balance#0 to l-stack (copy)' +debug: Replaced _update_ratio_block@0.ops[12]: 'load b_balance#0' with 'load b_balance#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[13]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[25]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[27]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[39]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[41]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[51]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[53]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[57]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[59]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[62]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[64]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[79]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[81]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[91]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[93]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[4]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[7]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[19]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[22]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[34]: 'store app_global_get_ex_did_exist%7#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[37]: 'load app_global_get_ex_did_exist%7#0' with 'load app_global_get_ex_did_exist%7#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[50]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[53]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[76]: 'store app_global_get_ex_did_exist%16#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[79]: 'load app_global_get_ex_did_exist%16#0' with 'load app_global_get_ex_did_exist%16#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[92]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[95]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[128]: 'store app_global_get_ex_did_exist%27#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[131]: 'load app_global_get_ex_did_exist%27#0' with 'load app_global_get_ex_did_exist%27#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[142]: 'store app_global_get_ex_did_exist%30#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[145]: 'load app_global_get_ex_did_exist%30#0' with 'load app_global_get_ex_did_exist%30#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[48]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[53]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[91]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[96]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[109]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[113]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[120]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[124]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[6]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[11]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[22]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[27]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[38]: 'store app_global_get_ex_value%6#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[43]: 'load app_global_get_ex_value%6#0' with 'load app_global_get_ex_value%6#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[82]: 'store app_global_get_ex_value%15#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[87]: 'load app_global_get_ex_value%15#0' with 'load app_global_get_ex_value%15#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[138]: 'store app_global_get_ex_value%26#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[143]: 'load app_global_get_ex_value%26#0' with 'load app_global_get_ex_value%26#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[153]: 'store app_global_get_ex_value%29#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[158]: 'load app_global_get_ex_value%29#0' with 'load app_global_get_ex_value%29#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[110]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[117]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[122]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[129]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[108]: 'store pool_balance#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[117]: 'load pool_balance#0' with 'load pool_balance#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[76]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[87]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[136]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[147]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[152]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[163]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[119]: 'store pool_balance#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[131]: 'load pool_balance#0' with 'load pool_balance#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[123]: 'store a_amt#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[151]: 'load a_amt#0' with 'load a_amt#0 from l-stack (no copy)' +debug: Inserted burn_block@0.ops[136]: 'store b_amt#0 to l-stack (copy)' +debug: Replaced burn_block@0.ops[168]: 'load b_amt#0' with 'load b_amt#0 from l-stack (no copy)' +debug: Simplified uncover 2; uncover 2 to cover 2 +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Inserted tokens_to_burn_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced tokens_to_burn_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted tokens_to_burn_block@0.ops[12]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced tokens_to_burn_block@0.ops[14]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted tokens_to_burn_block@0.ops[17]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced tokens_to_burn_block@0.ops[19]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted tokens_to_burn_block@0.ops[8]: 'store issued#0 to l-stack (copy)' +debug: Replaced tokens_to_burn_block@0.ops[16]: 'load issued#0' with 'load issued#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[13]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[25]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[27]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[31]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[33]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[36]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[38]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[48]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[50]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[4]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[7]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[19]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[22]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[46]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[49]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[58]: 'store app_global_get_ex_did_exist%12#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[61]: 'load app_global_get_ex_did_exist%12#0' with 'load app_global_get_ex_did_exist%12#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[66]: 'store app_global_get_ex_did_exist%14#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[69]: 'load app_global_get_ex_did_exist%14#0' with 'load app_global_get_ex_did_exist%14#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[44]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[49]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[74]: 'store awst_tmp%15#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[78]: 'load awst_tmp%15#0' with 'load awst_tmp%15#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[6]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[11]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[22]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[27]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[71]: 'store app_global_get_ex_value%13#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[80]: 'load app_global_get_ex_value%13#0' with 'load app_global_get_ex_value%13#0 from l-stack (no copy)' +debug: Inserted swap_block@0.ops[63]: 'store app_global_get_ex_value%11#0 to l-stack (copy)' +debug: Replaced swap_block@0.ops[80]: 'load app_global_get_ex_value%11#0' with 'load app_global_get_ex_value%11#0 from l-stack (no copy)' +debug: Inserted swap_switch_case_0@1.ops[7]: 'store app_global_get_ex_did_exist%17#0 to l-stack (copy)' +debug: Replaced swap_switch_case_0@1.ops[10]: 'load app_global_get_ex_did_exist%17#0' with 'load app_global_get_ex_did_exist%17#0 from l-stack (no copy)' +debug: Inserted swap_switch_case_1@2.ops[7]: 'store app_global_get_ex_did_exist%19#0 to l-stack (copy)' +debug: Replaced swap_switch_case_1@2.ops[10]: 'load app_global_get_ex_did_exist%19#0' with 'load app_global_get_ex_did_exist%19#0 from l-stack (no copy)' +debug: Inserted swap_switch_case_next@4.ops[2]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced swap_switch_case_next@4.ops[4]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted swap_switch_case_next@4.ops[8]: 'store to_swap#0 to l-stack (copy)' +debug: Replaced swap_switch_case_next@4.ops[10]: 'load to_swap#0' with 'load to_swap#0 from l-stack (no copy)' +debug: Inserted swap_switch_case_next@4.ops[13]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced swap_switch_case_next@4.ops[15]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted swap_switch_case_next@4.ops[18]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced swap_switch_case_next@4.ops[20]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted swap_switch_case_next@4.ops[11]: 'store to_swap#0 to l-stack (copy)' +debug: Replaced swap_switch_case_next@4.ops[23]: 'load to_swap#0' with 'load to_swap#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.amm.contract.ConstantProductAMM.swap +debug: Allocated 1 variable/s to x-stack: out_supply#0 +debug: shared x-stack for swap_switch_case_0@1 -> swap_switch_case_next@4: out_supply#0 +debug: shared x-stack for swap_switch_case_1@2 -> swap_switch_case_next@4: out_supply#0 +debug: examples.amm.contract.ConstantProductAMM.swap f-stack entry: ['in_supply#0', 'out_asset#0'] +debug: examples.amm.contract.ConstantProductAMM.swap f-stack on first store: [] +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Inserted tokens_to_swap_block@0.ops[19]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced tokens_to_swap_block@0.ops[21]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted tokens_to_swap_block@0.ops[24]: 'store out_total#0 to l-stack (copy)' +debug: Replaced tokens_to_swap_block@0.ops[26]: 'load out_total#0' with 'load out_total#0 from l-stack (no copy)' +debug: Inserted tokens_to_swap_block@0.ops[29]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced tokens_to_swap_block@0.ops[31]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted tokens_to_swap_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced tokens_to_swap_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted tokens_to_swap_block@0.ops[12]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced tokens_to_swap_block@0.ops[15]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted tokens_to_swap_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced tokens_to_swap_block@0.ops[15]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted tokens_to_swap_block@0.ops[18]: 'store in_total#0 to l-stack (copy)' +debug: Replaced tokens_to_swap_block@0.ops[31]: 'load in_total#0' with 'load in_total#0 from l-stack (no copy)' +debug: Inserted __init___block@0.ops[7]: 'store new_state_value%0#0 to l-stack (copy)' +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/contract.approval.teal +info: Writing amm/out/contract.approval.debug.teal +info: Writing amm/out/contract.clear.teal +info: Writing amm/out/contract.clear.debug.teal +info: Writing amm/out/application.json +>> exit code = 0 \ No newline at end of file diff --git a/examples/amm/contract.py b/examples/amm/contract.py index 376f61161b..ed640932bb 100644 --- a/examples/amm/contract.py +++ b/examples/amm/contract.py @@ -1,14 +1,15 @@ # WARNING: This code is provided for example only. Do NOT deploy to mainnet. from algopy import ( - Address, + Account, ARC4Contract, - AssetHoldingGet, - AssetParamsGet, + Asset, + AssetTransferTransaction, Bytes, CreateInnerTransaction, Global, InnerTransaction, + PaymentTransaction, Transaction, TransactionType, UInt64, @@ -16,7 +17,6 @@ sqrt, subroutine, ) -from algopy.arc4 import AssetTransferTransaction, PaymentTransaction # Total supply of the pool tokens TOTAL_SUPPLY = 10_000_000_000 @@ -28,68 +28,78 @@ FACTOR = SCALE - FEE -class ConstantProductionAMM(ARC4Contract): +class ConstantProductAMM(ARC4Contract): def __init__(self) -> None: # init runs whenever the txn's app ID is zero, and runs first # so if we have multiple create methods, this can contain common code. # The asset id of asset A - self.asset_a = UInt64(0) + self.asset_a = Asset(0) # The asset id of asset B - self.asset_b = UInt64(0) - # The asset id of the Pool Token, used to track share of pool the holder may recover - self.pool_token = UInt64(0) - # # The ratio between assets (A*Scale/B) - # self.ratio: UInt64 | None = None + self.asset_b = Asset(0) # The current governor of this contract, allowed to do admin type actions self.governor = Transaction.sender() + # The asset id of the Pool Token, used to track share of pool the holder may recover + self.pool_token = Asset(0) + # The ratio between assets (A*Scale/B) + self.ratio = UInt64(0) - @arc4.abimethod(create=True) + @arc4.baremethod(create=True) def create(self) -> None: """Allow creates""" @arc4.abimethod() - def set_governor(self, new_governor: arc4.Account) -> None: + def set_governor(self, new_governor: Account) -> None: + """sets the governor of the contract, may only be called by the current governor""" self._check_is_governor() - self.governor = new_governor.address + self.governor = new_governor @arc4.abimethod() - def bootstrap(self, seed: PaymentTransaction, asset_a: UInt64, asset_b: UInt64) -> UInt64: + def bootstrap(self, seed: PaymentTransaction, a_asset: Asset, b_asset: Asset) -> arc4.UInt64: """bootstraps the contract by opting into the assets and creating the pool token. - This method will fail if it is attempted more than once on the same contract. + Note this method will fail if it is attempted more than once on the same contract + since the assets and pool token application state values are marked as static and + cannot be overridden. Args: - seed: Initial Payment transaction to the app account, - so it can opt in to assets and create pool token. - asset_a: One of the two assets this pool should allow swapping between. - Must be in the foreign assets array - asset_b: The other of the two assets this pool should allow swapping between. - Must be in the foreign assets array + seed: Initial Payment transaction to the app account so it can opt in to assets + and create pool token. + a_asset: One of the two assets this pool should allow swapping between. + b_asset: The other of the two assets this pool should allow swapping between. Returns: The asset id of the pool token created. """ - assert self.pool_token == 0, "application has already been bootstrapped" + assert not self.pool_token, "application has already been bootstrapped" self._check_is_governor() assert Global.group_size() == 2, "group size not 2" assert seed.receiver == Global.current_application_address(), "receiver not app address" assert seed.amount >= 300_000, "amount minimum not met" # 0.3 Algos - assert asset_a < asset_b, "asset a must be less than asset b" - self.asset_a = asset_a - self.asset_b = asset_b - self._create_pool_token() + assert a_asset.asset_id < b_asset.asset_id, "asset a must be less than asset b" + self.asset_a = a_asset + self.asset_b = b_asset + self.pool_token = self._create_pool_token() self._do_opt_in(self.asset_a) self._do_opt_in(self.asset_b) - return self.pool_token - - @arc4.abimethod() + return arc4.UInt64.encode(self.pool_token.asset_id) + + @arc4.abimethod( + default_args={ + "pool_asset": "pool_token", + "a_asset": "asset_a", + "b_asset": "asset_b", + }, + ) def mint( self, a_xfer: AssetTransferTransaction, b_xfer: AssetTransferTransaction, + pool_asset: Asset, + a_asset: Asset, + b_asset: Asset, ) -> None: """mint pool tokens given some amount of asset A and asset B. @@ -97,17 +107,21 @@ def mint( tokens commensurate with the pools current balance and circulating supply of pool tokens. - NOTE: asset_a, asset_b and pool_token must be in the foreign assets array - Args: a_xfer: Asset Transfer Transaction of asset A as a deposit to the pool in exchange for pool tokens. b_xfer: Asset Transfer Transaction of asset B as a deposit to the pool in exchange for pool tokens. + pool_asset: The asset ID of the pool token so that we may distribute it. + a_asset: The asset ID of the Asset A so that we may inspect our balance. + b_asset: The asset ID of the Asset B so that we may inspect our balance. """ self._check_bootstrapped() # well-formed mint + assert pool_asset == self.pool_token, "asset pool incorrect" + assert a_asset == self.asset_a, "asset a incorrect" + assert b_asset == self.asset_b, "asset b incorrect" assert a_xfer.sender == Transaction.sender(), "sender invalid" assert b_xfer.sender == Transaction.sender(), "sender invalid" @@ -122,7 +136,7 @@ def mint( assert ( b_xfer.asset_receiver == Global.current_application_address() ), "receiver not app address" - assert b_xfer.xfer_asset == self.asset_a, "asset b incorrect" + assert b_xfer.xfer_asset == self.asset_b, "asset b incorrect" assert b_xfer.asset_amount > 0, "amount minimum not met" to_mint = tokens_to_mint( @@ -135,21 +149,38 @@ def mint( assert to_mint > 0, "send amount too low" # mint tokens - do_asset_transfer(receiver=Transaction.sender(), asset_id=self.pool_token, amount=to_mint) + do_asset_transfer(receiver=Transaction.sender(), asset=self.pool_token, amount=to_mint) self._update_ratio() - @arc4.abimethod() - def burn(self, pool_xfer: AssetTransferTransaction) -> None: + @arc4.abimethod( + default_args={ + "pool_asset": "pool_token", + "a_asset": "asset_a", + "b_asset": "asset_b", + }, + ) + def burn( + self, + pool_xfer: AssetTransferTransaction, + pool_asset: Asset, + a_asset: Asset, + b_asset: Asset, + ) -> None: """burn pool tokens to get back some amount of asset A and asset B - NOTE: asset_a, asset_b and pool_token must be in the foreign assets array - Args: pool_xfer: Asset Transfer Transaction of the pool token for the amount the sender wishes to redeem + pool_asset: Asset ID of the pool token so we may inspect balance. + a_asset: Asset ID of Asset A so we may inspect balance and distribute it + b_asset: Asset ID of Asset B so we may inspect balance and distribute it """ self._check_bootstrapped() + assert pool_asset == self.pool_token, "asset pool incorrect" + assert a_asset == self.asset_a, "asset a incorrect" + assert b_asset == self.asset_b, "asset b incorrect" + assert ( pool_xfer.asset_receiver == Global.current_application_address() ), "receiver not app address" @@ -172,23 +203,36 @@ def burn(self, pool_xfer: AssetTransferTransaction) -> None: ) # Send back commensurate amt of a - do_asset_transfer(receiver=Transaction.sender(), asset_id=self.asset_a, amount=a_amt) + do_asset_transfer(receiver=Transaction.sender(), asset=self.asset_a, amount=a_amt) # Send back commensurate amt of b - do_asset_transfer(receiver=Transaction.sender(), asset_id=self.asset_b, amount=b_amt) + do_asset_transfer(receiver=Transaction.sender(), asset=self.asset_b, amount=b_amt) self._update_ratio() - @arc4.abimethod() - def swap(self, swap_xfer: AssetTransferTransaction) -> None: + @arc4.abimethod( + default_args={ + "a_asset": "asset_a", + "b_asset": "asset_b", + }, + ) + def swap( + self, + swap_xfer: AssetTransferTransaction, + a_asset: Asset, + b_asset: Asset, + ) -> None: """Swap some amount of either asset A or asset B for the other - NOTE: asset_a and asset_b must be in the foreign assets array - Args: swap_xfer: Asset Transfer Transaction of either Asset A or Asset B + a_asset: Asset ID of asset A so we may inspect balance and possibly transfer it + b_asset: Asset ID of asset B so we may inspect balance and possibly transfer it """ self._check_bootstrapped() + assert a_asset == self.asset_a, "asset a incorrect" + assert b_asset == self.asset_b, "asset b incorrect" + assert swap_xfer.asset_amount > 0, "amount minimum not met" assert swap_xfer.sender == Transaction.sender(), "sender invalid" @@ -196,11 +240,11 @@ def swap(self, swap_xfer: AssetTransferTransaction) -> None: case self.asset_a: in_supply = self._current_b_balance() out_supply = self._current_a_balance() - out_id = self.asset_a + out_asset = self.asset_a case self.asset_b: in_supply = self._current_a_balance() out_supply = self._current_b_balance() - out_id = self.asset_b + out_asset = self.asset_b case _: assert False, "asset id incorrect" @@ -209,12 +253,12 @@ def swap(self, swap_xfer: AssetTransferTransaction) -> None: ) assert to_swap > 0, "send amount too low" - do_asset_transfer(receiver=Transaction.sender(), asset_id=out_id, amount=to_swap) + do_asset_transfer(receiver=Transaction.sender(), asset=out_asset, amount=to_swap) self._update_ratio() @subroutine def _check_bootstrapped(self) -> None: - assert self.pool_token != 0, "bootstrap method needs to be called first" + assert self.pool_token, "bootstrap method needs to be called first" @subroutine def _update_ratio(self) -> None: @@ -230,17 +274,11 @@ def _check_is_governor(self) -> None: ), "Only the account set in global_state.governor may call this method" @subroutine - def _create_pool_token(self) -> None: - unit_a, unit_a_exists = AssetParamsGet.asset_unit_name(self.asset_a) - assert unit_a_exists - - unit_b, unit_b_exists = AssetParamsGet.asset_unit_name(self.asset_b) - assert unit_b_exists - + def _create_pool_token(self) -> Asset: CreateInnerTransaction.begin() CreateInnerTransaction.set_type_enum(TransactionType.AssetConfig) CreateInnerTransaction.set_config_asset_name( - Bytes(b"DPT-") + unit_a + Bytes(b"-") + unit_b + Bytes(b"DPT-") + self.asset_a.unit_name + Bytes(b"-") + self.asset_b.unit_name ) CreateInnerTransaction.set_config_asset_unit_name(b"dpt") CreateInnerTransaction.set_config_asset_total(TOTAL_SUPPLY) @@ -250,42 +288,27 @@ def _create_pool_token(self) -> None: CreateInnerTransaction.set_fee(0) CreateInnerTransaction.submit() - self.pool_token = InnerTransaction.created_asset_id() + return Asset(InnerTransaction.created_asset_id()) @subroutine - def _do_opt_in(self, asset_id: UInt64) -> None: + def _do_opt_in(self, asset: Asset) -> None: do_asset_transfer( receiver=Global.current_application_address(), - asset_id=asset_id, + asset=asset, amount=UInt64(0), ) @subroutine def _current_pool_balance(self) -> UInt64: - balance, has_balance = AssetHoldingGet.asset_balance( - Global.current_application_address(), - self.pool_token, - ) - assert has_balance - return balance + return self.pool_token.balance(Global.current_application_address()) @subroutine def _current_a_balance(self) -> UInt64: - balance, has_balance = AssetHoldingGet.asset_balance( - Global.current_application_address(), - self.asset_a, - ) - assert has_balance - return balance + return self.asset_a.balance(Global.current_application_address()) @subroutine def _current_b_balance(self) -> UInt64: - balance, has_balance = AssetHoldingGet.asset_balance( - Global.current_application_address(), - self.asset_b, - ) - assert has_balance - return balance + return self.asset_b.balance(Global.current_application_address()) ############## @@ -341,10 +364,10 @@ def tokens_to_swap(*, in_amount: UInt64, in_supply: UInt64, out_supply: UInt64) @subroutine -def do_asset_transfer(*, receiver: Address, asset_id: UInt64, amount: UInt64) -> None: +def do_asset_transfer(*, receiver: Account, asset: Asset, amount: UInt64) -> None: CreateInnerTransaction.begin() CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) - CreateInnerTransaction.set_xfer_asset(asset_id) + CreateInnerTransaction.set_xfer_asset(asset.asset_id) CreateInnerTransaction.set_asset_amount(amount) CreateInnerTransaction.set_asset_receiver(receiver) CreateInnerTransaction.set_fee(0) diff --git a/examples/amm/out/application.json b/examples/amm/out/application.json new file mode 100644 index 0000000000..d895dc56ef --- /dev/null +++ b/examples/amm/out/application.json @@ -0,0 +1,246 @@ +{ + "hints": { + "set_governor(account)void": { + "call_config": { + "no_op": "CALL" + } + }, + "bootstrap(pay,asset,asset)uint64": { + "call_config": { + "no_op": "CALL" + } + }, + "mint(axfer,axfer,asset,asset,asset)void": { + "default_arguments": { + "pool_asset": { + "source": "global-state", + "data": "pool_token" + }, + "a_asset": { + "source": "global-state", + "data": "asset_a" + }, + "b_asset": { + "source": "global-state", + "data": "asset_b" + } + }, + "call_config": { + "no_op": "CALL" + } + }, + "burn(axfer,asset,asset,asset)void": { + "default_arguments": { + "pool_asset": { + "source": "global-state", + "data": "pool_token" + }, + "a_asset": { + "source": "global-state", + "data": "asset_a" + }, + "b_asset": { + "source": "global-state", + "data": "asset_b" + } + }, + "call_config": { + "no_op": "CALL" + } + }, + "swap(axfer,asset,asset)void": { + "default_arguments": { + "a_asset": { + "source": "global-state", + "data": "asset_a" + }, + "b_asset": { + "source": "global-state", + "data": "asset_b" + } + }, + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5Db25zdGFudFByb2R1Y3RBTU0uYXBwcm92YWxfcHJvZ3JhbSgpIC0+IHVpbnQ2NDoKbWFpbl9ibG9ja0AwOgogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYm56IG1haW5fZW50cnlwb2ludEAyCgptYWluX29uX2NyZWF0ZUAxOgogICAgICAgIGNhbGxzdWIgX19pbml0X18KCm1haW5fZW50cnlwb2ludEAyOgogICAgICAgIHR4biBOdW1BcHBBcmdzCiAgICAgICAgYnogbWFpbl9iYXJlX3JvdXRpbmdAMTEKCm1haW5fYWJpX3JvdXRpbmdAMzoKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAwCiAgICAgICAgbWV0aG9kICJzZXRfZ292ZXJub3IoYWNjb3VudCl2b2lkIgogICAgICAgIG1ldGhvZCAiYm9vdHN0cmFwKHBheSxhc3NldCxhc3NldCl1aW50NjQiCiAgICAgICAgbWV0aG9kICJtaW50KGF4ZmVyLGF4ZmVyLGFzc2V0LGFzc2V0LGFzc2V0KXZvaWQiCiAgICAgICAgbWV0aG9kICJidXJuKGF4ZmVyLGFzc2V0LGFzc2V0LGFzc2V0KXZvaWQiCiAgICAgICAgbWV0aG9kICJzd2FwKGF4ZmVyLGFzc2V0LGFzc2V0KXZvaWQiCiAgICAgICAgdW5jb3ZlciA1CiAgICAgICAgbWF0Y2ggbWFpbl9zZXRfZ292ZXJub3Jfcm91dGVANCBtYWluX2Jvb3RzdHJhcF9yb3V0ZUA1IG1haW5fbWludF9yb3V0ZUA2IG1haW5fYnVybl9yb3V0ZUA3IG1haW5fc3dhcF9yb3V0ZUA4CiAgICAgICAgYiBtYWluX3N3aXRjaF9jYXNlX2RlZmF1bHRAOQoKbWFpbl9zZXRfZ292ZXJub3Jfcm91dGVANDoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQWNjb3VudHMKICAgICAgICBjYWxsc3ViIHNldF9nb3Zlcm5vcgogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2Jvb3RzdHJhcF9yb3V0ZUA1OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuIEdyb3VwSW5kZXgKICAgICAgICBpbnQgMQogICAgICAgIC0KICAgICAgICBkdXAKICAgICAgICBndHhucyBUeXBlRW51bQogICAgICAgIGludCBwYXkKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIHBheQogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXNzZXRzCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMgogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBc3NldHMKICAgICAgICBjYWxsc3ViIGJvb3RzdHJhcAogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9taW50X3JvdXRlQDY6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICB0eG4gR3JvdXBJbmRleAogICAgICAgIGludCAyCiAgICAgICAgLQogICAgICAgIGR1cAogICAgICAgIGd0eG5zIFR5cGVFbnVtCiAgICAgICAgaW50IGF4ZmVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBheGZlcgogICAgICAgIHR4biBHcm91cEluZGV4CiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZHVwCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBpbnQgYXhmZXIKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGF4ZmVyCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBc3NldHMKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAyCiAgICAgICAgYnRvaQogICAgICAgIHR4bmFzIEFzc2V0cwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDMKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXNzZXRzCiAgICAgICAgY2FsbHN1YiBtaW50CiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fYnVybl9yb3V0ZUA3OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuIEdyb3VwSW5kZXgKICAgICAgICBpbnQgMQogICAgICAgIC0KICAgICAgICBkdXAKICAgICAgICBndHhucyBUeXBlRW51bQogICAgICAgIGludCBheGZlcgogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYXhmZXIKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICAgICAgYnRvaQogICAgICAgIHR4bmFzIEFzc2V0cwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDIKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXNzZXRzCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMwogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBc3NldHMKICAgICAgICBjYWxsc3ViIGJ1cm4KICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9zd2FwX3JvdXRlQDg6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICB0eG4gR3JvdXBJbmRleAogICAgICAgIGludCAxCiAgICAgICAgLQogICAgICAgIGR1cAogICAgICAgIGd0eG5zIFR5cGVFbnVtCiAgICAgICAgaW50IGF4ZmVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBheGZlcgogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBidG9pCiAgICAgICAgdHhuYXMgQXNzZXRzCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMgogICAgICAgIGJ0b2kKICAgICAgICB0eG5hcyBBc3NldHMKICAgICAgICBjYWxsc3ViIHN3YXAKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9zd2l0Y2hfY2FzZV9kZWZhdWx0QDk6CiAgICAgICAgZXJyIC8vIHJlamVjdCB0cmFuc2FjdGlvbgoKbWFpbl9iYXJlX3JvdXRpbmdAMTE6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgIGJueiBtYWluX3JlamVjdF9iYXJlX29uX2NvbXBsZXRpb25AMTMKCm1haW5fY3JlYXRlQDEyOgogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBpcyBjcmVhdGluZwogICAgICAgIGNhbGxzdWIgY3JlYXRlCiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fcmVqZWN0X2JhcmVfb25fY29tcGxldGlvbkAxMzoKICAgICAgICBlcnIgLy8gcmVqZWN0IHRyYW5zYWN0aW9uCgoKLy8gZXhhbXBsZXMuYW1tLmNvbnRyYWN0LkNvbnN0YW50UHJvZHVjdEFNTS5zZXRfZ292ZXJub3IobmV3X2dvdmVybm9yIzA6IGJ5dGVzKSAtPiB2b2lkOgpzZXRfZ292ZXJub3I6CiAgICAgICAgcHJvdG8gMSAwCgpzZXRfZ292ZXJub3JfYmxvY2tAMDoKICAgICAgICBjYWxsc3ViIF9jaGVja19pc19nb3Zlcm5vcgogICAgICAgIGJ5dGUgImdvdmVybm9yIgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYW1tLmNvbnRyYWN0LkNvbnN0YW50UHJvZHVjdEFNTS5fY2hlY2tfaXNfZ292ZXJub3IoKSAtPiB2b2lkOgpfY2hlY2tfaXNfZ292ZXJub3I6CiAgICAgICAgcHJvdG8gMCAwCgpfY2hlY2tfaXNfZ292ZXJub3JfYmxvY2tAMDoKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJnb3Zlcm5vciIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBPbmx5IHRoZSBhY2NvdW50IHNldCBpbiBnbG9iYWxfc3RhdGUuZ292ZXJub3IgbWF5IGNhbGwgdGhpcyBtZXRob2QKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hbW0uY29udHJhY3QuQ29uc3RhbnRQcm9kdWN0QU1NLmJvb3RzdHJhcChzZWVkIzA6IHVpbnQ2NCwgYV9hc3NldCMwOiB1aW50NjQsIGJfYXNzZXQjMDogdWludDY0KSAtPiBieXRlczoKYm9vdHN0cmFwOgogICAgICAgIHByb3RvIDMgMQoKYm9vdHN0cmFwX2Jsb2NrQDA6CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJwb29sX3Rva2VuIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gYXBwbGljYXRpb24gaGFzIGFscmVhZHkgYmVlbiBib290c3RyYXBwZWQKICAgICAgICBjYWxsc3ViIF9jaGVja19pc19nb3Zlcm5vcgogICAgICAgIGdsb2JhbCBHcm91cFNpemUKICAgICAgICBpbnQgMgogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIGdyb3VwIHNpemUgbm90IDIKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBndHhucyBSZWNlaXZlcgogICAgICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gcmVjZWl2ZXIgbm90IGFwcCBhZGRyZXNzCiAgICAgICAgZnJhbWVfZGlnIC0zCiAgICAgICAgZ3R4bnMgQW1vdW50CiAgICAgICAgaW50IDMwMDAwMAogICAgICAgID49CiAgICAgICAgYXNzZXJ0IC8vIGFtb3VudCBtaW5pbXVtIG5vdCBtZXQKICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICA8CiAgICAgICAgYXNzZXJ0IC8vIGFzc2V0IGEgbXVzdCBiZSBsZXNzIHRoYW4gYXNzZXQgYgogICAgICAgIGJ5dGUgImFzc2V0X2EiCiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJhc3NldF9iIgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgY2FsbHN1YiBfY3JlYXRlX3Bvb2xfdG9rZW4KICAgICAgICBieXRlICJwb29sX3Rva2VuIgogICAgICAgIHN3YXAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBjYWxsc3ViIF9kb19vcHRfaW4KICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2IiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgY2FsbHN1YiBfZG9fb3B0X2luCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJwb29sX3Rva2VuIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGl0b2IKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hbW0uY29udHJhY3QuQ29uc3RhbnRQcm9kdWN0QU1NLl9jcmVhdGVfcG9vbF90b2tlbigpIC0+IHVpbnQ2NDoKX2NyZWF0ZV9wb29sX3Rva2VuOgogICAgICAgIHByb3RvIDAgMQoKX2NyZWF0ZV9wb29sX3Rva2VuX2Jsb2NrQDA6CiAgICAgICAgaXR4bl9iZWdpbgogICAgICAgIGludCBhY2ZnCiAgICAgICAgaXR4bl9maWVsZCBUeXBlRW51bQogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBhc3NldF9wYXJhbXNfZ2V0IEFzc2V0VW5pdE5hbWUKICAgICAgICBhc3NlcnQgLy8gYXNzZXQgZXhpc3RzCiAgICAgICAgYnl0ZSAiRFBULSIKICAgICAgICBzd2FwCiAgICAgICAgY29uY2F0CiAgICAgICAgYnl0ZSAiLSIKICAgICAgICBjb25jYXQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2IiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgYXNzZXRfcGFyYW1zX2dldCBBc3NldFVuaXROYW1lCiAgICAgICAgYXNzZXJ0IC8vIGFzc2V0IGV4aXN0cwogICAgICAgIGNvbmNhdAogICAgICAgIGl0eG5fZmllbGQgQ29uZmlnQXNzZXROYW1lCiAgICAgICAgYnl0ZSAiZHB0IgogICAgICAgIGl0eG5fZmllbGQgQ29uZmlnQXNzZXRVbml0TmFtZQogICAgICAgIGludCAxMDAwMDAwMDAwMAogICAgICAgIGl0eG5fZmllbGQgQ29uZmlnQXNzZXRUb3RhbAogICAgICAgIGludCAzCiAgICAgICAgaXR4bl9maWVsZCBDb25maWdBc3NldERlY2ltYWxzCiAgICAgICAgZ2xvYmFsIEN1cnJlbnRBcHBsaWNhdGlvbkFkZHJlc3MKICAgICAgICBpdHhuX2ZpZWxkIENvbmZpZ0Fzc2V0TWFuYWdlcgogICAgICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICAgICAgaXR4bl9maWVsZCBDb25maWdBc3NldFJlc2VydmUKICAgICAgICBpbnQgMAogICAgICAgIGl0eG5fZmllbGQgRmVlCiAgICAgICAgaXR4bl9zdWJtaXQKICAgICAgICBpdHhuIENyZWF0ZWRBc3NldElECiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYW1tLmNvbnRyYWN0LkNvbnN0YW50UHJvZHVjdEFNTS5fZG9fb3B0X2luKGFzc2V0IzA6IHVpbnQ2NCkgLT4gdm9pZDoKX2RvX29wdF9pbjoKICAgICAgICBwcm90byAxIDAKCl9kb19vcHRfaW5fYmxvY2tAMDoKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGludCAwCiAgICAgICAgY2FsbHN1YiBkb19hc3NldF90cmFuc2ZlcgogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5kb19hc3NldF90cmFuc2ZlcihyZWNlaXZlciMwOiBieXRlcywgYXNzZXQjMDogdWludDY0LCBhbW91bnQjMDogdWludDY0KSAtPiB2b2lkOgpkb19hc3NldF90cmFuc2ZlcjoKICAgICAgICBwcm90byAzIDAKCmRvX2Fzc2V0X3RyYW5zZmVyX2Jsb2NrQDA6CiAgICAgICAgaXR4bl9iZWdpbgogICAgICAgIGludCBheGZlcgogICAgICAgIGl0eG5fZmllbGQgVHlwZUVudW0KICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICBpdHhuX2ZpZWxkIFhmZXJBc3NldAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGl0eG5fZmllbGQgQXNzZXRBbW91bnQKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBpdHhuX2ZpZWxkIEFzc2V0UmVjZWl2ZXIKICAgICAgICBpbnQgMAogICAgICAgIGl0eG5fZmllbGQgRmVlCiAgICAgICAgaXR4bl9zdWJtaXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hbW0uY29udHJhY3QuQ29uc3RhbnRQcm9kdWN0QU1NLm1pbnQoYV94ZmVyIzA6IHVpbnQ2NCwgYl94ZmVyIzA6IHVpbnQ2NCwgcG9vbF9hc3NldCMwOiB1aW50NjQsIGFfYXNzZXQjMDogdWludDY0LCBiX2Fzc2V0IzA6IHVpbnQ2NCkgLT4gdm9pZDoKbWludDoKICAgICAgICBwcm90byA1IDAKCm1pbnRfYmxvY2tAMDoKICAgICAgICBjYWxsc3ViIF9jaGVja19ib290c3RyYXBwZWQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgInBvb2xfdG9rZW4iCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgZnJhbWVfZGlnIC0zCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXQgcG9vbCBpbmNvcnJlY3QKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2EiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXQgYSBpbmNvcnJlY3QKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2IiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXQgYiBpbmNvcnJlY3QKICAgICAgICBmcmFtZV9kaWcgLTUKICAgICAgICBndHhucyBTZW5kZXIKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gc2VuZGVyIGludmFsaWQKICAgICAgICBmcmFtZV9kaWcgLTQKICAgICAgICBndHhucyBTZW5kZXIKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gc2VuZGVyIGludmFsaWQKICAgICAgICBmcmFtZV9kaWcgLTUKICAgICAgICBndHhucyBBc3NldFJlY2VpdmVyCiAgICAgICAgZ2xvYmFsIEN1cnJlbnRBcHBsaWNhdGlvbkFkZHJlc3MKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyByZWNlaXZlciBub3QgYXBwIGFkZHJlc3MKICAgICAgICBmcmFtZV9kaWcgLTUKICAgICAgICBndHhucyBYZmVyQXNzZXQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2EiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXQgYSBpbmNvcnJlY3QKICAgICAgICBmcmFtZV9kaWcgLTUKICAgICAgICBndHhucyBBc3NldEFtb3VudAogICAgICAgIGludCAwCiAgICAgICAgPgogICAgICAgIGFzc2VydCAvLyBhbW91bnQgbWluaW11bSBub3QgbWV0CiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgZ3R4bnMgQXNzZXRSZWNlaXZlcgogICAgICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gcmVjZWl2ZXIgbm90IGFwcCBhZGRyZXNzCiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgZ3R4bnMgWGZlckFzc2V0CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhc3NldF9iIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIGFzc2V0IGIgaW5jb3JyZWN0CiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgZ3R4bnMgQXNzZXRBbW91bnQKICAgICAgICBpbnQgMAogICAgICAgID4KICAgICAgICBhc3NlcnQgLy8gYW1vdW50IG1pbmltdW0gbm90IG1ldAogICAgICAgIGNhbGxzdWIgX2N1cnJlbnRfcG9vbF9iYWxhbmNlCiAgICAgICAgY2FsbHN1YiBfY3VycmVudF9hX2JhbGFuY2UKICAgICAgICBjYWxsc3ViIF9jdXJyZW50X2JfYmFsYW5jZQogICAgICAgIGZyYW1lX2RpZyAtNQogICAgICAgIGd0eG5zIEFzc2V0QW1vdW50CiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgZ3R4bnMgQXNzZXRBbW91bnQKICAgICAgICBjYWxsc3ViIHRva2Vuc190b19taW50CiAgICAgICAgZHVwCiAgICAgICAgaW50IDAKICAgICAgICA+CiAgICAgICAgYXNzZXJ0IC8vIHNlbmQgYW1vdW50IHRvbyBsb3cKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJwb29sX3Rva2VuIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIHVuY292ZXIgMgogICAgICAgIGNhbGxzdWIgZG9fYXNzZXRfdHJhbnNmZXIKICAgICAgICBjYWxsc3ViIF91cGRhdGVfcmF0aW8KICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hbW0uY29udHJhY3QuQ29uc3RhbnRQcm9kdWN0QU1NLl9jaGVja19ib290c3RyYXBwZWQoKSAtPiB2b2lkOgpfY2hlY2tfYm9vdHN0cmFwcGVkOgogICAgICAgIHByb3RvIDAgMAoKX2NoZWNrX2Jvb3RzdHJhcHBlZF9ibG9ja0AwOgogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAicG9vbF90b2tlbiIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBhc3NlcnQgLy8gYm9vdHN0cmFwIG1ldGhvZCBuZWVkcyB0byBiZSBjYWxsZWQgZmlyc3QKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hbW0uY29udHJhY3QuQ29uc3RhbnRQcm9kdWN0QU1NLl9jdXJyZW50X3Bvb2xfYmFsYW5jZSgpIC0+IHVpbnQ2NDoKX2N1cnJlbnRfcG9vbF9iYWxhbmNlOgogICAgICAgIHByb3RvIDAgMQoKX2N1cnJlbnRfcG9vbF9iYWxhbmNlX2Jsb2NrQDA6CiAgICAgICAgZ2xvYmFsIEN1cnJlbnRBcHBsaWNhdGlvbkFkZHJlc3MKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgInBvb2xfdG9rZW4iCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgYXNzZXRfaG9sZGluZ19nZXQgQXNzZXRCYWxhbmNlCiAgICAgICAgYXNzZXJ0IC8vIGFjY291bnQgb3B0ZWQgaW50byBhc3NldAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5Db25zdGFudFByb2R1Y3RBTU0uX2N1cnJlbnRfYV9iYWxhbmNlKCkgLT4gdWludDY0OgpfY3VycmVudF9hX2JhbGFuY2U6CiAgICAgICAgcHJvdG8gMCAxCgpfY3VycmVudF9hX2JhbGFuY2VfYmxvY2tAMDoKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBhc3NldF9ob2xkaW5nX2dldCBBc3NldEJhbGFuY2UKICAgICAgICBhc3NlcnQgLy8gYWNjb3VudCBvcHRlZCBpbnRvIGFzc2V0CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYW1tLmNvbnRyYWN0LkNvbnN0YW50UHJvZHVjdEFNTS5fY3VycmVudF9iX2JhbGFuY2UoKSAtPiB1aW50NjQ6Cl9jdXJyZW50X2JfYmFsYW5jZToKICAgICAgICBwcm90byAwIDEKCl9jdXJyZW50X2JfYmFsYW5jZV9ibG9ja0AwOgogICAgICAgIGdsb2JhbCBDdXJyZW50QXBwbGljYXRpb25BZGRyZXNzCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhc3NldF9iIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGFzc2V0X2hvbGRpbmdfZ2V0IEFzc2V0QmFsYW5jZQogICAgICAgIGFzc2VydCAvLyBhY2NvdW50IG9wdGVkIGludG8gYXNzZXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hbW0uY29udHJhY3QudG9rZW5zX3RvX21pbnQocG9vbF9iYWxhbmNlIzA6IHVpbnQ2NCwgYV9iYWxhbmNlIzA6IHVpbnQ2NCwgYl9iYWxhbmNlIzA6IHVpbnQ2NCwgYV9hbW91bnQjMDogdWludDY0LCBiX2Ftb3VudCMwOiB1aW50NjQpIC0+IHVpbnQ2NDoKdG9rZW5zX3RvX21pbnQ6CiAgICAgICAgcHJvdG8gNSAxCiAgICAgICAgYnl0ZSAiIgogICAgICAgIGR1cAoKdG9rZW5zX3RvX21pbnRfYmxvY2tAMDoKICAgICAgICBmcmFtZV9kaWcgLTQKICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICA9PQogICAgICAgIGJ6IHRva2Vuc190b19taW50X2Jvb2xfZmFsc2VAMwoKdG9rZW5zX3RvX21pbnRfYW5kX2NvbnRkQDE6CiAgICAgICAgZnJhbWVfZGlnIC0zCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgPT0KICAgICAgICBieiB0b2tlbnNfdG9fbWludF9ib29sX2ZhbHNlQDMKCnRva2Vuc190b19taW50X2Jvb2xfdHJ1ZUAyOgogICAgICAgIGludCAxCiAgICAgICAgYiB0b2tlbnNfdG9fbWludF9ib29sX21lcmdlQDQKCnRva2Vuc190b19taW50X2Jvb2xfZmFsc2VAMzoKICAgICAgICBpbnQgMAoKdG9rZW5zX3RvX21pbnRfYm9vbF9tZXJnZUA0OgogICAgICAgIGJ6IHRva2Vuc190b19taW50X2FmdGVyX2lmX2Vsc2VANgoKdG9rZW5zX3RvX21pbnRfaWZfYm9keUA1OgogICAgICAgIGZyYW1lX2RpZyAtMgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgICoKICAgICAgICBzcXJ0CiAgICAgICAgaW50IDEwMDAKICAgICAgICAtCiAgICAgICAgZnJhbWVfYnVyeSAwCiAgICAgICAgcmV0c3ViCgp0b2tlbnNfdG9fbWludF9hZnRlcl9pZl9lbHNlQDY6CiAgICAgICAgaW50IDEwMDAwMDAwMDAwCiAgICAgICAgZnJhbWVfZGlnIC01CiAgICAgICAgLQogICAgICAgIGludCAxMDAwCiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgKgogICAgICAgIGZyYW1lX2RpZyAtNAogICAgICAgIGZyYW1lX2RpZyAtMgogICAgICAgIC0KICAgICAgICAvCiAgICAgICAgZHVwCiAgICAgICAgZnJhbWVfYnVyeSAwCiAgICAgICAgaW50IDEwMDAKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICAqCiAgICAgICAgZnJhbWVfZGlnIC0zCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgLQogICAgICAgIC8KICAgICAgICBkdXAKICAgICAgICBmcmFtZV9idXJ5IDEKICAgICAgICA8CiAgICAgICAgYnogdG9rZW5zX3RvX21pbnRfZWxzZV9ib2R5QDgKCnRva2Vuc190b19taW50X2lmX2JvZHlANzoKICAgICAgICBmcmFtZV9kaWcgMAogICAgICAgICoKICAgICAgICBpbnQgMTAwMAogICAgICAgIC8KICAgICAgICBmcmFtZV9idXJ5IDAKICAgICAgICByZXRzdWIKCnRva2Vuc190b19taW50X2Vsc2VfYm9keUA4OgogICAgICAgIGZyYW1lX2RpZyAxCiAgICAgICAgKgogICAgICAgIGludCAxMDAwCiAgICAgICAgLwogICAgICAgIGZyYW1lX2J1cnkgMAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5Db25zdGFudFByb2R1Y3RBTU0uX3VwZGF0ZV9yYXRpbygpIC0+IHZvaWQ6Cl91cGRhdGVfcmF0aW86CiAgICAgICAgcHJvdG8gMCAwCgpfdXBkYXRlX3JhdGlvX2Jsb2NrQDA6CiAgICAgICAgY2FsbHN1YiBfY3VycmVudF9hX2JhbGFuY2UKICAgICAgICBjYWxsc3ViIF9jdXJyZW50X2JfYmFsYW5jZQogICAgICAgIHN3YXAKICAgICAgICBpbnQgMTAwMAogICAgICAgICoKICAgICAgICBzd2FwCiAgICAgICAgLwogICAgICAgIGJ5dGUgInJhdGlvIgogICAgICAgIHN3YXAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5Db25zdGFudFByb2R1Y3RBTU0uYnVybihwb29sX3hmZXIjMDogdWludDY0LCBwb29sX2Fzc2V0IzA6IHVpbnQ2NCwgYV9hc3NldCMwOiB1aW50NjQsIGJfYXNzZXQjMDogdWludDY0KSAtPiB2b2lkOgpidXJuOgogICAgICAgIHByb3RvIDQgMAoKYnVybl9ibG9ja0AwOgogICAgICAgIGNhbGxzdWIgX2NoZWNrX2Jvb3RzdHJhcHBlZAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAicG9vbF90b2tlbiIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBhc3NldCBwb29sIGluY29ycmVjdAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBhc3NldCBhIGluY29ycmVjdAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYiIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBhc3NldCBiIGluY29ycmVjdAogICAgICAgIGZyYW1lX2RpZyAtNAogICAgICAgIGd0eG5zIEFzc2V0UmVjZWl2ZXIKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIHJlY2VpdmVyIG5vdCBhcHAgYWRkcmVzcwogICAgICAgIGZyYW1lX2RpZyAtNAogICAgICAgIGd0eG5zIEFzc2V0QW1vdW50CiAgICAgICAgaW50IDAKICAgICAgICA+CiAgICAgICAgYXNzZXJ0IC8vIGFtb3VudCBtaW5pbXVtIG5vdCBtZXQKICAgICAgICBmcmFtZV9kaWcgLTQKICAgICAgICBndHhucyBYZmVyQXNzZXQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgInBvb2xfdG9rZW4iCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXQgcG9vbCBpbmNvcnJlY3QKICAgICAgICBmcmFtZV9kaWcgLTQKICAgICAgICBndHhucyBTZW5kZXIKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gc2VuZGVyIGludmFsaWQKICAgICAgICBjYWxsc3ViIF9jdXJyZW50X3Bvb2xfYmFsYW5jZQogICAgICAgIGNhbGxzdWIgX2N1cnJlbnRfYV9iYWxhbmNlCiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgZ3R4bnMgQXNzZXRBbW91bnQKICAgICAgICBkaWcgMgogICAgICAgIGNvdmVyIDIKICAgICAgICBjYWxsc3ViIHRva2Vuc190b19idXJuCiAgICAgICAgc3dhcAogICAgICAgIGNhbGxzdWIgX2N1cnJlbnRfYl9iYWxhbmNlCiAgICAgICAgZnJhbWVfZGlnIC00CiAgICAgICAgZ3R4bnMgQXNzZXRBbW91bnQKICAgICAgICBjYWxsc3ViIHRva2Vuc190b19idXJuCiAgICAgICAgc3dhcAogICAgICAgIHR4biBTZW5kZXIKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2EiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgdW5jb3ZlciAyCiAgICAgICAgY2FsbHN1YiBkb19hc3NldF90cmFuc2ZlcgogICAgICAgIHR4biBTZW5kZXIKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2IiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgdW5jb3ZlciAyCiAgICAgICAgY2FsbHN1YiBkb19hc3NldF90cmFuc2ZlcgogICAgICAgIGNhbGxzdWIgX3VwZGF0ZV9yYXRpbwogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC50b2tlbnNfdG9fYnVybihwb29sX2JhbGFuY2UjMDogdWludDY0LCBzdXBwbHkjMDogdWludDY0LCBhbW91bnQjMDogdWludDY0KSAtPiB1aW50NjQ6CnRva2Vuc190b19idXJuOgogICAgICAgIHByb3RvIDMgMQoKdG9rZW5zX3RvX2J1cm5fYmxvY2tAMDoKICAgICAgICBpbnQgMTAwMDAwMDAwMDAKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICAtCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgLQogICAgICAgIGZyYW1lX2RpZyAtMgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgICoKICAgICAgICBzd2FwCiAgICAgICAgLwogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5Db25zdGFudFByb2R1Y3RBTU0uc3dhcChzd2FwX3hmZXIjMDogdWludDY0LCBhX2Fzc2V0IzA6IHVpbnQ2NCwgYl9hc3NldCMwOiB1aW50NjQpIC0+IHZvaWQ6CnN3YXA6CiAgICAgICAgcHJvdG8gMyAwCiAgICAgICAgYnl0ZSAiIgogICAgICAgIGR1cAoKc3dhcF9ibG9ja0AwOgogICAgICAgIGNhbGxzdWIgX2NoZWNrX2Jvb3RzdHJhcHBlZAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBhc3NldCBhIGluY29ycmVjdAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYiIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBhc3NldCBiIGluY29ycmVjdAogICAgICAgIGZyYW1lX2RpZyAtMwogICAgICAgIGd0eG5zIEFzc2V0QW1vdW50CiAgICAgICAgaW50IDAKICAgICAgICA+CiAgICAgICAgYXNzZXJ0IC8vIGFtb3VudCBtaW5pbXVtIG5vdCBtZXQKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBndHhucyBTZW5kZXIKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gc2VuZGVyIGludmFsaWQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImFzc2V0X2EiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJhc3NldF9iIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGZyYW1lX2RpZyAtMwogICAgICAgIGd0eG5zIFhmZXJBc3NldAogICAgICAgIG1hdGNoIHN3YXBfc3dpdGNoX2Nhc2VfMEAxIHN3YXBfc3dpdGNoX2Nhc2VfMUAyCiAgICAgICAgYiBzd2FwX3N3aXRjaF9jYXNlX2RlZmF1bHRAMwoKc3dhcF9zd2l0Y2hfY2FzZV8wQDE6CiAgICAgICAgY2FsbHN1YiBfY3VycmVudF9iX2JhbGFuY2UKICAgICAgICBmcmFtZV9idXJ5IDAKICAgICAgICBjYWxsc3ViIF9jdXJyZW50X2FfYmFsYW5jZQogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIHN3YXAKICAgICAgICBmcmFtZV9idXJ5IDEKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgYiBzd2FwX3N3aXRjaF9jYXNlX25leHRANAoKc3dhcF9zd2l0Y2hfY2FzZV8xQDI6CiAgICAgICAgY2FsbHN1YiBfY3VycmVudF9hX2JhbGFuY2UKICAgICAgICBmcmFtZV9idXJ5IDAKICAgICAgICBjYWxsc3ViIF9jdXJyZW50X2JfYmFsYW5jZQogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiYXNzZXRfYiIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIHN3YXAKICAgICAgICBmcmFtZV9idXJ5IDEKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgYiBzd2FwX3N3aXRjaF9jYXNlX25leHRANAoKc3dhcF9zd2l0Y2hfY2FzZV9kZWZhdWx0QDM6CiAgICAgICAgZXJyIC8vIGFzc2V0IGlkIGluY29ycmVjdAoKc3dhcF9zd2l0Y2hfY2FzZV9uZXh0QDQ6CiAgICAgICAgZnJhbWVfZGlnIC0zCiAgICAgICAgZ3R4bnMgQXNzZXRBbW91bnQKICAgICAgICBmcmFtZV9kaWcgMAogICAgICAgIHVuY292ZXIgMgogICAgICAgIGNhbGxzdWIgdG9rZW5zX3RvX3N3YXAKICAgICAgICBkdXAKICAgICAgICBpbnQgMAogICAgICAgID4KICAgICAgICBhc3NlcnQgLy8gc2VuZCBhbW91bnQgdG9vIGxvdwogICAgICAgIHR4biBTZW5kZXIKICAgICAgICBmcmFtZV9kaWcgMQogICAgICAgIHVuY292ZXIgMgogICAgICAgIGNhbGxzdWIgZG9fYXNzZXRfdHJhbnNmZXIKICAgICAgICBjYWxsc3ViIF91cGRhdGVfcmF0aW8KICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5hbW0uY29udHJhY3QudG9rZW5zX3RvX3N3YXAoaW5fYW1vdW50IzA6IHVpbnQ2NCwgaW5fc3VwcGx5IzA6IHVpbnQ2NCwgb3V0X3N1cHBseSMwOiB1aW50NjQpIC0+IHVpbnQ2NDoKdG9rZW5zX3RvX3N3YXA6CiAgICAgICAgcHJvdG8gMyAxCgp0b2tlbnNfdG9fc3dhcF9ibG9ja0AwOgogICAgICAgIGZyYW1lX2RpZyAtMgogICAgICAgIGZyYW1lX2RpZyAtMwogICAgICAgIC0KICAgICAgICBpbnQgMTAwMAogICAgICAgICoKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBpbnQgOTk1CiAgICAgICAgKgogICAgICAgICsKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBpbnQgOTk1CiAgICAgICAgKgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgICoKICAgICAgICBzd2FwCiAgICAgICAgLwogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5Db25zdGFudFByb2R1Y3RBTU0uY3JlYXRlKCkgLT4gdm9pZDoKY3JlYXRlOgogICAgICAgIHByb3RvIDAgMAoKY3JlYXRlX2Jsb2NrQDA6CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYW1tLmNvbnRyYWN0LkNvbnN0YW50UHJvZHVjdEFNTS5fX2luaXRfXygpIC0+IHZvaWQ6Cl9faW5pdF9fOgogICAgICAgIHByb3RvIDAgMAoKX19pbml0X19fYmxvY2tAMDoKICAgICAgICBieXRlICJhc3NldF9hIgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJhc3NldF9iIgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgYnl0ZSAiZ292ZXJub3IiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgYnl0ZSAicG9vbF90b2tlbiIKICAgICAgICBpbnQgMAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgYnl0ZSAicmF0aW8iCiAgICAgICAgaW50IDAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIHJldHN1YgoK", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmFtbS5jb250cmFjdC5Db25zdGFudFByb2R1Y3RBTU0uY2xlYXJfc3RhdGVfcHJvZ3JhbSgpIC0+IHVpbnQ2NDoKbWFpbl9ibG9ja0AwOgogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgo=" + }, + "state": { + "global": { + "num_byte_slices": 1, + "num_uints": 4 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "asset_a": { + "type": "uint64", + "key": "asset_a" + }, + "asset_b": { + "type": "uint64", + "key": "asset_b" + }, + "governor": { + "type": "bytes", + "key": "governor" + }, + "pool_token": { + "type": "uint64", + "key": "pool_token" + }, + "ratio": { + "type": "uint64", + "key": "ratio" + } + }, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "ConstantProductAMM", + "methods": [ + { + "name": "set_governor", + "args": [ + { + "type": "account", + "name": "new_governor" + } + ], + "returns": { + "type": "void" + }, + "desc": "sets the governor of the contract, may only be called by the current governor" + }, + { + "name": "bootstrap", + "args": [ + { + "type": "pay", + "name": "seed", + "desc": "Initial Payment transaction to the app account so it can opt in to assets and create pool token." + }, + { + "type": "asset", + "name": "a_asset", + "desc": "One of the two assets this pool should allow swapping between." + }, + { + "type": "asset", + "name": "b_asset", + "desc": "The other of the two assets this pool should allow swapping between." + } + ], + "returns": { + "type": "uint64", + "desc": "The asset id of the pool token created." + }, + "desc": "bootstraps the contract by opting into the assets and creating the pool token.\nNote this method will fail if it is attempted more than once on the same contract since the assets and pool token application state values are marked as static and cannot be overridden." + }, + { + "name": "mint", + "args": [ + { + "type": "axfer", + "name": "a_xfer", + "desc": "Asset Transfer Transaction of asset A as a deposit to the pool in exchange for pool tokens." + }, + { + "type": "axfer", + "name": "b_xfer", + "desc": "Asset Transfer Transaction of asset B as a deposit to the pool in exchange for pool tokens." + }, + { + "type": "asset", + "name": "pool_asset", + "desc": "The asset ID of the pool token so that we may distribute it." + }, + { + "type": "asset", + "name": "a_asset", + "desc": "The asset ID of the Asset A so that we may inspect our balance." + }, + { + "type": "asset", + "name": "b_asset", + "desc": "The asset ID of the Asset B so that we may inspect our balance." + } + ], + "returns": { + "type": "void" + }, + "desc": "mint pool tokens given some amount of asset A and asset B.\nGiven some amount of Asset A and Asset B in the transfers, mint some number of pool tokens commensurate with the pools current balance and circulating supply of pool tokens." + }, + { + "name": "burn", + "args": [ + { + "type": "axfer", + "name": "pool_xfer", + "desc": "Asset Transfer Transaction of the pool token for the amount the sender wishes to redeem" + }, + { + "type": "asset", + "name": "pool_asset", + "desc": "Asset ID of the pool token so we may inspect balance." + }, + { + "type": "asset", + "name": "a_asset", + "desc": "Asset ID of Asset A so we may inspect balance and distribute it" + }, + { + "type": "asset", + "name": "b_asset", + "desc": "Asset ID of Asset B so we may inspect balance and distribute it" + } + ], + "returns": { + "type": "void" + }, + "desc": "burn pool tokens to get back some amount of asset A and asset B" + }, + { + "name": "swap", + "args": [ + { + "type": "axfer", + "name": "swap_xfer", + "desc": "Asset Transfer Transaction of either Asset A or Asset B" + }, + { + "type": "asset", + "name": "a_asset", + "desc": "Asset ID of asset A so we may inspect balance and possibly transfer it" + }, + { + "type": "asset", + "name": "b_asset", + "desc": "Asset ID of asset B so we may inspect balance and possibly transfer it" + } + ], + "returns": { + "type": "void" + }, + "desc": "Swap some amount of either asset A or asset B for the other" + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/examples/amm/out/contract.approval.debug.teal b/examples/amm/out/contract.approval.debug.teal new file mode 100644 index 0000000000..060259903e --- /dev/null +++ b/examples/amm/out/contract.approval.debug.teal @@ -0,0 +1,839 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + bz main_bare_routing@11 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + // Implicit fall through to main_abi_routing@3 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + method "set_governor(account)void" // tmp%2#0,method<"set_governor(account)void"> arc4.abimethod() File "amm/contract.py", line 51 + method "bootstrap(pay,asset,asset)uint64" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64"> arc4.abimethod() File "amm/contract.py", line 57 + method "mint(axfer,axfer,asset,asset,asset)void" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void"> arc4.abimethod( File "amm/contract.py", line 89 + method "burn(axfer,asset,asset,asset)void" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void">,method<"burn(axfer,asset,asset,asset)void"> arc4.abimethod( File "amm/contract.py", line 155 + method "swap(axfer,asset,asset)void" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void">,method<"burn(axfer,asset,asset,asset)void">,method<"swap(axfer,asset,asset)void"> arc4.abimethod( File "amm/contract.py", line 212 + uncover 5 // load tmp%2#0 from l-stack (no copy) method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void">,method<"burn(axfer,asset,asset,asset)void">,method<"swap(axfer,asset,asset)void">,tmp%2#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + match main_set_governor_route@4 main_bootstrap_route@5 main_mint_route@6 main_burn_route@7 main_swap_route@8 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + b main_switch_case_default@9 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_set_governor_route@4: + txn OnCompletion // {txn} arc4.abimethod() File "amm/contract.py", line 51 + ! // {!} arc4.abimethod() File "amm/contract.py", line 51 + assert // OnCompletion is NoOp // arc4.abimethod() File "amm/contract.py", line 51 + txn ApplicationID // {txn} arc4.abimethod() File "amm/contract.py", line 51 + assert // is not creating // arc4.abimethod() File "amm/contract.py", line 51 + txna ApplicationArgs 1 // {txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // {btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Accounts // {txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub set_governor // arc4.abimethod() File "amm/contract.py", line 51 + int 1 // 1 arc4.abimethod() File "amm/contract.py", line 51 + return // arc4.abimethod() File "amm/contract.py", line 51 + +main_bootstrap_route@5: + txn OnCompletion // {txn} arc4.abimethod() File "amm/contract.py", line 57 + ! // {!} arc4.abimethod() File "amm/contract.py", line 57 + assert // OnCompletion is NoOp // arc4.abimethod() File "amm/contract.py", line 57 + txn ApplicationID // {txn} arc4.abimethod() File "amm/contract.py", line 57 + assert // is not creating // arc4.abimethod() File "amm/contract.py", line 57 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // tmp%14#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int pay // awst_tmp%15#0,tmp%16#0,pay class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is pay // awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // awst_tmp%15#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%15#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%15#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // awst_tmp%15#0,tmp%20#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%15#0,tmp%20#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%15#0,tmp%20#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub bootstrap // {bootstrap} arc4.abimethod() File "amm/contract.py", line 57 + byte 0x151f7c75 // tmp%24#0,0x151f7c75 arc4.abimethod() File "amm/contract.py", line 57 + swap // load tmp%24#0 from l-stack (no copy) 0x151f7c75,tmp%24#0 arc4.abimethod() File "amm/contract.py", line 57 + concat // {concat} arc4.abimethod() File "amm/contract.py", line 57 + log // arc4.abimethod() File "amm/contract.py", line 57 + int 1 // 1 arc4.abimethod() File "amm/contract.py", line 57 + return // arc4.abimethod() File "amm/contract.py", line 57 + +main_mint_route@6: + txn OnCompletion // {txn} arc4.abimethod( File "amm/contract.py", line 89 + ! // {!} arc4.abimethod( File "amm/contract.py", line 89 + assert // OnCompletion is NoOp // arc4.abimethod( File "amm/contract.py", line 89 + txn ApplicationID // {txn} arc4.abimethod( File "amm/contract.py", line 89 + assert // is not creating // arc4.abimethod( File "amm/contract.py", line 89 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 2 // tmp%31#0,2 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%32#0 from l-stack (copy) awst_tmp%32#0,awst_tmp%32#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%32#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // awst_tmp%32#0,tmp%33#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%32#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // awst_tmp%32#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txn GroupIndex // awst_tmp%32#0,{txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // awst_tmp%32#0,tmp%37#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // awst_tmp%32#0,{-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) awst_tmp%32#0,awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%32#0,awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // awst_tmp%32#0,awst_tmp%15#0,tmp%38#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%32#0,awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // awst_tmp%32#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // awst_tmp%32#0,awst_tmp%15#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%32#0,awst_tmp%15#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%32#0,awst_tmp%15#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // awst_tmp%32#0,awst_tmp%15#0,tmp%42#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%32#0,awst_tmp%15#0,tmp%42#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%32#0,awst_tmp%15#0,tmp%42#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 3 // awst_tmp%32#0,awst_tmp%15#0,tmp%42#0,tmp%45#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%32#0,awst_tmp%15#0,tmp%42#0,tmp%45#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%32#0,awst_tmp%15#0,tmp%42#0,tmp%45#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub mint // arc4.abimethod( File "amm/contract.py", line 89 + int 1 // 1 arc4.abimethod( File "amm/contract.py", line 89 + return // arc4.abimethod( File "amm/contract.py", line 89 + +main_burn_route@7: + txn OnCompletion // {txn} arc4.abimethod( File "amm/contract.py", line 155 + ! // {!} arc4.abimethod( File "amm/contract.py", line 155 + assert // OnCompletion is NoOp // arc4.abimethod( File "amm/contract.py", line 155 + txn ApplicationID // {txn} arc4.abimethod( File "amm/contract.py", line 155 + assert // is not creating // arc4.abimethod( File "amm/contract.py", line 155 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // tmp%54#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // awst_tmp%15#0,tmp%55#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // awst_tmp%15#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%15#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%15#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // awst_tmp%15#0,tmp%59#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%15#0,tmp%59#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%15#0,tmp%59#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 3 // awst_tmp%15#0,tmp%59#0,tmp%62#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%15#0,tmp%59#0,tmp%62#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%15#0,tmp%59#0,tmp%62#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub burn // arc4.abimethod( File "amm/contract.py", line 155 + int 1 // 1 arc4.abimethod( File "amm/contract.py", line 155 + return // arc4.abimethod( File "amm/contract.py", line 155 + +main_swap_route@8: + txn OnCompletion // {txn} arc4.abimethod( File "amm/contract.py", line 212 + ! // {!} arc4.abimethod( File "amm/contract.py", line 212 + assert // OnCompletion is NoOp // arc4.abimethod( File "amm/contract.py", line 212 + txn ApplicationID // {txn} arc4.abimethod( File "amm/contract.py", line 212 + assert // is not creating // arc4.abimethod( File "amm/contract.py", line 212 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // tmp%71#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // awst_tmp%15#0,tmp%72#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // awst_tmp%15#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%15#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%15#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // awst_tmp%15#0,tmp%76#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // awst_tmp%15#0,tmp%76#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // awst_tmp%15#0,tmp%76#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub swap // arc4.abimethod( File "amm/contract.py", line 212 + int 1 // 1 arc4.abimethod( File "amm/contract.py", line 212 + return // arc4.abimethod( File "amm/contract.py", line 212 + +main_switch_case_default@9: + err // reject transaction // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_bare_routing@11: + txn OnCompletion // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + bnz main_reject_bare_on_completion@13 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + // Implicit fall through to main_create@12 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_create@12: + txn ApplicationID // {txn} arc4.baremethod(create=True) File "amm/contract.py", line 47 + ! // {!} arc4.baremethod(create=True) File "amm/contract.py", line 47 + assert // is creating // arc4.baremethod(create=True) File "amm/contract.py", line 47 + callsub create // def create(self) -> None: File "amm/contract.py", line 48 + int 1 // 1 def create(self) -> None: File "amm/contract.py", line 48 + return // def create(self) -> None: File "amm/contract.py", line 48 + +main_reject_bare_on_completion@13: + err // reject transaction // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + + +// examples.amm.contract.ConstantProductAMM.set_governor(new_governor#0: bytes) -> void: +set_governor: + proto 1 0 // (𝕡) new_governor#0 | def set_governor(self, new_governor: Account) -> None: File "amm/contract.py", line 52 + +set_governor_block@0: + callsub _check_is_governor // (𝕡) new_governor#0 | self._check_is_governor() File "amm/contract.py", line 54 + byte "governor" // (𝕡) new_governor#0 | "governor" self.governor File "amm/contract.py", line 55 + frame_dig -1 // load new_governor#0 from parameters (𝕡) new_governor#0 | "governor",new_governor#0 new_governor: Account File "amm/contract.py", line 52 + app_global_put // (𝕡) new_governor#0 | self.governor = new_governor File "amm/contract.py", line 55 + retsub // + + +// examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: +_check_is_governor: + proto 0 0 // def _check_is_governor(self) -> None: File "amm/contract.py", line 271 + +_check_is_governor_block@0: + txn Sender // {txn} Transaction.sender() File "amm/contract.py", line 273 + int 0 // tmp%0#0,0 self.governor File "amm/contract.py", line 273 + byte "governor" // tmp%0#0,0,"governor" self.governor File "amm/contract.py", line 273 + app_global_get_ex // tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.governor File "amm/contract.py", line 273 + assert // check value exists // tmp%0#0,app_global_get_ex_value%1#0 self.governor File "amm/contract.py", line 273 + == // {==} Transaction.sender() == self.governor File "amm/contract.py", line 273 + assert // Only the account set in global_state.governor may call this method // assert ( File "amm/contract.py", line 272 + retsub // + + +// examples.amm.contract.ConstantProductAMM.bootstrap(seed#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> bytes: +bootstrap: + proto 3 1 // (𝕡) seed#0,a_asset#0,b_asset#0 | def bootstrap(self, seed: PaymentTransaction, a_asset: Asset, b_asset: Asset) -> arc4.UInt64: File "amm/contract.py", line 58 + +bootstrap_block@0: + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 74 + byte "pool_token" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 74 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 74 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 74 + ! // (𝕡) seed#0,a_asset#0,b_asset#0 | {!} not self.pool_token File "amm/contract.py", line 74 + assert // application has already been bootstrapped // (𝕡) seed#0,a_asset#0,b_asset#0 | assert not self.pool_token, "application has already been bootstrapped" File "amm/contract.py", line 74 + callsub _check_is_governor // (𝕡) seed#0,a_asset#0,b_asset#0 | self._check_is_governor() File "amm/contract.py", line 75 + global GroupSize // (𝕡) seed#0,a_asset#0,b_asset#0 | {global} Global.group_size() File "amm/contract.py", line 76 + int 2 // (𝕡) seed#0,a_asset#0,b_asset#0 | tmp%3#0,2 2 File "amm/contract.py", line 76 + == // (𝕡) seed#0,a_asset#0,b_asset#0 | {==} Global.group_size() == 2, "group size not 2" File "amm/contract.py", line 76 + assert // group size not 2 // (𝕡) seed#0,a_asset#0,b_asset#0 | assert Global.group_size() == 2, "group size not 2" File "amm/contract.py", line 76 + frame_dig -3 // load seed#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | seed#0 seed: PaymentTransaction File "amm/contract.py", line 58 + gtxns Receiver // (𝕡) seed#0,a_asset#0,b_asset#0 | {gtxns} seed.receiver File "amm/contract.py", line 77 + global CurrentApplicationAddress // (𝕡) seed#0,a_asset#0,b_asset#0 | tmp%5#0,{global} Global.current_application_address() File "amm/contract.py", line 77 + == // (𝕡) seed#0,a_asset#0,b_asset#0 | {==} seed.receiver == Global.current_application_address(), "receiver not app address" File "amm/contract.py", line 77 + assert // receiver not app address // (𝕡) seed#0,a_asset#0,b_asset#0 | assert seed.receiver == Global.current_application_address(), "receiver not app address" File "amm/contract.py", line 77 + frame_dig -3 // load seed#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | seed#0 seed: PaymentTransaction File "amm/contract.py", line 58 + gtxns Amount // (𝕡) seed#0,a_asset#0,b_asset#0 | {gtxns} seed.amount File "amm/contract.py", line 79 + int 300000 // (𝕡) seed#0,a_asset#0,b_asset#0 | tmp%8#0,300000 300_000 File "amm/contract.py", line 79 + >= // (𝕡) seed#0,a_asset#0,b_asset#0 | {>=} seed.amount >= 300_000, "amount minimum not met" # 0.3 Algos File "amm/contract.py", line 79 + assert // amount minimum not met // (𝕡) seed#0,a_asset#0,b_asset#0 | assert seed.amount >= 300_000, "amount minimum not met" File "amm/contract.py", line 79 + frame_dig -2 // load a_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | a_asset#0 a_asset: Asset File "amm/contract.py", line 58 + frame_dig -1 // load b_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | a_asset#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 58 + < // (𝕡) seed#0,a_asset#0,b_asset#0 | {<} a_asset.asset_id < b_asset.asset_id, "asset a must be less than asset b" File "amm/contract.py", line 80 + assert // asset a must be less than asset b // (𝕡) seed#0,a_asset#0,b_asset#0 | assert a_asset.asset_id < b_asset.asset_id, "asset a must be less than asset b" File "amm/contract.py", line 80 + byte "asset_a" // (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_a" self.asset_a File "amm/contract.py", line 81 + frame_dig -2 // load a_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_a",a_asset#0 a_asset: Asset File "amm/contract.py", line 58 + app_global_put // (𝕡) seed#0,a_asset#0,b_asset#0 | self.asset_a = a_asset File "amm/contract.py", line 81 + byte "asset_b" // (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_b" self.asset_b File "amm/contract.py", line 82 + frame_dig -1 // load b_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_b",b_asset#0 b_asset: Asset File "amm/contract.py", line 58 + app_global_put // (𝕡) seed#0,a_asset#0,b_asset#0 | self.asset_b = b_asset File "amm/contract.py", line 82 + callsub _create_pool_token // (𝕡) seed#0,a_asset#0,b_asset#0 | {_create_pool_token} self._create_pool_token() File "amm/contract.py", line 83 + byte "pool_token" // (𝕡) seed#0,a_asset#0,b_asset#0 | new_state_value%11#0,"pool_token" self.pool_token File "amm/contract.py", line 83 + swap // load new_state_value%11#0 from l-stack (no copy) (𝕡) seed#0,a_asset#0,b_asset#0 | "pool_token",new_state_value%11#0 self._create_pool_token() File "amm/contract.py", line 83 + app_global_put // (𝕡) seed#0,a_asset#0,b_asset#0 | self.pool_token = self._create_pool_token() File "amm/contract.py", line 83 + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.asset_a File "amm/contract.py", line 85 + byte "asset_a" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 85 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 85 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%12#0 self.asset_a File "amm/contract.py", line 85 + callsub _do_opt_in // (𝕡) seed#0,a_asset#0,b_asset#0 | self._do_opt_in(self.asset_a) File "amm/contract.py", line 85 + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.asset_b File "amm/contract.py", line 86 + byte "asset_b" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 86 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 86 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%14#0 self.asset_b File "amm/contract.py", line 86 + callsub _do_opt_in // (𝕡) seed#0,a_asset#0,b_asset#0 | self._do_opt_in(self.asset_b) File "amm/contract.py", line 86 + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 87 + byte "pool_token" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 87 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 87 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%16#0 self.pool_token File "amm/contract.py", line 87 + itob // (𝕡) seed#0,a_asset#0,b_asset#0 | {itob} arc4.UInt64.encode(self.pool_token.asset_id) File "amm/contract.py", line 87 + retsub // val_as_bytes%18#0 return arc4.UInt64.encode(self.pool_token.asset_id) File "amm/contract.py", line 87 + + +// examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: +_create_pool_token: + proto 0 1 // def _create_pool_token(self) -> Asset: File "amm/contract.py", line 277 + +_create_pool_token_block@0: + itxn_begin // CreateInnerTransaction.begin() File "amm/contract.py", line 278 + int acfg // acfg TransactionType.AssetConfig File "amm/contract.py", line 279 + itxn_field TypeEnum // CreateInnerTransaction.set_type_enum(TransactionType.AssetConfig) File "amm/contract.py", line 279 + int 0 // 0 self.asset_a File "amm/contract.py", line 281 + byte "asset_a" // 0,"asset_a" self.asset_a File "amm/contract.py", line 281 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 281 + assert // check value exists // app_global_get_ex_value%2#0 self.asset_a File "amm/contract.py", line 281 + asset_params_get AssetUnitName // {asset_params_get}.0,{asset_params_get}.1 self.asset_a.unit_name File "amm/contract.py", line 281 + assert // asset exists // maybe_value%0#0 self.asset_a.unit_name File "amm/contract.py", line 281 + byte "DPT-" // maybe_value%0#0,"DPT-" b"DPT-" File "amm/contract.py", line 281 + swap // load maybe_value%0#0 from l-stack (no copy) "DPT-",maybe_value%0#0 self.asset_a.unit_name File "amm/contract.py", line 281 + concat // {concat} Bytes(b"DPT-") + self.asset_a.unit_name File "amm/contract.py", line 281 + byte "-" // tmp%4#0,"-" b"-" File "amm/contract.py", line 281 + concat // {concat} Bytes(b"DPT-") + self.asset_a.unit_name + Bytes(b"-") File "amm/contract.py", line 281 + int 0 // tmp%5#0,0 self.asset_b File "amm/contract.py", line 281 + byte "asset_b" // tmp%5#0,0,"asset_b" self.asset_b File "amm/contract.py", line 281 + app_global_get_ex // tmp%5#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 281 + assert // check value exists // tmp%5#0,app_global_get_ex_value%8#0 self.asset_b File "amm/contract.py", line 281 + asset_params_get AssetUnitName // tmp%5#0,{asset_params_get}.0,{asset_params_get}.1 self.asset_b.unit_name File "amm/contract.py", line 281 + assert // asset exists // tmp%5#0,maybe_value%6#0 self.asset_b.unit_name File "amm/contract.py", line 281 + concat // {concat} Bytes(b"DPT-") + self.asset_a.unit_name + Bytes(b"-") + self.asset_b.unit_name File "amm/contract.py", line 281 + itxn_field ConfigAssetName // CreateInnerTransaction.set_config_asset_name( File "amm/contract.py", line 280 + byte "dpt" // "dpt" b"dpt" File "amm/contract.py", line 283 + itxn_field ConfigAssetUnitName // CreateInnerTransaction.set_config_asset_unit_name(b"dpt") File "amm/contract.py", line 283 + int 10000000000 // 10000000000 TOTAL_SUPPLY File "amm/contract.py", line 284 + itxn_field ConfigAssetTotal // CreateInnerTransaction.set_config_asset_total(TOTAL_SUPPLY) File "amm/contract.py", line 284 + int 3 // 3 3 File "amm/contract.py", line 285 + itxn_field ConfigAssetDecimals // CreateInnerTransaction.set_config_asset_decimals(3) File "amm/contract.py", line 285 + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 286 + itxn_field ConfigAssetManager // CreateInnerTransaction.set_config_asset_manager(Global.current_application_address()) File "amm/contract.py", line 286 + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 287 + itxn_field ConfigAssetReserve // CreateInnerTransaction.set_config_asset_reserve(Global.current_application_address()) File "amm/contract.py", line 287 + int 0 // 0 0 File "amm/contract.py", line 288 + itxn_field Fee // CreateInnerTransaction.set_fee(0) File "amm/contract.py", line 288 + itxn_submit // CreateInnerTransaction.submit() File "amm/contract.py", line 289 + itxn CreatedAssetID // {itxn} InnerTransaction.created_asset_id() File "amm/contract.py", line 291 + retsub // tmp%13#0 return Asset(InnerTransaction.created_asset_id()) File "amm/contract.py", line 291 + + +// examples.amm.contract.ConstantProductAMM._do_opt_in(asset#0: uint64) -> void: +_do_opt_in: + proto 1 0 // (𝕡) asset#0 | def _do_opt_in(self, asset: Asset) -> None: File "amm/contract.py", line 294 + +_do_opt_in_block@0: + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "amm/contract.py", line 296 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | tmp%0#0,asset#0 asset: Asset File "amm/contract.py", line 294 + int 0 // (𝕡) asset#0 | tmp%0#0,asset#0,0 0 File "amm/contract.py", line 298 + callsub do_asset_transfer // (𝕡) asset#0 | do_asset_transfer( File "amm/contract.py", line 295 + retsub // + + +// examples.amm.contract.do_asset_transfer(receiver#0: bytes, asset#0: uint64, amount#0: uint64) -> void: +do_asset_transfer: + proto 3 0 // (𝕡) receiver#0,asset#0,amount#0 | def do_asset_transfer(*, receiver: Account, asset: Asset, amount: UInt64) -> None: File "amm/contract.py", line 367 + +do_asset_transfer_block@0: + itxn_begin // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.begin() File "amm/contract.py", line 368 + int axfer // (𝕡) receiver#0,asset#0,amount#0 | axfer TransactionType.AssetTransfer File "amm/contract.py", line 369 + itxn_field TypeEnum // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "amm/contract.py", line 369 + frame_dig -2 // load asset#0 from parameters (𝕡) receiver#0,asset#0,amount#0 | asset#0 asset: Asset File "amm/contract.py", line 367 + itxn_field XferAsset // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "amm/contract.py", line 370 + frame_dig -1 // load amount#0 from parameters (𝕡) receiver#0,asset#0,amount#0 | amount#0 amount: UInt64 File "amm/contract.py", line 367 + itxn_field AssetAmount // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_asset_amount(amount) File "amm/contract.py", line 371 + frame_dig -3 // load receiver#0 from parameters (𝕡) receiver#0,asset#0,amount#0 | receiver#0 receiver: Account File "amm/contract.py", line 367 + itxn_field AssetReceiver // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_asset_receiver(receiver) File "amm/contract.py", line 372 + int 0 // (𝕡) receiver#0,asset#0,amount#0 | 0 0 File "amm/contract.py", line 373 + itxn_field Fee // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_fee(0) File "amm/contract.py", line 373 + itxn_submit // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.submit() File "amm/contract.py", line 374 + retsub // + + +// examples.amm.contract.ConstantProductAMM.mint(a_xfer#0: uint64, b_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +mint: + proto 5 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | def mint( File "amm/contract.py", line 96 + +mint_block@0: + callsub _check_bootstrapped // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._check_bootstrapped() File "amm/contract.py", line 119 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 122 + byte "pool_token" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 122 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 122 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 122 + frame_dig -3 // load pool_asset#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0,pool_asset#0 pool_asset: Asset File "amm/contract.py", line 100 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 122 + assert // asset pool incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 122 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_a File "amm/contract.py", line 123 + byte "asset_a" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 123 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 123 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0 self.asset_a File "amm/contract.py", line 123 + frame_dig -2 // load a_asset#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0,a_asset#0 a_asset: Asset File "amm/contract.py", line 101 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 123 + assert // asset a incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 123 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_b File "amm/contract.py", line 124 + byte "asset_b" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 124 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 124 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0 self.asset_b File "amm/contract.py", line 124 + frame_dig -1 // load b_asset#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 102 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 124 + assert // asset b incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 124 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.sender File "amm/contract.py", line 125 + txn Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%9#0,{txn} Transaction.sender() File "amm/contract.py", line 125 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 125 + assert // sender invalid // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 125 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.sender File "amm/contract.py", line 126 + txn Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%12#0,{txn} Transaction.sender() File "amm/contract.py", line 126 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 126 + assert // sender invalid // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 126 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns AssetReceiver // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.asset_receiver File "amm/contract.py", line 130 + global CurrentApplicationAddress // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%15#0,{global} Global.current_application_address() File "amm/contract.py", line 130 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_xfer.asset_receiver == Global.current_application_address() File "amm/contract.py", line 130 + assert // receiver not app address // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert ( File "amm/contract.py", line 129 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns XferAsset // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.xfer_asset File "amm/contract.py", line 132 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,0 self.asset_a File "amm/contract.py", line 132 + byte "asset_a" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,0,"asset_a" self.asset_a File "amm/contract.py", line 132 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 132 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,app_global_get_ex_value%19#0 self.asset_a File "amm/contract.py", line 132 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_xfer.xfer_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 132 + assert // asset a incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_xfer.xfer_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 132 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.asset_amount File "amm/contract.py", line 133 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%22#0,0 0 File "amm/contract.py", line 133 + > // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {>} a_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 133 + assert // amount minimum not met // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 133 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns AssetReceiver // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.asset_receiver File "amm/contract.py", line 137 + global CurrentApplicationAddress // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%24#0,{global} Global.current_application_address() File "amm/contract.py", line 137 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_xfer.asset_receiver == Global.current_application_address() File "amm/contract.py", line 137 + assert // receiver not app address // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert ( File "amm/contract.py", line 136 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns XferAsset // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.xfer_asset File "amm/contract.py", line 139 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,0 self.asset_b File "amm/contract.py", line 139 + byte "asset_b" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,0,"asset_b" self.asset_b File "amm/contract.py", line 139 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 139 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,app_global_get_ex_value%28#0 self.asset_b File "amm/contract.py", line 139 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_xfer.xfer_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 139 + assert // asset b incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_xfer.xfer_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 139 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.asset_amount File "amm/contract.py", line 140 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%31#0,0 0 File "amm/contract.py", line 140 + > // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {>} b_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 140 + assert // amount minimum not met // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 140 + callsub _current_pool_balance // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {_current_pool_balance} self._current_pool_balance() File "amm/contract.py", line 143 + callsub _current_a_balance // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,{_current_a_balance} self._current_a_balance() File "amm/contract.py", line 144 + callsub _current_b_balance // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,{_current_b_balance} self._current_b_balance() File "amm/contract.py", line 145 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,{gtxns} a_xfer.asset_amount File "amm/contract.py", line 146 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,tmp%36#0,b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,tmp%36#0,{gtxns} b_xfer.asset_amount File "amm/contract.py", line 147 + callsub tokens_to_mint // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {tokens_to_mint} tokens_to_mint( File "amm/contract.py", line 142 + dup // load to_mint#0 from l-stack (copy) (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,to_mint#0 to_mint File "amm/contract.py", line 142 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,to_mint#0,0 0 File "amm/contract.py", line 149 + > // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,{>} to_mint > 0, "send amount too low" File "amm/contract.py", line 149 + assert // send amount too low // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0 assert to_mint > 0, "send amount too low" File "amm/contract.py", line 149 + txn Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,{txn} Transaction.sender() File "amm/contract.py", line 152 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,0 self.pool_token File "amm/contract.py", line 152 + byte "pool_token" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,0,"pool_token" self.pool_token File "amm/contract.py", line 152 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 152 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,app_global_get_ex_value%40#0 self.pool_token File "amm/contract.py", line 152 + uncover 2 // load to_mint#0 from l-stack (no copy) (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%39#0,app_global_get_ex_value%40#0,to_mint#0 to_mint File "amm/contract.py", line 142 + callsub do_asset_transfer // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | do_asset_transfer(receiver=Transaction.sender(), asset=self.pool_token, amount=to_mint) File "amm/contract.py", line 152 + callsub _update_ratio // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._update_ratio() File "amm/contract.py", line 153 + retsub // + + +// examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: +_check_bootstrapped: + proto 0 0 // def _check_bootstrapped(self) -> None: File "amm/contract.py", line 260 + +_check_bootstrapped_block@0: + int 0 // 0 self.pool_token File "amm/contract.py", line 261 + byte "pool_token" // 0,"pool_token" self.pool_token File "amm/contract.py", line 261 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 261 + assert // check value exists // app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 261 + assert // bootstrap method needs to be called first // assert self.pool_token, "bootstrap method needs to be called first" File "amm/contract.py", line 261 + retsub // + + +// examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: +_current_pool_balance: + proto 0 1 // def _current_pool_balance(self) -> UInt64: File "amm/contract.py", line 302 + +_current_pool_balance_block@0: + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 303 + int 0 // tmp%2#0,0 self.pool_token File "amm/contract.py", line 303 + byte "pool_token" // tmp%2#0,0,"pool_token" self.pool_token File "amm/contract.py", line 303 + app_global_get_ex // tmp%2#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 303 + assert // check value exists // tmp%2#0,app_global_get_ex_value%3#0 self.pool_token File "amm/contract.py", line 303 + asset_holding_get AssetBalance // {asset_holding_get}.0,{asset_holding_get}.1 self.pool_token.balance(Global.current_application_address()) File "amm/contract.py", line 303 + assert // account opted into asset // maybe_value%0#0 self.pool_token.balance(Global.current_application_address()) File "amm/contract.py", line 303 + retsub // maybe_value%0#0 return self.pool_token.balance(Global.current_application_address()) File "amm/contract.py", line 303 + + +// examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: +_current_a_balance: + proto 0 1 // def _current_a_balance(self) -> UInt64: File "amm/contract.py", line 306 + +_current_a_balance_block@0: + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 307 + int 0 // tmp%2#0,0 self.asset_a File "amm/contract.py", line 307 + byte "asset_a" // tmp%2#0,0,"asset_a" self.asset_a File "amm/contract.py", line 307 + app_global_get_ex // tmp%2#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 307 + assert // check value exists // tmp%2#0,app_global_get_ex_value%3#0 self.asset_a File "amm/contract.py", line 307 + asset_holding_get AssetBalance // {asset_holding_get}.0,{asset_holding_get}.1 self.asset_a.balance(Global.current_application_address()) File "amm/contract.py", line 307 + assert // account opted into asset // maybe_value%0#0 self.asset_a.balance(Global.current_application_address()) File "amm/contract.py", line 307 + retsub // maybe_value%0#0 return self.asset_a.balance(Global.current_application_address()) File "amm/contract.py", line 307 + + +// examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: +_current_b_balance: + proto 0 1 // def _current_b_balance(self) -> UInt64: File "amm/contract.py", line 310 + +_current_b_balance_block@0: + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 311 + int 0 // tmp%2#0,0 self.asset_b File "amm/contract.py", line 311 + byte "asset_b" // tmp%2#0,0,"asset_b" self.asset_b File "amm/contract.py", line 311 + app_global_get_ex // tmp%2#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 311 + assert // check value exists // tmp%2#0,app_global_get_ex_value%3#0 self.asset_b File "amm/contract.py", line 311 + asset_holding_get AssetBalance // {asset_holding_get}.0,{asset_holding_get}.1 self.asset_b.balance(Global.current_application_address()) File "amm/contract.py", line 311 + assert // account opted into asset // maybe_value%0#0 self.asset_b.balance(Global.current_application_address()) File "amm/contract.py", line 311 + retsub // maybe_value%0#0 return self.asset_b.balance(Global.current_application_address()) File "amm/contract.py", line 311 + + +// examples.amm.contract.tokens_to_mint(pool_balance#0: uint64, a_balance#0: uint64, b_balance#0: uint64, a_amount#0: uint64, b_amount#0: uint64) -> uint64: +tokens_to_mint: + proto 5 1 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | def tokens_to_mint( File "amm/contract.py", line 333 + byte "" + dup // allocate 2 to stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | + +tokens_to_mint_block@0: + frame_dig -4 // load a_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance#0 a_balance: UInt64 File "amm/contract.py", line 336 + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance#0,a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + == // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {==} a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + bz tokens_to_mint_bool_false@3 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + // Implicit fall through to tokens_to_mint_and_contd@1 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + +tokens_to_mint_and_contd@1: + frame_dig -3 // load b_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | b_balance#0 b_balance: UInt64 File "amm/contract.py", line 337 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | b_balance#0,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + == // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {==} b_balance == b_amount File "amm/contract.py", line 341 + bz tokens_to_mint_bool_false@3 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + // Implicit fall through to tokens_to_mint_bool_true@2 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + +tokens_to_mint_bool_true@2: + int 1 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 1 + b tokens_to_mint_bool_merge@4 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) is_initial_mint#0 | is_initial_mint#0 + +tokens_to_mint_bool_false@3: + int 0 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 0 + // Implicit fall through to tokens_to_mint_bool_merge@4 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) is_initial_mint#0 | is_initial_mint#0 + +tokens_to_mint_bool_merge@4: + bz tokens_to_mint_after_if_else@6 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | is_initial_mint#0 if is_initial_mint: File "amm/contract.py", line 342 + // Implicit fall through to tokens_to_mint_if_body@5 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | if is_initial_mint: File "amm/contract.py", line 342 + +tokens_to_mint_if_body@5: + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_amount#0,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {*} a_amount * b_amount File "amm/contract.py", line 343 + sqrt // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {sqrt} sqrt(a_amount * b_amount) File "amm/contract.py", line 343 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | tmp%4#0,1000 SCALE File "amm/contract.py", line 343 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {-} sqrt(a_amount * b_amount) - SCALE File "amm/contract.py", line 343 + frame_bury 0 + retsub // tmp%5#0 return sqrt(a_amount * b_amount) - SCALE File "amm/contract.py", line 343 + +tokens_to_mint_after_if_else@6: + int 10000000000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 10000000000 TOTAL_SUPPLY File "amm/contract.py", line 344 + frame_dig -5 // load pool_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 10000000000,pool_balance#0 pool_balance: UInt64 File "amm/contract.py", line 335 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {-} TOTAL_SUPPLY - pool_balance File "amm/contract.py", line 344 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | 1000 SCALE File "amm/contract.py", line 345 + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | 1000,a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | {*} SCALE * a_amount File "amm/contract.py", line 345 + frame_dig -4 // load a_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | tmp%6#0,a_balance#0 a_balance: UInt64 File "amm/contract.py", line 336 + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | tmp%6#0,a_balance#0,a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | tmp%6#0,{-} a_balance - a_amount File "amm/contract.py", line 345 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | {/} SCALE * a_amount // (a_balance - a_amount) File "amm/contract.py", line 345 + dup // store a_ratio#0 to l-stack (copy) (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,a_ratio#0 a_ratio File "amm/contract.py", line 345 + frame_bury 0 // store a_ratio#0 to f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0 a_ratio File "amm/contract.py", line 345 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,1000 SCALE File "amm/contract.py", line 346 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,1000,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,{*} SCALE * b_amount File "amm/contract.py", line 346 + frame_dig -3 // load b_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,tmp%8#0,b_balance#0 b_balance: UInt64 File "amm/contract.py", line 337 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,tmp%8#0,b_balance#0,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,tmp%8#0,{-} b_balance - b_amount File "amm/contract.py", line 346 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,{/} SCALE * b_amount // (b_balance - b_amount) File "amm/contract.py", line 346 + dup // store b_ratio#0 to l-stack (copy) (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,b_ratio#0,b_ratio#0 b_ratio File "amm/contract.py", line 346 + frame_bury 1 // store b_ratio#0 to f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,b_ratio#0 b_ratio File "amm/contract.py", line 346 + < // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | {<} a_ratio < b_ratio: File "amm/contract.py", line 347 + bz tokens_to_mint_else_body@8 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | if a_ratio < b_ratio: File "amm/contract.py", line 347 + // Implicit fall through to tokens_to_mint_if_body@7 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | issued#0 if a_ratio < b_ratio: File "amm/contract.py", line 347 + +tokens_to_mint_if_body@7: + frame_dig 0 // load a_ratio#0 from f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0 issued#0 a_ratio File "amm/contract.py", line 345 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {*} a_ratio * issued File "amm/contract.py", line 348 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | tmp%11#0,1000 SCALE File "amm/contract.py", line 348 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {/} a_ratio * issued // SCALE File "amm/contract.py", line 348 + frame_bury 0 + retsub // tmp%12#0 return a_ratio * issued // SCALE File "amm/contract.py", line 348 + +tokens_to_mint_else_body@8: + frame_dig 1 // load b_ratio#0 from f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | b_ratio#0 issued#0 b_ratio File "amm/contract.py", line 346 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {*} b_ratio * issued File "amm/contract.py", line 350 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | tmp%13#0,1000 SCALE File "amm/contract.py", line 350 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {/} b_ratio * issued // SCALE File "amm/contract.py", line 350 + frame_bury 0 + retsub // tmp%14#0 return b_ratio * issued // SCALE File "amm/contract.py", line 350 + + +// examples.amm.contract.ConstantProductAMM._update_ratio() -> void: +_update_ratio: + proto 0 0 // def _update_ratio(self) -> None: File "amm/contract.py", line 264 + +_update_ratio_block@0: + callsub _current_a_balance // {_current_a_balance} self._current_a_balance() File "amm/contract.py", line 265 + callsub _current_b_balance // a_balance#0,{_current_b_balance} self._current_b_balance() File "amm/contract.py", line 266 + swap // store b_balance#0 to l-stack (no copy) b_balance#0,a_balance#0 b_balance File "amm/contract.py", line 266 + int 1000 // b_balance#0,a_balance#0,1000 SCALE File "amm/contract.py", line 268 + * // b_balance#0,{*} a_balance * SCALE File "amm/contract.py", line 268 + swap // load b_balance#0 from l-stack (no copy) tmp%0#0,b_balance#0 b_balance File "amm/contract.py", line 266 + / // {/} a_balance * SCALE // b_balance File "amm/contract.py", line 268 + byte "ratio" // new_state_value%1#0,"ratio" self.ratio File "amm/contract.py", line 268 + swap // load new_state_value%1#0 from l-stack (no copy) "ratio",new_state_value%1#0 a_balance * SCALE // b_balance File "amm/contract.py", line 268 + app_global_put // self.ratio = a_balance * SCALE // b_balance File "amm/contract.py", line 268 + retsub // + + +// examples.amm.contract.ConstantProductAMM.burn(pool_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +burn: + proto 4 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | def burn( File "amm/contract.py", line 162 + +burn_block@0: + callsub _check_bootstrapped // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._check_bootstrapped() File "amm/contract.py", line 178 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 180 + byte "pool_token" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 180 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 180 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 180 + frame_dig -3 // load pool_asset#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0,pool_asset#0 pool_asset: Asset File "amm/contract.py", line 165 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 180 + assert // asset pool incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 180 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_a File "amm/contract.py", line 181 + byte "asset_a" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 181 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 181 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0 self.asset_a File "amm/contract.py", line 181 + frame_dig -2 // load a_asset#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0,a_asset#0 a_asset: Asset File "amm/contract.py", line 166 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 181 + assert // asset a incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 181 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_b File "amm/contract.py", line 182 + byte "asset_b" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 182 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 182 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0 self.asset_b File "amm/contract.py", line 182 + frame_dig -1 // load b_asset#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 167 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 182 + assert // asset b incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 182 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetReceiver // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.asset_receiver File "amm/contract.py", line 185 + global CurrentApplicationAddress // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%9#0,{global} Global.current_application_address() File "amm/contract.py", line 185 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_xfer.asset_receiver == Global.current_application_address() File "amm/contract.py", line 185 + assert // receiver not app address // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert ( File "amm/contract.py", line 184 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetAmount // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.asset_amount File "amm/contract.py", line 187 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%12#0,0 0 File "amm/contract.py", line 187 + > // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {>} pool_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 187 + assert // amount minimum not met // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 187 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns XferAsset // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.xfer_asset File "amm/contract.py", line 188 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,0 self.pool_token File "amm/contract.py", line 188 + byte "pool_token" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,0,"pool_token" self.pool_token File "amm/contract.py", line 188 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 188 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,app_global_get_ex_value%15#0 self.pool_token File "amm/contract.py", line 188 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_xfer.xfer_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 188 + assert // asset pool incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_xfer.xfer_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 188 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.sender File "amm/contract.py", line 189 + txn Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,{txn} Transaction.sender() File "amm/contract.py", line 189 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 189 + assert // sender invalid // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 189 + callsub _current_pool_balance // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {_current_pool_balance} self._current_pool_balance() File "amm/contract.py", line 193 + callsub _current_a_balance // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,{_current_a_balance} self._current_a_balance() File "amm/contract.py", line 196 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,tmp%21#0,pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetAmount // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,tmp%21#0,{gtxns} pool_xfer.asset_amount File "amm/contract.py", line 197 + dig 2 // load pool_balance#0 from l-stack (copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,tmp%21#0,tmp%22#0,pool_balance#0 pool_balance File "amm/contract.py", line 193 + cover 2 // virtual: 2 ops (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,pool_balance#0,tmp%21#0,tmp%22#0 self._current_a_balance(), File "amm/contract.py", line 196 + callsub tokens_to_burn // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,{tokens_to_burn} tokens_to_burn( File "amm/contract.py", line 194 + swap // store a_amt#0 to l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0 a_amt File "amm/contract.py", line 194 + callsub _current_b_balance // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0,{_current_b_balance} self._current_b_balance() File "amm/contract.py", line 201 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0,tmp%23#0,pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetAmount // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0,tmp%23#0,{gtxns} pool_xfer.asset_amount File "amm/contract.py", line 202 + callsub tokens_to_burn // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,{tokens_to_burn} tokens_to_burn( File "amm/contract.py", line 199 + swap // store b_amt#0 to l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0 b_amt File "amm/contract.py", line 199 + txn Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,{txn} Transaction.sender() File "amm/contract.py", line 206 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,0 self.asset_a File "amm/contract.py", line 206 + byte "asset_a" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,0,"asset_a" self.asset_a File "amm/contract.py", line 206 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 206 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,app_global_get_ex_value%26#0 self.asset_a File "amm/contract.py", line 206 + uncover 2 // load a_amt#0 from l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%25#0,app_global_get_ex_value%26#0,a_amt#0 a_amt File "amm/contract.py", line 194 + callsub do_asset_transfer // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0 do_asset_transfer(receiver=Transaction.sender(), asset=self.asset_a, amount=a_amt) File "amm/contract.py", line 206 + txn Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,{txn} Transaction.sender() File "amm/contract.py", line 209 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,0 self.asset_b File "amm/contract.py", line 209 + byte "asset_b" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,0,"asset_b" self.asset_b File "amm/contract.py", line 209 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 209 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,app_global_get_ex_value%29#0 self.asset_b File "amm/contract.py", line 209 + uncover 2 // load b_amt#0 from l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%28#0,app_global_get_ex_value%29#0,b_amt#0 b_amt File "amm/contract.py", line 199 + callsub do_asset_transfer // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | do_asset_transfer(receiver=Transaction.sender(), asset=self.asset_b, amount=b_amt) File "amm/contract.py", line 209 + callsub _update_ratio // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._update_ratio() File "amm/contract.py", line 210 + retsub // + + +// examples.amm.contract.tokens_to_burn(pool_balance#0: uint64, supply#0: uint64, amount#0: uint64) -> uint64: +tokens_to_burn: + proto 3 1 // (𝕡) pool_balance#0,supply#0,amount#0 | def tokens_to_burn(*, pool_balance: UInt64, supply: UInt64, amount: UInt64) -> UInt64: File "amm/contract.py", line 354 + +tokens_to_burn_block@0: + int 10000000000 // (𝕡) pool_balance#0,supply#0,amount#0 | 10000000000 TOTAL_SUPPLY File "amm/contract.py", line 355 + frame_dig -3 // load pool_balance#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | 10000000000,pool_balance#0 pool_balance: UInt64 File "amm/contract.py", line 354 + - // (𝕡) pool_balance#0,supply#0,amount#0 | {-} TOTAL_SUPPLY - pool_balance File "amm/contract.py", line 355 + frame_dig -1 // load amount#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | tmp%0#0,amount#0 amount: UInt64 File "amm/contract.py", line 354 + - // (𝕡) pool_balance#0,supply#0,amount#0 | {-} TOTAL_SUPPLY - pool_balance - amount File "amm/contract.py", line 355 + frame_dig -2 // load supply#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | issued#0,supply#0 supply: UInt64 File "amm/contract.py", line 354 + frame_dig -1 // load amount#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | issued#0,supply#0,amount#0 amount: UInt64 File "amm/contract.py", line 354 + * // (𝕡) pool_balance#0,supply#0,amount#0 | issued#0,{*} supply * amount File "amm/contract.py", line 356 + swap // load issued#0 from l-stack (no copy) (𝕡) pool_balance#0,supply#0,amount#0 | tmp%1#0,issued#0 issued File "amm/contract.py", line 355 + / // (𝕡) pool_balance#0,supply#0,amount#0 | {/} supply * amount // issued File "amm/contract.py", line 356 + retsub // tmp%2#0 return supply * amount // issued File "amm/contract.py", line 356 + + +// examples.amm.contract.ConstantProductAMM.swap(swap_xfer#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +swap: + proto 3 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | def swap( File "amm/contract.py", line 218 + byte "" + dup // allocate 2 to stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | + +swap_block@0: + callsub _check_bootstrapped // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | self._check_bootstrapped() File "amm/contract.py", line 231 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0 self.asset_a File "amm/contract.py", line 233 + byte "asset_a" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 233 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 233 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%0#0 self.asset_a File "amm/contract.py", line 233 + frame_dig -2 // load a_asset#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%0#0,a_asset#0 a_asset: Asset File "amm/contract.py", line 221 + == // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {==} a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 233 + assert // asset a incorrect // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 233 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0 self.asset_b File "amm/contract.py", line 234 + byte "asset_b" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 234 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 234 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%3#0 self.asset_b File "amm/contract.py", line 234 + frame_dig -1 // load b_asset#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%3#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 222 + == // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {==} b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 234 + assert // asset b incorrect // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 234 + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | swap_xfer#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns AssetAmount // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {gtxns} swap_xfer.asset_amount File "amm/contract.py", line 236 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%6#0,0 0 File "amm/contract.py", line 236 + > // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {>} swap_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 236 + assert // amount minimum not met // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert swap_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 236 + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | swap_xfer#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns Sender // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {gtxns} swap_xfer.sender File "amm/contract.py", line 237 + txn Sender // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%8#0,{txn} Transaction.sender() File "amm/contract.py", line 237 + == // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {==} swap_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 237 + assert // sender invalid // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert swap_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 237 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0 self.asset_a File "amm/contract.py", line 240 + byte "asset_a" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 240 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 240 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0 self.asset_a File "amm/contract.py", line 240 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,0 self.asset_b File "amm/contract.py", line 244 + byte "asset_b" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,0,"asset_b" self.asset_b File "amm/contract.py", line 244 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 244 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,app_global_get_ex_value%13#0 self.asset_b File "amm/contract.py", line 244 + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,app_global_get_ex_value%13#0,swap_xfer#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns XferAsset // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,app_global_get_ex_value%13#0,{gtxns} swap_xfer.xfer_asset File "amm/contract.py", line 239 + match swap_switch_case_0@1 swap_switch_case_1@2 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | match swap_xfer.xfer_asset: File "amm/contract.py", line 239 + b swap_switch_case_default@3 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | match swap_xfer.xfer_asset: File "amm/contract.py", line 239 + +swap_switch_case_0@1: + callsub _current_b_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_b_balance} self._current_b_balance() File "amm/contract.py", line 241 + frame_bury 0 // store in_supply#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | in_supply File "amm/contract.py", line 241 + callsub _current_a_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_a_balance} self._current_a_balance() File "amm/contract.py", line 242 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0 self.asset_a File "amm/contract.py", line 243 + byte "asset_a" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 243 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 243 + swap // store app_global_get_ex_did_exist%17#0 to l-stack (no copy) (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | app_global_get_ex_did_exist%17#0,{app_global_get_ex}.0 self.asset_a File "amm/contract.py", line 243 + frame_bury 1 // store out_asset#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | app_global_get_ex_did_exist%17#0 out_asset File "amm/contract.py", line 243 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | self.asset_a File "amm/contract.py", line 243 + b swap_switch_case_next@4 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | out_supply#0 + +swap_switch_case_1@2: + callsub _current_a_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_a_balance} self._current_a_balance() File "amm/contract.py", line 245 + frame_bury 0 // store in_supply#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | in_supply File "amm/contract.py", line 241 + callsub _current_b_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_b_balance} self._current_b_balance() File "amm/contract.py", line 246 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0 self.asset_b File "amm/contract.py", line 247 + byte "asset_b" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 247 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 247 + swap // store app_global_get_ex_did_exist%19#0 to l-stack (no copy) (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | app_global_get_ex_did_exist%19#0,{app_global_get_ex}.0 self.asset_b File "amm/contract.py", line 247 + frame_bury 1 // store out_asset#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | app_global_get_ex_did_exist%19#0 out_asset File "amm/contract.py", line 243 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | self.asset_b File "amm/contract.py", line 247 + b swap_switch_case_next@4 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | out_supply#0 + +swap_switch_case_default@3: + err // asset id incorrect // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert False, "asset id incorrect" File "amm/contract.py", line 249 + +swap_switch_case_next@4: + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | swap_xfer#0 out_supply#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns AssetAmount // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | {gtxns} swap_xfer.asset_amount File "amm/contract.py", line 252 + frame_dig 0 // load in_supply#0 from f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | tmp%20#0,in_supply#0 in_supply File "amm/contract.py", line 241 + uncover 2 // load out_supply#0 from x-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%20#0,in_supply#0,out_supply#0 out_supply File "amm/contract.py", line 242 + callsub tokens_to_swap // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {tokens_to_swap} tokens_to_swap( File "amm/contract.py", line 251 + dup // load to_swap#0 from l-stack (copy) (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,to_swap#0 to_swap File "amm/contract.py", line 251 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,to_swap#0,0 0 File "amm/contract.py", line 254 + > // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,{>} to_swap > 0, "send amount too low" File "amm/contract.py", line 254 + assert // send amount too low // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0 assert to_swap > 0, "send amount too low" File "amm/contract.py", line 254 + txn Sender // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,{txn} Transaction.sender() File "amm/contract.py", line 256 + frame_dig 1 // load out_asset#0 from f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,tmp%22#0,out_asset#0 out_asset File "amm/contract.py", line 243 + uncover 2 // load to_swap#0 from l-stack (no copy) (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%22#0,out_asset#0,to_swap#0 to_swap File "amm/contract.py", line 251 + callsub do_asset_transfer // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | do_asset_transfer(receiver=Transaction.sender(), asset=out_asset, amount=to_swap) File "amm/contract.py", line 256 + callsub _update_ratio // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | self._update_ratio() File "amm/contract.py", line 257 + retsub // + + +// examples.amm.contract.tokens_to_swap(in_amount#0: uint64, in_supply#0: uint64, out_supply#0: uint64) -> uint64: +tokens_to_swap: + proto 3 1 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | def tokens_to_swap(*, in_amount: UInt64, in_supply: UInt64, out_supply: UInt64) -> UInt64: File "amm/contract.py", line 360 + +tokens_to_swap_block@0: + frame_dig -2 // load in_supply#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_supply#0 in_supply: UInt64 File "amm/contract.py", line 360 + frame_dig -3 // load in_amount#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_supply#0,in_amount#0 in_amount: UInt64 File "amm/contract.py", line 360 + - // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {-} in_supply - in_amount File "amm/contract.py", line 361 + int 1000 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%0#0,1000 SCALE File "amm/contract.py", line 361 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {*} SCALE * (in_supply - in_amount) File "amm/contract.py", line 361 + frame_dig -3 // load in_amount#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%1#0,in_amount#0 in_amount: UInt64 File "amm/contract.py", line 360 + int 995 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%1#0,in_amount#0,995 FACTOR File "amm/contract.py", line 361 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%1#0,{*} in_amount * FACTOR File "amm/contract.py", line 361 + + // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {+} SCALE * (in_supply - in_amount) + (in_amount * FACTOR) File "amm/contract.py", line 361 + frame_dig -3 // load in_amount#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,in_amount#0 in_amount: UInt64 File "amm/contract.py", line 360 + int 995 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,in_amount#0,995 FACTOR File "amm/contract.py", line 362 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,{*} in_amount * FACTOR File "amm/contract.py", line 362 + frame_dig -1 // load out_supply#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,tmp%3#0,out_supply#0 out_supply: UInt64 File "amm/contract.py", line 360 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,{*} in_amount * FACTOR * out_supply File "amm/contract.py", line 362 + swap // load in_total#0 from l-stack (no copy) (𝕡) in_amount#0,in_supply#0,out_supply#0 | out_total#0,in_total#0 in_total File "amm/contract.py", line 361 + / // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {/} out_total // in_total File "amm/contract.py", line 363 + retsub // tmp%4#0 return out_total // in_total File "amm/contract.py", line 363 + + +// examples.amm.contract.ConstantProductAMM.create() -> void: +create: + proto 0 0 // def create(self) -> None: File "amm/contract.py", line 48 + +create_block@0: + retsub // + + +// examples.amm.contract.ConstantProductAMM.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "amm/contract.py", line 32 + +__init___block@0: + byte "asset_a" // "asset_a" self.asset_a File "amm/contract.py", line 37 + int 0 // "asset_a",0 0 File "amm/contract.py", line 37 + app_global_put // self.asset_a = Asset(0) File "amm/contract.py", line 37 + byte "asset_b" // "asset_b" self.asset_b File "amm/contract.py", line 39 + int 0 // "asset_b",0 0 File "amm/contract.py", line 39 + app_global_put // self.asset_b = Asset(0) File "amm/contract.py", line 39 + txn Sender // {txn} Transaction.sender() File "amm/contract.py", line 41 + byte "governor" // new_state_value%0#0,"governor" self.governor File "amm/contract.py", line 41 + swap // load new_state_value%0#0 from l-stack (no copy) "governor",new_state_value%0#0 Transaction.sender() File "amm/contract.py", line 41 + app_global_put // self.governor = Transaction.sender() File "amm/contract.py", line 41 + byte "pool_token" // "pool_token" self.pool_token File "amm/contract.py", line 43 + int 0 // "pool_token",0 0 File "amm/contract.py", line 43 + app_global_put // self.pool_token = Asset(0) File "amm/contract.py", line 43 + byte "ratio" // "ratio" self.ratio File "amm/contract.py", line 45 + int 0 // "ratio",0 0 File "amm/contract.py", line 45 + app_global_put // self.ratio = UInt64(0) File "amm/contract.py", line 45 + retsub // + diff --git a/examples/amm/out/contract.approval.teal b/examples/amm/out/contract.approval.teal new file mode 100644 index 0000000000..96e87bf13c --- /dev/null +++ b/examples/amm/out/contract.approval.teal @@ -0,0 +1,828 @@ +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_bare_routing@11 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "set_governor(account)void" + method "bootstrap(pay,asset,asset)uint64" + method "mint(axfer,axfer,asset,asset,asset)void" + method "burn(axfer,asset,asset,asset)void" + method "swap(axfer,asset,asset)void" + uncover 5 + match main_set_governor_route@4 main_bootstrap_route@5 main_mint_route@6 main_burn_route@7 main_swap_route@8 + b main_switch_case_default@9 + +main_set_governor_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Accounts + callsub set_governor + int 1 + return + +main_bootstrap_route@5: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + callsub bootstrap + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_mint_route@6: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 2 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + txna ApplicationArgs 3 + btoi + txnas Assets + callsub mint + int 1 + return + +main_burn_route@7: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + txna ApplicationArgs 3 + btoi + txnas Assets + callsub burn + int 1 + return + +main_swap_route@8: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + callsub swap + int 1 + return + +main_switch_case_default@9: + err // reject transaction + +main_bare_routing@11: + txn OnCompletion + bnz main_reject_bare_on_completion@13 + +main_create@12: + txn ApplicationID + ! + assert // is creating + callsub create + int 1 + return + +main_reject_bare_on_completion@13: + err // reject transaction + + +// examples.amm.contract.ConstantProductAMM.set_governor(new_governor#0: bytes) -> void: +set_governor: + proto 1 0 + +set_governor_block@0: + callsub _check_is_governor + byte "governor" + frame_dig -1 + app_global_put + retsub + + +// examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: +_check_is_governor: + proto 0 0 + +_check_is_governor_block@0: + txn Sender + int 0 + byte "governor" + app_global_get_ex + assert // check value exists + == + assert // Only the account set in global_state.governor may call this method + retsub + + +// examples.amm.contract.ConstantProductAMM.bootstrap(seed#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> bytes: +bootstrap: + proto 3 1 + +bootstrap_block@0: + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + ! + assert // application has already been bootstrapped + callsub _check_is_governor + global GroupSize + int 2 + == + assert // group size not 2 + frame_dig -3 + gtxns Receiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -3 + gtxns Amount + int 300000 + >= + assert // amount minimum not met + frame_dig -2 + frame_dig -1 + < + assert // asset a must be less than asset b + byte "asset_a" + frame_dig -2 + app_global_put + byte "asset_b" + frame_dig -1 + app_global_put + callsub _create_pool_token + byte "pool_token" + swap + app_global_put + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + callsub _do_opt_in + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + callsub _do_opt_in + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + itob + retsub + + +// examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: +_create_pool_token: + proto 0 1 + +_create_pool_token_block@0: + itxn_begin + int acfg + itxn_field TypeEnum + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + asset_params_get AssetUnitName + assert // asset exists + byte "DPT-" + swap + concat + byte "-" + concat + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + asset_params_get AssetUnitName + assert // asset exists + concat + itxn_field ConfigAssetName + byte "dpt" + itxn_field ConfigAssetUnitName + int 10000000000 + itxn_field ConfigAssetTotal + int 3 + itxn_field ConfigAssetDecimals + global CurrentApplicationAddress + itxn_field ConfigAssetManager + global CurrentApplicationAddress + itxn_field ConfigAssetReserve + int 0 + itxn_field Fee + itxn_submit + itxn CreatedAssetID + retsub + + +// examples.amm.contract.ConstantProductAMM._do_opt_in(asset#0: uint64) -> void: +_do_opt_in: + proto 1 0 + +_do_opt_in_block@0: + global CurrentApplicationAddress + frame_dig -1 + int 0 + callsub do_asset_transfer + retsub + + +// examples.amm.contract.do_asset_transfer(receiver#0: bytes, asset#0: uint64, amount#0: uint64) -> void: +do_asset_transfer: + proto 3 0 + +do_asset_transfer_block@0: + itxn_begin + int axfer + itxn_field TypeEnum + frame_dig -2 + itxn_field XferAsset + frame_dig -1 + itxn_field AssetAmount + frame_dig -3 + itxn_field AssetReceiver + int 0 + itxn_field Fee + itxn_submit + retsub + + +// examples.amm.contract.ConstantProductAMM.mint(a_xfer#0: uint64, b_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +mint: + proto 5 0 + +mint_block@0: + callsub _check_bootstrapped + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + frame_dig -3 + == + assert // asset pool incorrect + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + frame_dig -2 + == + assert // asset a incorrect + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -1 + == + assert // asset b incorrect + frame_dig -5 + gtxns Sender + txn Sender + == + assert // sender invalid + frame_dig -4 + gtxns Sender + txn Sender + == + assert // sender invalid + frame_dig -5 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -5 + gtxns XferAsset + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + == + assert // asset a incorrect + frame_dig -5 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + frame_dig -4 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -4 + gtxns XferAsset + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + == + assert // asset b incorrect + frame_dig -4 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + callsub _current_pool_balance + callsub _current_a_balance + callsub _current_b_balance + frame_dig -5 + gtxns AssetAmount + frame_dig -4 + gtxns AssetAmount + callsub tokens_to_mint + dup + int 0 + > + assert // send amount too low + txn Sender + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + uncover 2 + callsub do_asset_transfer + callsub _update_ratio + retsub + + +// examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: +_check_bootstrapped: + proto 0 0 + +_check_bootstrapped_block@0: + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + assert // bootstrap method needs to be called first + retsub + + +// examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: +_current_pool_balance: + proto 0 1 + +_current_pool_balance_block@0: + global CurrentApplicationAddress + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + asset_holding_get AssetBalance + assert // account opted into asset + retsub + + +// examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: +_current_a_balance: + proto 0 1 + +_current_a_balance_block@0: + global CurrentApplicationAddress + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + asset_holding_get AssetBalance + assert // account opted into asset + retsub + + +// examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: +_current_b_balance: + proto 0 1 + +_current_b_balance_block@0: + global CurrentApplicationAddress + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + asset_holding_get AssetBalance + assert // account opted into asset + retsub + + +// examples.amm.contract.tokens_to_mint(pool_balance#0: uint64, a_balance#0: uint64, b_balance#0: uint64, a_amount#0: uint64, b_amount#0: uint64) -> uint64: +tokens_to_mint: + proto 5 1 + byte "" + dup + +tokens_to_mint_block@0: + frame_dig -4 + frame_dig -2 + == + bz tokens_to_mint_bool_false@3 + +tokens_to_mint_and_contd@1: + frame_dig -3 + frame_dig -1 + == + bz tokens_to_mint_bool_false@3 + +tokens_to_mint_bool_true@2: + int 1 + b tokens_to_mint_bool_merge@4 + +tokens_to_mint_bool_false@3: + int 0 + +tokens_to_mint_bool_merge@4: + bz tokens_to_mint_after_if_else@6 + +tokens_to_mint_if_body@5: + frame_dig -2 + frame_dig -1 + * + sqrt + int 1000 + - + frame_bury 0 + retsub + +tokens_to_mint_after_if_else@6: + int 10000000000 + frame_dig -5 + - + int 1000 + frame_dig -2 + * + frame_dig -4 + frame_dig -2 + - + / + dup + frame_bury 0 + int 1000 + frame_dig -1 + * + frame_dig -3 + frame_dig -1 + - + / + dup + frame_bury 1 + < + bz tokens_to_mint_else_body@8 + +tokens_to_mint_if_body@7: + frame_dig 0 + * + int 1000 + / + frame_bury 0 + retsub + +tokens_to_mint_else_body@8: + frame_dig 1 + * + int 1000 + / + frame_bury 0 + retsub + + +// examples.amm.contract.ConstantProductAMM._update_ratio() -> void: +_update_ratio: + proto 0 0 + +_update_ratio_block@0: + callsub _current_a_balance + callsub _current_b_balance + swap + int 1000 + * + swap + / + byte "ratio" + swap + app_global_put + retsub + + +// examples.amm.contract.ConstantProductAMM.burn(pool_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +burn: + proto 4 0 + +burn_block@0: + callsub _check_bootstrapped + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + frame_dig -3 + == + assert // asset pool incorrect + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + frame_dig -2 + == + assert // asset a incorrect + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -1 + == + assert // asset b incorrect + frame_dig -4 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -4 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + frame_dig -4 + gtxns XferAsset + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + == + assert // asset pool incorrect + frame_dig -4 + gtxns Sender + txn Sender + == + assert // sender invalid + callsub _current_pool_balance + callsub _current_a_balance + frame_dig -4 + gtxns AssetAmount + dig 2 + cover 2 + callsub tokens_to_burn + swap + callsub _current_b_balance + frame_dig -4 + gtxns AssetAmount + callsub tokens_to_burn + swap + txn Sender + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + uncover 2 + callsub do_asset_transfer + txn Sender + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + uncover 2 + callsub do_asset_transfer + callsub _update_ratio + retsub + + +// examples.amm.contract.tokens_to_burn(pool_balance#0: uint64, supply#0: uint64, amount#0: uint64) -> uint64: +tokens_to_burn: + proto 3 1 + +tokens_to_burn_block@0: + int 10000000000 + frame_dig -3 + - + frame_dig -1 + - + frame_dig -2 + frame_dig -1 + * + swap + / + retsub + + +// examples.amm.contract.ConstantProductAMM.swap(swap_xfer#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +swap: + proto 3 0 + byte "" + dup + +swap_block@0: + callsub _check_bootstrapped + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + frame_dig -2 + == + assert // asset a incorrect + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -1 + == + assert // asset b incorrect + frame_dig -3 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + frame_dig -3 + gtxns Sender + txn Sender + == + assert // sender invalid + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -3 + gtxns XferAsset + match swap_switch_case_0@1 swap_switch_case_1@2 + b swap_switch_case_default@3 + +swap_switch_case_0@1: + callsub _current_b_balance + frame_bury 0 + callsub _current_a_balance + int 0 + byte "asset_a" + app_global_get_ex + swap + frame_bury 1 + assert // check value exists + b swap_switch_case_next@4 + +swap_switch_case_1@2: + callsub _current_a_balance + frame_bury 0 + callsub _current_b_balance + int 0 + byte "asset_b" + app_global_get_ex + swap + frame_bury 1 + assert // check value exists + b swap_switch_case_next@4 + +swap_switch_case_default@3: + err // asset id incorrect + +swap_switch_case_next@4: + frame_dig -3 + gtxns AssetAmount + frame_dig 0 + uncover 2 + callsub tokens_to_swap + dup + int 0 + > + assert // send amount too low + txn Sender + frame_dig 1 + uncover 2 + callsub do_asset_transfer + callsub _update_ratio + retsub + + +// examples.amm.contract.tokens_to_swap(in_amount#0: uint64, in_supply#0: uint64, out_supply#0: uint64) -> uint64: +tokens_to_swap: + proto 3 1 + +tokens_to_swap_block@0: + frame_dig -2 + frame_dig -3 + - + int 1000 + * + frame_dig -3 + int 995 + * + + + frame_dig -3 + int 995 + * + frame_dig -1 + * + swap + / + retsub + + +// examples.amm.contract.ConstantProductAMM.create() -> void: +create: + proto 0 0 + +create_block@0: + retsub + + +// examples.amm.contract.ConstantProductAMM.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "asset_a" + int 0 + app_global_put + byte "asset_b" + int 0 + app_global_put + txn Sender + byte "governor" + swap + app_global_put + byte "pool_token" + int 0 + app_global_put + byte "ratio" + int 0 + app_global_put + retsub + diff --git a/examples/amm/out/contract.approval_unoptimized.debug.teal b/examples/amm/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..636dc16910 --- /dev/null +++ b/examples/amm/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,850 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + bz main_bare_routing@11 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + // Implicit fall through to main_abi_routing@3 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + method "set_governor(account)void" // tmp%2#0,method<"set_governor(account)void"> arc4.abimethod() File "amm/contract.py", line 51 + method "bootstrap(pay,asset,asset)uint64" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64"> arc4.abimethod() File "amm/contract.py", line 57 + method "mint(axfer,axfer,asset,asset,asset)void" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void"> arc4.abimethod( File "amm/contract.py", line 89 + method "burn(axfer,asset,asset,asset)void" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void">,method<"burn(axfer,asset,asset,asset)void"> arc4.abimethod( File "amm/contract.py", line 155 + method "swap(axfer,asset,asset)void" // tmp%2#0,method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void">,method<"burn(axfer,asset,asset,asset)void">,method<"swap(axfer,asset,asset)void"> arc4.abimethod( File "amm/contract.py", line 212 + uncover 5 // load tmp%2#0 from l-stack (no copy) method<"set_governor(account)void">,method<"bootstrap(pay,asset,asset)uint64">,method<"mint(axfer,axfer,asset,asset,asset)void">,method<"burn(axfer,asset,asset,asset)void">,method<"swap(axfer,asset,asset)void">,tmp%2#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + match main_set_governor_route@4 main_bootstrap_route@5 main_mint_route@6 main_burn_route@7 main_swap_route@8 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + b main_switch_case_default@9 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_set_governor_route@4: + txn OnCompletion // {txn} arc4.abimethod() File "amm/contract.py", line 51 + int NoOp // tmp%3#0,NoOp arc4.abimethod() File "amm/contract.py", line 51 + == // {==} arc4.abimethod() File "amm/contract.py", line 51 + assert // OnCompletion is NoOp // arc4.abimethod() File "amm/contract.py", line 51 + txn ApplicationID // {txn} arc4.abimethod() File "amm/contract.py", line 51 + assert // is not creating // arc4.abimethod() File "amm/contract.py", line 51 + txna ApplicationArgs 1 // {txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // {btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Accounts // {txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub set_governor // arc4.abimethod() File "amm/contract.py", line 51 + int 1 // 1 arc4.abimethod() File "amm/contract.py", line 51 + return // arc4.abimethod() File "amm/contract.py", line 51 + +main_bootstrap_route@5: + txn OnCompletion // {txn} arc4.abimethod() File "amm/contract.py", line 57 + int NoOp // tmp%9#0,NoOp arc4.abimethod() File "amm/contract.py", line 57 + == // {==} arc4.abimethod() File "amm/contract.py", line 57 + assert // OnCompletion is NoOp // arc4.abimethod() File "amm/contract.py", line 57 + txn ApplicationID // {txn} arc4.abimethod() File "amm/contract.py", line 57 + assert // is not creating // arc4.abimethod() File "amm/contract.py", line 57 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // tmp%14#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int pay // awst_tmp%15#0,tmp%16#0,pay class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is pay // maybe_value%12#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // maybe_value%12#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%12#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%12#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // maybe_value%12#0,tmp%20#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%12#0,tmp%20#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%12#0,tmp%20#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub bootstrap // {bootstrap} arc4.abimethod() File "amm/contract.py", line 57 + byte 0x151f7c75 // tmp%24#0,0x151f7c75 arc4.abimethod() File "amm/contract.py", line 57 + swap // load tmp%24#0 from l-stack (no copy) 0x151f7c75,tmp%24#0 arc4.abimethod() File "amm/contract.py", line 57 + concat // {concat} arc4.abimethod() File "amm/contract.py", line 57 + log // arc4.abimethod() File "amm/contract.py", line 57 + int 1 // 1 arc4.abimethod() File "amm/contract.py", line 57 + return // arc4.abimethod() File "amm/contract.py", line 57 + +main_mint_route@6: + txn OnCompletion // {txn} arc4.abimethod( File "amm/contract.py", line 89 + int NoOp // tmp%26#0,NoOp arc4.abimethod( File "amm/contract.py", line 89 + == // {==} arc4.abimethod( File "amm/contract.py", line 89 + assert // OnCompletion is NoOp // arc4.abimethod( File "amm/contract.py", line 89 + txn ApplicationID // {txn} arc4.abimethod( File "amm/contract.py", line 89 + assert // is not creating // arc4.abimethod( File "amm/contract.py", line 89 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 2 // tmp%31#0,2 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%32#0 from l-stack (copy) awst_tmp%32#0,awst_tmp%32#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%32#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // awst_tmp%32#0,tmp%33#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%32#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // maybe_value%29#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txn GroupIndex // maybe_value%29#0,{txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // maybe_value%29#0,tmp%37#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // maybe_value%29#0,{-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) maybe_value%29#0,awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // maybe_value%29#0,awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // maybe_value%29#0,awst_tmp%15#0,tmp%38#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // maybe_value%29#0,awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // maybe_value%29#0,maybe_value%35#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // maybe_value%29#0,maybe_value%35#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%29#0,maybe_value%35#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%29#0,maybe_value%35#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // maybe_value%29#0,maybe_value%35#0,tmp%42#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%29#0,maybe_value%35#0,tmp%42#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%29#0,maybe_value%35#0,tmp%42#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 3 // maybe_value%29#0,maybe_value%35#0,tmp%42#0,tmp%45#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%29#0,maybe_value%35#0,tmp%42#0,tmp%45#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%29#0,maybe_value%35#0,tmp%42#0,tmp%45#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub mint // arc4.abimethod( File "amm/contract.py", line 89 + int 1 // 1 arc4.abimethod( File "amm/contract.py", line 89 + return // arc4.abimethod( File "amm/contract.py", line 89 + +main_burn_route@7: + txn OnCompletion // {txn} arc4.abimethod( File "amm/contract.py", line 155 + int NoOp // tmp%49#0,NoOp arc4.abimethod( File "amm/contract.py", line 155 + == // {==} arc4.abimethod( File "amm/contract.py", line 155 + assert // OnCompletion is NoOp // arc4.abimethod( File "amm/contract.py", line 155 + txn ApplicationID // {txn} arc4.abimethod( File "amm/contract.py", line 155 + assert // is not creating // arc4.abimethod( File "amm/contract.py", line 155 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // tmp%54#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // awst_tmp%15#0,tmp%55#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // maybe_value%52#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // maybe_value%52#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%52#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%52#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // maybe_value%52#0,tmp%59#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%52#0,tmp%59#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%52#0,tmp%59#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 3 // maybe_value%52#0,tmp%59#0,tmp%62#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%52#0,tmp%59#0,tmp%62#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%52#0,tmp%59#0,tmp%62#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub burn // arc4.abimethod( File "amm/contract.py", line 155 + int 1 // 1 arc4.abimethod( File "amm/contract.py", line 155 + return // arc4.abimethod( File "amm/contract.py", line 155 + +main_swap_route@8: + txn OnCompletion // {txn} arc4.abimethod( File "amm/contract.py", line 212 + int NoOp // tmp%66#0,NoOp arc4.abimethod( File "amm/contract.py", line 212 + == // {==} arc4.abimethod( File "amm/contract.py", line 212 + assert // OnCompletion is NoOp // arc4.abimethod( File "amm/contract.py", line 212 + txn ApplicationID // {txn} arc4.abimethod( File "amm/contract.py", line 212 + assert // is not creating // arc4.abimethod( File "amm/contract.py", line 212 + txn GroupIndex // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 1 // tmp%71#0,1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + - // {-} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + dup // load awst_tmp%15#0 from l-stack (copy) awst_tmp%15#0,awst_tmp%15#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + gtxns TypeEnum // awst_tmp%15#0,{gtxns} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int axfer // awst_tmp%15#0,tmp%72#0,axfer class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + == // awst_tmp%15#0,{==} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + assert // transaction type is axfer // maybe_value%69#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 1 // maybe_value%69#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%69#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%69#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txna ApplicationArgs 2 // maybe_value%69#0,tmp%76#0,{txna} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + btoi // maybe_value%69#0,tmp%76#0,{btoi} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + txnas Assets // maybe_value%69#0,tmp%76#0,{txnas} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + callsub swap // arc4.abimethod( File "amm/contract.py", line 212 + int 1 // 1 arc4.abimethod( File "amm/contract.py", line 212 + return // arc4.abimethod( File "amm/contract.py", line 212 + +main_switch_case_default@9: + // Implicit fall through to main_switch_case_next@10 // + +main_switch_case_next@10: + b main_after_if_else@14 // + +main_bare_routing@11: + txn OnCompletion // {txn} class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + int 0 // tmp%80#0,0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + swap // load tmp%80#0 from l-stack (no copy) 0,tmp%80#0 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + match main_create@12 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + b main_reject_bare_on_completion@13 // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_create@12: + txn ApplicationID // {txn} arc4.baremethod(create=True) File "amm/contract.py", line 47 + ! // {!} arc4.baremethod(create=True) File "amm/contract.py", line 47 + assert // is creating // arc4.baremethod(create=True) File "amm/contract.py", line 47 + callsub create // def create(self) -> None: File "amm/contract.py", line 48 + int 1 // 1 def create(self) -> None: File "amm/contract.py", line 48 + return // def create(self) -> None: File "amm/contract.py", line 48 + +main_reject_bare_on_completion@13: + err // reject transaction // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + +main_after_if_else@14: + err // reject transaction // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + + +// examples.amm.contract.ConstantProductAMM.set_governor(new_governor#0: bytes) -> void: +set_governor: + proto 1 0 // (𝕡) new_governor#0 | def set_governor(self, new_governor: Account) -> None: File "amm/contract.py", line 52 + +set_governor_block@0: + callsub _check_is_governor // (𝕡) new_governor#0 | self._check_is_governor() File "amm/contract.py", line 54 + byte "governor" // (𝕡) new_governor#0 | "governor" self.governor File "amm/contract.py", line 55 + frame_dig -1 // load new_governor#0 from parameters (𝕡) new_governor#0 | "governor",new_governor#0 new_governor: Account File "amm/contract.py", line 52 + app_global_put // (𝕡) new_governor#0 | self.governor = new_governor File "amm/contract.py", line 55 + retsub // + + +// examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: +_check_is_governor: + proto 0 0 // def _check_is_governor(self) -> None: File "amm/contract.py", line 271 + +_check_is_governor_block@0: + txn Sender // {txn} Transaction.sender() File "amm/contract.py", line 273 + int 0 // tmp%0#0,0 self.governor File "amm/contract.py", line 273 + byte "governor" // tmp%0#0,0,"governor" self.governor File "amm/contract.py", line 273 + app_global_get_ex // tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.governor File "amm/contract.py", line 273 + assert // check value exists // tmp%0#0,app_global_get_ex_value%1#0 self.governor File "amm/contract.py", line 273 + == // {==} Transaction.sender() == self.governor File "amm/contract.py", line 273 + assert // Only the account set in global_state.governor may call this method // assert ( File "amm/contract.py", line 272 + retsub // + + +// examples.amm.contract.ConstantProductAMM.bootstrap(seed#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> bytes: +bootstrap: + proto 3 1 // (𝕡) seed#0,a_asset#0,b_asset#0 | def bootstrap(self, seed: PaymentTransaction, a_asset: Asset, b_asset: Asset) -> arc4.UInt64: File "amm/contract.py", line 58 + +bootstrap_block@0: + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 74 + byte "pool_token" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 74 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 74 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 74 + ! // (𝕡) seed#0,a_asset#0,b_asset#0 | {!} not self.pool_token File "amm/contract.py", line 74 + assert // application has already been bootstrapped // (𝕡) seed#0,a_asset#0,b_asset#0 | assert not self.pool_token, "application has already been bootstrapped" File "amm/contract.py", line 74 + callsub _check_is_governor // (𝕡) seed#0,a_asset#0,b_asset#0 | self._check_is_governor() File "amm/contract.py", line 75 + global GroupSize // (𝕡) seed#0,a_asset#0,b_asset#0 | {global} Global.group_size() File "amm/contract.py", line 76 + int 2 // (𝕡) seed#0,a_asset#0,b_asset#0 | tmp%3#0,2 2 File "amm/contract.py", line 76 + == // (𝕡) seed#0,a_asset#0,b_asset#0 | {==} Global.group_size() == 2, "group size not 2" File "amm/contract.py", line 76 + assert // group size not 2 // (𝕡) seed#0,a_asset#0,b_asset#0 | assert Global.group_size() == 2, "group size not 2" File "amm/contract.py", line 76 + frame_dig -3 // load seed#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | seed#0 seed: PaymentTransaction File "amm/contract.py", line 58 + gtxns Receiver // (𝕡) seed#0,a_asset#0,b_asset#0 | {gtxns} seed.receiver File "amm/contract.py", line 77 + global CurrentApplicationAddress // (𝕡) seed#0,a_asset#0,b_asset#0 | tmp%5#0,{global} Global.current_application_address() File "amm/contract.py", line 77 + == // (𝕡) seed#0,a_asset#0,b_asset#0 | {==} seed.receiver == Global.current_application_address(), "receiver not app address" File "amm/contract.py", line 77 + assert // receiver not app address // (𝕡) seed#0,a_asset#0,b_asset#0 | assert seed.receiver == Global.current_application_address(), "receiver not app address" File "amm/contract.py", line 77 + frame_dig -3 // load seed#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | seed#0 seed: PaymentTransaction File "amm/contract.py", line 58 + gtxns Amount // (𝕡) seed#0,a_asset#0,b_asset#0 | {gtxns} seed.amount File "amm/contract.py", line 79 + int 300000 // (𝕡) seed#0,a_asset#0,b_asset#0 | tmp%8#0,300000 300_000 File "amm/contract.py", line 79 + >= // (𝕡) seed#0,a_asset#0,b_asset#0 | {>=} seed.amount >= 300_000, "amount minimum not met" # 0.3 Algos File "amm/contract.py", line 79 + assert // amount minimum not met // (𝕡) seed#0,a_asset#0,b_asset#0 | assert seed.amount >= 300_000, "amount minimum not met" File "amm/contract.py", line 79 + frame_dig -2 // load a_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | a_asset#0 a_asset: Asset File "amm/contract.py", line 58 + frame_dig -1 // load b_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | a_asset#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 58 + < // (𝕡) seed#0,a_asset#0,b_asset#0 | {<} a_asset.asset_id < b_asset.asset_id, "asset a must be less than asset b" File "amm/contract.py", line 80 + assert // asset a must be less than asset b // (𝕡) seed#0,a_asset#0,b_asset#0 | assert a_asset.asset_id < b_asset.asset_id, "asset a must be less than asset b" File "amm/contract.py", line 80 + byte "asset_a" // (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_a" self.asset_a File "amm/contract.py", line 81 + frame_dig -2 // load a_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_a",a_asset#0 a_asset: Asset File "amm/contract.py", line 58 + app_global_put // (𝕡) seed#0,a_asset#0,b_asset#0 | self.asset_a = a_asset File "amm/contract.py", line 81 + byte "asset_b" // (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_b" self.asset_b File "amm/contract.py", line 82 + frame_dig -1 // load b_asset#0 from parameters (𝕡) seed#0,a_asset#0,b_asset#0 | "asset_b",b_asset#0 b_asset: Asset File "amm/contract.py", line 58 + app_global_put // (𝕡) seed#0,a_asset#0,b_asset#0 | self.asset_b = b_asset File "amm/contract.py", line 82 + callsub _create_pool_token // (𝕡) seed#0,a_asset#0,b_asset#0 | {_create_pool_token} self._create_pool_token() File "amm/contract.py", line 83 + byte "pool_token" // (𝕡) seed#0,a_asset#0,b_asset#0 | new_state_value%11#0,"pool_token" self.pool_token File "amm/contract.py", line 83 + swap // load new_state_value%11#0 from l-stack (no copy) (𝕡) seed#0,a_asset#0,b_asset#0 | "pool_token",new_state_value%11#0 self._create_pool_token() File "amm/contract.py", line 83 + app_global_put // (𝕡) seed#0,a_asset#0,b_asset#0 | self.pool_token = self._create_pool_token() File "amm/contract.py", line 83 + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.asset_a File "amm/contract.py", line 85 + byte "asset_a" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 85 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 85 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%12#0 self.asset_a File "amm/contract.py", line 85 + callsub _do_opt_in // (𝕡) seed#0,a_asset#0,b_asset#0 | self._do_opt_in(self.asset_a) File "amm/contract.py", line 85 + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.asset_b File "amm/contract.py", line 86 + byte "asset_b" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 86 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 86 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%14#0 self.asset_b File "amm/contract.py", line 86 + callsub _do_opt_in // (𝕡) seed#0,a_asset#0,b_asset#0 | self._do_opt_in(self.asset_b) File "amm/contract.py", line 86 + int 0 // (𝕡) seed#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 87 + byte "pool_token" // (𝕡) seed#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 87 + app_global_get_ex // (𝕡) seed#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 87 + assert // check value exists // (𝕡) seed#0,a_asset#0,b_asset#0 | app_global_get_ex_value%16#0 self.pool_token File "amm/contract.py", line 87 + itob // (𝕡) seed#0,a_asset#0,b_asset#0 | {itob} arc4.UInt64.encode(self.pool_token.asset_id) File "amm/contract.py", line 87 + retsub // val_as_bytes%18#0 return arc4.UInt64.encode(self.pool_token.asset_id) File "amm/contract.py", line 87 + + +// examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: +_create_pool_token: + proto 0 1 // def _create_pool_token(self) -> Asset: File "amm/contract.py", line 277 + +_create_pool_token_block@0: + itxn_begin // CreateInnerTransaction.begin() File "amm/contract.py", line 278 + int acfg // acfg TransactionType.AssetConfig File "amm/contract.py", line 279 + itxn_field TypeEnum // CreateInnerTransaction.set_type_enum(TransactionType.AssetConfig) File "amm/contract.py", line 279 + int 0 // 0 self.asset_a File "amm/contract.py", line 281 + byte "asset_a" // 0,"asset_a" self.asset_a File "amm/contract.py", line 281 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 281 + assert // check value exists // app_global_get_ex_value%2#0 self.asset_a File "amm/contract.py", line 281 + asset_params_get AssetUnitName // {asset_params_get}.0,{asset_params_get}.1 self.asset_a.unit_name File "amm/contract.py", line 281 + assert // asset exists // maybe_value%0#0 self.asset_a.unit_name File "amm/contract.py", line 281 + byte "DPT-" // maybe_value%0#0,"DPT-" b"DPT-" File "amm/contract.py", line 281 + swap // load maybe_value%0#0 from l-stack (no copy) "DPT-",maybe_value%0#0 self.asset_a.unit_name File "amm/contract.py", line 281 + concat // {concat} Bytes(b"DPT-") + self.asset_a.unit_name File "amm/contract.py", line 281 + byte "-" // tmp%4#0,"-" b"-" File "amm/contract.py", line 281 + concat // {concat} Bytes(b"DPT-") + self.asset_a.unit_name + Bytes(b"-") File "amm/contract.py", line 281 + int 0 // tmp%5#0,0 self.asset_b File "amm/contract.py", line 281 + byte "asset_b" // tmp%5#0,0,"asset_b" self.asset_b File "amm/contract.py", line 281 + app_global_get_ex // tmp%5#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 281 + assert // check value exists // tmp%5#0,app_global_get_ex_value%8#0 self.asset_b File "amm/contract.py", line 281 + asset_params_get AssetUnitName // tmp%5#0,{asset_params_get}.0,{asset_params_get}.1 self.asset_b.unit_name File "amm/contract.py", line 281 + assert // asset exists // tmp%5#0,maybe_value%6#0 self.asset_b.unit_name File "amm/contract.py", line 281 + concat // {concat} Bytes(b"DPT-") + self.asset_a.unit_name + Bytes(b"-") + self.asset_b.unit_name File "amm/contract.py", line 281 + itxn_field ConfigAssetName // CreateInnerTransaction.set_config_asset_name( File "amm/contract.py", line 280 + byte "dpt" // "dpt" b"dpt" File "amm/contract.py", line 283 + itxn_field ConfigAssetUnitName // CreateInnerTransaction.set_config_asset_unit_name(b"dpt") File "amm/contract.py", line 283 + int 10000000000 // 10000000000 TOTAL_SUPPLY File "amm/contract.py", line 284 + itxn_field ConfigAssetTotal // CreateInnerTransaction.set_config_asset_total(TOTAL_SUPPLY) File "amm/contract.py", line 284 + int 3 // 3 3 File "amm/contract.py", line 285 + itxn_field ConfigAssetDecimals // CreateInnerTransaction.set_config_asset_decimals(3) File "amm/contract.py", line 285 + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 286 + itxn_field ConfigAssetManager // CreateInnerTransaction.set_config_asset_manager(Global.current_application_address()) File "amm/contract.py", line 286 + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 287 + itxn_field ConfigAssetReserve // CreateInnerTransaction.set_config_asset_reserve(Global.current_application_address()) File "amm/contract.py", line 287 + int 0 // 0 0 File "amm/contract.py", line 288 + itxn_field Fee // CreateInnerTransaction.set_fee(0) File "amm/contract.py", line 288 + itxn_submit // CreateInnerTransaction.submit() File "amm/contract.py", line 289 + itxn CreatedAssetID // {itxn} InnerTransaction.created_asset_id() File "amm/contract.py", line 291 + retsub // tmp%13#0 return Asset(InnerTransaction.created_asset_id()) File "amm/contract.py", line 291 + + +// examples.amm.contract.ConstantProductAMM._do_opt_in(asset#0: uint64) -> void: +_do_opt_in: + proto 1 0 // (𝕡) asset#0 | def _do_opt_in(self, asset: Asset) -> None: File "amm/contract.py", line 294 + +_do_opt_in_block@0: + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "amm/contract.py", line 296 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | tmp%0#0,asset#0 asset: Asset File "amm/contract.py", line 294 + int 0 // (𝕡) asset#0 | tmp%0#0,asset#0,0 0 File "amm/contract.py", line 298 + callsub do_asset_transfer // (𝕡) asset#0 | do_asset_transfer( File "amm/contract.py", line 295 + retsub // + + +// examples.amm.contract.do_asset_transfer(receiver#0: bytes, asset#0: uint64, amount#0: uint64) -> void: +do_asset_transfer: + proto 3 0 // (𝕡) receiver#0,asset#0,amount#0 | def do_asset_transfer(*, receiver: Account, asset: Asset, amount: UInt64) -> None: File "amm/contract.py", line 367 + +do_asset_transfer_block@0: + itxn_begin // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.begin() File "amm/contract.py", line 368 + int axfer // (𝕡) receiver#0,asset#0,amount#0 | axfer TransactionType.AssetTransfer File "amm/contract.py", line 369 + itxn_field TypeEnum // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "amm/contract.py", line 369 + frame_dig -2 // load asset#0 from parameters (𝕡) receiver#0,asset#0,amount#0 | asset#0 asset: Asset File "amm/contract.py", line 367 + itxn_field XferAsset // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "amm/contract.py", line 370 + frame_dig -1 // load amount#0 from parameters (𝕡) receiver#0,asset#0,amount#0 | amount#0 amount: UInt64 File "amm/contract.py", line 367 + itxn_field AssetAmount // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_asset_amount(amount) File "amm/contract.py", line 371 + frame_dig -3 // load receiver#0 from parameters (𝕡) receiver#0,asset#0,amount#0 | receiver#0 receiver: Account File "amm/contract.py", line 367 + itxn_field AssetReceiver // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_asset_receiver(receiver) File "amm/contract.py", line 372 + int 0 // (𝕡) receiver#0,asset#0,amount#0 | 0 0 File "amm/contract.py", line 373 + itxn_field Fee // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.set_fee(0) File "amm/contract.py", line 373 + itxn_submit // (𝕡) receiver#0,asset#0,amount#0 | CreateInnerTransaction.submit() File "amm/contract.py", line 374 + retsub // + + +// examples.amm.contract.ConstantProductAMM.mint(a_xfer#0: uint64, b_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +mint: + proto 5 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | def mint( File "amm/contract.py", line 96 + +mint_block@0: + callsub _check_bootstrapped // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._check_bootstrapped() File "amm/contract.py", line 119 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 122 + byte "pool_token" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 122 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 122 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 122 + frame_dig -3 // load pool_asset#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0,pool_asset#0 pool_asset: Asset File "amm/contract.py", line 100 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 122 + assert // asset pool incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 122 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_a File "amm/contract.py", line 123 + byte "asset_a" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 123 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 123 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0 self.asset_a File "amm/contract.py", line 123 + frame_dig -2 // load a_asset#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0,a_asset#0 a_asset: Asset File "amm/contract.py", line 101 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 123 + assert // asset a incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 123 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_b File "amm/contract.py", line 124 + byte "asset_b" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 124 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 124 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0 self.asset_b File "amm/contract.py", line 124 + frame_dig -1 // load b_asset#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 102 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 124 + assert // asset b incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 124 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.sender File "amm/contract.py", line 125 + txn Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%9#0,{txn} Transaction.sender() File "amm/contract.py", line 125 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 125 + assert // sender invalid // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 125 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.sender File "amm/contract.py", line 126 + txn Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%12#0,{txn} Transaction.sender() File "amm/contract.py", line 126 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 126 + assert // sender invalid // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 126 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns AssetReceiver // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.asset_receiver File "amm/contract.py", line 130 + global CurrentApplicationAddress // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%15#0,{global} Global.current_application_address() File "amm/contract.py", line 130 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_xfer.asset_receiver == Global.current_application_address() File "amm/contract.py", line 130 + assert // receiver not app address // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert ( File "amm/contract.py", line 129 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns XferAsset // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.xfer_asset File "amm/contract.py", line 132 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,0 self.asset_a File "amm/contract.py", line 132 + byte "asset_a" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,0,"asset_a" self.asset_a File "amm/contract.py", line 132 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 132 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,app_global_get_ex_value%19#0 self.asset_a File "amm/contract.py", line 132 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_xfer.xfer_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 132 + assert // asset a incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_xfer.xfer_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 132 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} a_xfer.asset_amount File "amm/contract.py", line 133 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%22#0,0 0 File "amm/contract.py", line 133 + > // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {>} a_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 133 + assert // amount minimum not met // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 133 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns AssetReceiver // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.asset_receiver File "amm/contract.py", line 137 + global CurrentApplicationAddress // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%24#0,{global} Global.current_application_address() File "amm/contract.py", line 137 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_xfer.asset_receiver == Global.current_application_address() File "amm/contract.py", line 137 + assert // receiver not app address // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert ( File "amm/contract.py", line 136 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns XferAsset // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.xfer_asset File "amm/contract.py", line 139 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,0 self.asset_b File "amm/contract.py", line 139 + byte "asset_b" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,0,"asset_b" self.asset_b File "amm/contract.py", line 139 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 139 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%27#0,app_global_get_ex_value%28#0 self.asset_b File "amm/contract.py", line 139 + == // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_xfer.xfer_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 139 + assert // asset b incorrect // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_xfer.xfer_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 139 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} b_xfer.asset_amount File "amm/contract.py", line 140 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%31#0,0 0 File "amm/contract.py", line 140 + > // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {>} b_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 140 + assert // amount minimum not met // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 140 + callsub _current_pool_balance // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {_current_pool_balance} self._current_pool_balance() File "amm/contract.py", line 143 + callsub _current_a_balance // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,{_current_a_balance} self._current_a_balance() File "amm/contract.py", line 144 + callsub _current_b_balance // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,{_current_b_balance} self._current_b_balance() File "amm/contract.py", line 145 + frame_dig -5 // load a_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,a_xfer#0 a_xfer: AssetTransferTransaction File "amm/contract.py", line 98 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,{gtxns} a_xfer.asset_amount File "amm/contract.py", line 146 + frame_dig -4 // load b_xfer#0 from parameters (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,tmp%36#0,b_xfer#0 b_xfer: AssetTransferTransaction File "amm/contract.py", line 99 + gtxns AssetAmount // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%33#0,tmp%34#0,tmp%35#0,tmp%36#0,{gtxns} b_xfer.asset_amount File "amm/contract.py", line 147 + callsub tokens_to_mint // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {tokens_to_mint} tokens_to_mint( File "amm/contract.py", line 142 + dup // load to_mint#0 from l-stack (copy) (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,to_mint#0 to_mint File "amm/contract.py", line 142 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,to_mint#0,0 0 File "amm/contract.py", line 149 + > // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,{>} to_mint > 0, "send amount too low" File "amm/contract.py", line 149 + assert // send amount too low // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0 assert to_mint > 0, "send amount too low" File "amm/contract.py", line 149 + txn Sender // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,{txn} Transaction.sender() File "amm/contract.py", line 152 + int 0 // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,0 self.pool_token File "amm/contract.py", line 152 + byte "pool_token" // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,0,"pool_token" self.pool_token File "amm/contract.py", line 152 + app_global_get_ex // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 152 + assert // check value exists // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | to_mint#0,tmp%39#0,app_global_get_ex_value%40#0 self.pool_token File "amm/contract.py", line 152 + uncover 2 // load to_mint#0 from l-stack (no copy) (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%39#0,app_global_get_ex_value%40#0,to_mint#0 to_mint File "amm/contract.py", line 142 + callsub do_asset_transfer // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | do_asset_transfer(receiver=Transaction.sender(), asset=self.pool_token, amount=to_mint) File "amm/contract.py", line 152 + callsub _update_ratio // (𝕡) a_xfer#0,b_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._update_ratio() File "amm/contract.py", line 153 + retsub // + + +// examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: +_check_bootstrapped: + proto 0 0 // def _check_bootstrapped(self) -> None: File "amm/contract.py", line 260 + +_check_bootstrapped_block@0: + int 0 // 0 self.pool_token File "amm/contract.py", line 261 + byte "pool_token" // 0,"pool_token" self.pool_token File "amm/contract.py", line 261 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 261 + assert // check value exists // app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 261 + assert // bootstrap method needs to be called first // assert self.pool_token, "bootstrap method needs to be called first" File "amm/contract.py", line 261 + retsub // + + +// examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: +_current_pool_balance: + proto 0 1 // def _current_pool_balance(self) -> UInt64: File "amm/contract.py", line 302 + +_current_pool_balance_block@0: + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 303 + int 0 // tmp%2#0,0 self.pool_token File "amm/contract.py", line 303 + byte "pool_token" // tmp%2#0,0,"pool_token" self.pool_token File "amm/contract.py", line 303 + app_global_get_ex // tmp%2#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 303 + assert // check value exists // tmp%2#0,app_global_get_ex_value%3#0 self.pool_token File "amm/contract.py", line 303 + asset_holding_get AssetBalance // {asset_holding_get}.0,{asset_holding_get}.1 self.pool_token.balance(Global.current_application_address()) File "amm/contract.py", line 303 + assert // account opted into asset // maybe_value%0#0 self.pool_token.balance(Global.current_application_address()) File "amm/contract.py", line 303 + retsub // maybe_value%0#0 return self.pool_token.balance(Global.current_application_address()) File "amm/contract.py", line 303 + + +// examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: +_current_a_balance: + proto 0 1 // def _current_a_balance(self) -> UInt64: File "amm/contract.py", line 306 + +_current_a_balance_block@0: + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 307 + int 0 // tmp%2#0,0 self.asset_a File "amm/contract.py", line 307 + byte "asset_a" // tmp%2#0,0,"asset_a" self.asset_a File "amm/contract.py", line 307 + app_global_get_ex // tmp%2#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 307 + assert // check value exists // tmp%2#0,app_global_get_ex_value%3#0 self.asset_a File "amm/contract.py", line 307 + asset_holding_get AssetBalance // {asset_holding_get}.0,{asset_holding_get}.1 self.asset_a.balance(Global.current_application_address()) File "amm/contract.py", line 307 + assert // account opted into asset // maybe_value%0#0 self.asset_a.balance(Global.current_application_address()) File "amm/contract.py", line 307 + retsub // maybe_value%0#0 return self.asset_a.balance(Global.current_application_address()) File "amm/contract.py", line 307 + + +// examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: +_current_b_balance: + proto 0 1 // def _current_b_balance(self) -> UInt64: File "amm/contract.py", line 310 + +_current_b_balance_block@0: + global CurrentApplicationAddress // {global} Global.current_application_address() File "amm/contract.py", line 311 + int 0 // tmp%2#0,0 self.asset_b File "amm/contract.py", line 311 + byte "asset_b" // tmp%2#0,0,"asset_b" self.asset_b File "amm/contract.py", line 311 + app_global_get_ex // tmp%2#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 311 + assert // check value exists // tmp%2#0,app_global_get_ex_value%3#0 self.asset_b File "amm/contract.py", line 311 + asset_holding_get AssetBalance // {asset_holding_get}.0,{asset_holding_get}.1 self.asset_b.balance(Global.current_application_address()) File "amm/contract.py", line 311 + assert // account opted into asset // maybe_value%0#0 self.asset_b.balance(Global.current_application_address()) File "amm/contract.py", line 311 + retsub // maybe_value%0#0 return self.asset_b.balance(Global.current_application_address()) File "amm/contract.py", line 311 + + +// examples.amm.contract.tokens_to_mint(pool_balance#0: uint64, a_balance#0: uint64, b_balance#0: uint64, a_amount#0: uint64, b_amount#0: uint64) -> uint64: +tokens_to_mint: + proto 5 1 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | def tokens_to_mint( File "amm/contract.py", line 333 + byte "" + dup // allocate 2 to stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | + +tokens_to_mint_block@0: + frame_dig -4 // load a_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance#0 a_balance: UInt64 File "amm/contract.py", line 336 + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance#0,a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + == // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {==} a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + bz tokens_to_mint_bool_false@3 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + // Implicit fall through to tokens_to_mint_and_contd@1 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + +tokens_to_mint_and_contd@1: + frame_dig -3 // load b_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | b_balance#0 b_balance: UInt64 File "amm/contract.py", line 337 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | b_balance#0,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + == // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {==} b_balance == b_amount File "amm/contract.py", line 341 + bz tokens_to_mint_bool_false@3 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + // Implicit fall through to tokens_to_mint_bool_true@2 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_balance == a_amount and b_balance == b_amount File "amm/contract.py", line 341 + +tokens_to_mint_bool_true@2: + int 1 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 1 + b tokens_to_mint_bool_merge@4 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) and_result%2#0 | and_result%2#0 + +tokens_to_mint_bool_false@3: + int 0 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 0 + // Implicit fall through to tokens_to_mint_bool_merge@4 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) and_result%2#0 | and_result%2#0 + +tokens_to_mint_bool_merge@4: + bz tokens_to_mint_after_if_else@6 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | and_result%2#0 if is_initial_mint: File "amm/contract.py", line 342 + // Implicit fall through to tokens_to_mint_if_body@5 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | if is_initial_mint: File "amm/contract.py", line 342 + +tokens_to_mint_if_body@5: + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | a_amount#0,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {*} a_amount * b_amount File "amm/contract.py", line 343 + sqrt // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {sqrt} sqrt(a_amount * b_amount) File "amm/contract.py", line 343 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | tmp%4#0,1000 SCALE File "amm/contract.py", line 343 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {-} sqrt(a_amount * b_amount) - SCALE File "amm/contract.py", line 343 + frame_bury 0 + retsub // tmp%5#0 return sqrt(a_amount * b_amount) - SCALE File "amm/contract.py", line 343 + +tokens_to_mint_after_if_else@6: + int 10000000000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 10000000000 TOTAL_SUPPLY File "amm/contract.py", line 344 + frame_dig -5 // load pool_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | 10000000000,pool_balance#0 pool_balance: UInt64 File "amm/contract.py", line 335 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {-} TOTAL_SUPPLY - pool_balance File "amm/contract.py", line 344 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | 1000 SCALE File "amm/contract.py", line 345 + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | 1000,a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | {*} SCALE * a_amount File "amm/contract.py", line 345 + frame_dig -4 // load a_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | tmp%6#0,a_balance#0 a_balance: UInt64 File "amm/contract.py", line 336 + frame_dig -2 // load a_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | tmp%6#0,a_balance#0,a_amount#0 a_amount: UInt64 File "amm/contract.py", line 338 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | tmp%6#0,{-} a_balance - a_amount File "amm/contract.py", line 345 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | {/} SCALE * a_amount // (a_balance - a_amount) File "amm/contract.py", line 345 + dup // store a_ratio#0 to l-stack (copy) (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,a_ratio#0 a_ratio File "amm/contract.py", line 345 + frame_bury 0 // store a_ratio#0 to f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0 a_ratio File "amm/contract.py", line 345 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,1000 SCALE File "amm/contract.py", line 346 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,1000,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,{*} SCALE * b_amount File "amm/contract.py", line 346 + frame_dig -3 // load b_balance#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,tmp%8#0,b_balance#0 b_balance: UInt64 File "amm/contract.py", line 337 + frame_dig -1 // load b_amount#0 from parameters (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,tmp%8#0,b_balance#0,b_amount#0 b_amount: UInt64 File "amm/contract.py", line 339 + - // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,tmp%8#0,{-} b_balance - b_amount File "amm/contract.py", line 346 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,{/} SCALE * b_amount // (b_balance - b_amount) File "amm/contract.py", line 346 + dup // store b_ratio#0 to l-stack (copy) (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,b_ratio#0,b_ratio#0 b_ratio File "amm/contract.py", line 346 + frame_bury 1 // store b_ratio#0 to f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0,b_ratio#0 b_ratio File "amm/contract.py", line 346 + < // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | {<} a_ratio < b_ratio: File "amm/contract.py", line 347 + bz tokens_to_mint_else_body@8 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | if a_ratio < b_ratio: File "amm/contract.py", line 347 + // Implicit fall through to tokens_to_mint_if_body@7 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | issued#0 if a_ratio < b_ratio: File "amm/contract.py", line 347 + +tokens_to_mint_if_body@7: + frame_dig 0 // load a_ratio#0 from f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | a_ratio#0 issued#0 a_ratio File "amm/contract.py", line 345 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {*} a_ratio * issued File "amm/contract.py", line 348 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | tmp%11#0,1000 SCALE File "amm/contract.py", line 348 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {/} a_ratio * issued // SCALE File "amm/contract.py", line 348 + frame_bury 0 + retsub // tmp%12#0 return a_ratio * issued // SCALE File "amm/contract.py", line 348 + +tokens_to_mint_else_body@8: + frame_dig 1 // load b_ratio#0 from f-stack (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | (𝕏) issued#0 | b_ratio#0 issued#0 b_ratio File "amm/contract.py", line 346 + * // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {*} b_ratio * issued File "amm/contract.py", line 350 + int 1000 // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | tmp%13#0,1000 SCALE File "amm/contract.py", line 350 + / // (𝕡) pool_balance#0,a_balance#0,b_balance#0,a_amount#0,b_amount#0 | (𝕗) a_ratio#0,b_ratio#0 | {/} b_ratio * issued // SCALE File "amm/contract.py", line 350 + frame_bury 0 + retsub // tmp%14#0 return b_ratio * issued // SCALE File "amm/contract.py", line 350 + + +// examples.amm.contract.ConstantProductAMM._update_ratio() -> void: +_update_ratio: + proto 0 0 // def _update_ratio(self) -> None: File "amm/contract.py", line 264 + +_update_ratio_block@0: + callsub _current_a_balance // {_current_a_balance} self._current_a_balance() File "amm/contract.py", line 265 + callsub _current_b_balance // a_balance#0,{_current_b_balance} self._current_b_balance() File "amm/contract.py", line 266 + swap // store b_balance#0 to l-stack (no copy) b_balance#0,a_balance#0 b_balance File "amm/contract.py", line 266 + int 1000 // b_balance#0,a_balance#0,1000 SCALE File "amm/contract.py", line 268 + * // b_balance#0,{*} a_balance * SCALE File "amm/contract.py", line 268 + swap // load b_balance#0 from l-stack (no copy) tmp%0#0,b_balance#0 b_balance File "amm/contract.py", line 266 + / // {/} a_balance * SCALE // b_balance File "amm/contract.py", line 268 + byte "ratio" // new_state_value%1#0,"ratio" self.ratio File "amm/contract.py", line 268 + swap // load new_state_value%1#0 from l-stack (no copy) "ratio",new_state_value%1#0 a_balance * SCALE // b_balance File "amm/contract.py", line 268 + app_global_put // self.ratio = a_balance * SCALE // b_balance File "amm/contract.py", line 268 + retsub // + + +// examples.amm.contract.ConstantProductAMM.burn(pool_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +burn: + proto 4 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | def burn( File "amm/contract.py", line 162 + +burn_block@0: + callsub _check_bootstrapped // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._check_bootstrapped() File "amm/contract.py", line 178 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.pool_token File "amm/contract.py", line 180 + byte "pool_token" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"pool_token" self.pool_token File "amm/contract.py", line 180 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 180 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0 self.pool_token File "amm/contract.py", line 180 + frame_dig -3 // load pool_asset#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%0#0,pool_asset#0 pool_asset: Asset File "amm/contract.py", line 165 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 180 + assert // asset pool incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 180 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_a File "amm/contract.py", line 181 + byte "asset_a" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 181 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 181 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0 self.asset_a File "amm/contract.py", line 181 + frame_dig -2 // load a_asset#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%3#0,a_asset#0 a_asset: Asset File "amm/contract.py", line 166 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 181 + assert // asset a incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 181 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0 self.asset_b File "amm/contract.py", line 182 + byte "asset_b" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 182 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 182 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0 self.asset_b File "amm/contract.py", line 182 + frame_dig -1 // load b_asset#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | app_global_get_ex_value%6#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 167 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 182 + assert // asset b incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 182 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetReceiver // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.asset_receiver File "amm/contract.py", line 185 + global CurrentApplicationAddress // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%9#0,{global} Global.current_application_address() File "amm/contract.py", line 185 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_xfer.asset_receiver == Global.current_application_address() File "amm/contract.py", line 185 + assert // receiver not app address // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert ( File "amm/contract.py", line 184 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetAmount // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.asset_amount File "amm/contract.py", line 187 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%12#0,0 0 File "amm/contract.py", line 187 + > // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {>} pool_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 187 + assert // amount minimum not met // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 187 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns XferAsset // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.xfer_asset File "amm/contract.py", line 188 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,0 self.pool_token File "amm/contract.py", line 188 + byte "pool_token" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,0,"pool_token" self.pool_token File "amm/contract.py", line 188 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.pool_token File "amm/contract.py", line 188 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%14#0,app_global_get_ex_value%15#0 self.pool_token File "amm/contract.py", line 188 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_xfer.xfer_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 188 + assert // asset pool incorrect // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_xfer.xfer_asset == self.pool_token, "asset pool incorrect" File "amm/contract.py", line 188 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {gtxns} pool_xfer.sender File "amm/contract.py", line 189 + txn Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%18#0,{txn} Transaction.sender() File "amm/contract.py", line 189 + == // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {==} pool_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 189 + assert // sender invalid // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | assert pool_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 189 + callsub _current_pool_balance // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | {_current_pool_balance} self._current_pool_balance() File "amm/contract.py", line 193 + callsub _current_a_balance // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,{_current_a_balance} self._current_a_balance() File "amm/contract.py", line 196 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,tmp%21#0,pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetAmount // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,tmp%21#0,{gtxns} pool_xfer.asset_amount File "amm/contract.py", line 197 + dig 2 // load pool_balance#0 from l-stack (copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,tmp%21#0,tmp%22#0,pool_balance#0 pool_balance File "amm/contract.py", line 193 + cover 2 // virtual: 2 ops (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,pool_balance#0,tmp%21#0,tmp%22#0 self._current_a_balance(), File "amm/contract.py", line 196 + callsub tokens_to_burn // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | pool_balance#0,{tokens_to_burn} tokens_to_burn( File "amm/contract.py", line 194 + swap // store a_amt#0 to l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0 a_amt File "amm/contract.py", line 194 + callsub _current_b_balance // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0,{_current_b_balance} self._current_b_balance() File "amm/contract.py", line 201 + frame_dig -4 // load pool_xfer#0 from parameters (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0,tmp%23#0,pool_xfer#0 pool_xfer: AssetTransferTransaction File "amm/contract.py", line 164 + gtxns AssetAmount // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,pool_balance#0,tmp%23#0,{gtxns} pool_xfer.asset_amount File "amm/contract.py", line 202 + callsub tokens_to_burn // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | a_amt#0,{tokens_to_burn} tokens_to_burn( File "amm/contract.py", line 199 + swap // store b_amt#0 to l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0 b_amt File "amm/contract.py", line 199 + txn Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,{txn} Transaction.sender() File "amm/contract.py", line 206 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,0 self.asset_a File "amm/contract.py", line 206 + byte "asset_a" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,0,"asset_a" self.asset_a File "amm/contract.py", line 206 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 206 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,a_amt#0,tmp%25#0,app_global_get_ex_value%26#0 self.asset_a File "amm/contract.py", line 206 + uncover 2 // load a_amt#0 from l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%25#0,app_global_get_ex_value%26#0,a_amt#0 a_amt File "amm/contract.py", line 194 + callsub do_asset_transfer // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0 do_asset_transfer(receiver=Transaction.sender(), asset=self.asset_a, amount=a_amt) File "amm/contract.py", line 206 + txn Sender // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,{txn} Transaction.sender() File "amm/contract.py", line 209 + int 0 // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,0 self.asset_b File "amm/contract.py", line 209 + byte "asset_b" // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,0,"asset_b" self.asset_b File "amm/contract.py", line 209 + app_global_get_ex // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 209 + assert // check value exists // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | b_amt#0,tmp%28#0,app_global_get_ex_value%29#0 self.asset_b File "amm/contract.py", line 209 + uncover 2 // load b_amt#0 from l-stack (no copy) (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | tmp%28#0,app_global_get_ex_value%29#0,b_amt#0 b_amt File "amm/contract.py", line 199 + callsub do_asset_transfer // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | do_asset_transfer(receiver=Transaction.sender(), asset=self.asset_b, amount=b_amt) File "amm/contract.py", line 209 + callsub _update_ratio // (𝕡) pool_xfer#0,pool_asset#0,a_asset#0,b_asset#0 | self._update_ratio() File "amm/contract.py", line 210 + retsub // + + +// examples.amm.contract.tokens_to_burn(pool_balance#0: uint64, supply#0: uint64, amount#0: uint64) -> uint64: +tokens_to_burn: + proto 3 1 // (𝕡) pool_balance#0,supply#0,amount#0 | def tokens_to_burn(*, pool_balance: UInt64, supply: UInt64, amount: UInt64) -> UInt64: File "amm/contract.py", line 354 + +tokens_to_burn_block@0: + int 10000000000 // (𝕡) pool_balance#0,supply#0,amount#0 | 10000000000 TOTAL_SUPPLY File "amm/contract.py", line 355 + frame_dig -3 // load pool_balance#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | 10000000000,pool_balance#0 pool_balance: UInt64 File "amm/contract.py", line 354 + - // (𝕡) pool_balance#0,supply#0,amount#0 | {-} TOTAL_SUPPLY - pool_balance File "amm/contract.py", line 355 + frame_dig -1 // load amount#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | tmp%0#0,amount#0 amount: UInt64 File "amm/contract.py", line 354 + - // (𝕡) pool_balance#0,supply#0,amount#0 | {-} TOTAL_SUPPLY - pool_balance - amount File "amm/contract.py", line 355 + frame_dig -2 // load supply#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | issued#0,supply#0 supply: UInt64 File "amm/contract.py", line 354 + frame_dig -1 // load amount#0 from parameters (𝕡) pool_balance#0,supply#0,amount#0 | issued#0,supply#0,amount#0 amount: UInt64 File "amm/contract.py", line 354 + * // (𝕡) pool_balance#0,supply#0,amount#0 | issued#0,{*} supply * amount File "amm/contract.py", line 356 + swap // load issued#0 from l-stack (no copy) (𝕡) pool_balance#0,supply#0,amount#0 | tmp%1#0,issued#0 issued File "amm/contract.py", line 355 + / // (𝕡) pool_balance#0,supply#0,amount#0 | {/} supply * amount // issued File "amm/contract.py", line 356 + retsub // tmp%2#0 return supply * amount // issued File "amm/contract.py", line 356 + + +// examples.amm.contract.ConstantProductAMM.swap(swap_xfer#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +swap: + proto 3 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | def swap( File "amm/contract.py", line 218 + byte "" + dup // allocate 2 to stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | + +swap_block@0: + callsub _check_bootstrapped // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | self._check_bootstrapped() File "amm/contract.py", line 231 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0 self.asset_a File "amm/contract.py", line 233 + byte "asset_a" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 233 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 233 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%0#0 self.asset_a File "amm/contract.py", line 233 + frame_dig -2 // load a_asset#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%0#0,a_asset#0 a_asset: Asset File "amm/contract.py", line 221 + == // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {==} a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 233 + assert // asset a incorrect // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert a_asset == self.asset_a, "asset a incorrect" File "amm/contract.py", line 233 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0 self.asset_b File "amm/contract.py", line 234 + byte "asset_b" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 234 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 234 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%3#0 self.asset_b File "amm/contract.py", line 234 + frame_dig -1 // load b_asset#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%3#0,b_asset#0 b_asset: Asset File "amm/contract.py", line 222 + == // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {==} b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 234 + assert // asset b incorrect // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert b_asset == self.asset_b, "asset b incorrect" File "amm/contract.py", line 234 + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | swap_xfer#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns AssetAmount // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {gtxns} swap_xfer.asset_amount File "amm/contract.py", line 236 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%6#0,0 0 File "amm/contract.py", line 236 + > // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {>} swap_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 236 + assert // amount minimum not met // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert swap_xfer.asset_amount > 0, "amount minimum not met" File "amm/contract.py", line 236 + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | swap_xfer#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns Sender // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {gtxns} swap_xfer.sender File "amm/contract.py", line 237 + txn Sender // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%8#0,{txn} Transaction.sender() File "amm/contract.py", line 237 + == // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {==} swap_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 237 + assert // sender invalid // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert swap_xfer.sender == Transaction.sender(), "sender invalid" File "amm/contract.py", line 237 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0 self.asset_a File "amm/contract.py", line 240 + byte "asset_a" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 240 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 240 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0 self.asset_a File "amm/contract.py", line 240 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,0 self.asset_b File "amm/contract.py", line 244 + byte "asset_b" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,0,"asset_b" self.asset_b File "amm/contract.py", line 244 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 244 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,app_global_get_ex_value%13#0 self.asset_b File "amm/contract.py", line 244 + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,app_global_get_ex_value%13#0,swap_xfer#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns XferAsset // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | app_global_get_ex_value%11#0,app_global_get_ex_value%13#0,{gtxns} swap_xfer.xfer_asset File "amm/contract.py", line 239 + match swap_switch_case_0@1 swap_switch_case_1@2 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | match swap_xfer.xfer_asset: File "amm/contract.py", line 239 + b swap_switch_case_default@3 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | match swap_xfer.xfer_asset: File "amm/contract.py", line 239 + +swap_switch_case_0@1: + callsub _current_b_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_b_balance} self._current_b_balance() File "amm/contract.py", line 241 + frame_bury 0 // store in_supply#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | in_supply File "amm/contract.py", line 241 + callsub _current_a_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_a_balance} self._current_a_balance() File "amm/contract.py", line 242 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0 self.asset_a File "amm/contract.py", line 243 + byte "asset_a" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0,"asset_a" self.asset_a File "amm/contract.py", line 243 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_a File "amm/contract.py", line 243 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | app_global_get_ex_value%16#0 self.asset_a File "amm/contract.py", line 243 + frame_bury 1 // store out_asset#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | out_asset File "amm/contract.py", line 243 + b swap_switch_case_next@4 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | out_supply#0 + +swap_switch_case_1@2: + callsub _current_a_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_a_balance} self._current_a_balance() File "amm/contract.py", line 245 + frame_bury 0 // store in_supply#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | in_supply File "amm/contract.py", line 241 + callsub _current_b_balance // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {_current_b_balance} self._current_b_balance() File "amm/contract.py", line 246 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0 self.asset_b File "amm/contract.py", line 247 + byte "asset_b" // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | 0,"asset_b" self.asset_b File "amm/contract.py", line 247 + app_global_get_ex // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asset_b File "amm/contract.py", line 247 + assert // check value exists // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | app_global_get_ex_value%18#0 self.asset_b File "amm/contract.py", line 247 + frame_bury 1 // store out_asset#0 to f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | out_asset File "amm/contract.py", line 243 + b swap_switch_case_next@4 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | out_supply#0 + +swap_switch_case_default@3: + err // asset id incorrect // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | assert False, "asset id incorrect" File "amm/contract.py", line 249 + +swap_switch_case_next@4: + frame_dig -3 // load swap_xfer#0 from parameters (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | swap_xfer#0 out_supply#0 swap_xfer: AssetTransferTransaction File "amm/contract.py", line 220 + gtxns AssetAmount // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | {gtxns} swap_xfer.asset_amount File "amm/contract.py", line 252 + frame_dig 0 // load in_supply#0 from f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | (𝕏) out_supply#0 | tmp%20#0,in_supply#0 in_supply File "amm/contract.py", line 241 + uncover 2 // load out_supply#0 from x-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%20#0,in_supply#0,out_supply#0 out_supply File "amm/contract.py", line 242 + callsub tokens_to_swap // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | {tokens_to_swap} tokens_to_swap( File "amm/contract.py", line 251 + dup // load to_swap#0 from l-stack (copy) (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,to_swap#0 to_swap File "amm/contract.py", line 251 + int 0 // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,to_swap#0,0 0 File "amm/contract.py", line 254 + > // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,{>} to_swap > 0, "send amount too low" File "amm/contract.py", line 254 + assert // send amount too low // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0 assert to_swap > 0, "send amount too low" File "amm/contract.py", line 254 + txn Sender // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,{txn} Transaction.sender() File "amm/contract.py", line 256 + frame_dig 1 // load out_asset#0 from f-stack (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | to_swap#0,tmp%22#0,out_asset#0 out_asset File "amm/contract.py", line 243 + uncover 2 // load to_swap#0 from l-stack (no copy) (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | tmp%22#0,out_asset#0,to_swap#0 to_swap File "amm/contract.py", line 251 + callsub do_asset_transfer // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | do_asset_transfer(receiver=Transaction.sender(), asset=out_asset, amount=to_swap) File "amm/contract.py", line 256 + callsub _update_ratio // (𝕡) swap_xfer#0,a_asset#0,b_asset#0 | (𝕗) in_supply#0,out_asset#0 | self._update_ratio() File "amm/contract.py", line 257 + retsub // + + +// examples.amm.contract.tokens_to_swap(in_amount#0: uint64, in_supply#0: uint64, out_supply#0: uint64) -> uint64: +tokens_to_swap: + proto 3 1 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | def tokens_to_swap(*, in_amount: UInt64, in_supply: UInt64, out_supply: UInt64) -> UInt64: File "amm/contract.py", line 360 + +tokens_to_swap_block@0: + frame_dig -2 // load in_supply#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_supply#0 in_supply: UInt64 File "amm/contract.py", line 360 + frame_dig -3 // load in_amount#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_supply#0,in_amount#0 in_amount: UInt64 File "amm/contract.py", line 360 + - // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {-} in_supply - in_amount File "amm/contract.py", line 361 + int 1000 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%0#0,1000 SCALE File "amm/contract.py", line 361 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {*} SCALE * (in_supply - in_amount) File "amm/contract.py", line 361 + frame_dig -3 // load in_amount#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%1#0,in_amount#0 in_amount: UInt64 File "amm/contract.py", line 360 + int 995 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%1#0,in_amount#0,995 FACTOR File "amm/contract.py", line 361 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | tmp%1#0,{*} in_amount * FACTOR File "amm/contract.py", line 361 + + // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {+} SCALE * (in_supply - in_amount) + (in_amount * FACTOR) File "amm/contract.py", line 361 + frame_dig -3 // load in_amount#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,in_amount#0 in_amount: UInt64 File "amm/contract.py", line 360 + int 995 // (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,in_amount#0,995 FACTOR File "amm/contract.py", line 362 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,{*} in_amount * FACTOR File "amm/contract.py", line 362 + frame_dig -1 // load out_supply#0 from parameters (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,tmp%3#0,out_supply#0 out_supply: UInt64 File "amm/contract.py", line 360 + * // (𝕡) in_amount#0,in_supply#0,out_supply#0 | in_total#0,{*} in_amount * FACTOR * out_supply File "amm/contract.py", line 362 + swap // load in_total#0 from l-stack (no copy) (𝕡) in_amount#0,in_supply#0,out_supply#0 | out_total#0,in_total#0 in_total File "amm/contract.py", line 361 + / // (𝕡) in_amount#0,in_supply#0,out_supply#0 | {/} out_total // in_total File "amm/contract.py", line 363 + retsub // tmp%4#0 return out_total // in_total File "amm/contract.py", line 363 + + +// examples.amm.contract.ConstantProductAMM.create() -> void: +create: + proto 0 0 // def create(self) -> None: File "amm/contract.py", line 48 + +create_block@0: + retsub // + + +// examples.amm.contract.ConstantProductAMM.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "amm/contract.py", line 32 + +__init___block@0: + byte "asset_a" // "asset_a" self.asset_a File "amm/contract.py", line 37 + int 0 // "asset_a",0 0 File "amm/contract.py", line 37 + app_global_put // self.asset_a = Asset(0) File "amm/contract.py", line 37 + byte "asset_b" // "asset_b" self.asset_b File "amm/contract.py", line 39 + int 0 // "asset_b",0 0 File "amm/contract.py", line 39 + app_global_put // self.asset_b = Asset(0) File "amm/contract.py", line 39 + txn Sender // {txn} Transaction.sender() File "amm/contract.py", line 41 + byte "governor" // new_state_value%0#0,"governor" self.governor File "amm/contract.py", line 41 + swap // load new_state_value%0#0 from l-stack (no copy) "governor",new_state_value%0#0 Transaction.sender() File "amm/contract.py", line 41 + app_global_put // self.governor = Transaction.sender() File "amm/contract.py", line 41 + byte "pool_token" // "pool_token" self.pool_token File "amm/contract.py", line 43 + int 0 // "pool_token",0 0 File "amm/contract.py", line 43 + app_global_put // self.pool_token = Asset(0) File "amm/contract.py", line 43 + byte "ratio" // "ratio" self.ratio File "amm/contract.py", line 45 + int 0 // "ratio",0 0 File "amm/contract.py", line 45 + app_global_put // self.ratio = UInt64(0) File "amm/contract.py", line 45 + retsub // + diff --git a/examples/amm/out/contract.approval_unoptimized.teal b/examples/amm/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..c519522180 --- /dev/null +++ b/examples/amm/out/contract.approval_unoptimized.teal @@ -0,0 +1,839 @@ +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_bare_routing@11 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "set_governor(account)void" + method "bootstrap(pay,asset,asset)uint64" + method "mint(axfer,axfer,asset,asset,asset)void" + method "burn(axfer,asset,asset,asset)void" + method "swap(axfer,asset,asset)void" + uncover 5 + match main_set_governor_route@4 main_bootstrap_route@5 main_mint_route@6 main_burn_route@7 main_swap_route@8 + b main_switch_case_default@9 + +main_set_governor_route@4: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + btoi + txnas Accounts + callsub set_governor + int 1 + return + +main_bootstrap_route@5: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + callsub bootstrap + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_mint_route@6: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 2 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + txna ApplicationArgs 3 + btoi + txnas Assets + callsub mint + int 1 + return + +main_burn_route@7: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + txna ApplicationArgs 3 + btoi + txnas Assets + callsub burn + int 1 + return + +main_swap_route@8: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + txna ApplicationArgs 1 + btoi + txnas Assets + txna ApplicationArgs 2 + btoi + txnas Assets + callsub swap + int 1 + return + +main_switch_case_default@9: + +main_switch_case_next@10: + b main_after_if_else@14 + +main_bare_routing@11: + txn OnCompletion + int 0 + swap + match main_create@12 + b main_reject_bare_on_completion@13 + +main_create@12: + txn ApplicationID + ! + assert // is creating + callsub create + int 1 + return + +main_reject_bare_on_completion@13: + err // reject transaction + +main_after_if_else@14: + err // reject transaction + + +// examples.amm.contract.ConstantProductAMM.set_governor(new_governor#0: bytes) -> void: +set_governor: + proto 1 0 + +set_governor_block@0: + callsub _check_is_governor + byte "governor" + frame_dig -1 + app_global_put + retsub + + +// examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: +_check_is_governor: + proto 0 0 + +_check_is_governor_block@0: + txn Sender + int 0 + byte "governor" + app_global_get_ex + assert // check value exists + == + assert // Only the account set in global_state.governor may call this method + retsub + + +// examples.amm.contract.ConstantProductAMM.bootstrap(seed#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> bytes: +bootstrap: + proto 3 1 + +bootstrap_block@0: + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + ! + assert // application has already been bootstrapped + callsub _check_is_governor + global GroupSize + int 2 + == + assert // group size not 2 + frame_dig -3 + gtxns Receiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -3 + gtxns Amount + int 300000 + >= + assert // amount minimum not met + frame_dig -2 + frame_dig -1 + < + assert // asset a must be less than asset b + byte "asset_a" + frame_dig -2 + app_global_put + byte "asset_b" + frame_dig -1 + app_global_put + callsub _create_pool_token + byte "pool_token" + swap + app_global_put + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + callsub _do_opt_in + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + callsub _do_opt_in + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + itob + retsub + + +// examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: +_create_pool_token: + proto 0 1 + +_create_pool_token_block@0: + itxn_begin + int acfg + itxn_field TypeEnum + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + asset_params_get AssetUnitName + assert // asset exists + byte "DPT-" + swap + concat + byte "-" + concat + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + asset_params_get AssetUnitName + assert // asset exists + concat + itxn_field ConfigAssetName + byte "dpt" + itxn_field ConfigAssetUnitName + int 10000000000 + itxn_field ConfigAssetTotal + int 3 + itxn_field ConfigAssetDecimals + global CurrentApplicationAddress + itxn_field ConfigAssetManager + global CurrentApplicationAddress + itxn_field ConfigAssetReserve + int 0 + itxn_field Fee + itxn_submit + itxn CreatedAssetID + retsub + + +// examples.amm.contract.ConstantProductAMM._do_opt_in(asset#0: uint64) -> void: +_do_opt_in: + proto 1 0 + +_do_opt_in_block@0: + global CurrentApplicationAddress + frame_dig -1 + int 0 + callsub do_asset_transfer + retsub + + +// examples.amm.contract.do_asset_transfer(receiver#0: bytes, asset#0: uint64, amount#0: uint64) -> void: +do_asset_transfer: + proto 3 0 + +do_asset_transfer_block@0: + itxn_begin + int axfer + itxn_field TypeEnum + frame_dig -2 + itxn_field XferAsset + frame_dig -1 + itxn_field AssetAmount + frame_dig -3 + itxn_field AssetReceiver + int 0 + itxn_field Fee + itxn_submit + retsub + + +// examples.amm.contract.ConstantProductAMM.mint(a_xfer#0: uint64, b_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +mint: + proto 5 0 + +mint_block@0: + callsub _check_bootstrapped + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + frame_dig -3 + == + assert // asset pool incorrect + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + frame_dig -2 + == + assert // asset a incorrect + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -1 + == + assert // asset b incorrect + frame_dig -5 + gtxns Sender + txn Sender + == + assert // sender invalid + frame_dig -4 + gtxns Sender + txn Sender + == + assert // sender invalid + frame_dig -5 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -5 + gtxns XferAsset + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + == + assert // asset a incorrect + frame_dig -5 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + frame_dig -4 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -4 + gtxns XferAsset + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + == + assert // asset b incorrect + frame_dig -4 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + callsub _current_pool_balance + callsub _current_a_balance + callsub _current_b_balance + frame_dig -5 + gtxns AssetAmount + frame_dig -4 + gtxns AssetAmount + callsub tokens_to_mint + dup + int 0 + > + assert // send amount too low + txn Sender + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + uncover 2 + callsub do_asset_transfer + callsub _update_ratio + retsub + + +// examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: +_check_bootstrapped: + proto 0 0 + +_check_bootstrapped_block@0: + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + assert // bootstrap method needs to be called first + retsub + + +// examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: +_current_pool_balance: + proto 0 1 + +_current_pool_balance_block@0: + global CurrentApplicationAddress + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + asset_holding_get AssetBalance + assert // account opted into asset + retsub + + +// examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: +_current_a_balance: + proto 0 1 + +_current_a_balance_block@0: + global CurrentApplicationAddress + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + asset_holding_get AssetBalance + assert // account opted into asset + retsub + + +// examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: +_current_b_balance: + proto 0 1 + +_current_b_balance_block@0: + global CurrentApplicationAddress + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + asset_holding_get AssetBalance + assert // account opted into asset + retsub + + +// examples.amm.contract.tokens_to_mint(pool_balance#0: uint64, a_balance#0: uint64, b_balance#0: uint64, a_amount#0: uint64, b_amount#0: uint64) -> uint64: +tokens_to_mint: + proto 5 1 + byte "" + dup + +tokens_to_mint_block@0: + frame_dig -4 + frame_dig -2 + == + bz tokens_to_mint_bool_false@3 + +tokens_to_mint_and_contd@1: + frame_dig -3 + frame_dig -1 + == + bz tokens_to_mint_bool_false@3 + +tokens_to_mint_bool_true@2: + int 1 + b tokens_to_mint_bool_merge@4 + +tokens_to_mint_bool_false@3: + int 0 + +tokens_to_mint_bool_merge@4: + bz tokens_to_mint_after_if_else@6 + +tokens_to_mint_if_body@5: + frame_dig -2 + frame_dig -1 + * + sqrt + int 1000 + - + frame_bury 0 + retsub + +tokens_to_mint_after_if_else@6: + int 10000000000 + frame_dig -5 + - + int 1000 + frame_dig -2 + * + frame_dig -4 + frame_dig -2 + - + / + dup + frame_bury 0 + int 1000 + frame_dig -1 + * + frame_dig -3 + frame_dig -1 + - + / + dup + frame_bury 1 + < + bz tokens_to_mint_else_body@8 + +tokens_to_mint_if_body@7: + frame_dig 0 + * + int 1000 + / + frame_bury 0 + retsub + +tokens_to_mint_else_body@8: + frame_dig 1 + * + int 1000 + / + frame_bury 0 + retsub + + +// examples.amm.contract.ConstantProductAMM._update_ratio() -> void: +_update_ratio: + proto 0 0 + +_update_ratio_block@0: + callsub _current_a_balance + callsub _current_b_balance + swap + int 1000 + * + swap + / + byte "ratio" + swap + app_global_put + retsub + + +// examples.amm.contract.ConstantProductAMM.burn(pool_xfer#0: uint64, pool_asset#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +burn: + proto 4 0 + +burn_block@0: + callsub _check_bootstrapped + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + frame_dig -3 + == + assert // asset pool incorrect + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + frame_dig -2 + == + assert // asset a incorrect + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -1 + == + assert // asset b incorrect + frame_dig -4 + gtxns AssetReceiver + global CurrentApplicationAddress + == + assert // receiver not app address + frame_dig -4 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + frame_dig -4 + gtxns XferAsset + int 0 + byte "pool_token" + app_global_get_ex + assert // check value exists + == + assert // asset pool incorrect + frame_dig -4 + gtxns Sender + txn Sender + == + assert // sender invalid + callsub _current_pool_balance + callsub _current_a_balance + frame_dig -4 + gtxns AssetAmount + dig 2 + cover 2 + callsub tokens_to_burn + swap + callsub _current_b_balance + frame_dig -4 + gtxns AssetAmount + callsub tokens_to_burn + swap + txn Sender + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + uncover 2 + callsub do_asset_transfer + txn Sender + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + uncover 2 + callsub do_asset_transfer + callsub _update_ratio + retsub + + +// examples.amm.contract.tokens_to_burn(pool_balance#0: uint64, supply#0: uint64, amount#0: uint64) -> uint64: +tokens_to_burn: + proto 3 1 + +tokens_to_burn_block@0: + int 10000000000 + frame_dig -3 + - + frame_dig -1 + - + frame_dig -2 + frame_dig -1 + * + swap + / + retsub + + +// examples.amm.contract.ConstantProductAMM.swap(swap_xfer#0: uint64, a_asset#0: uint64, b_asset#0: uint64) -> void: +swap: + proto 3 0 + byte "" + dup + +swap_block@0: + callsub _check_bootstrapped + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + frame_dig -2 + == + assert // asset a incorrect + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -1 + == + assert // asset b incorrect + frame_dig -3 + gtxns AssetAmount + int 0 + > + assert // amount minimum not met + frame_dig -3 + gtxns Sender + txn Sender + == + assert // sender invalid + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_dig -3 + gtxns XferAsset + match swap_switch_case_0@1 swap_switch_case_1@2 + b swap_switch_case_default@3 + +swap_switch_case_0@1: + callsub _current_b_balance + frame_bury 0 + callsub _current_a_balance + int 0 + byte "asset_a" + app_global_get_ex + assert // check value exists + frame_bury 1 + b swap_switch_case_next@4 + +swap_switch_case_1@2: + callsub _current_a_balance + frame_bury 0 + callsub _current_b_balance + int 0 + byte "asset_b" + app_global_get_ex + assert // check value exists + frame_bury 1 + b swap_switch_case_next@4 + +swap_switch_case_default@3: + err // asset id incorrect + +swap_switch_case_next@4: + frame_dig -3 + gtxns AssetAmount + frame_dig 0 + uncover 2 + callsub tokens_to_swap + dup + int 0 + > + assert // send amount too low + txn Sender + frame_dig 1 + uncover 2 + callsub do_asset_transfer + callsub _update_ratio + retsub + + +// examples.amm.contract.tokens_to_swap(in_amount#0: uint64, in_supply#0: uint64, out_supply#0: uint64) -> uint64: +tokens_to_swap: + proto 3 1 + +tokens_to_swap_block@0: + frame_dig -2 + frame_dig -3 + - + int 1000 + * + frame_dig -3 + int 995 + * + + + frame_dig -3 + int 995 + * + frame_dig -1 + * + swap + / + retsub + + +// examples.amm.contract.ConstantProductAMM.create() -> void: +create: + proto 0 0 + +create_block@0: + retsub + + +// examples.amm.contract.ConstantProductAMM.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "asset_a" + int 0 + app_global_put + byte "asset_b" + int 0 + app_global_put + txn Sender + byte "governor" + swap + app_global_put + byte "pool_token" + int 0 + app_global_put + byte "ratio" + int 0 + app_global_put + retsub + diff --git a/examples/amm/out/contract.awst b/examples/amm/out/contract.awst index a7ca94cce2..b85ee95187 100644 --- a/examples/amm/out/contract.awst +++ b/examples/amm/out/contract.awst @@ -3,31 +3,120 @@ SCALE = 1000 FEE = 5 FACTOR = 995 -contract ConstantProductionAMM +contract ConstantProductAMM { globals { - ['asset_a']: algopy.UInt64 - ['asset_b']: algopy.UInt64 - ['pool_token']: algopy.UInt64 - ['governor']: algopy.Address + ['asset_a']: algopy.Asset + ['asset_b']: algopy.Asset + ['governor']: algopy.Account + ['pool_token']: algopy.Asset ['ratio']: algopy.UInt64 } constructor() { - this.globals['asset_a']: algopy.UInt64 = 0u - this.globals['asset_b']: algopy.UInt64 = 0u - this.globals['pool_token']: algopy.UInt64 = 0u - this.globals['governor']: algopy.Address = txn() + this.globals['asset_a']: algopy.Asset = reinterpret_cast(0u) + this.globals['asset_b']: algopy.Asset = reinterpret_cast(0u) + this.globals['governor']: algopy.Account = txn() + this.globals['pool_token']: algopy.Asset = reinterpret_cast(0u) + this.globals['ratio']: algopy.UInt64 = 0u } abimethod create(): None { } + abimethod set_governor(new_governor: algopy.Account): None + { + this::_check_is_governor() + this.globals['governor']: algopy.Account = new_governor + } + + abimethod bootstrap(seed: algopy.PaymentTransaction, a_asset: algopy.Asset, b_asset: algopy.Asset): algopy.arc4.UIntN[typing.Literal[64]] + { + assert(!(reinterpret_cast(this.globals['pool_token'])), comment="application has already been bootstrapped") + this::_check_is_governor() + assert(global() == 2u, comment="group size not 2") + assert(gtxns(seed) == global(), comment="receiver not app address") + assert(gtxns(seed) >= 300000u, comment="amount minimum not met") + assert(reinterpret_cast(a_asset) < reinterpret_cast(b_asset), comment="asset a must be less than asset b") + this.globals['asset_a']: algopy.Asset = a_asset + this.globals['asset_b']: algopy.Asset = b_asset + this.globals['pool_token']: algopy.Asset = this::_create_pool_token() + this::_do_opt_in(this.globals['asset_a']) + this::_do_opt_in(this.globals['asset_b']) + return arc4_encode(reinterpret_cast(this.globals['pool_token']), algopy.arc4.UIntN[typing.Literal[64]]) + } + + abimethod mint(a_xfer: algopy.AssetTransferTransaction, b_xfer: algopy.AssetTransferTransaction, pool_asset: algopy.Asset, a_asset: algopy.Asset, b_asset: algopy.Asset): None + { + this::_check_bootstrapped() + assert(pool_asset == this.globals['pool_token'], comment="asset pool incorrect") + assert(a_asset == this.globals['asset_a'], comment="asset a incorrect") + assert(b_asset == this.globals['asset_b'], comment="asset b incorrect") + assert(gtxns(a_xfer) == txn(), comment="sender invalid") + assert(gtxns(b_xfer) == txn(), comment="sender invalid") + assert(gtxns(a_xfer) == global(), comment="receiver not app address") + assert(gtxns(a_xfer) == this.globals['asset_a'], comment="asset a incorrect") + assert(gtxns(a_xfer) > 0u, comment="amount minimum not met") + assert(gtxns(b_xfer) == global(), comment="receiver not app address") + assert(gtxns(b_xfer) == this.globals['asset_b'], comment="asset b incorrect") + assert(gtxns(b_xfer) > 0u, comment="amount minimum not met") + to_mint: algopy.UInt64 = examples.amm.contract::tokens_to_mint(pool_balance=this::_current_pool_balance(), a_balance=this::_current_a_balance(), b_balance=this::_current_b_balance(), a_amount=gtxns(a_xfer), b_amount=gtxns(b_xfer)) + assert(to_mint > 0u, comment="send amount too low") + examples.amm.contract::do_asset_transfer(receiver=txn(), asset=this.globals['pool_token'], amount=to_mint) + this::_update_ratio() + } + + abimethod burn(pool_xfer: algopy.AssetTransferTransaction, pool_asset: algopy.Asset, a_asset: algopy.Asset, b_asset: algopy.Asset): None + { + this::_check_bootstrapped() + assert(pool_asset == this.globals['pool_token'], comment="asset pool incorrect") + assert(a_asset == this.globals['asset_a'], comment="asset a incorrect") + assert(b_asset == this.globals['asset_b'], comment="asset b incorrect") + assert(gtxns(pool_xfer) == global(), comment="receiver not app address") + assert(gtxns(pool_xfer) > 0u, comment="amount minimum not met") + assert(gtxns(pool_xfer) == this.globals['pool_token'], comment="asset pool incorrect") + assert(gtxns(pool_xfer) == txn(), comment="sender invalid") + pool_balance: algopy.UInt64 = this::_current_pool_balance() + a_amt: algopy.UInt64 = examples.amm.contract::tokens_to_burn(pool_balance=pool_balance, supply=this::_current_a_balance(), amount=gtxns(pool_xfer)) + b_amt: algopy.UInt64 = examples.amm.contract::tokens_to_burn(pool_balance=pool_balance, supply=this::_current_b_balance(), amount=gtxns(pool_xfer)) + examples.amm.contract::do_asset_transfer(receiver=txn(), asset=this.globals['asset_a'], amount=a_amt) + examples.amm.contract::do_asset_transfer(receiver=txn(), asset=this.globals['asset_b'], amount=b_amt) + this::_update_ratio() + } + + abimethod swap(swap_xfer: algopy.AssetTransferTransaction, a_asset: algopy.Asset, b_asset: algopy.Asset): None + { + this::_check_bootstrapped() + assert(a_asset == this.globals['asset_a'], comment="asset a incorrect") + assert(b_asset == this.globals['asset_b'], comment="asset b incorrect") + assert(gtxns(swap_xfer) > 0u, comment="amount minimum not met") + assert(gtxns(swap_xfer) == txn(), comment="sender invalid") + switch (tmp$0: algopy.Asset := gtxns(swap_xfer)) { + case this.globals['asset_a']: { + in_supply: algopy.UInt64 = this::_current_b_balance() + out_supply: algopy.UInt64 = this::_current_a_balance() + out_asset: algopy.Asset = this.globals['asset_a'] + } + case this.globals['asset_b']: { + in_supply: algopy.UInt64 = this::_current_a_balance() + out_supply: algopy.UInt64 = this::_current_b_balance() + out_asset: algopy.Asset = this.globals['asset_b'] + } + case _: { + assert(false, comment="asset id incorrect") + } + } + to_swap: algopy.UInt64 = examples.amm.contract::tokens_to_swap(in_amount=gtxns(swap_xfer), in_supply=in_supply, out_supply=out_supply) + assert(to_swap > 0u, comment="send amount too low") + examples.amm.contract::do_asset_transfer(receiver=txn(), asset=out_asset, amount=to_swap) + this::_update_ratio() + } + subroutine _check_bootstrapped(): None { - assert(this.globals['pool_token'] != 0u, comment="bootstrap method needs to be called first") + assert(reinterpret_cast(this.globals['pool_token']), comment="bootstrap method needs to be called first") } subroutine _update_ratio(): None @@ -42,15 +131,11 @@ contract ConstantProductionAMM assert(txn() == this.globals['governor'], comment="Only the account set in global_state.governor may call this method") } - subroutine _create_pool_token(): None + subroutine _create_pool_token(): algopy.Asset { - (unit_a, unit_a_exists): tuple[algopy.Bytes, bool] = asset_params_get(this.globals['asset_a']) - assert(unit_a_exists) - (unit_b, unit_b_exists): tuple[algopy.Bytes, bool] = asset_params_get(this.globals['asset_b']) - assert(unit_b_exists) itxn_begin() itxn_field(acfg) - itxn_field('DPT-' + unit_a + '-' + unit_b) + itxn_field('DPT-' + checked_maybe(asset_params_get(this.globals['asset_a'])) + '-' + checked_maybe(asset_params_get(this.globals['asset_b']))) itxn_field('dpt') itxn_field(10000000000u) itxn_field(3u) @@ -58,33 +143,27 @@ contract ConstantProductionAMM itxn_field(global()) itxn_field(0u) itxn_submit() - this.globals['pool_token']: algopy.UInt64 = itxn() + return reinterpret_cast(itxn()) } - subroutine _do_opt_in(asset_id: algopy.UInt64): None + subroutine _do_opt_in(asset: algopy.Asset): None { - examples.amm.contract::do_asset_transfer(receiver=global(), asset_id=asset_id, amount=0u) + examples.amm.contract::do_asset_transfer(receiver=global(), asset=asset, amount=0u) } subroutine _current_pool_balance(): algopy.UInt64 { - (balance, has_balance): tuple[algopy.UInt64, bool] = asset_holding_get(global(), this.globals['pool_token']) - assert(has_balance) - return balance + return checked_maybe(asset_holding_get(global(), this.globals['pool_token'])) } subroutine _current_a_balance(): algopy.UInt64 { - (balance, has_balance): tuple[algopy.UInt64, bool] = asset_holding_get(global(), this.globals['asset_a']) - assert(has_balance) - return balance + return checked_maybe(asset_holding_get(global(), this.globals['asset_a'])) } subroutine _current_b_balance(): algopy.UInt64 { - (balance, has_balance): tuple[algopy.UInt64, bool] = asset_holding_get(global(), this.globals['asset_b']) - assert(has_balance) - return balance + return checked_maybe(asset_holding_get(global(), this.globals['asset_b'])) } } @@ -117,11 +196,11 @@ subroutine tokens_to_swap(in_amount: algopy.UInt64, in_supply: algopy.UInt64, ou return out_total // in_total } -subroutine do_asset_transfer(receiver: algopy.Address, asset_id: algopy.UInt64, amount: algopy.UInt64): None +subroutine do_asset_transfer(receiver: algopy.Account, asset: algopy.Asset, amount: algopy.UInt64): None { itxn_begin() itxn_field(axfer) - itxn_field(asset_id) + itxn_field(reinterpret_cast(asset)) itxn_field(amount) itxn_field(receiver) itxn_field(0u) diff --git a/examples/amm/out/contract.clear.debug.teal b/examples/amm/out/contract.clear.debug.teal new file mode 100644 index 0000000000..c35486cc10 --- /dev/null +++ b/examples/amm/out/contract.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + return // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + diff --git a/examples/amm/out/contract.clear.teal b/examples/amm/out/contract.clear.teal new file mode 100644 index 0000000000..6450aa06ff --- /dev/null +++ b/examples/amm/out/contract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/amm/out/contract.clear_unoptimized.debug.teal b/examples/amm/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..c35486cc10 --- /dev/null +++ b/examples/amm/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + return // class ConstantProductAMM(ARC4Contract): File "amm/contract.py", line 31 + diff --git a/examples/amm/out/contract.clear_unoptimized.teal b/examples/amm/out/contract.clear_unoptimized.teal new file mode 100644 index 0000000000..6450aa06ff --- /dev/null +++ b/examples/amm/out/contract.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/amm/out/contract_ConstantProductAMM.cssa.ir b/examples/amm/out/contract_ConstantProductAMM.cssa.ir new file mode 100644 index 0000000000..7e39c0da41 --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.cssa.ir @@ -0,0 +1,511 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + (assert tmp%17#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(awst_tmp%15#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + (assert tmp%34#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#1: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#1) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + (assert tmp%39#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(awst_tmp%32#0, awst_tmp%15#1, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (! tmp%49#0) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#2: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#2) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + (assert tmp%56#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(awst_tmp%15#2, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (! tmp%66#0) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#3: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#3) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + (assert tmp%73#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(awst_tmp%15#3, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + fail // reject transaction + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + goto tmp%80#0 ? block@13 : block@12 + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + let and_result%2#2: uint64 = and_result%2#0 + goto block@4 + block@3: // bool_false_L341 + let and_result%2#1: uint64 = 0u + let and_result%2#3: uint64 = and_result%2#1 + goto block@4 + block@4: // bool_merge_L341 + let is_initial_mint#1: uint64 = φ(and_result%2#2 <- block@2, and_result%2#3 <- block@3) + let is_initial_mint#0: uint64 = is_initial_mint#1 + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (out_asset#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let (out_asset#3: uint64, out_supply#3: uint64, in_supply#3: uint64) = (out_asset#0, out_supply#0, in_supply#0) + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (out_asset#1: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + let (out_asset#4: uint64, out_supply#4: uint64, in_supply#4: uint64) = (out_asset#1, out_supply#1, in_supply#1) + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let in_supply#5: uint64 = φ(in_supply#3 <- block@1, in_supply#4 <- block@2) + let out_supply#5: uint64 = φ(out_supply#3 <- block@1, out_supply#4 <- block@2) + let out_asset#5: uint64 = φ(out_asset#3 <- block@1, out_asset#4 <- block@2) + let (out_asset#2: uint64, out_supply#2: uint64, in_supply#2: uint64) = (out_asset#5, out_supply#5, in_supply#5) + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#2, out_supply#2) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#2, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/amm/out/contract_ConstantProductAMM.final.ir b/examples/amm/out/contract_ConstantProductAMM.final.ir new file mode 100644 index 0000000000..81426cc9d4 --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.final.ir @@ -0,0 +1,503 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + (assert tmp%17#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(awst_tmp%15#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + (assert tmp%34#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + (assert tmp%39#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(awst_tmp%32#0, awst_tmp%15#0, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (! tmp%49#0) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + (assert tmp%56#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(awst_tmp%15#0, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (! tmp%66#0) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + (assert tmp%73#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(awst_tmp%15#0, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + fail // reject transaction + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + goto tmp%80#0 ? block@13 : block@12 + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + let is_initial_mint#0: uint64 = and_result%2#0 + goto block@4 + block@3: // bool_false_L341 + let and_result%2#0: uint64 = 0u + let is_initial_mint#0: uint64 = and_result%2#0 + goto block@4 + block@4: // bool_merge_L341 + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (out_asset#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (out_asset#0: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#0, out_supply#0) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#0, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/amm/out/contract_ConstantProductAMM.final_unoptimized.ir b/examples/amm/out/contract_ConstantProductAMM.final_unoptimized.ir new file mode 100644 index 0000000000..f22f513c6b --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.final_unoptimized.ir @@ -0,0 +1,518 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (== tmp%9#0 NoOp) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + let maybe_value_did_exist%13#0: uint64 = tmp%17#0 + let maybe_value%12#0: uint64 = awst_tmp%15#0 + (assert maybe_value_did_exist%13#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(maybe_value%12#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + let maybe_value_did_exist%30#0: uint64 = tmp%34#0 + let maybe_value%29#0: uint64 = awst_tmp%32#0 + (assert maybe_value_did_exist%30#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + let maybe_value_did_exist%36#0: uint64 = tmp%39#0 + let maybe_value%35#0: uint64 = awst_tmp%15#0 + (assert maybe_value_did_exist%36#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(maybe_value%29#0, maybe_value%35#0, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (== tmp%49#0 NoOp) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + let maybe_value_did_exist%53#0: uint64 = tmp%56#0 + let maybe_value%52#0: uint64 = awst_tmp%15#0 + (assert maybe_value_did_exist%53#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(maybe_value%52#0, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (== tmp%66#0 NoOp) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + let maybe_value_did_exist%70#0: uint64 = tmp%73#0 + let maybe_value%69#0: uint64 = awst_tmp%15#0 + (assert maybe_value_did_exist%70#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(maybe_value%69#0, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + goto block@10 + block@10: // switch_case_next_L31 + goto block@14 + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + switch tmp%80#0 {0u => block@12, * => block@13} + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + block@14: // after_if_else_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + goto block@4 + block@3: // bool_false_L341 + let and_result%2#0: uint64 = 0u + goto block@4 + block@4: // bool_merge_L341 + let is_initial_mint#0: uint64 = and_result%2#0 + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let out_asset#0: uint64 = app_global_get_ex_value%16#0 + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (app_global_get_ex_value%18#0: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + let out_asset#0: uint64 = app_global_get_ex_value%18#0 + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#0, out_supply#0) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#0, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/amm/out/contract_ConstantProductAMM.parallel_copies.ir b/examples/amm/out/contract_ConstantProductAMM.parallel_copies.ir new file mode 100644 index 0000000000..f10db605ec --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.parallel_copies.ir @@ -0,0 +1,513 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + (assert tmp%17#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(awst_tmp%15#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + (assert tmp%34#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#1: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#1) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + (assert tmp%39#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(awst_tmp%32#0, awst_tmp%15#1, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (! tmp%49#0) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#2: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#2) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + (assert tmp%56#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(awst_tmp%15#2, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (! tmp%66#0) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#3: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#3) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + (assert tmp%73#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(awst_tmp%15#3, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + fail // reject transaction + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + goto tmp%80#0 ? block@13 : block@12 + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + let is_initial_mint#1: uint64 = and_result%2#0 + goto block@4 + block@3: // bool_false_L341 + let and_result%2#1: uint64 = 0u + let is_initial_mint#1: uint64 = and_result%2#1 + goto block@4 + block@4: // bool_merge_L341 + let is_initial_mint#0: uint64 = is_initial_mint#1 + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (out_asset#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let in_supply#5: uint64 = in_supply#0 + let out_supply#5: uint64 = out_supply#0 + let out_asset#5: uint64 = out_asset#0 + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (out_asset#1: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + let in_supply#5: uint64 = in_supply#1 + let out_supply#5: uint64 = out_supply#1 + let out_asset#5: uint64 = out_asset#1 + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let in_supply#2: uint64 = in_supply#5 + let out_supply#2: uint64 = out_supply#5 + let out_asset#2: uint64 = out_asset#5 + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#2, out_supply#2) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#2, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/amm/out/contract_ConstantProductAMM.post_ssa.ir b/examples/amm/out/contract_ConstantProductAMM.post_ssa.ir new file mode 100644 index 0000000000..41616969ef --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.post_ssa.ir @@ -0,0 +1,507 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + (assert tmp%17#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(awst_tmp%15#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + (assert tmp%34#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#1: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#1) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + (assert tmp%39#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(awst_tmp%32#0, awst_tmp%15#1, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (! tmp%49#0) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#2: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#2) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + (assert tmp%56#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(awst_tmp%15#2, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (! tmp%66#0) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#3: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#3) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + (assert tmp%73#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(awst_tmp%15#3, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + fail // reject transaction + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + goto tmp%80#0 ? block@13 : block@12 + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + let is_initial_mint#1: uint64 = and_result%2#0 + goto block@4 + block@3: // bool_false_L341 + let and_result%2#1: uint64 = 0u + let is_initial_mint#1: uint64 = and_result%2#1 + goto block@4 + block@4: // bool_merge_L341 + let is_initial_mint#0: uint64 = is_initial_mint#1 + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (out_asset#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let (out_asset#5: uint64, out_supply#5: uint64, in_supply#5: uint64) = (out_asset#0, out_supply#0, in_supply#0) + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (out_asset#1: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + let (out_asset#5: uint64, out_supply#5: uint64, in_supply#5: uint64) = (out_asset#1, out_supply#1, in_supply#1) + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let (out_asset#2: uint64, out_supply#2: uint64, in_supply#2: uint64) = (out_asset#5, out_supply#5, in_supply#5) + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#2, out_supply#2) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#2, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/amm/out/contract_ConstantProductAMM.ssa.ir b/examples/amm/out/contract_ConstantProductAMM.ssa.ir new file mode 100644 index 0000000000..a1542d56bc --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.ssa.ir @@ -0,0 +1,517 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (== tmp%9#0 NoOp) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + let (maybe_value%12#0: uint64, maybe_value_did_exist%13#0: uint64) = (awst_tmp%15#0, tmp%17#0) + (assert maybe_value_did_exist%13#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(maybe_value%12#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + let (maybe_value%29#0: uint64, maybe_value_did_exist%30#0: uint64) = (awst_tmp%32#0, tmp%34#0) + (assert maybe_value_did_exist%30#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#1: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#1) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + let (maybe_value%35#0: uint64, maybe_value_did_exist%36#0: uint64) = (awst_tmp%15#1, tmp%39#0) + (assert maybe_value_did_exist%36#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(maybe_value%29#0, maybe_value%35#0, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (== tmp%49#0 NoOp) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#2: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#2) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + let (maybe_value%52#0: uint64, maybe_value_did_exist%53#0: uint64) = (awst_tmp%15#2, tmp%56#0) + (assert maybe_value_did_exist%53#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(maybe_value%52#0, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (== tmp%66#0 NoOp) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#3: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#3) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + let (maybe_value%69#0: uint64, maybe_value_did_exist%70#0: uint64) = (awst_tmp%15#3, tmp%73#0) + (assert maybe_value_did_exist%70#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(maybe_value%69#0, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + goto block@10 + block@10: // switch_case_next_L31 + goto block@14 + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + switch tmp%80#0 {0u => block@12, * => block@13} + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + block@14: // after_if_else_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + goto block@4 + block@3: // bool_false_L341 + let and_result%2#1: uint64 = 0u + goto block@4 + block@4: // bool_merge_L341 + let and_result%2#2: uint64 = φ(and_result%2#0 <- block@2, and_result%2#1 <- block@3) + let is_initial_mint#0: uint64 = and_result%2#2 + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let out_asset#0: uint64 = app_global_get_ex_value%16#0 + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (app_global_get_ex_value%18#0: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + let out_asset#1: uint64 = app_global_get_ex_value%18#0 + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let in_supply#2: uint64 = φ(in_supply#0 <- block@1, in_supply#1 <- block@2) + let out_supply#2: uint64 = φ(out_supply#0 <- block@1, out_supply#1 <- block@2) + let out_asset#2: uint64 = φ(out_asset#0 <- block@1, out_asset#1 <- block@2) + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#2, out_supply#2) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#2, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_1.ir b/examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..844b9ee018 --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_1.ir @@ -0,0 +1,505 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + (assert tmp%17#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(awst_tmp%15#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + (assert tmp%34#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#1: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#1) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + (assert tmp%39#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(awst_tmp%32#0, awst_tmp%15#1, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (! tmp%49#0) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#2: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#2) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + (assert tmp%56#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(awst_tmp%15#2, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (! tmp%66#0) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#3: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#3) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + (assert tmp%73#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(awst_tmp%15#3, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + fail // reject transaction + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + goto [block@12, ...block@13][tmp%80#0] + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + goto block@4 + block@3: // bool_false_L341 + let and_result%2#1: uint64 = 0u + goto block@4 + block@4: // bool_merge_L341 + let is_initial_mint#0: uint64 = φ(and_result%2#0 <- block@2, and_result%2#1 <- block@3) + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (out_asset#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (out_asset#1: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let in_supply#2: uint64 = φ(in_supply#0 <- block@1, in_supply#1 <- block@2) + let out_supply#2: uint64 = φ(out_supply#0 <- block@1, out_supply#1 <- block@2) + let out_asset#2: uint64 = φ(out_asset#0 <- block@1, out_asset#1 <- block@2) + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#2, out_supply#2) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#2, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_2.ir b/examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..6d2b8d441a --- /dev/null +++ b/examples/amm/out/contract_ConstantProductAMM.ssa.opt_pass_2.ir @@ -0,0 +1,505 @@ +contract examples.amm.contract.ConstantProductAMM: + program approval: + subroutine examples.amm.contract.ConstantProductAMM.approval_program() -> uint64: + block@0: // L31 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L32 + examples.amm.contract.ConstantProductAMM.__init__() + goto block@2 + block@2: // entrypoint_L32 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L31 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "set_governor(account)void" => block@4, method "bootstrap(pay,asset,asset)uint64" => block@5, method "mint(axfer,axfer,asset,asset,asset)void" => block@6, method "burn(axfer,asset,asset,asset)void" => block@7, method "swap(axfer,asset,asset)void" => block@8, * => block@9} + block@4: // set_governor_route_L51 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + let tmp%6#0: bytes = (txna ApplicationArgs 1) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = ((txnas Accounts) tmp%7#0) + examples.amm.contract.ConstantProductAMM.set_governor(tmp%8#0) + return 1u + block@5: // bootstrap_route_L57 + let tmp%9#0: uint64 = (txn OnCompletion) + let tmp%10#0: uint64 = (! tmp%9#0) + (assert tmp%10#0) // OnCompletion is NoOp + let tmp%11#0: uint64 = (txn ApplicationID) + (assert tmp%11#0) // is not creating + let tmp%14#0: uint64 = (txn GroupIndex) + let awst_tmp%15#0: uint64 = (- tmp%14#0 1u) + let tmp%16#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#0) + let tmp%17#0: uint64 = (== tmp%16#0 pay) + (assert tmp%17#0) // transaction type is pay + let tmp%18#0: bytes = (txna ApplicationArgs 1) + let tmp%19#0: uint64 = (btoi tmp%18#0) + let tmp%20#0: uint64 = ((txnas Assets) tmp%19#0) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: uint64 = (btoi tmp%21#0) + let tmp%23#0: uint64 = ((txnas Assets) tmp%22#0) + let tmp%24#0: bytes = examples.amm.contract.ConstantProductAMM.bootstrap(awst_tmp%15#0, tmp%20#0, tmp%23#0) + let tmp%25#0: bytes = (concat 0x151f7c75 tmp%24#0) + (log tmp%25#0) + return 1u + block@6: // mint_route_L89 + 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%31#0: uint64 = (txn GroupIndex) + let awst_tmp%32#0: uint64 = (- tmp%31#0 2u) + let tmp%33#0: uint64 = ((gtxns TypeEnum) awst_tmp%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 axfer) + (assert tmp%34#0) // transaction type is axfer + let tmp%37#0: uint64 = (txn GroupIndex) + let awst_tmp%15#1: uint64 = (- tmp%37#0 1u) + let tmp%38#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#1) + let tmp%39#0: uint64 = (== tmp%38#0 axfer) + (assert tmp%39#0) // transaction type is axfer + let tmp%40#0: bytes = (txna ApplicationArgs 1) + let tmp%41#0: uint64 = (btoi tmp%40#0) + let tmp%42#0: uint64 = ((txnas Assets) tmp%41#0) + let tmp%43#0: bytes = (txna ApplicationArgs 2) + let tmp%44#0: uint64 = (btoi tmp%43#0) + let tmp%45#0: uint64 = ((txnas Assets) tmp%44#0) + let tmp%46#0: bytes = (txna ApplicationArgs 3) + let tmp%47#0: uint64 = (btoi tmp%46#0) + let tmp%48#0: uint64 = ((txnas Assets) tmp%47#0) + examples.amm.contract.ConstantProductAMM.mint(awst_tmp%32#0, awst_tmp%15#1, tmp%42#0, tmp%45#0, tmp%48#0) + return 1u + block@7: // burn_route_L155 + let tmp%49#0: uint64 = (txn OnCompletion) + let tmp%50#0: uint64 = (! tmp%49#0) + (assert tmp%50#0) // OnCompletion is NoOp + let tmp%51#0: uint64 = (txn ApplicationID) + (assert tmp%51#0) // is not creating + let tmp%54#0: uint64 = (txn GroupIndex) + let awst_tmp%15#2: uint64 = (- tmp%54#0 1u) + let tmp%55#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#2) + let tmp%56#0: uint64 = (== tmp%55#0 axfer) + (assert tmp%56#0) // transaction type is axfer + let tmp%57#0: bytes = (txna ApplicationArgs 1) + let tmp%58#0: uint64 = (btoi tmp%57#0) + let tmp%59#0: uint64 = ((txnas Assets) tmp%58#0) + let tmp%60#0: bytes = (txna ApplicationArgs 2) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = ((txnas Assets) tmp%61#0) + let tmp%63#0: bytes = (txna ApplicationArgs 3) + let tmp%64#0: uint64 = (btoi tmp%63#0) + let tmp%65#0: uint64 = ((txnas Assets) tmp%64#0) + examples.amm.contract.ConstantProductAMM.burn(awst_tmp%15#2, tmp%59#0, tmp%62#0, tmp%65#0) + return 1u + block@8: // swap_route_L212 + let tmp%66#0: uint64 = (txn OnCompletion) + let tmp%67#0: uint64 = (! tmp%66#0) + (assert tmp%67#0) // OnCompletion is NoOp + let tmp%68#0: uint64 = (txn ApplicationID) + (assert tmp%68#0) // is not creating + let tmp%71#0: uint64 = (txn GroupIndex) + let awst_tmp%15#3: uint64 = (- tmp%71#0 1u) + let tmp%72#0: uint64 = ((gtxns TypeEnum) awst_tmp%15#3) + let tmp%73#0: uint64 = (== tmp%72#0 axfer) + (assert tmp%73#0) // transaction type is axfer + let tmp%74#0: bytes = (txna ApplicationArgs 1) + let tmp%75#0: uint64 = (btoi tmp%74#0) + let tmp%76#0: uint64 = ((txnas Assets) tmp%75#0) + let tmp%77#0: bytes = (txna ApplicationArgs 2) + let tmp%78#0: uint64 = (btoi tmp%77#0) + let tmp%79#0: uint64 = ((txnas Assets) tmp%78#0) + examples.amm.contract.ConstantProductAMM.swap(awst_tmp%15#3, tmp%76#0, tmp%79#0) + return 1u + block@9: // switch_case_default_L31 + fail // reject transaction + block@11: // bare_routing_L31 + let tmp%80#0: uint64 = (txn OnCompletion) + goto tmp%80#0 ? block@13 : block@12 + block@12: // create_L48 + let tmp%81#0: uint64 = (txn ApplicationID) + let tmp%82#0: uint64 = (! tmp%81#0) + (assert tmp%82#0) // is creating + examples.amm.contract.ConstantProductAMM.create() + return 1u + block@13: // reject_bare_on_completion_L31 + fail // reject transaction + + subroutine examples.amm.contract.ConstantProductAMM.set_governor(new_governor: bytes) -> void: + block@0: // L52 + examples.amm.contract.ConstantProductAMM._check_is_governor() + (app_global_put "governor" new_governor#0) + return + + subroutine examples.amm.contract.ConstantProductAMM._check_is_governor() -> void: + block@0: // L271 + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "governor") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (== tmp%0#0 app_global_get_ex_value%1#0) + (assert tmp%3#0) // Only the account set in global_state.governor may call this method + return + + subroutine examples.amm.contract.ConstantProductAMM.bootstrap(seed: uint64, a_asset: uint64, b_asset: uint64) -> bytes: + block@0: // L58 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // application has already been bootstrapped + examples.amm.contract.ConstantProductAMM._check_is_governor() + let tmp%3#0: uint64 = (global GroupSize) + let tmp%4#0: uint64 = (== tmp%3#0 2u) + (assert tmp%4#0) // group size not 2 + let tmp%5#0: bytes = ((gtxns Receiver) seed#0) + let tmp%6#0: bytes = (global CurrentApplicationAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // receiver not app address + let tmp%8#0: uint64 = ((gtxns Amount) seed#0) + let tmp%9#0: uint64 = (>= tmp%8#0 300000u) + (assert tmp%9#0) // amount minimum not met + let tmp%10#0: uint64 = (< a_asset#0 b_asset#0) + (assert tmp%10#0) // asset a must be less than asset b + (app_global_put "asset_a" a_asset#0) + (app_global_put "asset_b" b_asset#0) + let new_state_value%11#0: uint64 = examples.amm.contract.ConstantProductAMM._create_pool_token() + (app_global_put "pool_token" new_state_value%11#0) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%12#0) + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + examples.amm.contract.ConstantProductAMM._do_opt_in(app_global_get_ex_value%14#0) + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let val_as_bytes%18#0: bytes = (itob app_global_get_ex_value%16#0) + return val_as_bytes%18#0 + + subroutine examples.amm.contract.ConstantProductAMM._create_pool_token() -> uint64: + block@0: // L277 + itxn_begin + ((itxn_field TypeEnum) acfg) + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%3#0) // check value exists + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%2#0) + (assert maybe_value_did_exist%1#0) // asset exists + let tmp%4#0: bytes = (concat "DPT-" maybe_value%0#0) + let tmp%5#0: bytes = (concat tmp%4#0 "-") + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let (maybe_value%6#0: bytes, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetUnitName) app_global_get_ex_value%8#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%10#0: bytes = (concat tmp%5#0 maybe_value%6#0) + ((itxn_field ConfigAssetName) tmp%10#0) + ((itxn_field ConfigAssetUnitName) "dpt") + ((itxn_field ConfigAssetTotal) 10000000000u) + ((itxn_field ConfigAssetDecimals) 3u) + let tmp%11#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetManager) tmp%11#0) + let tmp%12#0: bytes = (global CurrentApplicationAddress) + ((itxn_field ConfigAssetReserve) tmp%12#0) + ((itxn_field Fee) 0u) + itxn_submit + let tmp%13#0: uint64 = (itxn CreatedAssetID) + return tmp%13#0 + + subroutine examples.amm.contract.ConstantProductAMM._do_opt_in(asset: uint64) -> void: + block@0: // L294 + let tmp%0#0: bytes = (global CurrentApplicationAddress) + examples.amm.contract.do_asset_transfer(tmp%0#0, asset#0, 0u) + return + + subroutine examples.amm.contract.do_asset_transfer(receiver: bytes, asset: uint64, amount: uint64) -> void: + block@0: // L367 + itxn_begin + ((itxn_field TypeEnum) axfer) + ((itxn_field XferAsset) asset#0) + ((itxn_field AssetAmount) amount#0) + ((itxn_field AssetReceiver) receiver#0) + ((itxn_field Fee) 0u) + itxn_submit + return + + subroutine examples.amm.contract.ConstantProductAMM.mint(a_xfer: uint64, b_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L96 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns Sender) a_xfer#0) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // sender invalid + let tmp%12#0: bytes = ((gtxns Sender) b_xfer#0) + let tmp%13#0: bytes = (txn Sender) + let tmp%14#0: uint64 = (== tmp%12#0 tmp%13#0) + (assert tmp%14#0) // sender invalid + let tmp%15#0: bytes = ((gtxns AssetReceiver) a_xfer#0) + let tmp%16#0: bytes = (global CurrentApplicationAddress) + let tmp%17#0: uint64 = (== tmp%15#0 tmp%16#0) + (assert tmp%17#0) // receiver not app address + let tmp%18#0: uint64 = ((gtxns XferAsset) a_xfer#0) + let (app_global_get_ex_value%19#0: uint64, app_global_get_ex_did_exist%20#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%20#0) // check value exists + let tmp%21#0: uint64 = (== tmp%18#0 app_global_get_ex_value%19#0) + (assert tmp%21#0) // asset a incorrect + let tmp%22#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%23#0: uint64 = (> tmp%22#0 0u) + (assert tmp%23#0) // amount minimum not met + let tmp%24#0: bytes = ((gtxns AssetReceiver) b_xfer#0) + let tmp%25#0: bytes = (global CurrentApplicationAddress) + let tmp%26#0: uint64 = (== tmp%24#0 tmp%25#0) + (assert tmp%26#0) // receiver not app address + let tmp%27#0: uint64 = ((gtxns XferAsset) b_xfer#0) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%29#0) // check value exists + let tmp%30#0: uint64 = (== tmp%27#0 app_global_get_ex_value%28#0) + (assert tmp%30#0) // asset b incorrect + let tmp%31#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let tmp%32#0: uint64 = (> tmp%31#0 0u) + (assert tmp%32#0) // amount minimum not met + let tmp%33#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%34#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%35#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%36#0: uint64 = ((gtxns AssetAmount) a_xfer#0) + let tmp%37#0: uint64 = ((gtxns AssetAmount) b_xfer#0) + let to_mint#0: uint64 = examples.amm.contract.tokens_to_mint(tmp%33#0, tmp%34#0, tmp%35#0, tmp%36#0, tmp%37#0) + let tmp%38#0: uint64 = (> to_mint#0 0u) + (assert tmp%38#0) // send amount too low + let tmp%39#0: bytes = (txn Sender) + let (app_global_get_ex_value%40#0: uint64, app_global_get_ex_did_exist%41#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%41#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%39#0, app_global_get_ex_value%40#0, to_mint#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.ConstantProductAMM._check_bootstrapped() -> void: + block@0: // L260 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + (assert app_global_get_ex_value%0#0) // bootstrap method needs to be called first + return + + subroutine examples.amm.contract.ConstantProductAMM._current_pool_balance() -> uint64: + block@0: // L302 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_a_balance() -> uint64: + block@0: // L306 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.ConstantProductAMM._current_b_balance() -> uint64: + block@0: // L310 + let tmp%2#0: bytes = (global CurrentApplicationAddress) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let (maybe_value%0#0: uint64, maybe_value_did_exist%1#0: uint64) = ((asset_holding_get AssetBalance) tmp%2#0 app_global_get_ex_value%3#0) + (assert maybe_value_did_exist%1#0) // account opted into asset + return maybe_value%0#0 + + subroutine examples.amm.contract.tokens_to_mint(pool_balance: uint64, a_balance: uint64, b_balance: uint64, a_amount: uint64, b_amount: uint64) -> uint64: + block@0: // L333 + let tmp%0#0: uint64 = (== a_balance#0 a_amount#0) + goto tmp%0#0 ? block@1 : block@3 + block@1: // and_contd_L341 + let tmp%1#0: uint64 = (== b_balance#0 b_amount#0) + goto tmp%1#0 ? block@2 : block@3 + block@2: // bool_true_L341 + let and_result%2#0: uint64 = 1u + goto block@4 + block@3: // bool_false_L341 + let and_result%2#1: uint64 = 0u + goto block@4 + block@4: // bool_merge_L341 + let is_initial_mint#0: uint64 = φ(and_result%2#0 <- block@2, and_result%2#1 <- block@3) + goto is_initial_mint#0 ? block@5 : block@6 + block@5: // if_body_L342 + let tmp%3#0: uint64 = (* a_amount#0 b_amount#0) + let tmp%4#0: uint64 = (sqrt tmp%3#0) + let tmp%5#0: uint64 = (- tmp%4#0 1000u) + return tmp%5#0 + block@6: // after_if_else_L342 + let issued#0: uint64 = (- 10000000000u pool_balance#0) + let tmp%6#0: uint64 = (* 1000u a_amount#0) + let tmp%7#0: uint64 = (- a_balance#0 a_amount#0) + let a_ratio#0: uint64 = (/ tmp%6#0 tmp%7#0) + let tmp%8#0: uint64 = (* 1000u b_amount#0) + let tmp%9#0: uint64 = (- b_balance#0 b_amount#0) + let b_ratio#0: uint64 = (/ tmp%8#0 tmp%9#0) + let tmp%10#0: uint64 = (< a_ratio#0 b_ratio#0) + goto tmp%10#0 ? block@7 : block@8 + block@7: // if_body_L347 + let tmp%11#0: uint64 = (* a_ratio#0 issued#0) + let tmp%12#0: uint64 = (/ tmp%11#0 1000u) + return tmp%12#0 + block@8: // else_body_L347 + let tmp%13#0: uint64 = (* b_ratio#0 issued#0) + let tmp%14#0: uint64 = (/ tmp%13#0 1000u) + return tmp%14#0 + + subroutine examples.amm.contract.ConstantProductAMM._update_ratio() -> void: + block@0: // L264 + let a_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let b_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%0#0: uint64 = (* a_balance#0 1000u) + let new_state_value%1#0: uint64 = (/ tmp%0#0 b_balance#0) + (app_global_put "ratio" new_state_value%1#0) + return + + subroutine examples.amm.contract.ConstantProductAMM.burn(pool_xfer: uint64, pool_asset: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L162 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== pool_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset pool incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== a_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset a incorrect + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + let tmp%8#0: uint64 = (== b_asset#0 app_global_get_ex_value%6#0) + (assert tmp%8#0) // asset b incorrect + let tmp%9#0: bytes = ((gtxns AssetReceiver) pool_xfer#0) + let tmp%10#0: bytes = (global CurrentApplicationAddress) + let tmp%11#0: uint64 = (== tmp%9#0 tmp%10#0) + (assert tmp%11#0) // receiver not app address + let tmp%12#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let tmp%13#0: uint64 = (> tmp%12#0 0u) + (assert tmp%13#0) // amount minimum not met + let tmp%14#0: uint64 = ((gtxns XferAsset) pool_xfer#0) + let (app_global_get_ex_value%15#0: uint64, app_global_get_ex_did_exist%16#0: uint64) = (app_global_get_ex 0u "pool_token") + (assert app_global_get_ex_did_exist%16#0) // check value exists + let tmp%17#0: uint64 = (== tmp%14#0 app_global_get_ex_value%15#0) + (assert tmp%17#0) // asset pool incorrect + let tmp%18#0: bytes = ((gtxns Sender) pool_xfer#0) + let tmp%19#0: bytes = (txn Sender) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // sender invalid + let pool_balance#0: uint64 = examples.amm.contract.ConstantProductAMM._current_pool_balance() + let tmp%21#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let tmp%22#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let a_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%21#0, tmp%22#0) + let tmp%23#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let tmp%24#0: uint64 = ((gtxns AssetAmount) pool_xfer#0) + let b_amt#0: uint64 = examples.amm.contract.tokens_to_burn(pool_balance#0, tmp%23#0, tmp%24#0) + let tmp%25#0: bytes = (txn Sender) + let (app_global_get_ex_value%26#0: uint64, app_global_get_ex_did_exist%27#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%27#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%25#0, app_global_get_ex_value%26#0, a_amt#0) + let tmp%28#0: bytes = (txn Sender) + let (app_global_get_ex_value%29#0: uint64, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%30#0) // check value exists + examples.amm.contract.do_asset_transfer(tmp%28#0, app_global_get_ex_value%29#0, b_amt#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_burn(pool_balance: uint64, supply: uint64, amount: uint64) -> uint64: + block@0: // L354 + let tmp%0#0: uint64 = (- 10000000000u pool_balance#0) + let issued#0: uint64 = (- tmp%0#0 amount#0) + let tmp%1#0: uint64 = (* supply#0 amount#0) + let tmp%2#0: uint64 = (/ tmp%1#0 issued#0) + return tmp%2#0 + + subroutine examples.amm.contract.ConstantProductAMM.swap(swap_xfer: uint64, a_asset: uint64, b_asset: uint64) -> void: + block@0: // L218 + examples.amm.contract.ConstantProductAMM._check_bootstrapped() + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== a_asset#0 app_global_get_ex_value%0#0) + (assert tmp%2#0) // asset a incorrect + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (== b_asset#0 app_global_get_ex_value%3#0) + (assert tmp%5#0) // asset b incorrect + let tmp%6#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let tmp%7#0: uint64 = (> tmp%6#0 0u) + (assert tmp%7#0) // amount minimum not met + let tmp%8#0: bytes = ((gtxns Sender) swap_xfer#0) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: uint64 = (== tmp%8#0 tmp%9#0) + (assert tmp%10#0) // sender invalid + let (app_global_get_ex_value%11#0: uint64, app_global_get_ex_did_exist%12#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%12#0) // check value exists + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let awst_tmp%15#0: uint64 = ((gtxns XferAsset) swap_xfer#0) + switch awst_tmp%15#0 {app_global_get_ex_value%11#0 => block@1, app_global_get_ex_value%13#0 => block@2, * => block@3} + block@1: // switch_case_0_L241 + let in_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let out_supply#0: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let (out_asset#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "asset_a") + (assert app_global_get_ex_did_exist%17#0) // check value exists + goto block@4 + block@2: // switch_case_1_L245 + let in_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_a_balance() + let out_supply#1: uint64 = examples.amm.contract.ConstantProductAMM._current_b_balance() + let (out_asset#1: uint64, app_global_get_ex_did_exist%19#0: uint64) = (app_global_get_ex 0u "asset_b") + (assert app_global_get_ex_did_exist%19#0) // check value exists + goto block@4 + block@3: // switch_case_default_L239 + fail // asset id incorrect + block@4: // switch_case_next_L239 + let in_supply#2: uint64 = φ(in_supply#0 <- block@1, in_supply#1 <- block@2) + let out_supply#2: uint64 = φ(out_supply#0 <- block@1, out_supply#1 <- block@2) + let out_asset#2: uint64 = φ(out_asset#0 <- block@1, out_asset#1 <- block@2) + let tmp%20#0: uint64 = ((gtxns AssetAmount) swap_xfer#0) + let to_swap#0: uint64 = examples.amm.contract.tokens_to_swap(tmp%20#0, in_supply#2, out_supply#2) + let tmp%21#0: uint64 = (> to_swap#0 0u) + (assert tmp%21#0) // send amount too low + let tmp%22#0: bytes = (txn Sender) + examples.amm.contract.do_asset_transfer(tmp%22#0, out_asset#2, to_swap#0) + examples.amm.contract.ConstantProductAMM._update_ratio() + return + + subroutine examples.amm.contract.tokens_to_swap(in_amount: uint64, in_supply: uint64, out_supply: uint64) -> uint64: + block@0: // L360 + let tmp%0#0: uint64 = (- in_supply#0 in_amount#0) + let tmp%1#0: uint64 = (* 1000u tmp%0#0) + let tmp%2#0: uint64 = (* in_amount#0 995u) + let in_total#0: uint64 = (+ tmp%1#0 tmp%2#0) + let tmp%3#0: uint64 = (* in_amount#0 995u) + let out_total#0: uint64 = (* tmp%3#0 out_supply#0) + let tmp%4#0: uint64 = (/ out_total#0 in_total#0) + return tmp%4#0 + + subroutine examples.amm.contract.ConstantProductAMM.create() -> void: + block@0: // L48 + return + + subroutine examples.amm.contract.ConstantProductAMM.__init__() -> void: + block@0: // L32 + (app_global_put "asset_a" 0u) + (app_global_put "asset_b" 0u) + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "governor" new_state_value%0#0) + (app_global_put "pool_token" 0u) + (app_global_put "ratio" 0u) + return + + program clear-state: + subroutine examples.amm.contract.ConstantProductAMM.clear_state_program() -> uint64: + block@0: // L31 + return 1u \ No newline at end of file diff --git a/examples/application/algopy.log b/examples/application/algopy.log new file mode 100644 index 0000000000..189ec15c17 --- /dev/null +++ b/examples/application/algopy.log @@ -0,0 +1,214 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug application +debug: Building AWST for __init__.py +debug: Building AWST for application +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for application/contract.py +debug: Sealing block@0: // L38 +debug: Terminated block@0: // L38 +debug: Sealing block@0: // L14 +debug: Terminated block@0: // L14 +debug: Sealing block@0: // L26 +debug: Terminated block@0: // L26 +debug: Sealing block@None: // on_create_L14 +debug: Terminated block@1: // on_create_L14 +debug: Sealing block@2: // entrypoint_L14 +debug: Terminated block@2: // entrypoint_L14 +debug: Sealing block@None: // if_body_L27 +debug: Sealing block@None: // else_body_L27 +debug: Terminated block@3: // if_body_L27 +debug: Sealing block@None: // if_body_L28 +debug: Sealing block@None: // else_body_L28 +debug: Terminated block@4: // if_body_L28 +debug: Terminated block@5: // else_body_L28 +debug: Sealing block@6: // after_if_else_L28 +debug: Terminated block@6: // after_if_else_L28 +debug: Sealing block@7: // after_if_else_L27 +debug: Terminated block@7: // after_if_else_L27 +debug: Sealing block@0: // L34 +debug: Terminated block@0: // L34 +debug: Output IR to /examples/application/out/contract_Reference.ssa.ir +info: Optimizing examples.application.contract.Reference at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.application.contract.Reference.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@6: // after_if_else_L28 with block@4: // if_body_L28 in block@7: // after_if_else_L27 +debug: Merged linear block@6: // after_if_else_L28 into block@4: // if_body_L28 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.application.contract.Reference.validate_asset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.application.contract.Reference.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.application.contract.Reference.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/application/out/contract_Reference.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.application.contract.Reference.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.application.contract.Reference.validate_asset +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.application.contract.Reference.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.application.contract.Reference.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 2, ending loop +debug: Output IR to /examples/application/out/contract_Reference.cssa.ir +debug: Removing Phis from examples.application.contract.Reference.approval_program +debug: Removing Phis from examples.application.contract.Reference.validate_asset +debug: Removing Phis from examples.application.contract.Reference.__init__ +debug: Removing Phis from examples.application.contract.Reference.clear_state_program +debug: Output IR to /examples/application/out/contract_Reference.post_ssa.ir +debug: Sequentializing parallel copies in examples.application.contract.Reference.approval_program +debug: Sequentializing parallel copies in examples.application.contract.Reference.validate_asset +debug: Sequentializing parallel copies in examples.application.contract.Reference.__init__ +debug: Sequentializing parallel copies in examples.application.contract.Reference.clear_state_program +debug: Output IR to /examples/application/out/contract_Reference.parallel_copies.ir +debug: Coalescing local variables in examples.application.contract.Reference.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.application.contract.Reference.validate_asset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.application.contract.Reference.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.application.contract.Reference.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/application/out/contract_Reference.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[6]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[8]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_if_body@3.ops[1]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_if_body@3.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_if_body@3.ops[6]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_if_body@3.ops[8]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_if_body@4.ops[1]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_if_body@4.ops[3]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Found 3 edge set/s for examples.application.contract.Reference.approval_program +debug: Inserted validate_asset_block@0.ops[11]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[13]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[24]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[26]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[37]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[39]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[50]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[52]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[63]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[65]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[75]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[77]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[87]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[89]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[96]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[98]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[111]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[113]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[2]: 'store maybe_value_did_exist%1#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[5]: 'load maybe_value_did_exist%1#0' with 'load maybe_value_did_exist%1#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[8]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[11]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[19]: 'store maybe_value_did_exist%5#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[22]: 'load maybe_value_did_exist%5#0' with 'load maybe_value_did_exist%5#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[33]: 'store maybe_value_did_exist%8#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[36]: 'load maybe_value_did_exist%8#0' with 'load maybe_value_did_exist%8#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[47]: 'store maybe_value_did_exist%11#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[50]: 'load maybe_value_did_exist%11#0' with 'load maybe_value_did_exist%11#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[61]: 'store maybe_value_did_exist%14#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[64]: 'load maybe_value_did_exist%14#0' with 'load maybe_value_did_exist%14#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[75]: 'store maybe_value_did_exist%17#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[78]: 'load maybe_value_did_exist%17#0' with 'load maybe_value_did_exist%17#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[88]: 'store maybe_value_did_exist%20#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[91]: 'load maybe_value_did_exist%20#0' with 'load maybe_value_did_exist%20#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[100]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[103]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[111]: 'store maybe_value_did_exist%25#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[114]: 'load maybe_value_did_exist%25#0' with 'load maybe_value_did_exist%25#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[117]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[120]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[21]: 'store maybe_value%4#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[25]: 'load maybe_value%4#0' with 'load maybe_value%4#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[36]: 'store maybe_value%7#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[40]: 'load maybe_value%7#0' with 'load maybe_value%7#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[51]: 'store maybe_value%10#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[55]: 'load maybe_value%10#0' with 'load maybe_value%10#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[66]: 'store maybe_value%13#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[70]: 'load maybe_value%13#0' with 'load maybe_value%13#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[81]: 'store maybe_value%16#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[85]: 'load maybe_value%16#0' with 'load maybe_value%16#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[95]: 'store maybe_value%19#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[99]: 'load maybe_value%19#0' with 'load maybe_value%19#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[4]: 'store maybe_value%0#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[11]: 'load maybe_value%0#0' with 'load maybe_value%0#0 from l-stack (no copy)' +debug: Inserted validate_asset_block@0.ops[120]: 'store maybe_value%24#0 to l-stack (copy)' +debug: Replaced validate_asset_block@0.ops[127]: 'load maybe_value%24#0' with 'load maybe_value%24#0 from l-stack (no copy)' +info: Writing application/out/contract.approval.teal +info: Writing application/out/contract.approval.debug.teal +info: Writing application/out/contract.clear.teal +info: Writing application/out/contract.clear.debug.teal +>> exit code = 0 \ No newline at end of file diff --git a/examples/application/contract.py b/examples/application/contract.py new file mode 100644 index 0000000000..c38bf45ace --- /dev/null +++ b/examples/application/contract.py @@ -0,0 +1,51 @@ +from algopy import ( + Application, + Bytes, + Contract, + Global, + Local, + Transaction, + UInt64, + subroutine, +) + + +class Reference(Contract): + def __init__(self) -> None: + self.int_1 = UInt64(0) + self.bytes_1 = Bytes(b"") + self.bytes_2 = Bytes(b"") + self.int_l1 = Local(UInt64) + self.int_l2 = Local(UInt64) + self.int_l3 = Local(UInt64) + self.bytes_l1 = Local(Bytes) + self.bytes_l2 = Local(Bytes) + self.bytes_l3 = Local(Bytes) + self.bytes_l4 = Local(Bytes) + + def approval_program(self) -> bool: + if Transaction.num_app_args() == 1: + if Transaction.application_args(0) == b"validate": + self.validate_asset(Application(Global.current_application_id())) + else: + assert False, "Expected validate" + return True + + def clear_state_program(self) -> bool: + return True + + @subroutine + def validate_asset(self, app: Application) -> None: + assert app.creator == 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.local_num_uint == 3, "expected local_num_uint" + assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" + assert app.approval_program, "expected approval_program" + assert app.clear_state_program, "expected clear_state_program" + assert ( + app.application_id == Global.current_application_id() + ), "expected current_application_id" + assert ( + app.address == Global.current_application_address() + ), "expected current_application_address" diff --git a/examples/application/out/contract.approval.debug.teal b/examples/application/out/contract.approval.debug.teal new file mode 100644 index 0000000000..af1b6ea084 --- /dev/null +++ b/examples/application/out/contract.approval.debug.teal @@ -0,0 +1,115 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.application.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} Transaction.num_app_args() File "application/contract.py", line 27 + int 1 // tmp%1#0,1 1 File "application/contract.py", line 27 + == // {==} Transaction.num_app_args() == 1: File "application/contract.py", line 27 + bz main_after_if_else@7 // if Transaction.num_app_args() == 1: File "application/contract.py", line 27 + // Implicit fall through to main_if_body@3 // if Transaction.num_app_args() == 1: File "application/contract.py", line 27 + +main_if_body@3: + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "application/contract.py", line 28 + byte "validate" // tmp%3#0,"validate" b"validate" File "application/contract.py", line 28 + == // {==} Transaction.application_args(0) == b"validate": File "application/contract.py", line 28 + bz main_else_body@5 // if Transaction.application_args(0) == b"validate": File "application/contract.py", line 28 + // Implicit fall through to main_if_body@4 // if Transaction.application_args(0) == b"validate": File "application/contract.py", line 28 + +main_if_body@4: + global CurrentApplicationID // {global} Global.current_application_id() File "application/contract.py", line 29 + callsub validate_asset // self.validate_asset(Application(Global.current_application_id())) File "application/contract.py", line 29 + b main_after_if_else@7 // + +main_else_body@5: + err // Expected validate // assert False, "Expected validate" File "application/contract.py", line 31 + +main_after_if_else@7: + int 1 // 1 True File "application/contract.py", line 32 + return // return True File "application/contract.py", line 32 + + +// examples.application.contract.Reference.validate_asset(app#0: uint64) -> void: +validate_asset: + proto 1 0 // (𝕡) app#0 | def validate_asset(self, app: Application) -> None: File "application/contract.py", line 38 + +validate_asset_block@0: + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppCreator // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.creator File "application/contract.py", line 39 + assert // application exists // (𝕡) app#0 | maybe_value%0#0 app.creator File "application/contract.py", line 39 + global CreatorAddress // (𝕡) app#0 | maybe_value%0#0,{global} Global.creator_address() File "application/contract.py", line 39 + == // (𝕡) app#0 | {==} app.creator == Global.creator_address(), "expected creator" File "application/contract.py", line 39 + assert // expected creator // (𝕡) app#0 | assert app.creator == Global.creator_address(), "expected creator" File "application/contract.py", line 39 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppGlobalNumUint // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.global_num_uint File "application/contract.py", line 40 + assert // application exists // (𝕡) app#0 | maybe_value%4#0 app.global_num_uint File "application/contract.py", line 40 + int 1 // (𝕡) app#0 | maybe_value%4#0,1 1 File "application/contract.py", line 40 + == // (𝕡) app#0 | {==} app.global_num_uint == 1, "expected global_num_uint" File "application/contract.py", line 40 + assert // expected global_num_uint // (𝕡) app#0 | assert app.global_num_uint == 1, "expected global_num_uint" File "application/contract.py", line 40 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppGlobalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.global_num_byte_slice File "application/contract.py", line 41 + assert // application exists // (𝕡) app#0 | maybe_value%7#0 app.global_num_byte_slice File "application/contract.py", line 41 + int 2 // (𝕡) app#0 | maybe_value%7#0,2 2 File "application/contract.py", line 41 + == // (𝕡) app#0 | {==} app.global_num_byte_slice == 2, "expected global_num_byte_slice" File "application/contract.py", line 41 + assert // expected global_num_byte_slice // (𝕡) app#0 | assert app.global_num_byte_slice == 2, "expected global_num_byte_slice" File "application/contract.py", line 41 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppLocalNumUint // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.local_num_uint File "application/contract.py", line 42 + assert // application exists // (𝕡) app#0 | maybe_value%10#0 app.local_num_uint File "application/contract.py", line 42 + int 3 // (𝕡) app#0 | maybe_value%10#0,3 3 File "application/contract.py", line 42 + == // (𝕡) app#0 | {==} app.local_num_uint == 3, "expected local_num_uint" File "application/contract.py", line 42 + assert // expected local_num_uint // (𝕡) app#0 | assert app.local_num_uint == 3, "expected local_num_uint" File "application/contract.py", line 42 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppLocalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.local_num_byte_slice File "application/contract.py", line 43 + assert // application exists // (𝕡) app#0 | maybe_value%13#0 app.local_num_byte_slice File "application/contract.py", line 43 + int 4 // (𝕡) app#0 | maybe_value%13#0,4 4 File "application/contract.py", line 43 + == // (𝕡) app#0 | {==} app.local_num_byte_slice == 4, "expected local_num_byte_slice" File "application/contract.py", line 43 + assert // expected local_num_byte_slice // (𝕡) app#0 | assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" File "application/contract.py", line 43 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppApprovalProgram // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.approval_program File "application/contract.py", line 44 + assert // application exists // (𝕡) app#0 | maybe_value%16#0 app.approval_program File "application/contract.py", line 44 + len // (𝕡) app#0 | {len} app.approval_program File "application/contract.py", line 44 + assert // expected approval_program // (𝕡) app#0 | assert app.approval_program, "expected approval_program" File "application/contract.py", line 44 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppClearStateProgram // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.clear_state_program File "application/contract.py", line 45 + assert // application exists // (𝕡) app#0 | maybe_value%19#0 app.clear_state_program File "application/contract.py", line 45 + len // (𝕡) app#0 | {len} app.clear_state_program File "application/contract.py", line 45 + assert // expected clear_state_program // (𝕡) app#0 | assert app.clear_state_program, "expected clear_state_program" File "application/contract.py", line 45 + global CurrentApplicationID // (𝕡) app#0 | {global} Global.current_application_id() File "application/contract.py", line 47 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | tmp%22#0,app#0 app: Application File "application/contract.py", line 38 + == // (𝕡) app#0 | {==} app.application_id == Global.current_application_id() File "application/contract.py", line 47 + assert // expected current_application_id // (𝕡) app#0 | assert ( File "application/contract.py", line 46 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppAddress // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.address File "application/contract.py", line 50 + assert // application exists // (𝕡) app#0 | maybe_value%24#0 app.address File "application/contract.py", line 50 + global CurrentApplicationAddress // (𝕡) app#0 | maybe_value%24#0,{global} Global.current_application_address() File "application/contract.py", line 50 + == // (𝕡) app#0 | {==} app.address == Global.current_application_address() File "application/contract.py", line 50 + assert // expected current_application_address // (𝕡) app#0 | assert ( File "application/contract.py", line 49 + retsub // + + +// examples.application.contract.Reference.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "application/contract.py", line 14 + +__init___block@0: + byte "int_1" // "int_1" self.int_1 File "application/contract.py", line 15 + int 0 // "int_1",0 0 File "application/contract.py", line 15 + app_global_put // self.int_1 = UInt64(0) File "application/contract.py", line 15 + byte "bytes_1" // "bytes_1" self.bytes_1 File "application/contract.py", line 16 + byte "" // "bytes_1","" b"" File "application/contract.py", line 16 + app_global_put // self.bytes_1 = Bytes(b"") File "application/contract.py", line 16 + byte "bytes_2" // "bytes_2" self.bytes_2 File "application/contract.py", line 17 + byte "" // "bytes_2","" b"" File "application/contract.py", line 17 + app_global_put // self.bytes_2 = Bytes(b"") File "application/contract.py", line 17 + retsub // + diff --git a/examples/application/out/contract.approval.teal b/examples/application/out/contract.approval.teal new file mode 100644 index 0000000000..41be86bb42 --- /dev/null +++ b/examples/application/out/contract.approval.teal @@ -0,0 +1,109 @@ +#pragma version 8 + +// examples.application.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + int 1 + == + bz main_after_if_else@7 + +main_if_body@3: + txna ApplicationArgs 0 + byte "validate" + == + bz main_else_body@5 + +main_if_body@4: + global CurrentApplicationID + callsub validate_asset + b main_after_if_else@7 + +main_else_body@5: + err // Expected validate + +main_after_if_else@7: + int 1 + return + + +// examples.application.contract.Reference.validate_asset(app#0: uint64) -> void: +validate_asset: + proto 1 0 + +validate_asset_block@0: + frame_dig -1 + app_params_get AppCreator + assert // application exists + global CreatorAddress + == + assert // expected creator + frame_dig -1 + app_params_get AppGlobalNumUint + assert // application exists + int 1 + == + assert // expected global_num_uint + frame_dig -1 + app_params_get AppGlobalNumByteSlice + assert // application exists + int 2 + == + assert // expected global_num_byte_slice + frame_dig -1 + app_params_get AppLocalNumUint + assert // application exists + int 3 + == + assert // expected local_num_uint + frame_dig -1 + app_params_get AppLocalNumByteSlice + assert // application exists + int 4 + == + assert // expected local_num_byte_slice + frame_dig -1 + app_params_get AppApprovalProgram + assert // application exists + len + assert // expected approval_program + frame_dig -1 + app_params_get AppClearStateProgram + assert // application exists + len + assert // expected clear_state_program + global CurrentApplicationID + frame_dig -1 + == + assert // expected current_application_id + frame_dig -1 + app_params_get AppAddress + assert // application exists + global CurrentApplicationAddress + == + assert // expected current_application_address + retsub + + +// examples.application.contract.Reference.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "int_1" + int 0 + app_global_put + byte "bytes_1" + byte "" + app_global_put + byte "bytes_2" + byte "" + app_global_put + retsub + diff --git a/examples/application/out/contract.approval_unoptimized.debug.teal b/examples/application/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..47b96be939 --- /dev/null +++ b/examples/application/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,118 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.application.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} Transaction.num_app_args() File "application/contract.py", line 27 + int 1 // tmp%1#0,1 1 File "application/contract.py", line 27 + == // {==} Transaction.num_app_args() == 1: File "application/contract.py", line 27 + bz main_after_if_else@7 // if Transaction.num_app_args() == 1: File "application/contract.py", line 27 + // Implicit fall through to main_if_body@3 // if Transaction.num_app_args() == 1: File "application/contract.py", line 27 + +main_if_body@3: + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "application/contract.py", line 28 + byte "validate" // tmp%3#0,"validate" b"validate" File "application/contract.py", line 28 + == // {==} Transaction.application_args(0) == b"validate": File "application/contract.py", line 28 + bz main_else_body@5 // if Transaction.application_args(0) == b"validate": File "application/contract.py", line 28 + // Implicit fall through to main_if_body@4 // if Transaction.application_args(0) == b"validate": File "application/contract.py", line 28 + +main_if_body@4: + global CurrentApplicationID // {global} Global.current_application_id() File "application/contract.py", line 29 + callsub validate_asset // self.validate_asset(Application(Global.current_application_id())) File "application/contract.py", line 29 + b main_after_if_else@6 // + +main_else_body@5: + err // Expected validate // assert False, "Expected validate" File "application/contract.py", line 31 + +main_after_if_else@6: + // Implicit fall through to main_after_if_else@7 // + +main_after_if_else@7: + int 1 // 1 True File "application/contract.py", line 32 + return // return True File "application/contract.py", line 32 + + +// examples.application.contract.Reference.validate_asset(app#0: uint64) -> void: +validate_asset: + proto 1 0 // (𝕡) app#0 | def validate_asset(self, app: Application) -> None: File "application/contract.py", line 38 + +validate_asset_block@0: + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppCreator // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.creator File "application/contract.py", line 39 + assert // application exists // (𝕡) app#0 | maybe_value%0#0 app.creator File "application/contract.py", line 39 + global CreatorAddress // (𝕡) app#0 | maybe_value%0#0,{global} Global.creator_address() File "application/contract.py", line 39 + == // (𝕡) app#0 | {==} app.creator == Global.creator_address(), "expected creator" File "application/contract.py", line 39 + assert // expected creator // (𝕡) app#0 | assert app.creator == Global.creator_address(), "expected creator" File "application/contract.py", line 39 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppGlobalNumUint // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.global_num_uint File "application/contract.py", line 40 + assert // application exists // (𝕡) app#0 | maybe_value%4#0 app.global_num_uint File "application/contract.py", line 40 + int 1 // (𝕡) app#0 | maybe_value%4#0,1 1 File "application/contract.py", line 40 + == // (𝕡) app#0 | {==} app.global_num_uint == 1, "expected global_num_uint" File "application/contract.py", line 40 + assert // expected global_num_uint // (𝕡) app#0 | assert app.global_num_uint == 1, "expected global_num_uint" File "application/contract.py", line 40 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppGlobalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.global_num_byte_slice File "application/contract.py", line 41 + assert // application exists // (𝕡) app#0 | maybe_value%7#0 app.global_num_byte_slice File "application/contract.py", line 41 + int 2 // (𝕡) app#0 | maybe_value%7#0,2 2 File "application/contract.py", line 41 + == // (𝕡) app#0 | {==} app.global_num_byte_slice == 2, "expected global_num_byte_slice" File "application/contract.py", line 41 + assert // expected global_num_byte_slice // (𝕡) app#0 | assert app.global_num_byte_slice == 2, "expected global_num_byte_slice" File "application/contract.py", line 41 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppLocalNumUint // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.local_num_uint File "application/contract.py", line 42 + assert // application exists // (𝕡) app#0 | maybe_value%10#0 app.local_num_uint File "application/contract.py", line 42 + int 3 // (𝕡) app#0 | maybe_value%10#0,3 3 File "application/contract.py", line 42 + == // (𝕡) app#0 | {==} app.local_num_uint == 3, "expected local_num_uint" File "application/contract.py", line 42 + assert // expected local_num_uint // (𝕡) app#0 | assert app.local_num_uint == 3, "expected local_num_uint" File "application/contract.py", line 42 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppLocalNumByteSlice // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.local_num_byte_slice File "application/contract.py", line 43 + assert // application exists // (𝕡) app#0 | maybe_value%13#0 app.local_num_byte_slice File "application/contract.py", line 43 + int 4 // (𝕡) app#0 | maybe_value%13#0,4 4 File "application/contract.py", line 43 + == // (𝕡) app#0 | {==} app.local_num_byte_slice == 4, "expected local_num_byte_slice" File "application/contract.py", line 43 + assert // expected local_num_byte_slice // (𝕡) app#0 | assert app.local_num_byte_slice == 4, "expected local_num_byte_slice" File "application/contract.py", line 43 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppApprovalProgram // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.approval_program File "application/contract.py", line 44 + assert // application exists // (𝕡) app#0 | maybe_value%16#0 app.approval_program File "application/contract.py", line 44 + len // (𝕡) app#0 | {len} app.approval_program File "application/contract.py", line 44 + assert // expected approval_program // (𝕡) app#0 | assert app.approval_program, "expected approval_program" File "application/contract.py", line 44 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppClearStateProgram // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.clear_state_program File "application/contract.py", line 45 + assert // application exists // (𝕡) app#0 | maybe_value%19#0 app.clear_state_program File "application/contract.py", line 45 + len // (𝕡) app#0 | {len} app.clear_state_program File "application/contract.py", line 45 + assert // expected clear_state_program // (𝕡) app#0 | assert app.clear_state_program, "expected clear_state_program" File "application/contract.py", line 45 + global CurrentApplicationID // (𝕡) app#0 | {global} Global.current_application_id() File "application/contract.py", line 47 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | tmp%22#0,app#0 app: Application File "application/contract.py", line 38 + == // (𝕡) app#0 | {==} app.application_id == Global.current_application_id() File "application/contract.py", line 47 + assert // expected current_application_id // (𝕡) app#0 | assert ( File "application/contract.py", line 46 + frame_dig -1 // load app#0 from parameters (𝕡) app#0 | app#0 app: Application File "application/contract.py", line 38 + app_params_get AppAddress // (𝕡) app#0 | {app_params_get}.0,{app_params_get}.1 app.address File "application/contract.py", line 50 + assert // application exists // (𝕡) app#0 | maybe_value%24#0 app.address File "application/contract.py", line 50 + global CurrentApplicationAddress // (𝕡) app#0 | maybe_value%24#0,{global} Global.current_application_address() File "application/contract.py", line 50 + == // (𝕡) app#0 | {==} app.address == Global.current_application_address() File "application/contract.py", line 50 + assert // expected current_application_address // (𝕡) app#0 | assert ( File "application/contract.py", line 49 + retsub // + + +// examples.application.contract.Reference.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "application/contract.py", line 14 + +__init___block@0: + byte "int_1" // "int_1" self.int_1 File "application/contract.py", line 15 + int 0 // "int_1",0 0 File "application/contract.py", line 15 + app_global_put // self.int_1 = UInt64(0) File "application/contract.py", line 15 + byte "bytes_1" // "bytes_1" self.bytes_1 File "application/contract.py", line 16 + byte "" // "bytes_1","" b"" File "application/contract.py", line 16 + app_global_put // self.bytes_1 = Bytes(b"") File "application/contract.py", line 16 + byte "bytes_2" // "bytes_2" self.bytes_2 File "application/contract.py", line 17 + byte "" // "bytes_2","" b"" File "application/contract.py", line 17 + app_global_put // self.bytes_2 = Bytes(b"") File "application/contract.py", line 17 + retsub // + diff --git a/examples/application/out/contract.approval_unoptimized.teal b/examples/application/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..881eddb8fd --- /dev/null +++ b/examples/application/out/contract.approval_unoptimized.teal @@ -0,0 +1,111 @@ +#pragma version 8 + +// examples.application.contract.Reference.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + int 1 + == + bz main_after_if_else@7 + +main_if_body@3: + txna ApplicationArgs 0 + byte "validate" + == + bz main_else_body@5 + +main_if_body@4: + global CurrentApplicationID + callsub validate_asset + b main_after_if_else@6 + +main_else_body@5: + err // Expected validate + +main_after_if_else@6: + +main_after_if_else@7: + int 1 + return + + +// examples.application.contract.Reference.validate_asset(app#0: uint64) -> void: +validate_asset: + proto 1 0 + +validate_asset_block@0: + frame_dig -1 + app_params_get AppCreator + assert // application exists + global CreatorAddress + == + assert // expected creator + frame_dig -1 + app_params_get AppGlobalNumUint + assert // application exists + int 1 + == + assert // expected global_num_uint + frame_dig -1 + app_params_get AppGlobalNumByteSlice + assert // application exists + int 2 + == + assert // expected global_num_byte_slice + frame_dig -1 + app_params_get AppLocalNumUint + assert // application exists + int 3 + == + assert // expected local_num_uint + frame_dig -1 + app_params_get AppLocalNumByteSlice + assert // application exists + int 4 + == + assert // expected local_num_byte_slice + frame_dig -1 + app_params_get AppApprovalProgram + assert // application exists + len + assert // expected approval_program + frame_dig -1 + app_params_get AppClearStateProgram + assert // application exists + len + assert // expected clear_state_program + global CurrentApplicationID + frame_dig -1 + == + assert // expected current_application_id + frame_dig -1 + app_params_get AppAddress + assert // application exists + global CurrentApplicationAddress + == + assert // expected current_application_address + retsub + + +// examples.application.contract.Reference.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "int_1" + int 0 + app_global_put + byte "bytes_1" + byte "" + app_global_put + byte "bytes_2" + byte "" + app_global_put + retsub + diff --git a/examples/application/out/contract.awst b/examples/application/out/contract.awst new file mode 100644 index 0000000000..038e21b3a3 --- /dev/null +++ b/examples/application/out/contract.awst @@ -0,0 +1,54 @@ +contract Reference +{ + globals { + ['int_1']: algopy.UInt64 + ['bytes_1']: algopy.Bytes + ['bytes_2']: algopy.Bytes + } + locals { + ['int_l1']: algopy.UInt64 + ['int_l2']: algopy.UInt64 + ['int_l3']: algopy.UInt64 + ['bytes_l1']: algopy.Bytes + ['bytes_l2']: algopy.Bytes + ['bytes_l3']: algopy.Bytes + ['bytes_l4']: algopy.Bytes + } + + constructor() + { + this.globals['int_1']: algopy.UInt64 = 0u + this.globals['bytes_1']: algopy.Bytes = '' + this.globals['bytes_2']: algopy.Bytes = '' + } + + approval_program(): bool + { + if (txn() == 1u) { + if (txna() == 'validate') { + this::validate_asset(reinterpret_cast(global())) + } else { + assert(false, comment="Expected validate") + } + } + return true + } + + clear_state_program(): bool + { + return true + } + + subroutine validate_asset(app: algopy.Application): None + { + 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)) == 3u, comment="expected local_num_uint") + assert(checked_maybe(app_params_get(app)) == 4u, comment="expected local_num_byte_slice") + 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(reinterpret_cast(app) == global(), comment="expected current_application_id") + assert(checked_maybe(app_params_get(app)) == global(), comment="expected current_application_address") + } +} \ No newline at end of file diff --git a/examples/application/out/contract.clear.debug.teal b/examples/application/out/contract.clear.debug.teal new file mode 100644 index 0000000000..23d9c8763b --- /dev/null +++ b/examples/application/out/contract.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.application.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "application/contract.py", line 35 + return // return True File "application/contract.py", line 35 + diff --git a/examples/application/out/contract.clear.teal b/examples/application/out/contract.clear.teal new file mode 100644 index 0000000000..af56f4ccdd --- /dev/null +++ b/examples/application/out/contract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.application.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/application/out/contract.clear_unoptimized.debug.teal b/examples/application/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..23d9c8763b --- /dev/null +++ b/examples/application/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.application.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "application/contract.py", line 35 + return // return True File "application/contract.py", line 35 + diff --git a/examples/application/out/contract.clear_unoptimized.teal b/examples/application/out/contract.clear_unoptimized.teal new file mode 100644 index 0000000000..af56f4ccdd --- /dev/null +++ b/examples/application/out/contract.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.application.contract.Reference.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/application/out/contract_Reference.cssa.ir b/examples/application/out/contract_Reference.cssa.ir new file mode 100644 index 0000000000..58881009b8 --- /dev/null +++ b/examples/application/out/contract_Reference.cssa.ir @@ -0,0 +1,78 @@ +contract examples.application.contract.Reference: + program approval: + subroutine examples.application.contract.Reference.approval_program() -> uint64: + block@0: // L26 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L14 + examples.application.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L14 + let tmp%1#0: uint64 = (txn NumAppArgs) + let tmp%2#0: uint64 = (== tmp%1#0 1u) + goto tmp%2#0 ? block@3 : block@7 + block@3: // if_body_L27 + let tmp%3#0: bytes = (txna ApplicationArgs 0) + let tmp%4#0: uint64 = (== tmp%3#0 "validate") + goto tmp%4#0 ? block@4 : block@5 + block@4: // if_body_L28 + let tmp%5#0: uint64 = (global CurrentApplicationID) + examples.application.contract.Reference.validate_asset(tmp%5#0) + goto block@7 + block@5: // else_body_L28 + fail // Expected validate + block@7: // after_if_else_L27 + return 1u + + subroutine examples.application.contract.Reference.validate_asset(app: uint64) -> void: + block@0: // L38 + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((app_params_get AppCreator) app#0) + (assert maybe_value_did_exist%1#0) // application exists + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== maybe_value%0#0 tmp%2#0) + (assert tmp%3#0) // expected creator + let (maybe_value%4#0: uint64, maybe_value_did_exist%5#0: uint64) = ((app_params_get AppGlobalNumUint) app#0) + (assert maybe_value_did_exist%5#0) // application exists + let tmp%6#0: uint64 = (== maybe_value%4#0 1u) + (assert tmp%6#0) // expected global_num_uint + let (maybe_value%7#0: uint64, maybe_value_did_exist%8#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) + (assert maybe_value_did_exist%8#0) // application exists + let tmp%9#0: uint64 = (== maybe_value%7#0 2u) + (assert tmp%9#0) // expected global_num_byte_slice + let (maybe_value%10#0: uint64, maybe_value_did_exist%11#0: uint64) = ((app_params_get AppLocalNumUint) app#0) + (assert maybe_value_did_exist%11#0) // application exists + let tmp%12#0: uint64 = (== maybe_value%10#0 3u) + (assert tmp%12#0) // expected local_num_uint + let (maybe_value%13#0: uint64, maybe_value_did_exist%14#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) + (assert maybe_value_did_exist%14#0) // application exists + let tmp%15#0: uint64 = (== maybe_value%13#0 4u) + (assert tmp%15#0) // expected local_num_byte_slice + let (maybe_value%16#0: bytes, maybe_value_did_exist%17#0: uint64) = ((app_params_get AppApprovalProgram) app#0) + (assert maybe_value_did_exist%17#0) // application exists + let tmp%18#0: uint64 = (len maybe_value%16#0) + (assert tmp%18#0) // expected approval_program + let (maybe_value%19#0: bytes, maybe_value_did_exist%20#0: uint64) = ((app_params_get AppClearStateProgram) app#0) + (assert maybe_value_did_exist%20#0) // application exists + let tmp%21#0: uint64 = (len maybe_value%19#0) + (assert tmp%21#0) // expected clear_state_program + let tmp%22#0: uint64 = (global CurrentApplicationID) + let tmp%23#0: uint64 = (== app#0 tmp%22#0) + (assert tmp%23#0) // expected current_application_id + let (maybe_value%24#0: bytes, maybe_value_did_exist%25#0: uint64) = ((app_params_get AppAddress) app#0) + (assert maybe_value_did_exist%25#0) // application exists + let tmp%26#0: bytes = (global CurrentApplicationAddress) + let tmp%27#0: uint64 = (== maybe_value%24#0 tmp%26#0) + (assert tmp%27#0) // expected current_application_address + return + + subroutine examples.application.contract.Reference.__init__() -> void: + block@0: // L14 + (app_global_put "int_1" 0u) + (app_global_put "bytes_1" "") + (app_global_put "bytes_2" "") + return + + program clear-state: + subroutine examples.application.contract.Reference.clear_state_program() -> uint64: + block@0: // L34 + return 1u \ No newline at end of file diff --git a/examples/application/out/contract_Reference.final.ir b/examples/application/out/contract_Reference.final.ir new file mode 100644 index 0000000000..58881009b8 --- /dev/null +++ b/examples/application/out/contract_Reference.final.ir @@ -0,0 +1,78 @@ +contract examples.application.contract.Reference: + program approval: + subroutine examples.application.contract.Reference.approval_program() -> uint64: + block@0: // L26 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L14 + examples.application.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L14 + let tmp%1#0: uint64 = (txn NumAppArgs) + let tmp%2#0: uint64 = (== tmp%1#0 1u) + goto tmp%2#0 ? block@3 : block@7 + block@3: // if_body_L27 + let tmp%3#0: bytes = (txna ApplicationArgs 0) + let tmp%4#0: uint64 = (== tmp%3#0 "validate") + goto tmp%4#0 ? block@4 : block@5 + block@4: // if_body_L28 + let tmp%5#0: uint64 = (global CurrentApplicationID) + examples.application.contract.Reference.validate_asset(tmp%5#0) + goto block@7 + block@5: // else_body_L28 + fail // Expected validate + block@7: // after_if_else_L27 + return 1u + + subroutine examples.application.contract.Reference.validate_asset(app: uint64) -> void: + block@0: // L38 + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((app_params_get AppCreator) app#0) + (assert maybe_value_did_exist%1#0) // application exists + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== maybe_value%0#0 tmp%2#0) + (assert tmp%3#0) // expected creator + let (maybe_value%4#0: uint64, maybe_value_did_exist%5#0: uint64) = ((app_params_get AppGlobalNumUint) app#0) + (assert maybe_value_did_exist%5#0) // application exists + let tmp%6#0: uint64 = (== maybe_value%4#0 1u) + (assert tmp%6#0) // expected global_num_uint + let (maybe_value%7#0: uint64, maybe_value_did_exist%8#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) + (assert maybe_value_did_exist%8#0) // application exists + let tmp%9#0: uint64 = (== maybe_value%7#0 2u) + (assert tmp%9#0) // expected global_num_byte_slice + let (maybe_value%10#0: uint64, maybe_value_did_exist%11#0: uint64) = ((app_params_get AppLocalNumUint) app#0) + (assert maybe_value_did_exist%11#0) // application exists + let tmp%12#0: uint64 = (== maybe_value%10#0 3u) + (assert tmp%12#0) // expected local_num_uint + let (maybe_value%13#0: uint64, maybe_value_did_exist%14#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) + (assert maybe_value_did_exist%14#0) // application exists + let tmp%15#0: uint64 = (== maybe_value%13#0 4u) + (assert tmp%15#0) // expected local_num_byte_slice + let (maybe_value%16#0: bytes, maybe_value_did_exist%17#0: uint64) = ((app_params_get AppApprovalProgram) app#0) + (assert maybe_value_did_exist%17#0) // application exists + let tmp%18#0: uint64 = (len maybe_value%16#0) + (assert tmp%18#0) // expected approval_program + let (maybe_value%19#0: bytes, maybe_value_did_exist%20#0: uint64) = ((app_params_get AppClearStateProgram) app#0) + (assert maybe_value_did_exist%20#0) // application exists + let tmp%21#0: uint64 = (len maybe_value%19#0) + (assert tmp%21#0) // expected clear_state_program + let tmp%22#0: uint64 = (global CurrentApplicationID) + let tmp%23#0: uint64 = (== app#0 tmp%22#0) + (assert tmp%23#0) // expected current_application_id + let (maybe_value%24#0: bytes, maybe_value_did_exist%25#0: uint64) = ((app_params_get AppAddress) app#0) + (assert maybe_value_did_exist%25#0) // application exists + let tmp%26#0: bytes = (global CurrentApplicationAddress) + let tmp%27#0: uint64 = (== maybe_value%24#0 tmp%26#0) + (assert tmp%27#0) // expected current_application_address + return + + subroutine examples.application.contract.Reference.__init__() -> void: + block@0: // L14 + (app_global_put "int_1" 0u) + (app_global_put "bytes_1" "") + (app_global_put "bytes_2" "") + return + + program clear-state: + subroutine examples.application.contract.Reference.clear_state_program() -> uint64: + block@0: // L34 + return 1u \ No newline at end of file diff --git a/examples/application/out/contract_Reference.final_unoptimized.ir b/examples/application/out/contract_Reference.final_unoptimized.ir new file mode 100644 index 0000000000..c64029b3f3 --- /dev/null +++ b/examples/application/out/contract_Reference.final_unoptimized.ir @@ -0,0 +1,80 @@ +contract examples.application.contract.Reference: + program approval: + subroutine examples.application.contract.Reference.approval_program() -> uint64: + block@0: // L26 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L14 + examples.application.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L14 + let tmp%1#0: uint64 = (txn NumAppArgs) + let tmp%2#0: uint64 = (== tmp%1#0 1u) + goto tmp%2#0 ? block@3 : block@7 + block@3: // if_body_L27 + let tmp%3#0: bytes = (txna ApplicationArgs 0) + let tmp%4#0: uint64 = (== tmp%3#0 "validate") + goto tmp%4#0 ? block@4 : block@5 + block@4: // if_body_L28 + let tmp%5#0: uint64 = (global CurrentApplicationID) + examples.application.contract.Reference.validate_asset(tmp%5#0) + goto block@6 + block@5: // else_body_L28 + fail // Expected validate + block@6: // after_if_else_L28 + goto block@7 + block@7: // after_if_else_L27 + return 1u + + subroutine examples.application.contract.Reference.validate_asset(app: uint64) -> void: + block@0: // L38 + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((app_params_get AppCreator) app#0) + (assert maybe_value_did_exist%1#0) // application exists + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== maybe_value%0#0 tmp%2#0) + (assert tmp%3#0) // expected creator + let (maybe_value%4#0: uint64, maybe_value_did_exist%5#0: uint64) = ((app_params_get AppGlobalNumUint) app#0) + (assert maybe_value_did_exist%5#0) // application exists + let tmp%6#0: uint64 = (== maybe_value%4#0 1u) + (assert tmp%6#0) // expected global_num_uint + let (maybe_value%7#0: uint64, maybe_value_did_exist%8#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) + (assert maybe_value_did_exist%8#0) // application exists + let tmp%9#0: uint64 = (== maybe_value%7#0 2u) + (assert tmp%9#0) // expected global_num_byte_slice + let (maybe_value%10#0: uint64, maybe_value_did_exist%11#0: uint64) = ((app_params_get AppLocalNumUint) app#0) + (assert maybe_value_did_exist%11#0) // application exists + let tmp%12#0: uint64 = (== maybe_value%10#0 3u) + (assert tmp%12#0) // expected local_num_uint + let (maybe_value%13#0: uint64, maybe_value_did_exist%14#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) + (assert maybe_value_did_exist%14#0) // application exists + let tmp%15#0: uint64 = (== maybe_value%13#0 4u) + (assert tmp%15#0) // expected local_num_byte_slice + let (maybe_value%16#0: bytes, maybe_value_did_exist%17#0: uint64) = ((app_params_get AppApprovalProgram) app#0) + (assert maybe_value_did_exist%17#0) // application exists + let tmp%18#0: uint64 = (len maybe_value%16#0) + (assert tmp%18#0) // expected approval_program + let (maybe_value%19#0: bytes, maybe_value_did_exist%20#0: uint64) = ((app_params_get AppClearStateProgram) app#0) + (assert maybe_value_did_exist%20#0) // application exists + let tmp%21#0: uint64 = (len maybe_value%19#0) + (assert tmp%21#0) // expected clear_state_program + let tmp%22#0: uint64 = (global CurrentApplicationID) + let tmp%23#0: uint64 = (== app#0 tmp%22#0) + (assert tmp%23#0) // expected current_application_id + let (maybe_value%24#0: bytes, maybe_value_did_exist%25#0: uint64) = ((app_params_get AppAddress) app#0) + (assert maybe_value_did_exist%25#0) // application exists + let tmp%26#0: bytes = (global CurrentApplicationAddress) + let tmp%27#0: uint64 = (== maybe_value%24#0 tmp%26#0) + (assert tmp%27#0) // expected current_application_address + return + + subroutine examples.application.contract.Reference.__init__() -> void: + block@0: // L14 + (app_global_put "int_1" 0u) + (app_global_put "bytes_1" "") + (app_global_put "bytes_2" "") + return + + program clear-state: + subroutine examples.application.contract.Reference.clear_state_program() -> uint64: + block@0: // L34 + return 1u \ No newline at end of file diff --git a/examples/application/out/contract_Reference.parallel_copies.ir b/examples/application/out/contract_Reference.parallel_copies.ir new file mode 100644 index 0000000000..58881009b8 --- /dev/null +++ b/examples/application/out/contract_Reference.parallel_copies.ir @@ -0,0 +1,78 @@ +contract examples.application.contract.Reference: + program approval: + subroutine examples.application.contract.Reference.approval_program() -> uint64: + block@0: // L26 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L14 + examples.application.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L14 + let tmp%1#0: uint64 = (txn NumAppArgs) + let tmp%2#0: uint64 = (== tmp%1#0 1u) + goto tmp%2#0 ? block@3 : block@7 + block@3: // if_body_L27 + let tmp%3#0: bytes = (txna ApplicationArgs 0) + let tmp%4#0: uint64 = (== tmp%3#0 "validate") + goto tmp%4#0 ? block@4 : block@5 + block@4: // if_body_L28 + let tmp%5#0: uint64 = (global CurrentApplicationID) + examples.application.contract.Reference.validate_asset(tmp%5#0) + goto block@7 + block@5: // else_body_L28 + fail // Expected validate + block@7: // after_if_else_L27 + return 1u + + subroutine examples.application.contract.Reference.validate_asset(app: uint64) -> void: + block@0: // L38 + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((app_params_get AppCreator) app#0) + (assert maybe_value_did_exist%1#0) // application exists + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== maybe_value%0#0 tmp%2#0) + (assert tmp%3#0) // expected creator + let (maybe_value%4#0: uint64, maybe_value_did_exist%5#0: uint64) = ((app_params_get AppGlobalNumUint) app#0) + (assert maybe_value_did_exist%5#0) // application exists + let tmp%6#0: uint64 = (== maybe_value%4#0 1u) + (assert tmp%6#0) // expected global_num_uint + let (maybe_value%7#0: uint64, maybe_value_did_exist%8#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) + (assert maybe_value_did_exist%8#0) // application exists + let tmp%9#0: uint64 = (== maybe_value%7#0 2u) + (assert tmp%9#0) // expected global_num_byte_slice + let (maybe_value%10#0: uint64, maybe_value_did_exist%11#0: uint64) = ((app_params_get AppLocalNumUint) app#0) + (assert maybe_value_did_exist%11#0) // application exists + let tmp%12#0: uint64 = (== maybe_value%10#0 3u) + (assert tmp%12#0) // expected local_num_uint + let (maybe_value%13#0: uint64, maybe_value_did_exist%14#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) + (assert maybe_value_did_exist%14#0) // application exists + let tmp%15#0: uint64 = (== maybe_value%13#0 4u) + (assert tmp%15#0) // expected local_num_byte_slice + let (maybe_value%16#0: bytes, maybe_value_did_exist%17#0: uint64) = ((app_params_get AppApprovalProgram) app#0) + (assert maybe_value_did_exist%17#0) // application exists + let tmp%18#0: uint64 = (len maybe_value%16#0) + (assert tmp%18#0) // expected approval_program + let (maybe_value%19#0: bytes, maybe_value_did_exist%20#0: uint64) = ((app_params_get AppClearStateProgram) app#0) + (assert maybe_value_did_exist%20#0) // application exists + let tmp%21#0: uint64 = (len maybe_value%19#0) + (assert tmp%21#0) // expected clear_state_program + let tmp%22#0: uint64 = (global CurrentApplicationID) + let tmp%23#0: uint64 = (== app#0 tmp%22#0) + (assert tmp%23#0) // expected current_application_id + let (maybe_value%24#0: bytes, maybe_value_did_exist%25#0: uint64) = ((app_params_get AppAddress) app#0) + (assert maybe_value_did_exist%25#0) // application exists + let tmp%26#0: bytes = (global CurrentApplicationAddress) + let tmp%27#0: uint64 = (== maybe_value%24#0 tmp%26#0) + (assert tmp%27#0) // expected current_application_address + return + + subroutine examples.application.contract.Reference.__init__() -> void: + block@0: // L14 + (app_global_put "int_1" 0u) + (app_global_put "bytes_1" "") + (app_global_put "bytes_2" "") + return + + program clear-state: + subroutine examples.application.contract.Reference.clear_state_program() -> uint64: + block@0: // L34 + return 1u \ No newline at end of file diff --git a/examples/application/out/contract_Reference.post_ssa.ir b/examples/application/out/contract_Reference.post_ssa.ir new file mode 100644 index 0000000000..58881009b8 --- /dev/null +++ b/examples/application/out/contract_Reference.post_ssa.ir @@ -0,0 +1,78 @@ +contract examples.application.contract.Reference: + program approval: + subroutine examples.application.contract.Reference.approval_program() -> uint64: + block@0: // L26 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L14 + examples.application.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L14 + let tmp%1#0: uint64 = (txn NumAppArgs) + let tmp%2#0: uint64 = (== tmp%1#0 1u) + goto tmp%2#0 ? block@3 : block@7 + block@3: // if_body_L27 + let tmp%3#0: bytes = (txna ApplicationArgs 0) + let tmp%4#0: uint64 = (== tmp%3#0 "validate") + goto tmp%4#0 ? block@4 : block@5 + block@4: // if_body_L28 + let tmp%5#0: uint64 = (global CurrentApplicationID) + examples.application.contract.Reference.validate_asset(tmp%5#0) + goto block@7 + block@5: // else_body_L28 + fail // Expected validate + block@7: // after_if_else_L27 + return 1u + + subroutine examples.application.contract.Reference.validate_asset(app: uint64) -> void: + block@0: // L38 + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((app_params_get AppCreator) app#0) + (assert maybe_value_did_exist%1#0) // application exists + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== maybe_value%0#0 tmp%2#0) + (assert tmp%3#0) // expected creator + let (maybe_value%4#0: uint64, maybe_value_did_exist%5#0: uint64) = ((app_params_get AppGlobalNumUint) app#0) + (assert maybe_value_did_exist%5#0) // application exists + let tmp%6#0: uint64 = (== maybe_value%4#0 1u) + (assert tmp%6#0) // expected global_num_uint + let (maybe_value%7#0: uint64, maybe_value_did_exist%8#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) + (assert maybe_value_did_exist%8#0) // application exists + let tmp%9#0: uint64 = (== maybe_value%7#0 2u) + (assert tmp%9#0) // expected global_num_byte_slice + let (maybe_value%10#0: uint64, maybe_value_did_exist%11#0: uint64) = ((app_params_get AppLocalNumUint) app#0) + (assert maybe_value_did_exist%11#0) // application exists + let tmp%12#0: uint64 = (== maybe_value%10#0 3u) + (assert tmp%12#0) // expected local_num_uint + let (maybe_value%13#0: uint64, maybe_value_did_exist%14#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) + (assert maybe_value_did_exist%14#0) // application exists + let tmp%15#0: uint64 = (== maybe_value%13#0 4u) + (assert tmp%15#0) // expected local_num_byte_slice + let (maybe_value%16#0: bytes, maybe_value_did_exist%17#0: uint64) = ((app_params_get AppApprovalProgram) app#0) + (assert maybe_value_did_exist%17#0) // application exists + let tmp%18#0: uint64 = (len maybe_value%16#0) + (assert tmp%18#0) // expected approval_program + let (maybe_value%19#0: bytes, maybe_value_did_exist%20#0: uint64) = ((app_params_get AppClearStateProgram) app#0) + (assert maybe_value_did_exist%20#0) // application exists + let tmp%21#0: uint64 = (len maybe_value%19#0) + (assert tmp%21#0) // expected clear_state_program + let tmp%22#0: uint64 = (global CurrentApplicationID) + let tmp%23#0: uint64 = (== app#0 tmp%22#0) + (assert tmp%23#0) // expected current_application_id + let (maybe_value%24#0: bytes, maybe_value_did_exist%25#0: uint64) = ((app_params_get AppAddress) app#0) + (assert maybe_value_did_exist%25#0) // application exists + let tmp%26#0: bytes = (global CurrentApplicationAddress) + let tmp%27#0: uint64 = (== maybe_value%24#0 tmp%26#0) + (assert tmp%27#0) // expected current_application_address + return + + subroutine examples.application.contract.Reference.__init__() -> void: + block@0: // L14 + (app_global_put "int_1" 0u) + (app_global_put "bytes_1" "") + (app_global_put "bytes_2" "") + return + + program clear-state: + subroutine examples.application.contract.Reference.clear_state_program() -> uint64: + block@0: // L34 + return 1u \ No newline at end of file diff --git a/examples/application/out/contract_Reference.ssa.ir b/examples/application/out/contract_Reference.ssa.ir new file mode 100644 index 0000000000..c64029b3f3 --- /dev/null +++ b/examples/application/out/contract_Reference.ssa.ir @@ -0,0 +1,80 @@ +contract examples.application.contract.Reference: + program approval: + subroutine examples.application.contract.Reference.approval_program() -> uint64: + block@0: // L26 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L14 + examples.application.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L14 + let tmp%1#0: uint64 = (txn NumAppArgs) + let tmp%2#0: uint64 = (== tmp%1#0 1u) + goto tmp%2#0 ? block@3 : block@7 + block@3: // if_body_L27 + let tmp%3#0: bytes = (txna ApplicationArgs 0) + let tmp%4#0: uint64 = (== tmp%3#0 "validate") + goto tmp%4#0 ? block@4 : block@5 + block@4: // if_body_L28 + let tmp%5#0: uint64 = (global CurrentApplicationID) + examples.application.contract.Reference.validate_asset(tmp%5#0) + goto block@6 + block@5: // else_body_L28 + fail // Expected validate + block@6: // after_if_else_L28 + goto block@7 + block@7: // after_if_else_L27 + return 1u + + subroutine examples.application.contract.Reference.validate_asset(app: uint64) -> void: + block@0: // L38 + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((app_params_get AppCreator) app#0) + (assert maybe_value_did_exist%1#0) // application exists + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== maybe_value%0#0 tmp%2#0) + (assert tmp%3#0) // expected creator + let (maybe_value%4#0: uint64, maybe_value_did_exist%5#0: uint64) = ((app_params_get AppGlobalNumUint) app#0) + (assert maybe_value_did_exist%5#0) // application exists + let tmp%6#0: uint64 = (== maybe_value%4#0 1u) + (assert tmp%6#0) // expected global_num_uint + let (maybe_value%7#0: uint64, maybe_value_did_exist%8#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) + (assert maybe_value_did_exist%8#0) // application exists + let tmp%9#0: uint64 = (== maybe_value%7#0 2u) + (assert tmp%9#0) // expected global_num_byte_slice + let (maybe_value%10#0: uint64, maybe_value_did_exist%11#0: uint64) = ((app_params_get AppLocalNumUint) app#0) + (assert maybe_value_did_exist%11#0) // application exists + let tmp%12#0: uint64 = (== maybe_value%10#0 3u) + (assert tmp%12#0) // expected local_num_uint + let (maybe_value%13#0: uint64, maybe_value_did_exist%14#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) + (assert maybe_value_did_exist%14#0) // application exists + let tmp%15#0: uint64 = (== maybe_value%13#0 4u) + (assert tmp%15#0) // expected local_num_byte_slice + let (maybe_value%16#0: bytes, maybe_value_did_exist%17#0: uint64) = ((app_params_get AppApprovalProgram) app#0) + (assert maybe_value_did_exist%17#0) // application exists + let tmp%18#0: uint64 = (len maybe_value%16#0) + (assert tmp%18#0) // expected approval_program + let (maybe_value%19#0: bytes, maybe_value_did_exist%20#0: uint64) = ((app_params_get AppClearStateProgram) app#0) + (assert maybe_value_did_exist%20#0) // application exists + let tmp%21#0: uint64 = (len maybe_value%19#0) + (assert tmp%21#0) // expected clear_state_program + let tmp%22#0: uint64 = (global CurrentApplicationID) + let tmp%23#0: uint64 = (== app#0 tmp%22#0) + (assert tmp%23#0) // expected current_application_id + let (maybe_value%24#0: bytes, maybe_value_did_exist%25#0: uint64) = ((app_params_get AppAddress) app#0) + (assert maybe_value_did_exist%25#0) // application exists + let tmp%26#0: bytes = (global CurrentApplicationAddress) + let tmp%27#0: uint64 = (== maybe_value%24#0 tmp%26#0) + (assert tmp%27#0) // expected current_application_address + return + + subroutine examples.application.contract.Reference.__init__() -> void: + block@0: // L14 + (app_global_put "int_1" 0u) + (app_global_put "bytes_1" "") + (app_global_put "bytes_2" "") + return + + program clear-state: + subroutine examples.application.contract.Reference.clear_state_program() -> uint64: + block@0: // L34 + return 1u \ No newline at end of file diff --git a/examples/application/out/contract_Reference.ssa.opt_pass_1.ir b/examples/application/out/contract_Reference.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..58881009b8 --- /dev/null +++ b/examples/application/out/contract_Reference.ssa.opt_pass_1.ir @@ -0,0 +1,78 @@ +contract examples.application.contract.Reference: + program approval: + subroutine examples.application.contract.Reference.approval_program() -> uint64: + block@0: // L26 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L14 + examples.application.contract.Reference.__init__() + goto block@2 + block@2: // entrypoint_L14 + let tmp%1#0: uint64 = (txn NumAppArgs) + let tmp%2#0: uint64 = (== tmp%1#0 1u) + goto tmp%2#0 ? block@3 : block@7 + block@3: // if_body_L27 + let tmp%3#0: bytes = (txna ApplicationArgs 0) + let tmp%4#0: uint64 = (== tmp%3#0 "validate") + goto tmp%4#0 ? block@4 : block@5 + block@4: // if_body_L28 + let tmp%5#0: uint64 = (global CurrentApplicationID) + examples.application.contract.Reference.validate_asset(tmp%5#0) + goto block@7 + block@5: // else_body_L28 + fail // Expected validate + block@7: // after_if_else_L27 + return 1u + + subroutine examples.application.contract.Reference.validate_asset(app: uint64) -> void: + block@0: // L38 + let (maybe_value%0#0: bytes, maybe_value_did_exist%1#0: uint64) = ((app_params_get AppCreator) app#0) + (assert maybe_value_did_exist%1#0) // application exists + let tmp%2#0: bytes = (global CreatorAddress) + let tmp%3#0: uint64 = (== maybe_value%0#0 tmp%2#0) + (assert tmp%3#0) // expected creator + let (maybe_value%4#0: uint64, maybe_value_did_exist%5#0: uint64) = ((app_params_get AppGlobalNumUint) app#0) + (assert maybe_value_did_exist%5#0) // application exists + let tmp%6#0: uint64 = (== maybe_value%4#0 1u) + (assert tmp%6#0) // expected global_num_uint + let (maybe_value%7#0: uint64, maybe_value_did_exist%8#0: uint64) = ((app_params_get AppGlobalNumByteSlice) app#0) + (assert maybe_value_did_exist%8#0) // application exists + let tmp%9#0: uint64 = (== maybe_value%7#0 2u) + (assert tmp%9#0) // expected global_num_byte_slice + let (maybe_value%10#0: uint64, maybe_value_did_exist%11#0: uint64) = ((app_params_get AppLocalNumUint) app#0) + (assert maybe_value_did_exist%11#0) // application exists + let tmp%12#0: uint64 = (== maybe_value%10#0 3u) + (assert tmp%12#0) // expected local_num_uint + let (maybe_value%13#0: uint64, maybe_value_did_exist%14#0: uint64) = ((app_params_get AppLocalNumByteSlice) app#0) + (assert maybe_value_did_exist%14#0) // application exists + let tmp%15#0: uint64 = (== maybe_value%13#0 4u) + (assert tmp%15#0) // expected local_num_byte_slice + let (maybe_value%16#0: bytes, maybe_value_did_exist%17#0: uint64) = ((app_params_get AppApprovalProgram) app#0) + (assert maybe_value_did_exist%17#0) // application exists + let tmp%18#0: uint64 = (len maybe_value%16#0) + (assert tmp%18#0) // expected approval_program + let (maybe_value%19#0: bytes, maybe_value_did_exist%20#0: uint64) = ((app_params_get AppClearStateProgram) app#0) + (assert maybe_value_did_exist%20#0) // application exists + let tmp%21#0: uint64 = (len maybe_value%19#0) + (assert tmp%21#0) // expected clear_state_program + let tmp%22#0: uint64 = (global CurrentApplicationID) + let tmp%23#0: uint64 = (== app#0 tmp%22#0) + (assert tmp%23#0) // expected current_application_id + let (maybe_value%24#0: bytes, maybe_value_did_exist%25#0: uint64) = ((app_params_get AppAddress) app#0) + (assert maybe_value_did_exist%25#0) // application exists + let tmp%26#0: bytes = (global CurrentApplicationAddress) + let tmp%27#0: uint64 = (== maybe_value%24#0 tmp%26#0) + (assert tmp%27#0) // expected current_application_address + return + + subroutine examples.application.contract.Reference.__init__() -> void: + block@0: // L14 + (app_global_put "int_1" 0u) + (app_global_put "bytes_1" "") + (app_global_put "bytes_2" "") + return + + program clear-state: + subroutine examples.application.contract.Reference.clear_state_program() -> uint64: + block@0: // L34 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/algopy.log b/examples/arc4_types/algopy.log new file mode 100644 index 0000000000..2feec173fe --- /dev/null +++ b/examples/arc4_types/algopy.log @@ -0,0 +1,4604 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug arc4_types +debug: Building AWST for __init__.py +debug: Building AWST for arc4_types +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for arc4_types/tuples.py +debug: Building AWST for arc4_types/structs.py +debug: Building AWST for arc4_types/string.py +debug: Building AWST for arc4_types/numeric.py +debug: Building AWST for arc4_types/dynamic_string_array.py +debug: Building AWST for arc4_types/bool.py +debug: Building AWST for arc4_types/array.py +debug: Sealing block@0: // L55 +debug: Terminated block@0: // L55 +debug: Sealing block@0: // L14 +debug: Terminated block@0: // L14 +debug: Sealing block@None: // ternary_true_L39 +debug: Sealing block@None: // ternary_false_L39 +debug: Terminated block@1: // ternary_true_L39 +debug: Terminated block@2: // ternary_false_L39 +debug: Sealing block@None: // ternary_true_L39 +debug: Sealing block@None: // ternary_false_L39 +debug: Terminated block@3: // ternary_true_L39 +debug: Terminated block@4: // ternary_false_L39 +debug: Sealing block@None: // ternary_true_L39 +debug: Sealing block@None: // ternary_false_L39 +debug: Terminated block@5: // ternary_true_L39 +debug: Terminated block@6: // ternary_false_L39 +debug: Sealing block@None: // ternary_true_L39 +debug: Sealing block@None: // ternary_false_L39 +debug: Terminated block@7: // ternary_true_L39 +debug: Terminated block@8: // ternary_false_L39 +debug: Sealing block@None: // ternary_true_L39 +debug: Sealing block@None: // ternary_false_L39 +debug: Terminated block@9: // ternary_true_L39 +debug: Terminated block@10: // ternary_false_L39 +debug: Sealing block@None: // ternary_true_L39 +debug: Sealing block@None: // ternary_false_L39 +debug: Terminated block@11: // ternary_true_L39 +debug: Terminated block@12: // ternary_false_L39 +debug: Sealing block@13: // ternary_merge_L39 +debug: Created Phi assignment: let ternary_result%63#2: bytes = undefined while trying to resolve 'ternary_result%63' in block@13: // ternary_merge_L39 +debug: Added ternary_result%63#0 to Phi node: let ternary_result%63#2: bytes = φ(ternary_result%63#0 <- block@11) in block@11: // ternary_true_L39 +debug: Added ternary_result%63#1 to Phi node: let ternary_result%63#2: bytes = φ(ternary_result%63#0 <- block@11, ternary_result%63#1 <- block@12) in block@12: // ternary_false_L39 +debug: Terminated block@13: // ternary_merge_L39 +debug: Sealing block@14: // ternary_merge_L39 +debug: Created Phi assignment: let ternary_result%61#2: bytes = undefined while trying to resolve 'ternary_result%61' in block@14: // ternary_merge_L39 +debug: Added ternary_result%61#0 to Phi node: let ternary_result%61#2: bytes = φ(ternary_result%61#0 <- block@9) in block@9: // ternary_true_L39 +debug: Added ternary_result%61#1 to Phi node: let ternary_result%61#2: bytes = φ(ternary_result%61#0 <- block@9, ternary_result%61#1 <- block@13) in block@13: // ternary_merge_L39 +debug: Terminated block@14: // ternary_merge_L39 +debug: Sealing block@15: // ternary_merge_L39 +debug: Created Phi assignment: let ternary_result%59#2: bytes = undefined while trying to resolve 'ternary_result%59' in block@15: // ternary_merge_L39 +debug: Added ternary_result%59#0 to Phi node: let ternary_result%59#2: bytes = φ(ternary_result%59#0 <- block@7) in block@7: // ternary_true_L39 +debug: Added ternary_result%59#1 to Phi node: let ternary_result%59#2: bytes = φ(ternary_result%59#0 <- block@7, ternary_result%59#1 <- block@14) in block@14: // ternary_merge_L39 +debug: Terminated block@15: // ternary_merge_L39 +debug: Sealing block@16: // ternary_merge_L39 +debug: Created Phi assignment: let ternary_result%57#2: bytes = undefined while trying to resolve 'ternary_result%57' in block@16: // ternary_merge_L39 +debug: Added ternary_result%57#0 to Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@5) in block@5: // ternary_true_L39 +debug: Added ternary_result%57#1 to Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@5, ternary_result%57#1 <- block@15) in block@15: // ternary_merge_L39 +debug: Terminated block@16: // ternary_merge_L39 +debug: Sealing block@17: // ternary_merge_L39 +debug: Created Phi assignment: let ternary_result%55#2: bytes = undefined while trying to resolve 'ternary_result%55' in block@17: // ternary_merge_L39 +debug: Added ternary_result%55#0 to Phi node: let ternary_result%55#2: bytes = φ(ternary_result%55#0 <- block@3) in block@3: // ternary_true_L39 +debug: Added ternary_result%55#1 to Phi node: let ternary_result%55#2: bytes = φ(ternary_result%55#0 <- block@3, ternary_result%55#1 <- block@16) in block@16: // ternary_merge_L39 +debug: Terminated block@17: // ternary_merge_L39 +debug: Sealing block@18: // ternary_merge_L39 +debug: Created Phi assignment: let ternary_result%53#2: bytes = undefined while trying to resolve 'ternary_result%53' in block@18: // ternary_merge_L39 +debug: Added ternary_result%53#0 to Phi node: let ternary_result%53#2: bytes = φ(ternary_result%53#0 <- block@1) in block@1: // ternary_true_L39 +debug: Added ternary_result%53#1 to Phi node: let ternary_result%53#2: bytes = φ(ternary_result%53#0 <- block@1, ternary_result%53#1 <- block@17) in block@17: // ternary_merge_L39 +debug: Created Phi assignment: let c#1: bytes = undefined while trying to resolve 'c' in block@18: // ternary_merge_L39 +debug: Added c#0 to Phi node: let c#1: bytes = φ(c#0 <- block@1) in block@1: // ternary_true_L39 +debug: Created Phi assignment: let c#2: bytes = undefined while trying to resolve 'c' in block@17: // ternary_merge_L39 +debug: Added c#0 to Phi node: let c#2: bytes = φ(c#0 <- block@3) in block@3: // ternary_true_L39 +debug: Created Phi assignment: let c#3: bytes = undefined while trying to resolve 'c' in block@16: // ternary_merge_L39 +debug: Added c#0 to Phi node: let c#3: bytes = φ(c#0 <- block@5) in block@5: // ternary_true_L39 +debug: Created Phi assignment: let c#4: bytes = undefined while trying to resolve 'c' in block@15: // ternary_merge_L39 +debug: Added c#0 to Phi node: let c#4: bytes = φ(c#0 <- block@7) in block@7: // ternary_true_L39 +debug: Created Phi assignment: let c#5: bytes = undefined while trying to resolve 'c' in block@14: // ternary_merge_L39 +debug: Added c#0 to Phi node: let c#5: bytes = φ(c#0 <- block@9) in block@9: // ternary_true_L39 +debug: Created Phi assignment: let c#6: bytes = undefined while trying to resolve 'c' in block@13: // ternary_merge_L39 +debug: Added c#0 to Phi node: let c#6: bytes = φ(c#0 <- block@11) in block@11: // ternary_true_L39 +debug: Added c#0 to Phi node: let c#6: bytes = φ(c#0 <- block@11, c#0 <- block@12) in block@12: // ternary_false_L39 +debug: Replacing trivial Phi node: let c#6: bytes = φ(c#0 <- block@11, c#0 <- block@12) (c#6) with c#0 +debug: Deleting Phi assignment: let c#6: bytes = φ(c#0 <- block@11, c#0 <- block@12) +debug: Replaced trivial Phi node: let c#6: bytes = φ(c#0 <- block@11, c#0 <- block@12) (c#6) with c#0 in current definition for 1 blocks +debug: Added c#0 to Phi node: let c#5: bytes = φ(c#0 <- block@9, c#0 <- block@13) in block@13: // ternary_merge_L39 +debug: Replacing trivial Phi node: let c#5: bytes = φ(c#0 <- block@9, c#0 <- block@13) (c#5) with c#0 +debug: Deleting Phi assignment: let c#5: bytes = φ(c#0 <- block@9, c#0 <- block@13) +debug: Replaced trivial Phi node: let c#5: bytes = φ(c#0 <- block@9, c#0 <- block@13) (c#5) with c#0 in current definition for 1 blocks +debug: Added c#0 to Phi node: let c#4: bytes = φ(c#0 <- block@7, c#0 <- block@14) in block@14: // ternary_merge_L39 +debug: Replacing trivial Phi node: let c#4: bytes = φ(c#0 <- block@7, c#0 <- block@14) (c#4) with c#0 +debug: Deleting Phi assignment: let c#4: bytes = φ(c#0 <- block@7, c#0 <- block@14) +debug: Replaced trivial Phi node: let c#4: bytes = φ(c#0 <- block@7, c#0 <- block@14) (c#4) with c#0 in current definition for 1 blocks +debug: Added c#0 to Phi node: let c#3: bytes = φ(c#0 <- block@5, c#0 <- block@15) in block@15: // ternary_merge_L39 +debug: Replacing trivial Phi node: let c#3: bytes = φ(c#0 <- block@5, c#0 <- block@15) (c#3) with c#0 +debug: Deleting Phi assignment: let c#3: bytes = φ(c#0 <- block@5, c#0 <- block@15) +debug: Replaced trivial Phi node: let c#3: bytes = φ(c#0 <- block@5, c#0 <- block@15) (c#3) with c#0 in current definition for 1 blocks +debug: Added c#0 to Phi node: let c#2: bytes = φ(c#0 <- block@3, c#0 <- block@16) in block@16: // ternary_merge_L39 +debug: Replacing trivial Phi node: let c#2: bytes = φ(c#0 <- block@3, c#0 <- block@16) (c#2) with c#0 +debug: Deleting Phi assignment: let c#2: bytes = φ(c#0 <- block@3, c#0 <- block@16) +debug: Replaced trivial Phi node: let c#2: bytes = φ(c#0 <- block@3, c#0 <- block@16) (c#2) with c#0 in current definition for 1 blocks +debug: Added c#0 to Phi node: let c#1: bytes = φ(c#0 <- block@1, c#0 <- block@17) in block@17: // ternary_merge_L39 +debug: Replacing trivial Phi node: let c#1: bytes = φ(c#0 <- block@1, c#0 <- block@17) (c#1) with c#0 +debug: Deleting Phi assignment: let c#1: bytes = φ(c#0 <- block@1, c#0 <- block@17) +debug: Replaced trivial Phi node: let c#1: bytes = φ(c#0 <- block@1, c#0 <- block@17) (c#1) with c#0 in current definition for 1 blocks +debug: Terminated block@18: // ternary_merge_L39 +debug: Sealing block@None: // ternary_true_L40 +debug: Sealing block@None: // ternary_false_L40 +debug: Terminated block@19: // ternary_true_L40 +debug: Created Phi assignment: let h#1: bytes = undefined while trying to resolve 'h' in block@18: // ternary_merge_L39 +debug: Added h#0 to Phi node: let h#1: bytes = φ(h#0 <- block@1) in block@1: // ternary_true_L39 +debug: Created Phi assignment: let h#2: bytes = undefined while trying to resolve 'h' in block@17: // ternary_merge_L39 +debug: Added h#0 to Phi node: let h#2: bytes = φ(h#0 <- block@3) in block@3: // ternary_true_L39 +debug: Created Phi assignment: let h#3: bytes = undefined while trying to resolve 'h' in block@16: // ternary_merge_L39 +debug: Added h#0 to Phi node: let h#3: bytes = φ(h#0 <- block@5) in block@5: // ternary_true_L39 +debug: Created Phi assignment: let h#4: bytes = undefined while trying to resolve 'h' in block@15: // ternary_merge_L39 +debug: Added h#0 to Phi node: let h#4: bytes = φ(h#0 <- block@7) in block@7: // ternary_true_L39 +debug: Created Phi assignment: let h#5: bytes = undefined while trying to resolve 'h' in block@14: // ternary_merge_L39 +debug: Added h#0 to Phi node: let h#5: bytes = φ(h#0 <- block@9) in block@9: // ternary_true_L39 +debug: Created Phi assignment: let h#6: bytes = undefined while trying to resolve 'h' in block@13: // ternary_merge_L39 +debug: Added h#0 to Phi node: let h#6: bytes = φ(h#0 <- block@11) in block@11: // ternary_true_L39 +debug: Added h#0 to Phi node: let h#6: bytes = φ(h#0 <- block@11, h#0 <- block@12) in block@12: // ternary_false_L39 +debug: Replacing trivial Phi node: let h#6: bytes = φ(h#0 <- block@11, h#0 <- block@12) (h#6) with h#0 +debug: Deleting Phi assignment: let h#6: bytes = φ(h#0 <- block@11, h#0 <- block@12) +debug: Replaced trivial Phi node: let h#6: bytes = φ(h#0 <- block@11, h#0 <- block@12) (h#6) with h#0 in current definition for 1 blocks +debug: Added h#0 to Phi node: let h#5: bytes = φ(h#0 <- block@9, h#0 <- block@13) in block@13: // ternary_merge_L39 +debug: Replacing trivial Phi node: let h#5: bytes = φ(h#0 <- block@9, h#0 <- block@13) (h#5) with h#0 +debug: Deleting Phi assignment: let h#5: bytes = φ(h#0 <- block@9, h#0 <- block@13) +debug: Replaced trivial Phi node: let h#5: bytes = φ(h#0 <- block@9, h#0 <- block@13) (h#5) with h#0 in current definition for 1 blocks +debug: Added h#0 to Phi node: let h#4: bytes = φ(h#0 <- block@7, h#0 <- block@14) in block@14: // ternary_merge_L39 +debug: Replacing trivial Phi node: let h#4: bytes = φ(h#0 <- block@7, h#0 <- block@14) (h#4) with h#0 +debug: Deleting Phi assignment: let h#4: bytes = φ(h#0 <- block@7, h#0 <- block@14) +debug: Replaced trivial Phi node: let h#4: bytes = φ(h#0 <- block@7, h#0 <- block@14) (h#4) with h#0 in current definition for 1 blocks +debug: Added h#0 to Phi node: let h#3: bytes = φ(h#0 <- block@5, h#0 <- block@15) in block@15: // ternary_merge_L39 +debug: Replacing trivial Phi node: let h#3: bytes = φ(h#0 <- block@5, h#0 <- block@15) (h#3) with h#0 +debug: Deleting Phi assignment: let h#3: bytes = φ(h#0 <- block@5, h#0 <- block@15) +debug: Replaced trivial Phi node: let h#3: bytes = φ(h#0 <- block@5, h#0 <- block@15) (h#3) with h#0 in current definition for 1 blocks +debug: Added h#0 to Phi node: let h#2: bytes = φ(h#0 <- block@3, h#0 <- block@16) in block@16: // ternary_merge_L39 +debug: Replacing trivial Phi node: let h#2: bytes = φ(h#0 <- block@3, h#0 <- block@16) (h#2) with h#0 +debug: Deleting Phi assignment: let h#2: bytes = φ(h#0 <- block@3, h#0 <- block@16) +debug: Replaced trivial Phi node: let h#2: bytes = φ(h#0 <- block@3, h#0 <- block@16) (h#2) with h#0 in current definition for 1 blocks +debug: Added h#0 to Phi node: let h#1: bytes = φ(h#0 <- block@1, h#0 <- block@17) in block@17: // ternary_merge_L39 +debug: Replacing trivial Phi node: let h#1: bytes = φ(h#0 <- block@1, h#0 <- block@17) (h#1) with h#0 +debug: Deleting Phi assignment: let h#1: bytes = φ(h#0 <- block@1, h#0 <- block@17) +debug: Replaced trivial Phi node: let h#1: bytes = φ(h#0 <- block@1, h#0 <- block@17) (h#1) with h#0 in current definition for 1 blocks +debug: Terminated block@20: // ternary_false_L40 +debug: Sealing block@21: // ternary_merge_L40 +debug: Created Phi assignment: let ternary_result%66#2: bytes = undefined while trying to resolve 'ternary_result%66' in block@21: // ternary_merge_L40 +debug: Added ternary_result%66#0 to Phi node: let ternary_result%66#2: bytes = φ(ternary_result%66#0 <- block@19) in block@19: // ternary_true_L40 +debug: Added ternary_result%66#1 to Phi node: let ternary_result%66#2: bytes = φ(ternary_result%66#0 <- block@19, ternary_result%66#1 <- block@20) in block@20: // ternary_false_L40 +debug: Created Phi assignment: let k#1: bytes = undefined while trying to resolve 'k' in block@21: // ternary_merge_L40 +debug: Created Phi assignment: let k#2: bytes = undefined while trying to resolve 'k' in block@18: // ternary_merge_L39 +debug: Added k#0 to Phi node: let k#2: bytes = φ(k#0 <- block@1) in block@1: // ternary_true_L39 +debug: Created Phi assignment: let k#3: bytes = undefined while trying to resolve 'k' in block@17: // ternary_merge_L39 +debug: Added k#0 to Phi node: let k#3: bytes = φ(k#0 <- block@3) in block@3: // ternary_true_L39 +debug: Created Phi assignment: let k#4: bytes = undefined while trying to resolve 'k' in block@16: // ternary_merge_L39 +debug: Added k#0 to Phi node: let k#4: bytes = φ(k#0 <- block@5) in block@5: // ternary_true_L39 +debug: Created Phi assignment: let k#5: bytes = undefined while trying to resolve 'k' in block@15: // ternary_merge_L39 +debug: Added k#0 to Phi node: let k#5: bytes = φ(k#0 <- block@7) in block@7: // ternary_true_L39 +debug: Created Phi assignment: let k#6: bytes = undefined while trying to resolve 'k' in block@14: // ternary_merge_L39 +debug: Added k#0 to Phi node: let k#6: bytes = φ(k#0 <- block@9) in block@9: // ternary_true_L39 +debug: Created Phi assignment: let k#7: bytes = undefined while trying to resolve 'k' in block@13: // ternary_merge_L39 +debug: Added k#0 to Phi node: let k#7: bytes = φ(k#0 <- block@11) in block@11: // ternary_true_L39 +debug: Added k#0 to Phi node: let k#7: bytes = φ(k#0 <- block@11, k#0 <- block@12) in block@12: // ternary_false_L39 +debug: Replacing trivial Phi node: let k#7: bytes = φ(k#0 <- block@11, k#0 <- block@12) (k#7) with k#0 +debug: Deleting Phi assignment: let k#7: bytes = φ(k#0 <- block@11, k#0 <- block@12) +debug: Replaced trivial Phi node: let k#7: bytes = φ(k#0 <- block@11, k#0 <- block@12) (k#7) with k#0 in current definition for 1 blocks +debug: Added k#0 to Phi node: let k#6: bytes = φ(k#0 <- block@9, k#0 <- block@13) in block@13: // ternary_merge_L39 +debug: Replacing trivial Phi node: let k#6: bytes = φ(k#0 <- block@9, k#0 <- block@13) (k#6) with k#0 +debug: Deleting Phi assignment: let k#6: bytes = φ(k#0 <- block@9, k#0 <- block@13) +debug: Replaced trivial Phi node: let k#6: bytes = φ(k#0 <- block@9, k#0 <- block@13) (k#6) with k#0 in current definition for 1 blocks +debug: Added k#0 to Phi node: let k#5: bytes = φ(k#0 <- block@7, k#0 <- block@14) in block@14: // ternary_merge_L39 +debug: Replacing trivial Phi node: let k#5: bytes = φ(k#0 <- block@7, k#0 <- block@14) (k#5) with k#0 +debug: Deleting Phi assignment: let k#5: bytes = φ(k#0 <- block@7, k#0 <- block@14) +debug: Replaced trivial Phi node: let k#5: bytes = φ(k#0 <- block@7, k#0 <- block@14) (k#5) with k#0 in current definition for 1 blocks +debug: Added k#0 to Phi node: let k#4: bytes = φ(k#0 <- block@5, k#0 <- block@15) in block@15: // ternary_merge_L39 +debug: Replacing trivial Phi node: let k#4: bytes = φ(k#0 <- block@5, k#0 <- block@15) (k#4) with k#0 +debug: Deleting Phi assignment: let k#4: bytes = φ(k#0 <- block@5, k#0 <- block@15) +debug: Replaced trivial Phi node: let k#4: bytes = φ(k#0 <- block@5, k#0 <- block@15) (k#4) with k#0 in current definition for 1 blocks +debug: Added k#0 to Phi node: let k#3: bytes = φ(k#0 <- block@3, k#0 <- block@16) in block@16: // ternary_merge_L39 +debug: Replacing trivial Phi node: let k#3: bytes = φ(k#0 <- block@3, k#0 <- block@16) (k#3) with k#0 +debug: Deleting Phi assignment: let k#3: bytes = φ(k#0 <- block@3, k#0 <- block@16) +debug: Replaced trivial Phi node: let k#3: bytes = φ(k#0 <- block@3, k#0 <- block@16) (k#3) with k#0 in current definition for 1 blocks +debug: Added k#0 to Phi node: let k#2: bytes = φ(k#0 <- block@1, k#0 <- block@17) in block@17: // ternary_merge_L39 +debug: Replacing trivial Phi node: let k#2: bytes = φ(k#0 <- block@1, k#0 <- block@17) (k#2) with k#0 +debug: Deleting Phi assignment: let k#2: bytes = φ(k#0 <- block@1, k#0 <- block@17) +debug: Replaced trivial Phi node: let k#2: bytes = φ(k#0 <- block@1, k#0 <- block@17) (k#2) with k#0 in current definition for 1 blocks +debug: Added k#0 to Phi node: let k#1: bytes = φ(k#0 <- block@19) in block@19: // ternary_true_L40 +debug: Added k#0 to Phi node: let k#1: bytes = φ(k#0 <- block@19, k#0 <- block@20) in block@20: // ternary_false_L40 +debug: Replacing trivial Phi node: let k#1: bytes = φ(k#0 <- block@19, k#0 <- block@20) (k#1) with k#0 +debug: Deleting Phi assignment: let k#1: bytes = φ(k#0 <- block@19, k#0 <- block@20) +debug: Replaced trivial Phi node: let k#1: bytes = φ(k#0 <- block@19, k#0 <- block@20) (k#1) with k#0 in current definition for 1 blocks +debug: Created Phi assignment: let boolean_packing#1: bytes = undefined while trying to resolve 'boolean_packing' in block@21: // ternary_merge_L40 +debug: Created Phi assignment: let boolean_packing#2: bytes = undefined while trying to resolve 'boolean_packing' in block@18: // ternary_merge_L39 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#2: bytes = φ(boolean_packing#0 <- block@1) in block@1: // ternary_true_L39 +debug: Created Phi assignment: let boolean_packing#3: bytes = undefined while trying to resolve 'boolean_packing' in block@17: // ternary_merge_L39 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#3: bytes = φ(boolean_packing#0 <- block@3) in block@3: // ternary_true_L39 +debug: Created Phi assignment: let boolean_packing#4: bytes = undefined while trying to resolve 'boolean_packing' in block@16: // ternary_merge_L39 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#4: bytes = φ(boolean_packing#0 <- block@5) in block@5: // ternary_true_L39 +debug: Created Phi assignment: let boolean_packing#5: bytes = undefined while trying to resolve 'boolean_packing' in block@15: // ternary_merge_L39 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#5: bytes = φ(boolean_packing#0 <- block@7) in block@7: // ternary_true_L39 +debug: Created Phi assignment: let boolean_packing#6: bytes = undefined while trying to resolve 'boolean_packing' in block@14: // ternary_merge_L39 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#6: bytes = φ(boolean_packing#0 <- block@9) in block@9: // ternary_true_L39 +debug: Created Phi assignment: let boolean_packing#7: bytes = undefined while trying to resolve 'boolean_packing' in block@13: // ternary_merge_L39 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#7: bytes = φ(boolean_packing#0 <- block@11) in block@11: // ternary_true_L39 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#7: bytes = φ(boolean_packing#0 <- block@11, boolean_packing#0 <- block@12) in block@12: // ternary_false_L39 +debug: Replacing trivial Phi node: let boolean_packing#7: bytes = φ(boolean_packing#0 <- block@11, boolean_packing#0 <- block@12) (boolean_packing#7) with boolean_packing#0 +debug: Deleting Phi assignment: let boolean_packing#7: bytes = φ(boolean_packing#0 <- block@11, boolean_packing#0 <- block@12) +debug: Replaced trivial Phi node: let boolean_packing#7: bytes = φ(boolean_packing#0 <- block@11, boolean_packing#0 <- block@12) (boolean_packing#7) with boolean_packing#0 in current definition for 1 blocks +debug: Added boolean_packing#0 to Phi node: let boolean_packing#6: bytes = φ(boolean_packing#0 <- block@9, boolean_packing#0 <- block@13) in block@13: // ternary_merge_L39 +debug: Replacing trivial Phi node: let boolean_packing#6: bytes = φ(boolean_packing#0 <- block@9, boolean_packing#0 <- block@13) (boolean_packing#6) with boolean_packing#0 +debug: Deleting Phi assignment: let boolean_packing#6: bytes = φ(boolean_packing#0 <- block@9, boolean_packing#0 <- block@13) +debug: Replaced trivial Phi node: let boolean_packing#6: bytes = φ(boolean_packing#0 <- block@9, boolean_packing#0 <- block@13) (boolean_packing#6) with boolean_packing#0 in current definition for 1 blocks +debug: Added boolean_packing#0 to Phi node: let boolean_packing#5: bytes = φ(boolean_packing#0 <- block@7, boolean_packing#0 <- block@14) in block@14: // ternary_merge_L39 +debug: Replacing trivial Phi node: let boolean_packing#5: bytes = φ(boolean_packing#0 <- block@7, boolean_packing#0 <- block@14) (boolean_packing#5) with boolean_packing#0 +debug: Deleting Phi assignment: let boolean_packing#5: bytes = φ(boolean_packing#0 <- block@7, boolean_packing#0 <- block@14) +debug: Replaced trivial Phi node: let boolean_packing#5: bytes = φ(boolean_packing#0 <- block@7, boolean_packing#0 <- block@14) (boolean_packing#5) with boolean_packing#0 in current definition for 1 blocks +debug: Added boolean_packing#0 to Phi node: let boolean_packing#4: bytes = φ(boolean_packing#0 <- block@5, boolean_packing#0 <- block@15) in block@15: // ternary_merge_L39 +debug: Replacing trivial Phi node: let boolean_packing#4: bytes = φ(boolean_packing#0 <- block@5, boolean_packing#0 <- block@15) (boolean_packing#4) with boolean_packing#0 +debug: Deleting Phi assignment: let boolean_packing#4: bytes = φ(boolean_packing#0 <- block@5, boolean_packing#0 <- block@15) +debug: Replaced trivial Phi node: let boolean_packing#4: bytes = φ(boolean_packing#0 <- block@5, boolean_packing#0 <- block@15) (boolean_packing#4) with boolean_packing#0 in current definition for 1 blocks +debug: Added boolean_packing#0 to Phi node: let boolean_packing#3: bytes = φ(boolean_packing#0 <- block@3, boolean_packing#0 <- block@16) in block@16: // ternary_merge_L39 +debug: Replacing trivial Phi node: let boolean_packing#3: bytes = φ(boolean_packing#0 <- block@3, boolean_packing#0 <- block@16) (boolean_packing#3) with boolean_packing#0 +debug: Deleting Phi assignment: let boolean_packing#3: bytes = φ(boolean_packing#0 <- block@3, boolean_packing#0 <- block@16) +debug: Replaced trivial Phi node: let boolean_packing#3: bytes = φ(boolean_packing#0 <- block@3, boolean_packing#0 <- block@16) (boolean_packing#3) with boolean_packing#0 in current definition for 1 blocks +debug: Added boolean_packing#0 to Phi node: let boolean_packing#2: bytes = φ(boolean_packing#0 <- block@1, boolean_packing#0 <- block@17) in block@17: // ternary_merge_L39 +debug: Replacing trivial Phi node: let boolean_packing#2: bytes = φ(boolean_packing#0 <- block@1, boolean_packing#0 <- block@17) (boolean_packing#2) with boolean_packing#0 +debug: Deleting Phi assignment: let boolean_packing#2: bytes = φ(boolean_packing#0 <- block@1, boolean_packing#0 <- block@17) +debug: Replaced trivial Phi node: let boolean_packing#2: bytes = φ(boolean_packing#0 <- block@1, boolean_packing#0 <- block@17) (boolean_packing#2) with boolean_packing#0 in current definition for 1 blocks +debug: Added boolean_packing#0 to Phi node: let boolean_packing#1: bytes = φ(boolean_packing#0 <- block@19) in block@19: // ternary_true_L40 +debug: Added boolean_packing#0 to Phi node: let boolean_packing#1: bytes = φ(boolean_packing#0 <- block@19, boolean_packing#0 <- block@20) in block@20: // ternary_false_L40 +debug: Replacing trivial Phi node: let boolean_packing#1: bytes = φ(boolean_packing#0 <- block@19, boolean_packing#0 <- block@20) (boolean_packing#1) with boolean_packing#0 +debug: Deleting Phi assignment: let boolean_packing#1: bytes = φ(boolean_packing#0 <- block@19, boolean_packing#0 <- block@20) +debug: Replaced trivial Phi node: let boolean_packing#1: bytes = φ(boolean_packing#0 <- block@19, boolean_packing#0 <- block@20) (boolean_packing#1) with boolean_packing#0 in current definition for 1 blocks +debug: Created Phi assignment: let my_tuple#1: bytes = undefined while trying to resolve 'my_tuple' in block@21: // ternary_merge_L40 +debug: Created Phi assignment: let my_tuple#2: bytes = undefined while trying to resolve 'my_tuple' in block@18: // ternary_merge_L39 +debug: Added my_tuple#0 to Phi node: let my_tuple#2: bytes = φ(my_tuple#0 <- block@1) in block@1: // ternary_true_L39 +debug: Created Phi assignment: let my_tuple#3: bytes = undefined while trying to resolve 'my_tuple' in block@17: // ternary_merge_L39 +debug: Added my_tuple#0 to Phi node: let my_tuple#3: bytes = φ(my_tuple#0 <- block@3) in block@3: // ternary_true_L39 +debug: Created Phi assignment: let my_tuple#4: bytes = undefined while trying to resolve 'my_tuple' in block@16: // ternary_merge_L39 +debug: Added my_tuple#0 to Phi node: let my_tuple#4: bytes = φ(my_tuple#0 <- block@5) in block@5: // ternary_true_L39 +debug: Created Phi assignment: let my_tuple#5: bytes = undefined while trying to resolve 'my_tuple' in block@15: // ternary_merge_L39 +debug: Added my_tuple#0 to Phi node: let my_tuple#5: bytes = φ(my_tuple#0 <- block@7) in block@7: // ternary_true_L39 +debug: Created Phi assignment: let my_tuple#6: bytes = undefined while trying to resolve 'my_tuple' in block@14: // ternary_merge_L39 +debug: Added my_tuple#0 to Phi node: let my_tuple#6: bytes = φ(my_tuple#0 <- block@9) in block@9: // ternary_true_L39 +debug: Created Phi assignment: let my_tuple#7: bytes = undefined while trying to resolve 'my_tuple' in block@13: // ternary_merge_L39 +debug: Added my_tuple#0 to Phi node: let my_tuple#7: bytes = φ(my_tuple#0 <- block@11) in block@11: // ternary_true_L39 +debug: Added my_tuple#0 to Phi node: let my_tuple#7: bytes = φ(my_tuple#0 <- block@11, my_tuple#0 <- block@12) in block@12: // ternary_false_L39 +debug: Replacing trivial Phi node: let my_tuple#7: bytes = φ(my_tuple#0 <- block@11, my_tuple#0 <- block@12) (my_tuple#7) with my_tuple#0 +debug: Deleting Phi assignment: let my_tuple#7: bytes = φ(my_tuple#0 <- block@11, my_tuple#0 <- block@12) +debug: Replaced trivial Phi node: let my_tuple#7: bytes = φ(my_tuple#0 <- block@11, my_tuple#0 <- block@12) (my_tuple#7) with my_tuple#0 in current definition for 1 blocks +debug: Added my_tuple#0 to Phi node: let my_tuple#6: bytes = φ(my_tuple#0 <- block@9, my_tuple#0 <- block@13) in block@13: // ternary_merge_L39 +debug: Replacing trivial Phi node: let my_tuple#6: bytes = φ(my_tuple#0 <- block@9, my_tuple#0 <- block@13) (my_tuple#6) with my_tuple#0 +debug: Deleting Phi assignment: let my_tuple#6: bytes = φ(my_tuple#0 <- block@9, my_tuple#0 <- block@13) +debug: Replaced trivial Phi node: let my_tuple#6: bytes = φ(my_tuple#0 <- block@9, my_tuple#0 <- block@13) (my_tuple#6) with my_tuple#0 in current definition for 1 blocks +debug: Added my_tuple#0 to Phi node: let my_tuple#5: bytes = φ(my_tuple#0 <- block@7, my_tuple#0 <- block@14) in block@14: // ternary_merge_L39 +debug: Replacing trivial Phi node: let my_tuple#5: bytes = φ(my_tuple#0 <- block@7, my_tuple#0 <- block@14) (my_tuple#5) with my_tuple#0 +debug: Deleting Phi assignment: let my_tuple#5: bytes = φ(my_tuple#0 <- block@7, my_tuple#0 <- block@14) +debug: Replaced trivial Phi node: let my_tuple#5: bytes = φ(my_tuple#0 <- block@7, my_tuple#0 <- block@14) (my_tuple#5) with my_tuple#0 in current definition for 1 blocks +debug: Added my_tuple#0 to Phi node: let my_tuple#4: bytes = φ(my_tuple#0 <- block@5, my_tuple#0 <- block@15) in block@15: // ternary_merge_L39 +debug: Replacing trivial Phi node: let my_tuple#4: bytes = φ(my_tuple#0 <- block@5, my_tuple#0 <- block@15) (my_tuple#4) with my_tuple#0 +debug: Deleting Phi assignment: let my_tuple#4: bytes = φ(my_tuple#0 <- block@5, my_tuple#0 <- block@15) +debug: Replaced trivial Phi node: let my_tuple#4: bytes = φ(my_tuple#0 <- block@5, my_tuple#0 <- block@15) (my_tuple#4) with my_tuple#0 in current definition for 1 blocks +debug: Added my_tuple#0 to Phi node: let my_tuple#3: bytes = φ(my_tuple#0 <- block@3, my_tuple#0 <- block@16) in block@16: // ternary_merge_L39 +debug: Replacing trivial Phi node: let my_tuple#3: bytes = φ(my_tuple#0 <- block@3, my_tuple#0 <- block@16) (my_tuple#3) with my_tuple#0 +debug: Deleting Phi assignment: let my_tuple#3: bytes = φ(my_tuple#0 <- block@3, my_tuple#0 <- block@16) +debug: Replaced trivial Phi node: let my_tuple#3: bytes = φ(my_tuple#0 <- block@3, my_tuple#0 <- block@16) (my_tuple#3) with my_tuple#0 in current definition for 1 blocks +debug: Added my_tuple#0 to Phi node: let my_tuple#2: bytes = φ(my_tuple#0 <- block@1, my_tuple#0 <- block@17) in block@17: // ternary_merge_L39 +debug: Replacing trivial Phi node: let my_tuple#2: bytes = φ(my_tuple#0 <- block@1, my_tuple#0 <- block@17) (my_tuple#2) with my_tuple#0 +debug: Deleting Phi assignment: let my_tuple#2: bytes = φ(my_tuple#0 <- block@1, my_tuple#0 <- block@17) +debug: Replaced trivial Phi node: let my_tuple#2: bytes = φ(my_tuple#0 <- block@1, my_tuple#0 <- block@17) (my_tuple#2) with my_tuple#0 in current definition for 1 blocks +debug: Added my_tuple#0 to Phi node: let my_tuple#1: bytes = φ(my_tuple#0 <- block@19) in block@19: // ternary_true_L40 +debug: Added my_tuple#0 to Phi node: let my_tuple#1: bytes = φ(my_tuple#0 <- block@19, my_tuple#0 <- block@20) in block@20: // ternary_false_L40 +debug: Replacing trivial Phi node: let my_tuple#1: bytes = φ(my_tuple#0 <- block@19, my_tuple#0 <- block@20) (my_tuple#1) with my_tuple#0 +debug: Deleting Phi assignment: let my_tuple#1: bytes = φ(my_tuple#0 <- block@19, my_tuple#0 <- block@20) +debug: Replaced trivial Phi node: let my_tuple#1: bytes = φ(my_tuple#0 <- block@19, my_tuple#0 <- block@20) (my_tuple#1) with my_tuple#0 in current definition for 1 blocks +debug: Terminated block@21: // ternary_merge_L40 +debug: Sealing block@0: // L51 +debug: Terminated block@0: // L51 +debug: Sealing block@0: // L46 +debug: Terminated block@0: // L46 +debug: Sealing block@0: // L54 +debug: Terminated block@0: // L54 +debug: Sealing block@0: // L62 +debug: Terminated block@0: // L62 +debug: Sealing block@0: // L26 +debug: Terminated block@0: // L26 +debug: Sealing block@1: // for_header_0_L30 +debug: Terminated block@1: // for_header_0_L30 +debug: Terminated block@2: // for_header_1_L30 +debug: Sealing block@None: // for_body_L30 +debug: Created Phi assignment: let val#2: bytes = undefined while trying to resolve 'val' in block@3: // for_body_L30 +debug: Added val#0 to Phi node: let val#2: bytes = φ(val#0 <- block@1) in block@1: // for_header_0_L30 +debug: Added val#1 to Phi node: let val#2: bytes = φ(val#0 <- block@1, val#1 <- block@2) in block@2: // for_header_1_L30 +debug: Terminated block@3: // for_body_L30 +debug: Sealing block@4: // for_footer_L30 +debug: Created Phi assignment: let tuple_index%6#1: uint64 = undefined while trying to resolve 'tuple_index%6' in block@3: // for_body_L30 +debug: Added tuple_index%6#0 to Phi node: let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@1) in block@1: // for_header_0_L30 +debug: Looking for 'tuple_index%6' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L30 +debug: Created Phi assignment: let tuple_index%6#2: uint64 = undefined while trying to resolve 'tuple_index%6' in block@2: // for_header_1_L30 +debug: Added tuple_index%6#2 to Phi node: let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@1, tuple_index%6#2 <- block@2) in block@2: // for_header_1_L30 +debug: Terminated block@4: // for_footer_L30 +debug: Sealing block@2: // for_header_1_L30 +debug: Added tuple_index%6#3 to Phi node: let tuple_index%6#2: uint64 = φ(tuple_index%6#3 <- block@4) in block@4: // for_footer_L30 +debug: Replacing trivial Phi node: let tuple_index%6#2: uint64 = φ(tuple_index%6#3 <- block@4) (tuple_index%6#2) with tuple_index%6#3 +debug: Deleting Phi assignment: let tuple_index%6#2: uint64 = φ(tuple_index%6#3 <- block@4) +debug: Replaced trivial Phi node: let tuple_index%6#2: uint64 = φ(tuple_index%6#3 <- block@4) (tuple_index%6#2) with tuple_index%6#3 in current definition for 1 blocks +debug: Sealing block@None: // after_for_L30 +debug: Created Phi assignment: let coord_1#1: bytes = undefined while trying to resolve 'coord_1' in block@3: // for_body_L30 +debug: Added coord_1#0 to Phi node: let coord_1#1: bytes = φ(coord_1#0 <- block@1) in block@1: // for_header_0_L30 +debug: Added coord_1#1 to Phi node: let coord_1#1: bytes = φ(coord_1#0 <- block@1, coord_1#1 <- block@2) in block@2: // for_header_1_L30 +debug: Replacing trivial Phi node: let coord_1#1: bytes = φ(coord_1#0 <- block@1, coord_1#1 <- block@2) (coord_1#1) with coord_1#0 +debug: Deleting Phi assignment: let coord_1#1: bytes = φ(coord_1#0 <- block@1, coord_1#1 <- block@2) +debug: Replaced trivial Phi node: let coord_1#1: bytes = φ(coord_1#0 <- block@1, coord_1#1 <- block@2) (coord_1#1) with coord_1#0 in current definition for 3 blocks +debug: Terminated block@5: // after_for_L30 +debug: Sealing block@0: // L41 +debug: Terminated block@0: // L41 +debug: Sealing block@0: // L8 +debug: Terminated block@0: // L8 +debug: Sealing block@None: // ternary_true_L20 +debug: Sealing block@None: // ternary_false_L20 +debug: Terminated block@1: // ternary_true_L20 +debug: Terminated block@2: // ternary_false_L20 +debug: Sealing block@3: // ternary_merge_L20 +debug: Created Phi assignment: let ternary_result%6#2: uint64 = undefined while trying to resolve 'ternary_result%6' in block@3: // ternary_merge_L20 +debug: Added ternary_result%6#0 to Phi node: let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1) in block@1: // ternary_true_L20 +debug: Added ternary_result%6#1 to Phi node: let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, ternary_result%6#1 <- block@2) in block@2: // ternary_false_L20 +debug: Created Phi assignment: let some_bytes#1: bytes = undefined while trying to resolve 'some_bytes' in block@3: // ternary_merge_L20 +debug: Added some_bytes#0 to Phi node: let some_bytes#1: bytes = φ(some_bytes#0 <- block@1) in block@1: // ternary_true_L20 +debug: Added some_bytes#0 to Phi node: let some_bytes#1: bytes = φ(some_bytes#0 <- block@1, some_bytes#0 <- block@2) in block@2: // ternary_false_L20 +debug: Replacing trivial Phi node: let some_bytes#1: bytes = φ(some_bytes#0 <- block@1, some_bytes#0 <- block@2) (some_bytes#1) with some_bytes#0 +debug: Deleting Phi assignment: let some_bytes#1: bytes = φ(some_bytes#0 <- block@1, some_bytes#0 <- block@2) +debug: Replaced trivial Phi node: let some_bytes#1: bytes = φ(some_bytes#0 <- block@1, some_bytes#0 <- block@2) (some_bytes#1) with some_bytes#0 in current definition for 1 blocks +debug: Created Phi assignment: let some_bytes_as_bytes_again#1: bytes = undefined while trying to resolve 'some_bytes_as_bytes_again' in block@3: // ternary_merge_L20 +debug: Added some_bytes_as_bytes_again#0 to Phi node: let some_bytes_as_bytes_again#1: bytes = φ(some_bytes_as_bytes_again#0 <- block@1) in block@1: // ternary_true_L20 +debug: Added some_bytes_as_bytes_again#0 to Phi node: let some_bytes_as_bytes_again#1: bytes = φ(some_bytes_as_bytes_again#0 <- block@1, some_bytes_as_bytes_again#0 <- block@2) in block@2: // ternary_false_L20 +debug: Replacing trivial Phi node: let some_bytes_as_bytes_again#1: bytes = φ(some_bytes_as_bytes_again#0 <- block@1, some_bytes_as_bytes_again#0 <- block@2) (some_bytes_as_bytes_again#1) with some_bytes_as_bytes_again#0 +debug: Deleting Phi assignment: let some_bytes_as_bytes_again#1: bytes = φ(some_bytes_as_bytes_again#0 <- block@1, some_bytes_as_bytes_again#0 <- block@2) +debug: Replaced trivial Phi node: let some_bytes_as_bytes_again#1: bytes = φ(some_bytes_as_bytes_again#0 <- block@1, some_bytes_as_bytes_again#0 <- block@2) (some_bytes_as_bytes_again#1) with some_bytes_as_bytes_again#0 in current definition for 1 blocks +debug: Terminated block@3: // ternary_merge_L20 +debug: Sealing block@0: // L27 +debug: Terminated block@0: // L27 +debug: Sealing block@0: // L25 +debug: Terminated block@0: // L25 +debug: Sealing block@None: // ternary_true_L35 +debug: Sealing block@None: // ternary_false_L35 +debug: Terminated block@1: // ternary_true_L35 +debug: Terminated block@2: // ternary_false_L35 +debug: Sealing block@3: // ternary_merge_L35 +debug: Created Phi assignment: let ternary_result%4#2: uint64 = undefined while trying to resolve 'ternary_result%4' in block@3: // ternary_merge_L35 +debug: Added ternary_result%4#0 to Phi node: let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1) in block@1: // ternary_true_L35 +debug: Added ternary_result%4#1 to Phi node: let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, ternary_result%4#1 <- block@2) in block@2: // ternary_false_L35 +debug: Created Phi assignment: let test_bytes#1: bytes = undefined while trying to resolve 'test_bytes' in block@3: // ternary_merge_L35 +debug: Added test_bytes#0 to Phi node: let test_bytes#1: bytes = φ(test_bytes#0 <- block@1) in block@1: // ternary_true_L35 +debug: Added test_bytes#0 to Phi node: let test_bytes#1: bytes = φ(test_bytes#0 <- block@1, test_bytes#0 <- block@2) in block@2: // ternary_false_L35 +debug: Replacing trivial Phi node: let test_bytes#1: bytes = φ(test_bytes#0 <- block@1, test_bytes#0 <- block@2) (test_bytes#1) with test_bytes#0 +debug: Deleting Phi assignment: let test_bytes#1: bytes = φ(test_bytes#0 <- block@1, test_bytes#0 <- block@2) +debug: Replaced trivial Phi node: let test_bytes#1: bytes = φ(test_bytes#0 <- block@1, test_bytes#0 <- block@2) (test_bytes#1) with test_bytes#0 in current definition for 1 blocks +debug: Terminated block@3: // ternary_merge_L35 +debug: Sealing block@None: // ternary_true_L37 +debug: Sealing block@None: // ternary_false_L37 +debug: Terminated block@4: // ternary_true_L37 +debug: Terminated block@5: // ternary_false_L37 +debug: Sealing block@6: // ternary_merge_L37 +debug: Created Phi assignment: let ternary_result%10#2: uint64 = undefined while trying to resolve 'ternary_result%10' in block@6: // ternary_merge_L37 +debug: Added ternary_result%10#0 to Phi node: let ternary_result%10#2: uint64 = φ(ternary_result%10#0 <- block@4) in block@4: // ternary_true_L37 +debug: Added ternary_result%10#1 to Phi node: let ternary_result%10#2: uint64 = φ(ternary_result%10#0 <- block@4, ternary_result%10#1 <- block@5) in block@5: // ternary_false_L37 +debug: Created Phi assignment: let test_bytes#2: bytes = undefined while trying to resolve 'test_bytes' in block@6: // ternary_merge_L37 +debug: Added test_bytes#0 to Phi node: let test_bytes#2: bytes = φ(test_bytes#0 <- block@4) in block@4: // ternary_true_L37 +debug: Added test_bytes#0 to Phi node: let test_bytes#2: bytes = φ(test_bytes#0 <- block@4, test_bytes#0 <- block@5) in block@5: // ternary_false_L37 +debug: Replacing trivial Phi node: let test_bytes#2: bytes = φ(test_bytes#0 <- block@4, test_bytes#0 <- block@5) (test_bytes#2) with test_bytes#0 +debug: Deleting Phi assignment: let test_bytes#2: bytes = φ(test_bytes#0 <- block@4, test_bytes#0 <- block@5) +debug: Replaced trivial Phi node: let test_bytes#2: bytes = φ(test_bytes#0 <- block@4, test_bytes#0 <- block@5) (test_bytes#2) with test_bytes#0 in current definition for 1 blocks +debug: Terminated block@6: // ternary_merge_L37 +debug: Sealing block@None: // ternary_true_L39 +debug: Sealing block@None: // ternary_false_L39 +debug: Terminated block@7: // ternary_true_L39 +debug: Terminated block@8: // ternary_false_L39 +debug: Sealing block@9: // ternary_merge_L39 +debug: Created Phi assignment: let ternary_result%16#2: uint64 = undefined while trying to resolve 'ternary_result%16' in block@9: // ternary_merge_L39 +debug: Added ternary_result%16#0 to Phi node: let ternary_result%16#2: uint64 = φ(ternary_result%16#0 <- block@7) in block@7: // ternary_true_L39 +debug: Added ternary_result%16#1 to Phi node: let ternary_result%16#2: uint64 = φ(ternary_result%16#0 <- block@7, ternary_result%16#1 <- block@8) in block@8: // ternary_false_L39 +debug: Created Phi assignment: let test_bytes#3: bytes = undefined while trying to resolve 'test_bytes' in block@9: // ternary_merge_L39 +debug: Added test_bytes#0 to Phi node: let test_bytes#3: bytes = φ(test_bytes#0 <- block@7) in block@7: // ternary_true_L39 +debug: Added test_bytes#0 to Phi node: let test_bytes#3: bytes = φ(test_bytes#0 <- block@7, test_bytes#0 <- block@8) in block@8: // ternary_false_L39 +debug: Replacing trivial Phi node: let test_bytes#3: bytes = φ(test_bytes#0 <- block@7, test_bytes#0 <- block@8) (test_bytes#3) with test_bytes#0 +debug: Deleting Phi assignment: let test_bytes#3: bytes = φ(test_bytes#0 <- block@7, test_bytes#0 <- block@8) +debug: Replaced trivial Phi node: let test_bytes#3: bytes = φ(test_bytes#0 <- block@7, test_bytes#0 <- block@8) (test_bytes#3) with test_bytes#0 in current definition for 1 blocks +debug: Terminated block@9: // ternary_merge_L39 +debug: Sealing block@None: // ternary_true_L40 +debug: Sealing block@None: // ternary_false_L40 +debug: Terminated block@10: // ternary_true_L40 +debug: Terminated block@11: // ternary_false_L40 +debug: Sealing block@12: // ternary_merge_L40 +debug: Created Phi assignment: let ternary_result%22#2: uint64 = undefined while trying to resolve 'ternary_result%22' in block@12: // ternary_merge_L40 +debug: Added ternary_result%22#0 to Phi node: let ternary_result%22#2: uint64 = φ(ternary_result%22#0 <- block@10) in block@10: // ternary_true_L40 +debug: Added ternary_result%22#1 to Phi node: let ternary_result%22#2: uint64 = φ(ternary_result%22#0 <- block@10, ternary_result%22#1 <- block@11) in block@11: // ternary_false_L40 +debug: Created Phi assignment: let test_bytes#4: bytes = undefined while trying to resolve 'test_bytes' in block@12: // ternary_merge_L40 +debug: Added test_bytes#0 to Phi node: let test_bytes#4: bytes = φ(test_bytes#0 <- block@10) in block@10: // ternary_true_L40 +debug: Added test_bytes#0 to Phi node: let test_bytes#4: bytes = φ(test_bytes#0 <- block@10, test_bytes#0 <- block@11) in block@11: // ternary_false_L40 +debug: Replacing trivial Phi node: let test_bytes#4: bytes = φ(test_bytes#0 <- block@10, test_bytes#0 <- block@11) (test_bytes#4) with test_bytes#0 +debug: Deleting Phi assignment: let test_bytes#4: bytes = φ(test_bytes#0 <- block@10, test_bytes#0 <- block@11) +debug: Replaced trivial Phi node: let test_bytes#4: bytes = φ(test_bytes#0 <- block@10, test_bytes#0 <- block@11) (test_bytes#4) with test_bytes#0 in current definition for 1 blocks +debug: Terminated block@12: // ternary_merge_L40 +debug: Sealing block@None: // ternary_true_L41 +debug: Sealing block@None: // ternary_false_L41 +debug: Terminated block@13: // ternary_true_L41 +debug: Terminated block@14: // ternary_false_L41 +debug: Sealing block@15: // ternary_merge_L41 +debug: Created Phi assignment: let ternary_result%28#2: uint64 = undefined while trying to resolve 'ternary_result%28' in block@15: // ternary_merge_L41 +debug: Added ternary_result%28#0 to Phi node: let ternary_result%28#2: uint64 = φ(ternary_result%28#0 <- block@13) in block@13: // ternary_true_L41 +debug: Added ternary_result%28#1 to Phi node: let ternary_result%28#2: uint64 = φ(ternary_result%28#0 <- block@13, ternary_result%28#1 <- block@14) in block@14: // ternary_false_L41 +debug: Terminated block@15: // ternary_merge_L41 +debug: Sealing block@0: // L68 +debug: Terminated block@0: // L68 +debug: Sealing block@0: // L6 +debug: Terminated block@0: // L6 +debug: Sealing block@0: // L14 +debug: Terminated block@0: // L14 +debug: Sealing block@0: // L4 +debug: Terminated block@0: // L4 +debug: Sealing block@None: // abi_routing_L4 +debug: Sealing block@None: // bare_routing_L4 +debug: Terminated block@1: // abi_routing_L4 +debug: Sealing block@None: // switch_case_default_L4 +debug: Sealing block@None: // xyz_route_L5 +debug: Sealing block@None: // xyz_raw_route_L13 +debug: Terminated block@2: // xyz_route_L5 +debug: Terminated block@3: // xyz_raw_route_L13 +debug: Terminated block@4: // switch_case_default_L4 +debug: Sealing block@5: // switch_case_next_L4 +debug: Terminated block@5: // switch_case_next_L4 +debug: Terminated block@6: // bare_routing_L4 +debug: Sealing block@None: // reject_bare_on_completion_L4 +debug: Sealing block@None: // create_L4 +debug: Terminated block@7: // create_L4 +debug: Terminated block@8: // reject_bare_on_completion_L4 +debug: Sealing block@None: // switch_case_next_L4 +debug: Sealing block@9: // after_if_else_L4 +debug: Terminated block@9: // after_if_else_L4 +debug: Sealing block@0: // L4 +debug: Terminated block@0: // L4 +debug: Sealing block@0: // L47 +debug: Terminated block@0: // L47 +debug: Sealing block@0: // L12 +debug: Terminated block@0: // L12 +debug: Sealing block@0: // L43 +debug: Terminated block@0: // L43 +debug: Sealing block@0: // L21 +debug: Terminated block@0: // L21 +debug: Looking for 'item_index_internal%3' in an unsealed block creating an incomplete Phi: block@1: // for_header_L24 +debug: Created Phi assignment: let item_index_internal%3#1: uint64 = undefined while trying to resolve 'item_index_internal%3' in block@1: // for_header_L24 +debug: Terminated block@1: // for_header_L24 +debug: Sealing block@None: // for_body_L24 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@1: // for_header_L24 +debug: Created Phi assignment: let total#1: uint64 = undefined while trying to resolve 'total' in block@1: // for_header_L24 +debug: Terminated block@2: // for_body_L24 +debug: Sealing block@3: // for_footer_L24 +debug: Sealing block@None: // after_for_L24 +debug: Terminated block@3: // for_footer_L24 +debug: Sealing block@1: // for_header_L24 +debug: Added item_index_internal%3#0 to Phi node: let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0) in block@0: // L21 +debug: Added item_index_internal%3#2 to Phi node: let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0, item_index_internal%3#2 <- block@3) in block@3: // for_footer_L24 +debug: Added total#0 to Phi node: let total#1: uint64 = φ(total#0 <- block@0) in block@0: // L21 +debug: Added total#2 to Phi node: let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@3) in block@3: // for_footer_L24 +debug: Terminated block@4: // after_for_L24 +debug: Looking for 'item_index_internal%11' in an unsealed block creating an incomplete Phi: block@5: // for_header_L29 +debug: Created Phi assignment: let item_index_internal%11#1: uint64 = undefined while trying to resolve 'item_index_internal%11' in block@5: // for_header_L29 +debug: Terminated block@5: // for_header_L29 +debug: Sealing block@None: // for_body_L29 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@5: // for_header_L29 +debug: Created Phi assignment: let total#3: uint64 = undefined while trying to resolve 'total' in block@5: // for_header_L29 +debug: Terminated block@6: // for_body_L29 +debug: Sealing block@7: // for_footer_L29 +debug: Sealing block@None: // after_for_L29 +debug: Terminated block@7: // for_footer_L29 +debug: Sealing block@5: // for_header_L29 +debug: Added item_index_internal%11#0 to Phi node: let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4) in block@4: // after_for_L24 +debug: Added item_index_internal%11#2 to Phi node: let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4, item_index_internal%11#2 <- block@7) in block@7: // for_footer_L29 +debug: Added total#1 to Phi node: let total#3: uint64 = φ(total#1 <- block@4) in block@4: // after_for_L24 +debug: Added total#4 to Phi node: let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@7) in block@7: // for_footer_L29 +debug: Terminated block@8: // after_for_L29 +debug: Looking for 'item_index_internal%37' in an unsealed block creating an incomplete Phi: block@9: // for_header_L36 +debug: Created Phi assignment: let item_index_internal%37#1: uint64 = undefined while trying to resolve 'item_index_internal%37' in block@9: // for_header_L36 +debug: Terminated block@9: // for_header_L36 +debug: Sealing block@None: // for_body_L36 +debug: Terminated block@10: // for_body_L36 +debug: Sealing block@None: // if_body_L37 +debug: Sealing block@None: // else_body_L37 +debug: Terminated block@11: // if_body_L37 +debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@9: // for_header_L36 +debug: Created Phi assignment: let result#2: bytes = undefined while trying to resolve 'result' in block@9: // for_header_L36 +debug: Terminated block@12: // else_body_L37 +debug: Sealing block@13: // after_if_else_L37 +debug: Terminated block@13: // after_if_else_L37 +debug: Sealing block@14: // for_footer_L36 +debug: Sealing block@None: // after_for_L36 +debug: Created Phi assignment: let item_index_internal%37#2: uint64 = undefined while trying to resolve 'item_index_internal%37' in block@13: // after_if_else_L37 +debug: Added item_index_internal%37#1 to Phi node: let item_index_internal%37#2: uint64 = φ(item_index_internal%37#1 <- block@11) in block@11: // if_body_L37 +debug: Added item_index_internal%37#1 to Phi node: let item_index_internal%37#2: uint64 = φ(item_index_internal%37#1 <- block@11, item_index_internal%37#1 <- block@12) in block@12: // else_body_L37 +debug: Replacing trivial Phi node: let item_index_internal%37#2: uint64 = φ(item_index_internal%37#1 <- block@11, item_index_internal%37#1 <- block@12) (item_index_internal%37#2) with item_index_internal%37#1 +debug: Deleting Phi assignment: let item_index_internal%37#2: uint64 = φ(item_index_internal%37#1 <- block@11, item_index_internal%37#1 <- block@12) +debug: Replaced trivial Phi node: let item_index_internal%37#2: uint64 = φ(item_index_internal%37#1 <- block@11, item_index_internal%37#1 <- block@12) (item_index_internal%37#2) with item_index_internal%37#1 in current definition for 1 blocks +debug: Terminated block@14: // for_footer_L36 +debug: Sealing block@9: // for_header_L36 +debug: Added item_index_internal%37#0 to Phi node: let item_index_internal%37#1: uint64 = φ(item_index_internal%37#0 <- block@8) in block@8: // after_for_L29 +debug: Added item_index_internal%37#3 to Phi node: let item_index_internal%37#1: uint64 = φ(item_index_internal%37#0 <- block@8, item_index_internal%37#3 <- block@14) in block@14: // for_footer_L36 +debug: Added result#0 to Phi node: let result#2: bytes = φ(result#0 <- block@8) in block@8: // after_for_L29 +debug: Created Phi assignment: let result#4: bytes = undefined while trying to resolve 'result' in block@13: // after_if_else_L37 +debug: Added result#1 to Phi node: let result#4: bytes = φ(result#1 <- block@11) in block@11: // if_body_L37 +debug: Added result#3 to Phi node: let result#4: bytes = φ(result#1 <- block@11, result#3 <- block@12) in block@12: // else_body_L37 +debug: Added result#4 to Phi node: let result#2: bytes = φ(result#0 <- block@8, result#4 <- block@14) in block@14: // for_footer_L36 +debug: Terminated block@15: // after_for_L36 +debug: Looking for 'item_index_internal%48' in an unsealed block creating an incomplete Phi: block@16: // for_header_L46 +debug: Created Phi assignment: let item_index_internal%48#1: uint64 = undefined while trying to resolve 'item_index_internal%48' in block@16: // for_header_L46 +debug: Terminated block@16: // for_header_L46 +debug: Sealing block@None: // for_body_L46 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@16: // for_header_L46 +debug: Created Phi assignment: let total#5: uint64 = undefined while trying to resolve 'total' in block@16: // for_header_L46 +debug: Terminated block@17: // for_body_L46 +debug: Sealing block@18: // for_footer_L46 +debug: Sealing block@None: // after_for_L46 +debug: Terminated block@18: // for_footer_L46 +debug: Sealing block@16: // for_header_L46 +debug: Added item_index_internal%48#0 to Phi node: let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15) in block@15: // after_for_L36 +debug: Added item_index_internal%48#2 to Phi node: let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15, item_index_internal%48#2 <- block@18) in block@18: // for_footer_L46 +debug: Created Phi assignment: let total#7: uint64 = undefined while trying to resolve 'total' in block@9: // for_header_L36 +debug: Added total#3 to Phi node: let total#7: uint64 = φ(total#3 <- block@8) in block@8: // after_for_L29 +debug: Created Phi assignment: let total#8: uint64 = undefined while trying to resolve 'total' in block@13: // after_if_else_L37 +debug: Added total#7 to Phi node: let total#8: uint64 = φ(total#7 <- block@11) in block@11: // if_body_L37 +debug: Added total#7 to Phi node: let total#8: uint64 = φ(total#7 <- block@11, total#7 <- block@12) in block@12: // else_body_L37 +debug: Replacing trivial Phi node: let total#8: uint64 = φ(total#7 <- block@11, total#7 <- block@12) (total#8) with total#7 +debug: Deleting Phi assignment: let total#8: uint64 = φ(total#7 <- block@11, total#7 <- block@12) +debug: Replaced trivial Phi node: let total#8: uint64 = φ(total#7 <- block@11, total#7 <- block@12) (total#8) with total#7 in current definition for 1 blocks +debug: Added total#7 to Phi node: let total#7: uint64 = φ(total#3 <- block@8, total#7 <- block@14) in block@14: // for_footer_L36 +debug: Replacing trivial Phi node: let total#7: uint64 = φ(total#3 <- block@8, total#7 <- block@14) (total#7) with total#3 +debug: Deleting Phi assignment: let total#7: uint64 = φ(total#3 <- block@8, total#7 <- block@14) +debug: Replaced trivial Phi node: let total#7: uint64 = φ(total#3 <- block@8, total#7 <- block@14) (total#7) with total#3 in current definition for 6 blocks +debug: Added total#3 to Phi node: let total#5: uint64 = φ(total#3 <- block@15) in block@15: // after_for_L36 +debug: Added total#6 to Phi node: let total#5: uint64 = φ(total#3 <- block@15, total#6 <- block@18) in block@18: // for_footer_L46 +debug: Terminated block@19: // after_for_L46 +debug: Looking for 'item_index_internal%72' in an unsealed block creating an incomplete Phi: block@20: // for_header_L60 +debug: Created Phi assignment: let item_index_internal%72#1: uint64 = undefined while trying to resolve 'item_index_internal%72' in block@20: // for_header_L60 +debug: Terminated block@20: // for_header_L60 +debug: Sealing block@None: // for_body_L60 +debug: Terminated block@21: // for_body_L60 +debug: Sealing block@None: // if_body_L61 +debug: Sealing block@None: // else_body_L61 +debug: Terminated block@22: // if_body_L61 +debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@20: // for_header_L60 +debug: Created Phi assignment: let result#7: bytes = undefined while trying to resolve 'result' in block@20: // for_header_L60 +debug: Terminated block@23: // else_body_L61 +debug: Sealing block@24: // after_if_else_L61 +debug: Terminated block@24: // after_if_else_L61 +debug: Sealing block@25: // for_footer_L60 +debug: Sealing block@None: // after_for_L60 +debug: Created Phi assignment: let item_index_internal%72#2: uint64 = undefined while trying to resolve 'item_index_internal%72' in block@24: // after_if_else_L61 +debug: Added item_index_internal%72#1 to Phi node: let item_index_internal%72#2: uint64 = φ(item_index_internal%72#1 <- block@22) in block@22: // if_body_L61 +debug: Added item_index_internal%72#1 to Phi node: let item_index_internal%72#2: uint64 = φ(item_index_internal%72#1 <- block@22, item_index_internal%72#1 <- block@23) in block@23: // else_body_L61 +debug: Replacing trivial Phi node: let item_index_internal%72#2: uint64 = φ(item_index_internal%72#1 <- block@22, item_index_internal%72#1 <- block@23) (item_index_internal%72#2) with item_index_internal%72#1 +debug: Deleting Phi assignment: let item_index_internal%72#2: uint64 = φ(item_index_internal%72#1 <- block@22, item_index_internal%72#1 <- block@23) +debug: Replaced trivial Phi node: let item_index_internal%72#2: uint64 = φ(item_index_internal%72#1 <- block@22, item_index_internal%72#1 <- block@23) (item_index_internal%72#2) with item_index_internal%72#1 in current definition for 1 blocks +debug: Terminated block@25: // for_footer_L60 +debug: Sealing block@20: // for_header_L60 +debug: Added item_index_internal%72#0 to Phi node: let item_index_internal%72#1: uint64 = φ(item_index_internal%72#0 <- block@19) in block@19: // after_for_L46 +debug: Added item_index_internal%72#3 to Phi node: let item_index_internal%72#1: uint64 = φ(item_index_internal%72#0 <- block@19, item_index_internal%72#3 <- block@25) in block@25: // for_footer_L60 +debug: Added result#5 to Phi node: let result#7: bytes = φ(result#5 <- block@19) in block@19: // after_for_L46 +debug: Created Phi assignment: let result#9: bytes = undefined while trying to resolve 'result' in block@24: // after_if_else_L61 +debug: Added result#6 to Phi node: let result#9: bytes = φ(result#6 <- block@22) in block@22: // if_body_L61 +debug: Added result#8 to Phi node: let result#9: bytes = φ(result#6 <- block@22, result#8 <- block@23) in block@23: // else_body_L61 +debug: Added result#9 to Phi node: let result#7: bytes = φ(result#5 <- block@19, result#9 <- block@25) in block@25: // for_footer_L60 +debug: Terminated block@26: // after_for_L60 +debug: Sealing block@0: // L70 +debug: Terminated block@0: // L70 +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.ssa.ir +info: Optimizing examples.arc4_types.array.Arc4ArraysContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded item_index_internal%3#1 * 1u to item_index_internal%3#1 +debug: Folded len("/x00/x05Hello") to 7 +debug: Folded len("/x00/x05World") to 7 +debug: Folded 0 * 2 to 0 +debug: Folded 0u * 1u to 0u +debug: Folded index#1 * 1u to index#1 +debug: Folded len("/x00/x04Ping") to 6 +debug: Folded len("/x00/x04Pong") to 6 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: array_data%0#2, dynamic_uint8_array#0 +debug: Replacing {array_data%0#2} with dynamic_uint8_array#0 made 1 modifications +debug: Found equivalence set: array_data%8#1, aliased_dynamic#0 +debug: Replacing {array_data%8#1} with aliased_dynamic#0 made 1 modifications +debug: Found equivalence set: item_index_internal%3#1, item_index%5#0 +debug: Replacing {item_index%5#0} with item_index_internal%3#1 made 1 modifications +debug: Found equivalence set: array_data%16#4, dynamic_string_array#0 +debug: Replacing {array_data%16#4} with dynamic_string_array#0 made 1 modifications +debug: Found equivalence set: array_data%47#4, static_uint32_array#0 +debug: Replacing {array_data%47#4} with static_uint32_array#0 made 1 modifications +debug: Found equivalence set: item_index_internal%37#1, index#0 +debug: Replacing {item_index_internal%37#1} with index#0 made 4 modifications +debug: Found equivalence set: array_data%53#1, aliased_static#0 +debug: Replacing {array_data%53#1} with aliased_static#0 made 1 modifications +debug: Found equivalence set: array_data%64#4, static_string_array#0 +debug: Replacing {array_data%64#4} with static_string_array#0 made 1 modifications +debug: Found equivalence set: item_index_internal%72#1, index#2 +debug: Replacing {item_index_internal%72#1} with index#2 made 4 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#0 +debug: Removing unused variable array_data%8#0 +debug: Removing unused variable array_data%16#0 +debug: Removing unused variable next_offset%17#0 +debug: Removing unused variable element_length%20#0 +debug: Removing unused variable element_length%23#0 +debug: Removing unused variable item_index_index%29#0 +debug: Removing unused variable array_data%47#0 +debug: Removing unused variable array_data%53#0 +debug: Removing unused variable index#1 +debug: Removing unused variable item_index%54#0 +debug: Removing unused variable array_length%57#0 +debug: Removing unused variable item_index%59#0 +debug: Removing unused variable array_data%64#0 +debug: Removing unused variable next_offset%65#0 +debug: Removing unused variable element_length%68#0 +debug: Removing unused variable element_length%71#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@3: // for_footer_L24 with block@2: // for_body_L24 in block@1: // for_header_L24 +debug: Merged linear block@3: // for_footer_L24 into block@2: // for_body_L24 +debug: Replaced predecessor block@7: // for_footer_L29 with block@6: // for_body_L29 in block@5: // for_header_L29 +debug: Merged linear block@7: // for_footer_L29 into block@6: // for_body_L29 +debug: Replaced predecessor block@14: // for_footer_L36 with block@13: // after_if_else_L37 in block@9: // for_header_L36 +debug: Merged linear block@14: // for_footer_L36 into block@13: // after_if_else_L37 +debug: Replaced predecessor block@18: // for_footer_L46 with block@17: // for_body_L46 in block@16: // for_header_L46 +debug: Merged linear block@18: // for_footer_L46 into block@17: // for_body_L46 +debug: Replaced predecessor block@25: // for_footer_L60 with block@24: // after_if_else_L61 in block@20: // for_header_L60 +debug: Merged linear block@25: // for_footer_L60 into block@24: // after_if_else_L61 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x0002, 0x01) to b'/x00/x02/x01' +debug: Folded concat(0x0001, 0x0001) to b'/x00/x01/x00/x01' +debug: Folded 4 + 7 to 11 +debug: Folded 0 < 1 to 1 +debug: Folded 4 + 6 to 10 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: value_as_uint16%67#0, array_data%64#1 +debug: Replacing {array_data%64#1} with value_as_uint16%67#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#1 +debug: Removing unused variable aliased_dynamic#0 +debug: Removing unused variable next_offset%17#1 +debug: Removing unused variable array_data%47#1 +debug: Removing unused variable aliased_static#0 +debug: Removing unused variable index_is_in_bounds%58#0 +debug: Removing unused variable next_offset%65#1 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x000201, 0x02) to b'/x00/x02/x01/x02' +debug: Folded 11 + 7 to 18 +debug: Folded concat(0x00000001, 0x0000000a) to b'/x00/x00/x00/x01/x00/x00/x00/n' +debug: Folded 10 + 6 to 16 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable dynamic_uint8_array#0 +debug: Removing unused variable array_value%10#0 +debug: Removing unused variable next_offset%17#2 +debug: Removing unused variable array_data%47#2 +debug: Removing unused variable tmp%55#0 +debug: Removing unused variable tmp%60#0 +debug: Removing unused variable next_offset%65#2 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x000000010000000a, 0x000000ff) to b'/x00/x00/x00/x01/x00/x00/x00/n/x00/x00/x00/xff' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_value%2#0 +debug: Removing unused variable array_data%47#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x000000010000000a000000ff, 0x00000080) to b'/x00/x00/x00/x01/x00/x00/x00/n/x00/x00/x00/xff/x00/x00/x00/x80' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable static_uint32_array#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 6, ending loop +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.cssa.ir +debug: Removing Phis from examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Removing Phis from examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: loc: {total#9=None, item_index_internal%3#5=None, total#0=total#0, item_index_internal%3#0=item_index_internal%3#0} +debug: pred: {total#9=total#0, item_index_internal%3#5=item_index_internal%3#0} +debug: ready: total#9, item_index_internal%3#5 +debug: to_do: total#9, item_index_internal%3#5 +debug: * avail item_index_internal%3#5 +debug: * avail item_index_internal%3#0 +debug: * avail total#9 +debug: * avail total#0 +debug: * to_do item_index_internal%3#5 +debug: * to_do total#9 +debug: loc: {total#1=None, item_index_internal%3#1=None, total#9=total#9, item_index_internal%3#5=item_index_internal%3#5} +debug: pred: {total#1=total#9, item_index_internal%3#1=item_index_internal%3#5} +debug: ready: total#1, item_index_internal%3#1 +debug: to_do: total#1, item_index_internal%3#1 +debug: * avail item_index_internal%3#1 +debug: * avail item_index_internal%3#5 +debug: * avail total#1 +debug: * avail total#9 +debug: * to_do item_index_internal%3#1 +debug: * to_do total#1 +debug: loc: {total#9=None, item_index_internal%3#5=None, total#2=total#2, item_index_internal%3#2=item_index_internal%3#2} +debug: pred: {total#9=total#2, item_index_internal%3#5=item_index_internal%3#2} +debug: ready: total#9, item_index_internal%3#5 +debug: to_do: total#9, item_index_internal%3#5 +debug: * avail item_index_internal%3#5 +debug: * avail item_index_internal%3#2 +debug: * avail total#9 +debug: * avail total#2 +debug: * to_do item_index_internal%3#5 +debug: * to_do total#9 +debug: loc: {total#12=None, item_index_internal%11#5=None, total#1=total#1, item_index_internal%11#0=item_index_internal%11#0} +debug: pred: {total#12=total#1, item_index_internal%11#5=item_index_internal%11#0} +debug: ready: total#12, item_index_internal%11#5 +debug: to_do: total#12, item_index_internal%11#5 +debug: * avail item_index_internal%11#5 +debug: * avail item_index_internal%11#0 +debug: * avail total#12 +debug: * avail total#1 +debug: * to_do item_index_internal%11#5 +debug: * to_do total#12 +debug: loc: {total#3=None, item_index_internal%11#1=None, total#12=total#12, item_index_internal%11#5=item_index_internal%11#5} +debug: pred: {total#3=total#12, item_index_internal%11#1=item_index_internal%11#5} +debug: ready: total#3, item_index_internal%11#1 +debug: to_do: total#3, item_index_internal%11#1 +debug: * avail item_index_internal%11#1 +debug: * avail item_index_internal%11#5 +debug: * avail total#3 +debug: * avail total#12 +debug: * to_do item_index_internal%11#1 +debug: * to_do total#3 +debug: loc: {total#12=None, item_index_internal%11#5=None, total#4=total#4, item_index_internal%11#2=item_index_internal%11#2} +debug: pred: {total#12=total#4, item_index_internal%11#5=item_index_internal%11#2} +debug: ready: total#12, item_index_internal%11#5 +debug: to_do: total#12, item_index_internal%11#5 +debug: * avail item_index_internal%11#5 +debug: * avail item_index_internal%11#2 +debug: * avail total#12 +debug: * avail total#4 +debug: * to_do item_index_internal%11#5 +debug: * to_do total#12 +debug: loc: {result#12=None, index#3=None, result#0=result#0, item_index_internal%37#0=item_index_internal%37#0} +debug: pred: {result#12=result#0, index#3=item_index_internal%37#0} +debug: ready: result#12, index#3 +debug: to_do: result#12, index#3 +debug: * avail index#3 +debug: * avail item_index_internal%37#0 +debug: * avail result#12 +debug: * avail result#0 +debug: * to_do index#3 +debug: * to_do result#12 +debug: loc: {result#2=None, index#0=None, result#12=result#12, index#3=index#3} +debug: pred: {result#2=result#12, index#0=index#3} +debug: ready: result#2, index#0 +debug: to_do: result#2, index#0 +debug: * avail index#0 +debug: * avail index#3 +debug: * avail result#2 +debug: * avail result#12 +debug: * to_do index#0 +debug: * to_do result#2 +debug: loc: {result#12=None, index#3=None, result#4=result#4, item_index_internal%37#3=item_index_internal%37#3} +debug: pred: {result#12=result#4, index#3=item_index_internal%37#3} +debug: ready: result#12, index#3 +debug: to_do: result#12, index#3 +debug: * avail index#3 +debug: * avail item_index_internal%37#3 +debug: * avail result#12 +debug: * avail result#4 +debug: * to_do index#3 +debug: * to_do result#12 +debug: loc: {total#15=None, item_index_internal%48#5=None, total#3=total#3, item_index_internal%48#0=item_index_internal%48#0} +debug: pred: {total#15=total#3, item_index_internal%48#5=item_index_internal%48#0} +debug: ready: total#15, item_index_internal%48#5 +debug: to_do: total#15, item_index_internal%48#5 +debug: * avail item_index_internal%48#5 +debug: * avail item_index_internal%48#0 +debug: * avail total#15 +debug: * avail total#3 +debug: * to_do item_index_internal%48#5 +debug: * to_do total#15 +debug: loc: {total#5=None, item_index_internal%48#1=None, total#15=total#15, item_index_internal%48#5=item_index_internal%48#5} +debug: pred: {total#5=total#15, item_index_internal%48#1=item_index_internal%48#5} +debug: ready: total#5, item_index_internal%48#1 +debug: to_do: total#5, item_index_internal%48#1 +debug: * avail item_index_internal%48#1 +debug: * avail item_index_internal%48#5 +debug: * avail total#5 +debug: * avail total#15 +debug: * to_do item_index_internal%48#1 +debug: * to_do total#5 +debug: loc: {total#15=None, item_index_internal%48#5=None, total#6=total#6, item_index_internal%48#2=item_index_internal%48#2} +debug: pred: {total#15=total#6, item_index_internal%48#5=item_index_internal%48#2} +debug: ready: total#15, item_index_internal%48#5 +debug: to_do: total#15, item_index_internal%48#5 +debug: * avail item_index_internal%48#5 +debug: * avail item_index_internal%48#2 +debug: * avail total#15 +debug: * avail total#6 +debug: * to_do item_index_internal%48#5 +debug: * to_do total#15 +debug: loc: {result#18=None, index#4=None, result#5=result#5, item_index_internal%72#0=item_index_internal%72#0} +debug: pred: {result#18=result#5, index#4=item_index_internal%72#0} +debug: ready: result#18, index#4 +debug: to_do: result#18, index#4 +debug: * avail index#4 +debug: * avail item_index_internal%72#0 +debug: * avail result#18 +debug: * avail result#5 +debug: * to_do index#4 +debug: * to_do result#18 +debug: loc: {result#7=None, index#2=None, result#18=result#18, index#4=index#4} +debug: pred: {result#7=result#18, index#2=index#4} +debug: ready: result#7, index#2 +debug: to_do: result#7, index#2 +debug: * avail index#2 +debug: * avail index#4 +debug: * avail result#7 +debug: * avail result#18 +debug: * to_do index#2 +debug: * to_do result#7 +debug: loc: {result#18=None, index#4=None, result#9=result#9, item_index_internal%72#3=item_index_internal%72#3} +debug: pred: {result#18=result#9, index#4=item_index_internal%72#3} +debug: ready: result#18, index#4 +debug: to_do: result#18, index#4 +debug: * avail index#4 +debug: * avail item_index_internal%72#3 +debug: * avail result#18 +debug: * avail result#9 +debug: * to_do index#4 +debug: * to_do result#18 +debug: Sequentializing parallel copies in examples.arc4_types.array.Arc4ArraysContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.parallel_copies.ir +debug: Coalescing local variables in examples.arc4_types.array.Arc4ArraysContract.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%3#0 with [item_index_internal%3#5, item_index_internal%3#1, item_index_internal%3#2] +debug: Coalescing item_index_internal%11#0 with [item_index_internal%11#5, item_index_internal%11#1, item_index_internal%11#2] +debug: Coalescing array_data%16#1 with [array_data%16#2, array_data%16#3] +debug: Coalescing result#0 with [result#12, result#2, result#1, result#15, result#3, result#4, result#5, result#18, result#7, result#6, result#21, result#8, result#9] +debug: Coalescing item_index_internal%37#0 with [item_index_internal%37#3] +debug: Coalescing index#0 with [index#3, index#4, index#2] +debug: Coalescing string_item#0 with [string_item#1] +debug: Coalescing item_index_internal%48#0 with [item_index_internal%48#5, item_index_internal%48#1, item_index_internal%48#2] +debug: Coalescing array_data%64#2 with [array_data%64#3] +debug: Coalescing item_index_internal%72#0 with [item_index_internal%72#3] +debug: Coalescing resulted in 109 replacement/s +debug: Coalescing local variables in examples.arc4_types.array.Arc4ArraysContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/arc4_types/out/array_Arc4ArraysContract.final.ir +debug: Inserted main_for_header@1.ops[3]: 'store continue_looping%4#0 to l-stack (copy)' +debug: Replaced main_for_header@1.ops[5]: 'load continue_looping%4#0' with 'load continue_looping%4#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%6#0 to l-stack (copy)' +debug: Replaced main_for_body@2.ops[11]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_for_body@2.ops[2]: 'store item_index_internal%3#0 to l-stack (copy)' +debug: Replaced main_for_body@2.ops[15]: 'load item_index_internal%3#0' with 'load item_index_internal%3#0 from l-stack (no copy)' +debug: Inserted main_after_for@4.ops[3]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_after_for@4.ops[5]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_for_header@5.ops[3]: 'store continue_looping%12#0 to l-stack (copy)' +debug: Replaced main_for_header@5.ops[5]: 'load continue_looping%12#0' with 'load continue_looping%12#0 from l-stack (no copy)' +debug: Inserted main_for_body@6.ops[8]: 'store uint16_item#0 to l-stack (copy)' +debug: Replaced main_for_body@6.ops[10]: 'load uint16_item#0' with 'load uint16_item#0 from l-stack (no copy)' +debug: Inserted main_for_body@6.ops[3]: 'store item_index%13#0 to l-stack (copy)' +debug: Replaced main_for_body@6.ops[6]: 'load item_index%13#0' with 'load item_index%13#0 from l-stack (no copy)' +debug: Inserted main_for_body@6.ops[13]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_for_body@6.ops[16]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_for_body@6.ops[1]: 'store item_index_internal%11#0 to l-stack (copy)' +debug: Replaced main_for_body@6.ops[20]: 'load item_index_internal%11#0' with 'load item_index_internal%11#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[3]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[5]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[9]: 'store value_as_bytes%18#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[11]: 'load value_as_bytes%18#0' with 'load value_as_bytes%18#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[20]: 'store value_as_bytes%21#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[22]: 'load value_as_bytes%21#0' with 'load value_as_bytes%21#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[28]: 'store array_data%16#1 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[30]: 'load array_data%16#1' with 'load array_data%16#1 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[33]: 'store array_data%16#1 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[35]: 'load array_data%16#1' with 'load array_data%16#1 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[38]: 'store dynamic_string_array#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[40]: 'load dynamic_string_array#0' with 'load dynamic_string_array#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[43]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[45]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[48]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[50]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[59]: 'store index_is_in_bounds%27#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[61]: 'load index_is_in_bounds%27#0' with 'load index_is_in_bounds%27#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[65]: 'store array_data_sans_header%28#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[67]: 'load array_data_sans_header%28#0' with 'load array_data_sans_header%28#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[74]: 'store item_length%31#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[76]: 'load item_length%31#0' with 'load item_length%31#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[84]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[86]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[89]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[91]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[103]: 'store item_index_internal%37#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[105]: 'load item_index_internal%37#0' with 'load item_index_internal%37#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[13]: 'store value_as_uint16%19#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[16]: 'load value_as_uint16%19#0' with 'load value_as_uint16%19#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[25]: 'store value_as_uint16%22#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[28]: 'load value_as_uint16%22#0' with 'load value_as_uint16%22#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[57]: 'store array_length%26#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[60]: 'load array_length%26#0' with 'load array_length%26#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[73]: 'store item_index%30#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[76]: 'load item_index%30#0' with 'load item_index%30#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[83]: 'store item_length_plus_2%32#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[87]: 'load item_length_plus_2%32#0' with 'load item_length_plus_2%32#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[71]: 'store array_data_sans_header%28#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[76]: 'load array_data_sans_header%28#0' with 'load array_data_sans_header%28#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[102]: 'store dynamic_string_array#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[106]: 'load dynamic_string_array#0' with 'load dynamic_string_array#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[18]: 'store array_data%16#1 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[28]: 'load array_data%16#1' with 'load array_data%16#1 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[78]: 'store array_data_sans_header%28#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[88]: 'load array_data_sans_header%28#0' with 'load array_data_sans_header%28#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[80]: 'store item_index%30#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[90]: 'load item_index%30#0' with 'load item_index%30#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[44]: 'store dynamic_string_array#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[56]: 'load dynamic_string_array#0' with 'load dynamic_string_array#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[57]: 'store dynamic_string_array#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[69]: 'load dynamic_string_array#0' with 'load dynamic_string_array#0 from l-stack (no copy)' +debug: Inserted main_after_for@8.ops[70]: 'store dynamic_string_array#0 to l-stack (copy)' +debug: Replaced main_after_for@8.ops[107]: 'load dynamic_string_array#0' with 'load dynamic_string_array#0 from l-stack (no copy)' +debug: Inserted main_for_header@9.ops[3]: 'store continue_looping%38#0 to l-stack (copy)' +debug: Replaced main_for_header@9.ops[5]: 'load continue_looping%38#0' with 'load continue_looping%38#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[11]: 'store item_length%41#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[13]: 'load item_length%41#0' with 'load item_length%41#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[24]: 'store tmp%43#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[26]: 'load tmp%43#0' with 'load tmp%43#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[3]: 'store item_index_index%39#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[6]: 'load item_index_index%39#0' with 'load item_index_index%39#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[8]: 'store item_index%40#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[11]: 'load item_index%40#0' with 'load item_index%40#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[18]: 'store item_length_plus_2%42#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[22]: 'load item_length_plus_2%42#0' with 'load item_length_plus_2%42#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[6]: 'store array_value%36#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[11]: 'load array_value%36#0' with 'load array_value%36#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[12]: 'store array_value%36#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[22]: 'load array_value%36#0' with 'load array_value%36#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[14]: 'store item_index%40#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[24]: 'load item_index%40#0' with 'load item_index%40#0 from l-stack (no copy)' +debug: Inserted main_for_body@10.ops[1]: 'store index#0 to l-stack (copy)' +debug: Replaced main_for_body@10.ops[29]: 'load index#0' with 'load index#0 from l-stack (no copy)' +debug: Inserted main_else_body@12.ops[2]: 'store tmp%44#0 to l-stack (copy)' +debug: Replaced main_else_body@12.ops[5]: 'load tmp%44#0' with 'load tmp%44#0 from l-stack (no copy)' +debug: Inserted main_else_body@12.ops[7]: 'store tmp%45#0 to l-stack (copy)' +debug: Replaced main_else_body@12.ops[10]: 'load tmp%45#0' with 'load tmp%45#0 from l-stack (no copy)' +debug: Inserted main_after_if_else@13.ops[3]: 'store item_index_internal%37#0 to l-stack (copy)' +debug: Replaced main_after_if_else@13.ops[5]: 'load item_index_internal%37#0' with 'load item_index_internal%37#0 from l-stack (no copy)' +debug: Inserted main_after_for@15.ops[3]: 'store tmp%46#0 to l-stack (copy)' +debug: Replaced main_after_for@15.ops[5]: 'load tmp%46#0' with 'load tmp%46#0 from l-stack (no copy)' +debug: Inserted main_for_header@16.ops[3]: 'store continue_looping%49#0 to l-stack (copy)' +debug: Replaced main_for_header@16.ops[5]: 'load continue_looping%49#0' with 'load continue_looping%49#0 from l-stack (no copy)' +debug: Inserted main_for_body@17.ops[8]: 'store uint32_item#0 to l-stack (copy)' +debug: Replaced main_for_body@17.ops[10]: 'load uint32_item#0' with 'load uint32_item#0 from l-stack (no copy)' +debug: Inserted main_for_body@17.ops[3]: 'store item_index%50#0 to l-stack (copy)' +debug: Replaced main_for_body@17.ops[6]: 'load item_index%50#0' with 'load item_index%50#0 from l-stack (no copy)' +debug: Inserted main_for_body@17.ops[13]: 'store tmp%51#0 to l-stack (copy)' +debug: Replaced main_for_body@17.ops[16]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' +debug: Inserted main_for_body@17.ops[1]: 'store item_index_internal%48#0 to l-stack (copy)' +debug: Replaced main_for_body@17.ops[20]: 'load item_index_internal%48#0' with 'load item_index_internal%48#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[3]: 'store tmp%52#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[5]: 'load tmp%52#0' with 'load tmp%52#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[16]: 'store tmp%62#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[18]: 'load tmp%62#0' with 'load tmp%62#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[21]: 'store tmp%63#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[23]: 'load tmp%63#0' with 'load tmp%63#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[27]: 'store value_as_bytes%66#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[29]: 'load value_as_bytes%66#0' with 'load value_as_bytes%66#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[34]: 'store value_as_bytes%69#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[36]: 'load value_as_bytes%69#0' with 'load value_as_bytes%69#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[42]: 'store array_data%64#2 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[44]: 'load array_data%64#2' with 'load array_data%64#2 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[47]: 'store array_data%64#2 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[49]: 'load array_data%64#2' with 'load array_data%64#2 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[56]: 'store item_index_internal%72#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[58]: 'load item_index_internal%72#0' with 'load item_index_internal%72#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[12]: 'store tmp%61#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[15]: 'load tmp%61#0' with 'load tmp%61#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[39]: 'store value_as_uint16%70#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[42]: 'load value_as_uint16%70#0' with 'load value_as_uint16%70#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[9]: 'store tmp%56#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[15]: 'load tmp%56#0' with 'load tmp%56#0 from l-stack (no copy)' +debug: Inserted main_after_for@19.ops[33]: 'store value_as_uint16%67#0 to l-stack (copy)' +debug: Replaced main_after_for@19.ops[43]: 'load value_as_uint16%67#0' with 'load value_as_uint16%67#0 from l-stack (no copy)' +debug: Inserted main_for_header@20.ops[3]: 'store continue_looping%73#0 to l-stack (copy)' +debug: Replaced main_for_header@20.ops[5]: 'load continue_looping%73#0' with 'load continue_looping%73#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[11]: 'store item_length%76#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[13]: 'load item_length%76#0' with 'load item_length%76#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[24]: 'store tmp%78#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[26]: 'load tmp%78#0' with 'load tmp%78#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[3]: 'store item_index_index%74#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[6]: 'load item_index_index%74#0' with 'load item_index_index%74#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[8]: 'store item_index%75#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[11]: 'load item_index%75#0' with 'load item_index%75#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[18]: 'store item_length_plus_2%77#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[22]: 'load item_length_plus_2%77#0' with 'load item_length_plus_2%77#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[6]: 'store static_string_array#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[11]: 'load static_string_array#0' with 'load static_string_array#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[12]: 'store static_string_array#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[22]: 'load static_string_array#0' with 'load static_string_array#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[14]: 'store item_index%75#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[24]: 'load item_index%75#0' with 'load item_index%75#0 from l-stack (no copy)' +debug: Inserted main_for_body@21.ops[1]: 'store index#0 to l-stack (copy)' +debug: Replaced main_for_body@21.ops[29]: 'load index#0' with 'load index#0 from l-stack (no copy)' +debug: Inserted main_else_body@23.ops[2]: 'store tmp%79#0 to l-stack (copy)' +debug: Replaced main_else_body@23.ops[5]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' +debug: Inserted main_else_body@23.ops[7]: 'store tmp%80#0 to l-stack (copy)' +debug: Replaced main_else_body@23.ops[10]: 'load tmp%80#0' with 'load tmp%80#0 from l-stack (no copy)' +debug: Inserted main_after_if_else@24.ops[3]: 'store item_index_internal%72#0 to l-stack (copy)' +debug: Replaced main_after_if_else@24.ops[5]: 'load item_index_internal%72#0' with 'load item_index_internal%72#0 from l-stack (no copy)' +debug: Inserted main_after_for@26.ops[3]: 'store tmp%81#0 to l-stack (copy)' +debug: Replaced main_after_for@26.ops[5]: 'load tmp%81#0' with 'load tmp%81#0 from l-stack (no copy)' +debug: Found 14 edge set/s for examples.arc4_types.array.Arc4ArraysContract.approval_program +debug: Allocated 1 variable/s to x-stack: string_item#0 +debug: shared x-stack for main_for_body@10 -> main_if_body@11: string_item#0 +debug: shared x-stack for main_for_body@10 -> main_else_body@12: string_item#0 +debug: shared x-stack for main_for_body@21 -> main_if_body@22: string_item#0 +debug: shared x-stack for main_for_body@21 -> main_else_body@23: string_item#0 +debug: examples.arc4_types.array.Arc4ArraysContract.approval_program f-stack entry: ['array_value%36#0', 'result#0', 'static_string_array#0', 'array_length%35#0', 'array_length%9#0', 'index#0', 'item_index_internal%11#0', 'item_index_internal%48#0'] +debug: examples.arc4_types.array.Arc4ArraysContract.approval_program f-stack on first store: ['total#0', 'array_length%1#0', 'item_index_internal%3#0'] +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.ir +info: Optimizing examples.arc4_types.bool.Arc4BoolTypeContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded 0u * 1u to 0u +debug: Folded 12 - 1 to 11 +debug: Folded tmp%31#0 * 1u to tmp%31#0 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: array_data%14#12, static_boolean_array#0 +debug: Replacing {array_data%14#12} with static_boolean_array#0 made 1 modifications +debug: Found equivalence set: array_data%42#3, dynamic_boolean_array#0 +debug: Replacing {array_data%42#3} with dynamic_boolean_array#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%0#0 +debug: Removing unused variable tmp%1#0 +debug: Removing unused variable tmp%2#0 +debug: Removing unused variable tmp%3#0 +debug: Removing unused variable tmp%4#0 +debug: Removing unused variable tmp%5#0 +debug: Removing unused variable tmp%6#0 +debug: Removing unused variable tmp%7#0 +debug: Removing unused variable tmp%8#0 +debug: Removing unused variable tmp%9#0 +debug: Removing unused variable tmp%10#0 +debug: Removing unused variable tmp%11#0 +debug: Removing unused variable tmp%12#0 +debug: Removing unused variable tmp%13#0 +debug: Removing unused variable array_data%14#0 +debug: Removing unused variable item_index%26#0 +debug: Removing unused variable tmp%29#0 +debug: Removing unused variable tmp%31#0 +debug: Removing unused variable array_length%32#0 +debug: Removing unused variable item_index%34#0 +debug: Removing unused variable tmp%37#0 +debug: Removing unused variable tmp%39#0 +debug: Removing unused variable tmp%40#0 +debug: Removing unused variable tmp%41#0 +debug: Removing unused variable array_data%42#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded 11 < 12 to 1 +debug: Folded concat(0x0003, 0x80) to b'/x00/x03/x80' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#1 +debug: Removing unused variable is_true%15#0 +debug: Removing unused variable is_true%16#0 +debug: Removing unused variable is_true%17#0 +debug: Removing unused variable is_true%18#0 +debug: Removing unused variable is_true%19#0 +debug: Removing unused variable is_true%20#0 +debug: Removing unused variable is_true%21#0 +debug: Removing unused variable is_true%22#0 +debug: Removing unused variable is_true%23#0 +debug: Removing unused variable is_true%24#0 +debug: Removing unused variable index_is_in_bounds%33#0 +debug: Removing unused variable array_data%42#1 +debug: Removing unused variable is_true%43#0 +debug: Removing unused variable is_true%44#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#2 +debug: Removing unused variable array_data%42#2 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#3 +debug: Removing unused variable dynamic_boolean_array#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#4 +debug: Removing unused variable tmp%45#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#5 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#6 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_7.ir +debug: Begin optimization pass 8/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#7 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_8.ir +debug: Begin optimization pass 9/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#8 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_9.ir +debug: Begin optimization pass 10/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0xff, 0x80) to b'/xff/x80' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#9 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_10.ir +debug: Begin optimization pass 11/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#10 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_11.ir +debug: Begin optimization pass 12/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%14#11 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_12.ir +debug: Begin optimization pass 13/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable static_boolean_array#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_13.ir +debug: Begin optimization pass 14/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%25#0 +debug: Removing unused variable is_true%27#0 +debug: Removing unused variable is_true%35#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_14.ir +debug: Begin optimization pass 15/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%28#0 +debug: Removing unused variable tmp%36#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_15.ir +debug: Begin optimization pass 16/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%30#0 +debug: Removing unused variable tmp%38#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_16.ir +debug: Begin optimization pass 17/100 +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 17, ending loop +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.cssa.ir +debug: Removing Phis from examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Removing Phis from examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Removing Phis from examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.arc4_types.bool.Arc4BoolTypeContract.approval_program +debug: Sequentializing parallel copies in examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff +debug: Sequentializing parallel copies in examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.parallel_copies.ir +debug: Coalescing local variables in examples.arc4_types.bool.Arc4BoolTypeContract.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/arc4_types/out/bool_Arc4BoolTypeContract.final.ir +debug: Inserted test_stuff_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[30]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[32]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[46]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[48]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[26]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[29]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[43]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[46]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[21]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[25]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[39]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[43]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.ir +info: Optimizing examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Switch switch tmp%12#0 {0u => block@7, * => block@8} simplified to goto [block@7, ...block@8][tmp%12#0] +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@5: // switch_case_next_L4 with block@4: // switch_case_default_L4 in block@9: // after_if_else_L4 +debug: Merged linear block@5: // switch_case_next_L4 into block@4: // switch_case_default_L4 +debug: Merged linear block@9: // after_if_else_L4 into block@4: // switch_case_default_L4 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded len("/x00/x01X") to 3 +debug: Folded len("/x00/x01Y") to 3 +debug: Folded len("/x00/x01Z") to 3 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#0 +debug: Removing unused variable next_offset%1#0 +debug: Removing unused variable element_length%4#0 +debug: Removing unused variable element_length%7#0 +debug: Removing unused variable element_length%10#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: array_data%3#6, raw#0 +debug: Replacing {array_data%3#6} with raw#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#0 +debug: Removing unused variable array_data%1#0 +debug: Removing unused variable array_data%2#0 +debug: Removing unused variable array_data%3#0 +debug: Removing unused variable next_offset%4#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: GotoNth goto [block@7, ...block@8][tmp%12#0] simplified to goto tmp%12#0 ? block@8 : block@7 +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Optimizer: Arithmetic Simplification +debug: Folded 6 + 3 to 9 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable next_offset%1#1 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x0001, 0x58) to b'/x00/x01X' +debug: Folded concat(0x0001, 0x59) to b'/x00/x01Y' +debug: Folded concat(0x0001, 0x5a) to b'/x00/x01Z' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable array_data%0#1 +debug: Removing unused variable array_data%1#1 +debug: Removing unused variable array_data%2#1 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Optimizer: Arithmetic Simplification +debug: Folded 9 + 3 to 12 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable next_offset%1#2 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Optimizer: Arithmetic Simplification +debug: Folded len(0x000158) to 3 +debug: Folded len(0x000159) to 3 +debug: Folded len(0x00015a) to 3 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable element_length%7#0 +debug: Removing unused variable element_length%10#0 +debug: Removing unused variable element_length%13#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Optimizer: Arithmetic Simplification +debug: Folded 12 + 3 to 15 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable next_offset%1#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Optimizer: Arithmetic Simplification +debug: Folded 6 + 3 to 9 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable next_offset%4#1 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Optimizer: Arithmetic Simplification +debug: Folded 9 + 3 to 12 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable next_offset%4#2 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Optimizer: Arithmetic Simplification +debug: Folded 12 + 3 to 15 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable next_offset%4#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 7, ending loop +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.cssa.ir +debug: Removing Phis from examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Removing Phis from examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Removing Phis from examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Removing Phis from examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Sequentializing parallel copies in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz +debug: Sequentializing parallel copies in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw +debug: Sequentializing parallel copies in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.parallel_copies.ir +debug: Coalescing local variables in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz using strategy RootOperandGrouping +debug: Coalescing array_data%0#1 with [array_data%0#2, array_data%0#3, array_data%0#4, array_data%0#5, array_data%0#6] +debug: Coalescing resulted in 10 replacement/s +debug: Coalescing local variables in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw using strategy RootOperandGrouping +debug: Coalescing array_data%3#1 with [array_data%3#2, array_data%3#3, array_data%3#4, array_data%3#5] +debug: Coalescing resulted in 8 replacement/s +debug: Coalescing local variables in examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final.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[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_xyz_route@2.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_xyz_route@2.ops[3]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_xyz_route@2.ops[5]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_xyz_route@2.ops[7]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_xyz_route@2.ops[10]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_xyz_route@2.ops[12]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_xyz_route@2.ops[19]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_xyz_route@2.ops[21]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_xyz_route@2.ops[15]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_xyz_route@2.ops[18]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_xyz_raw_route@3.ops[1]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_xyz_raw_route@3.ops[3]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_xyz_raw_route@3.ops[5]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_xyz_raw_route@3.ops[7]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_xyz_raw_route@3.ops[10]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_xyz_raw_route@3.ops[12]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_xyz_raw_route@3.ops[19]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_xyz_raw_route@3.ops[21]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_xyz_raw_route@3.ops[15]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_xyz_raw_route@3.ops[18]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_bare_routing@6.ops[1]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_bare_routing@6.ops[3]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_create@7.ops[1]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_create@7.ops[3]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_create@7.ops[5]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_create@7.ops[7]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Found 3 edge set/s for examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program +debug: Inserted xyz_block@0.ops[2]: 'store value_as_bytes%2#0 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[4]: 'load value_as_bytes%2#0' with 'load value_as_bytes%2#0 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[13]: 'store value_as_bytes%5#0 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[15]: 'load value_as_bytes%5#0' with 'load value_as_bytes%5#0 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[24]: 'store value_as_bytes%8#0 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[26]: 'load value_as_bytes%8#0' with 'load value_as_bytes%8#0 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[32]: 'store array_data%0#1 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[34]: 'load array_data%0#1' with 'load array_data%0#1 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[37]: 'store array_data%0#1 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[39]: 'load array_data%0#1' with 'load array_data%0#1 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[42]: 'store array_data%0#1 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[44]: 'load array_data%0#1' with 'load array_data%0#1 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[47]: 'store array_data%0#1 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[49]: 'load array_data%0#1' with 'load array_data%0#1 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[6]: 'store value_as_uint16%3#0 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[9]: 'load value_as_uint16%3#0' with 'load value_as_uint16%3#0 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[18]: 'store value_as_uint16%6#0 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[21]: 'load value_as_uint16%6#0' with 'load value_as_uint16%6#0 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[30]: 'store value_as_uint16%9#0 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[33]: 'load value_as_uint16%9#0' with 'load value_as_uint16%9#0 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[11]: 'store array_data%0#1 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[21]: 'load array_data%0#1' with 'load array_data%0#1 from l-stack (no copy)' +debug: Inserted xyz_block@0.ops[24]: 'store array_data%0#1 to l-stack (copy)' +debug: Replaced xyz_block@0.ops[34]: 'load array_data%0#1' with 'load array_data%0#1 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[2]: 'store value_as_bytes%5#0 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[4]: 'load value_as_bytes%5#0' with 'load value_as_bytes%5#0 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[13]: 'store value_as_bytes%8#0 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[15]: 'load value_as_bytes%8#0' with 'load value_as_bytes%8#0 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[24]: 'store value_as_bytes%11#0 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[26]: 'load value_as_bytes%11#0' with 'load value_as_bytes%11#0 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[32]: 'store array_data%3#1 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[34]: 'load array_data%3#1' with 'load array_data%3#1 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[37]: 'store array_data%3#1 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[39]: 'load array_data%3#1' with 'load array_data%3#1 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[42]: 'store array_data%3#1 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[44]: 'load array_data%3#1' with 'load array_data%3#1 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[47]: 'store raw#0 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[49]: 'load raw#0' with 'load raw#0 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[6]: 'store value_as_uint16%6#0 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[9]: 'load value_as_uint16%6#0' with 'load value_as_uint16%6#0 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[18]: 'store value_as_uint16%9#0 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[21]: 'load value_as_uint16%9#0' with 'load value_as_uint16%9#0 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[30]: 'store value_as_uint16%12#0 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[33]: 'load value_as_uint16%12#0' with 'load value_as_uint16%12#0 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[11]: 'store array_data%3#1 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[21]: 'load array_data%3#1' with 'load array_data%3#1 from l-stack (no copy)' +debug: Inserted xyz_raw_block@0.ops[24]: 'store array_data%3#1 to l-stack (copy)' +debug: Replaced xyz_raw_block@0.ops[34]: 'load array_data%3#1' with 'load array_data%3#1 from l-stack (no copy)' +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.ir +info: Optimizing examples.arc4_types.numeric.Arc4NumericTypesContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%2#0, ternary_result%4#1 +debug: Replacing {ternary_result%4#1} with awst_tmp%2#0 made 1 modifications +debug: Found equivalence set: awst_tmp%8#0, ternary_result%10#1 +debug: Replacing {ternary_result%10#1} with awst_tmp%8#0 made 1 modifications +debug: Found equivalence set: awst_tmp%14#0, ternary_result%16#1 +debug: Replacing {ternary_result%16#1} with awst_tmp%14#0 made 1 modifications +debug: Found equivalence set: awst_tmp%20#0, ternary_result%22#1 +debug: Replacing {ternary_result%22#1} with awst_tmp%20#0 made 1 modifications +debug: Found equivalence set: awst_tmp%26#0, ternary_result%28#1 +debug: Replacing {ternary_result%28#1} with awst_tmp%26#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable uint8#0 +debug: Removing unused variable test_bytes#0 +debug: Removing unused variable decimals#0 +debug: Removing unused variable really_big_int#0 +debug: Removing unused variable biguint#0 +debug: Removing unused variable arc4_biguint_const#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L35 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_false_L37 because it's used by phi nodes +info: Not removing empty block block@8: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_false_L40 because it's used by phi nodes +info: Not removing empty block block@14: // ternary_false_L41 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded len(0x7fffffffffffffff00) to 9 +debug: Folded len(0x7fffffffffffffff00) to 9 +debug: Folded len(0x7fffffffffffffff00) to 9 +debug: Folded len(0x7fffffffffffffff00) to 9 +debug: Folded len(0x7fffffffffffffff00) to 9 +debug: Folded len(0x0000015333430684) to 8 +debug: Folded len(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) to 64 +debug: Folded len(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) to 64 +debug: Folded 1 b+ 1 to 2 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%32#0 +debug: Removing unused variable tmp%34#0 +debug: Removing unused variable len_%36#0 +debug: Removing unused variable tmp%44#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L35 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_false_L37 because it's used by phi nodes +info: Not removing empty block block@8: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_false_L40 because it's used by phi nodes +info: Not removing empty block block@14: // ternary_false_L41 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded 1 < 9 to 1 +debug: Folded 3 < 9 to 1 +debug: Folded 2 < 9 to 1 +debug: Folded 4 < 9 to 1 +debug: Folded 8 < 9 to 1 +debug: Folded 8 == 8 to 1 +debug: Folded 64 == 64 to 1 +debug: Folded 64 <= 64 to 1 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%3#0 +debug: Removing unused variable tmp%9#0 +debug: Removing unused variable tmp%15#0 +debug: Removing unused variable tmp%21#0 +debug: Removing unused variable tmp%27#0 +debug: Removing unused variable tmp%33#0 +debug: Removing unused variable tmp%35#0 +debug: Removing unused variable no_overflow%37#0 +debug: Optimizer: Simplify Conditional Branches +debug: ConditionalBranch goto 1u ? block@1 : block@2 simplified to goto block@1 +debug: ConditionalBranch goto 1u ? block@4 : block@5 simplified to goto block@4 +debug: ConditionalBranch goto 1u ? block@7 : block@8 simplified to goto block@7 +debug: ConditionalBranch goto 1u ? block@10 : block@11 simplified to goto block@10 +debug: ConditionalBranch goto 1u ? block@13 : block@14 simplified to goto block@13 +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@1: // ternary_true_L35 with block@0: // L25 in block@3: // ternary_merge_L35 +debug: Merged linear block@1: // ternary_true_L35 into block@0: // L25 +debug: Replaced predecessor block@4: // ternary_true_L37 with block@3: // ternary_merge_L35 in block@6: // ternary_merge_L37 +debug: Merged linear block@4: // ternary_true_L37 into block@3: // ternary_merge_L35 +debug: Replaced predecessor block@7: // ternary_true_L39 with block@6: // ternary_merge_L37 in block@9: // ternary_merge_L39 +debug: Merged linear block@7: // ternary_true_L39 into block@6: // ternary_merge_L37 +debug: Replaced predecessor block@10: // ternary_true_L40 with block@9: // ternary_merge_L39 in block@12: // ternary_merge_L40 +debug: Merged linear block@10: // ternary_true_L40 into block@9: // ternary_merge_L39 +debug: Replaced predecessor block@13: // ternary_true_L41 with block@12: // ternary_merge_L40 in block@15: // ternary_merge_L41 +debug: Merged linear block@13: // ternary_true_L41 into block@12: // ternary_merge_L40 +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L35 because it's currently unreachable +info: Not removing empty block block@5: // ternary_false_L37 because it's currently unreachable +info: Not removing empty block block@8: // ternary_false_L39 because it's currently unreachable +info: Not removing empty block block@11: // ternary_false_L40 because it's currently unreachable +info: Not removing empty block block@14: // ternary_false_L41 because it's currently unreachable +debug: Optimizer: Remove Unreachable Blocks +debug: Removing unreachable blocks: block@2: // ternary_false_L35, block@5: // ternary_false_L37, block@8: // ternary_false_L39, block@11: // ternary_false_L40, block@14: // ternary_false_L41 +debug: Removed unreachable predecessors from block@3: // ternary_merge_L35 +debug: Removed unreachable predecessors from block@6: // ternary_merge_L37 +debug: Removed unreachable predecessors from block@9: // ternary_merge_L39 +debug: Removed unreachable predecessors from block@12: // ternary_merge_L40 +debug: Removed unreachable predecessors from block@15: // ternary_merge_L41 +debug: Removing unreachable phi arguments: awst_tmp%2#0 <- block@2 +debug: Replacing trivial Phi node: let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@0) (ternary_result%4#2) with ternary_result%4#0 +debug: Deleting Phi assignment: let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@0) +debug: Removing unreachable phi arguments: awst_tmp%8#0 <- block@5 +debug: Replacing trivial Phi node: let ternary_result%10#2: uint64 = φ(ternary_result%10#0 <- block@3) (ternary_result%10#2) with ternary_result%10#0 +debug: Deleting Phi assignment: let ternary_result%10#2: uint64 = φ(ternary_result%10#0 <- block@3) +debug: Removing unreachable phi arguments: awst_tmp%14#0 <- block@8 +debug: Replacing trivial Phi node: let ternary_result%16#2: uint64 = φ(ternary_result%16#0 <- block@6) (ternary_result%16#2) with ternary_result%16#0 +debug: Deleting Phi assignment: let ternary_result%16#2: uint64 = φ(ternary_result%16#0 <- block@6) +debug: Removing unreachable phi arguments: awst_tmp%20#0 <- block@11 +debug: Replacing trivial Phi node: let ternary_result%22#2: uint64 = φ(ternary_result%22#0 <- block@9) (ternary_result%22#2) with ternary_result%22#0 +debug: Deleting Phi assignment: let ternary_result%22#2: uint64 = φ(ternary_result%22#0 <- block@9) +debug: Removing unreachable phi arguments: awst_tmp%26#0 <- block@14 +debug: Replacing trivial Phi node: let ternary_result%28#2: uint64 = φ(ternary_result%28#0 <- block@12) (ternary_result%28#2) with ternary_result%28#0 +debug: Deleting Phi assignment: let ternary_result%28#2: uint64 = φ(ternary_result%28#0 <- block@12) +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable awst_tmp%2#0 +debug: Removing unused variable ternary_result%4#0 +debug: Removing unused variable awst_tmp%8#0 +debug: Removing unused variable ternary_result%10#0 +debug: Removing unused variable awst_tmp%14#0 +debug: Removing unused variable ternary_result%16#0 +debug: Removing unused variable awst_tmp%20#0 +debug: Removing unused variable ternary_result%22#0 +debug: Removing unused variable awst_tmp%26#0 +debug: Removing unused variable ternary_result%28#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@3: // ternary_merge_L35 with block@0: // L25 in block@6: // ternary_merge_L37 +debug: Merged linear block@3: // ternary_merge_L35 into block@0: // L25 +debug: Replaced predecessor block@6: // ternary_merge_L37 with block@0: // L25 in block@9: // ternary_merge_L39 +debug: Merged linear block@6: // ternary_merge_L37 into block@0: // L25 +debug: Replaced predecessor block@9: // ternary_merge_L39 with block@0: // L25 in block@12: // ternary_merge_L40 +debug: Merged linear block@9: // ternary_merge_L39 into block@0: // L25 +debug: Replaced predecessor block@12: // ternary_merge_L40 with block@0: // L25 in block@15: // ternary_merge_L41 +debug: Merged linear block@12: // ternary_merge_L40 into block@0: // L25 +debug: Merged linear block@15: // ternary_merge_L41 into block@0: // L25 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%5#0 +debug: Removing unused variable tmp%11#0 +debug: Removing unused variable tmp%17#0 +debug: Removing unused variable tmp%23#0 +debug: Removing unused variable tmp%29#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 6, ending loop +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.cssa.ir +debug: Removing Phis from examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Removing Phis from examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program +debug: Sequentializing parallel copies in examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.parallel_copies.ir +debug: Coalescing local variables in examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/arc4_types/out/numeric_Arc4NumericTypesContract.final.ir +debug: Inserted main_block@0.ops[2]: 'store val_as_bytes%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[4]: 'load val_as_bytes%0#0' with 'load val_as_bytes%0#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[6]: 'store int8_encoded#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[8]: 'load int8_encoded#0' with 'load int8_encoded#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[14]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[16]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[20]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[22]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[25]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[27]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[31]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[33]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[36]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[38]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[42]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[44]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[47]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[49]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[53]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[55]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[58]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[60]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[64]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[66]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[69]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[71]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[83]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[85]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[89]: 'store len_%41#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[91]: 'load len_%41#0' with 'load len_%41#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[94]: 'store no_overflow%42#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[96]: 'load no_overflow%42#0' with 'load no_overflow%42#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[107]: 'store len_%45#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[109]: 'load len_%45#0' with 'load len_%45#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[112]: 'store no_overflow%46#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[114]: 'load no_overflow%46#0' with 'load no_overflow%46#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[126]: 'store tmp%48#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[128]: 'load tmp%48#0' with 'load tmp%48#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[132]: 'store tmp%49#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[134]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[137]: 'store tmp%50#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[139]: 'load tmp%50#0' with 'load tmp%50#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[143]: 'store tmp%51#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[145]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[148]: 'store tmp%52#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[150]: 'load tmp%52#0' with 'load tmp%52#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[10]: 'store int8_decoded#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[13]: 'load int8_decoded#0' with 'load int8_decoded#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[76]: 'store b_zeros%38#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[79]: 'load b_zeros%38#0' with 'load b_zeros%38#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[81]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[84]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[103]: 'store b_zeros%43#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[106]: 'load b_zeros%43#0' with 'load b_zeros%43#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[122]: 'store b_zeros%47#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[125]: 'load b_zeros%47#0' with 'load b_zeros%47#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[127]: 'store arc4_biguint_dynamic#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[136]: 'load arc4_biguint_dynamic#0' with 'load arc4_biguint_dynamic#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[108]: 'store really_big_decimal#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[148]: 'load really_big_decimal#0' with 'load really_big_decimal#0 from l-stack (no copy)' +debug: Output IR to /examples/arc4_types/out/string_Arc4StringTypesContract.ssa.ir +info: Optimizing examples.arc4_types.string.Arc4StringTypesContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%4#0, ternary_result%6#1 +debug: Replacing {ternary_result%6#1} with awst_tmp%4#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable some_bytes#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L20 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded len("Hello World!") to 12 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable length%0#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L20 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L20 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 3, ending loop +debug: Output IR to /examples/arc4_types/out/string_Arc4StringTypesContract.cssa.ir +debug: Removing Phis from examples.arc4_types.string.Arc4StringTypesContract.approval_program +debug: Removing Phis from examples.arc4_types.string.Arc4StringTypesContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/string_Arc4StringTypesContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.arc4_types.string.Arc4StringTypesContract.approval_program +debug: Sequentializing parallel copies in examples.arc4_types.string.Arc4StringTypesContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/string_Arc4StringTypesContract.parallel_copies.ir +debug: Coalescing local variables in examples.arc4_types.string.Arc4StringTypesContract.approval_program using strategy RootOperandGrouping +debug: Coalescing ternary_result%6#0 with [ternary_result%6#4, ternary_result%6#2] +debug: Coalescing resulted in 5 replacement/s +debug: Coalescing local variables in examples.arc4_types.string.Arc4StringTypesContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/arc4_types/out/string_Arc4StringTypesContract.final.ir +debug: Inserted main_block@0.ops[2]: 'store value_as_bytes%1#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[4]: 'load value_as_bytes%1#0' with 'load value_as_bytes%1#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[6]: 'store value_as_uint16%2#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[8]: 'load value_as_uint16%2#0' with 'load value_as_uint16%2#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[11]: 'store some_bytes_as_string#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[13]: 'load some_bytes_as_string#0' with 'load some_bytes_as_string#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[19]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[21]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[29]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[31]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[25]: 'store awst_tmp%4#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[28]: 'load awst_tmp%4#0' with 'load awst_tmp%4#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[14]: 'store some_bytes_as_string#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[18]: 'load some_bytes_as_string#0' with 'load some_bytes_as_string#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[19]: 'store some_bytes_as_string#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[25]: 'load some_bytes_as_string#0' with 'load some_bytes_as_string#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@3.ops[11]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@3.ops[13]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@3.ops[18]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@3.ops[20]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@3.ops[7]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@3.ops[10]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@3.ops[1]: 'store some_bytes_as_string#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@3.ops[4]: 'load some_bytes_as_string#0' with 'load some_bytes_as_string#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@3.ops[3]: 'store base_length%7#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@3.ops[7]: 'load base_length%7#0' with 'load base_length%7#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.arc4_types.string.Arc4StringTypesContract.approval_program +debug: Allocated 1 variable/s to x-stack: ternary_result%6#0 +debug: shared x-stack for main_ternary_true@1 -> main_ternary_merge@3: ternary_result%6#0 +debug: shared x-stack for main_ternary_false@2 -> main_ternary_merge@3: ternary_result%6#0 +debug: examples.arc4_types.string.Arc4StringTypesContract.approval_program f-stack entry: [] +debug: examples.arc4_types.string.Arc4StringTypesContract.approval_program f-stack on first store: ['some_bytes_as_string#0', 'some_bytes_as_bytes_again#0', 'awst_tmp%4#0'] +debug: Simplified uncover 2; uncover 2 to cover 2 +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.ir +info: Optimizing examples.arc4_types.structs.Arc4StructsTypeContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: encoded_tuple_buffer%1#2, coord_1#0 +debug: Replacing {encoded_tuple_buffer%1#2} with coord_1#0 made 1 modifications +debug: Found equivalence set: encoded_tuple_buffer%3#2, coord_2#0 +debug: Replacing {encoded_tuple_buffer%3#2} with coord_2#0 made 1 modifications +debug: Found equivalence set: tmp%4#0, val#0 +debug: Replacing {tmp%4#0} with val#0 made 1 modifications +debug: Found equivalence set: tmp%5#0, val#1 +debug: Replacing {tmp%5#0} with val#1 made 1 modifications +debug: Found equivalence set: encoded_tuple_buffer%12#4, flags#0 +debug: Replacing {encoded_tuple_buffer%12#4} with flags#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable current_tail_offset%0#0 +debug: Removing unused variable encoded_tuple_buffer%1#0 +debug: Removing unused variable current_tail_offset%2#0 +debug: Removing unused variable encoded_tuple_buffer%3#0 +debug: Removing unused variable tmp%7#0 +debug: Removing unused variable tmp%8#0 +debug: Removing unused variable tmp%9#0 +debug: Removing unused variable tmp%10#0 +debug: Removing unused variable current_tail_offset%11#0 +debug: Removing unused variable encoded_tuple_buffer%12#0 +debug: Removing unused variable current_tail_offset%16#0 +debug: Removing unused variable encoded_tuple_buffer%17#0 +debug: Optimizer: Simplify Conditional Branches +debug: GotoNth goto [block@2, ...block@5][tuple_index%6#1] simplified to goto tuple_index%6#1 ? block@5 : block@2 +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@1: // for_header_0_L30 with block@0: // L26 in block@3: // for_body_L30 +debug: Merged linear block@1: // for_header_0_L30 into block@0: // L26 +debug: Replaced predecessor block@4: // for_footer_L30 with block@3: // for_body_L30 in block@2: // for_header_1_L30 +debug: Replaced predecessor block@4: // for_footer_L30 with block@3: // for_body_L30 in block@5: // after_for_L30 +debug: Merged linear block@4: // for_footer_L30 into block@3: // for_body_L30 +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // for_header_1_L30 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.add +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable current_tail_offset%12#0 +debug: Removing unused variable encoded_tuple_buffer%13#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.check +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.nested_decode +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: coord_1#0, encoded_tuple_buffer%17#1 +debug: Replacing {encoded_tuple_buffer%17#1} with coord_1#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%1#1 +debug: Removing unused variable encoded_tuple_buffer%3#1 +debug: Removing unused variable encoded_tuple_buffer%12#1 +debug: Removing unused variable is_true%13#0 +debug: Removing unused variable is_true%14#0 +debug: Removing unused variable is_true%15#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // for_header_1_L30 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.add +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: val_as_bytes%5#0, encoded_tuple_buffer%13#1 +debug: Replacing {encoded_tuple_buffer%13#1} with val_as_bytes%5#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.check +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.nested_decode +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x000000083cfbf217, 0x000000230384b842) to b'/x00/x00/x00/x08/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%12#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // for_header_1_L30 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.add +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.check +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.nested_decode +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable flags#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // for_header_1_L30 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.add +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.check +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.nested_decode +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x000000083cfbf217000000230384b842, 0xa0) to b'/x00/x00/x00/x08/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // for_header_1_L30 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.add +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.check +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.nested_decode +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 7, ending loop +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.cssa.ir +debug: Removing Phis from examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Removing Phis from examples.arc4_types.structs.add +debug: Removing Phis from examples.arc4_types.structs.check +debug: Removing Phis from examples.arc4_types.structs.nested_decode +debug: Removing Phis from examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: loc: {tuple_index%6#6=None, val#5=None, tuple_index%6#0=tuple_index%6#0, val#0=val#0} +debug: pred: {tuple_index%6#6=tuple_index%6#0, val#5=val#0} +debug: ready: tuple_index%6#6, val#5 +debug: to_do: tuple_index%6#6, val#5 +debug: * avail val#5 +debug: * avail val#0 +debug: * avail tuple_index%6#6 +debug: * avail tuple_index%6#0 +debug: * to_do val#5 +debug: * to_do tuple_index%6#6 +debug: loc: {tuple_index%6#6=None, val#5=None, tuple_index%6#3=tuple_index%6#3, val#1=val#1} +debug: pred: {tuple_index%6#6=tuple_index%6#3, val#5=val#1} +debug: ready: tuple_index%6#6, val#5 +debug: to_do: tuple_index%6#6, val#5 +debug: * avail val#5 +debug: * avail val#1 +debug: * avail tuple_index%6#6 +debug: * avail tuple_index%6#3 +debug: * to_do val#5 +debug: * to_do tuple_index%6#6 +debug: loc: {tuple_index%6#1=None, val#2=None, tuple_index%6#6=tuple_index%6#6, val#5=val#5} +debug: pred: {tuple_index%6#1=tuple_index%6#6, val#2=val#5} +debug: ready: tuple_index%6#1, val#2 +debug: to_do: tuple_index%6#1, val#2 +debug: * avail val#2 +debug: * avail val#5 +debug: * avail tuple_index%6#1 +debug: * avail tuple_index%6#6 +debug: * to_do val#2 +debug: * to_do tuple_index%6#1 +debug: Sequentializing parallel copies in examples.arc4_types.structs.add +debug: Sequentializing parallel copies in examples.arc4_types.structs.check +debug: Sequentializing parallel copies in examples.arc4_types.structs.nested_decode +debug: Sequentializing parallel copies in examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.parallel_copies.ir +debug: Coalescing local variables in examples.arc4_types.structs.Arc4StructsTypeContract.approval_program using strategy RootOperandGrouping +debug: Coalescing val#0 with [val#5, val#2] +debug: Coalescing tuple_index%6#0 with [tuple_index%6#6, tuple_index%6#1] +debug: Coalescing resulted in 11 replacement/s +debug: Coalescing local variables in examples.arc4_types.structs.add using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.structs.check using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.structs.nested_decode using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/arc4_types/out/structs_Arc4StructsTypeContract.final.ir +debug: Inserted main_block@0.ops[3]: 'store coord_3#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[5]: 'load coord_3#0' with 'load coord_3#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[6]: 'store coord_3#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[11]: 'load coord_3#0' with 'load coord_3#0 from l-stack (no copy)' +debug: Inserted main_for_body@3.ops[3]: 'store tuple_index%6#0 to l-stack (copy)' +debug: Replaced main_for_body@3.ops[7]: 'load tuple_index%6#0' with 'load tuple_index%6#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.arc4_types.structs.Arc4StructsTypeContract.approval_program +debug: Allocated 1 variable/s to x-stack: val#0 +debug: shared x-stack for main_block@0 -> main_for_body@3: val#0 +debug: shared x-stack for main_for_header_1@2 -> main_for_body@3: val#0 +debug: examples.arc4_types.structs.Arc4StructsTypeContract.approval_program f-stack entry: ['tuple_index%6#3'] +debug: examples.arc4_types.structs.Arc4StructsTypeContract.approval_program f-stack on first store: ['val#1', 'tuple_index%6#0'] +debug: Inserted add_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[13]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[15]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[21]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[23]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[30]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[32]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[39]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[41]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[47]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[49]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[55]: 'store encoded_tuple_buffer%13#2 to l-stack (copy)' +debug: Replaced add_block@0.ops[57]: 'load encoded_tuple_buffer%13#2' with 'load encoded_tuple_buffer%13#2 from l-stack (no copy)' +debug: Inserted add_block@0.ops[17]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[20]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[44]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[47]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[53]: 'store val_as_bytes%11#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[56]: 'load val_as_bytes%11#0' with 'load val_as_bytes%11#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[20]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[36]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[48]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted add_block@0.ops[27]: 'store val_as_bytes%5#0 to l-stack (copy)' +debug: Replaced add_block@0.ops[58]: 'load val_as_bytes%5#0' with 'load val_as_bytes%5#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[13]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[15]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[25]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[27]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[30]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[32]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[34]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[36]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[46]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[48]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[51]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[53]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[63]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[65]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[68]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[70]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[72]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[74]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[3]: 'store is_true%0#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[7]: 'load is_true%0#0' with 'load is_true%0#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[21]: 'store is_true%3#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[25]: 'load is_true%3#0' with 'load is_true%3#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[43]: 'store is_true%7#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[47]: 'load is_true%7#0' with 'load is_true%7#0 from l-stack (no copy)' +debug: Inserted check_block@0.ops[61]: 'store is_true%10#0 to l-stack (copy)' +debug: Replaced check_block@0.ops[65]: 'load is_true%10#0' with 'load is_true%10#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[19]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[21]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[27]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[29]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[37]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[39]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[42]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[44]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted nested_decode_block@0.ops[32]: 'store is_true%5#0 to l-stack (copy)' +debug: Replaced nested_decode_block@0.ops[36]: 'load is_true%5#0' with 'load is_true%5#0 from l-stack (no copy)' +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.ir +info: Optimizing examples.arc4_types.tuples.Arc4TuplesTypeContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded len("/x00/x05hello") to 7 +debug: Folded len("/x00/x05world") to 7 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: encoded_tuple_buffer%1#7, my_tuple#0 +debug: Replacing {encoded_tuple_buffer%1#7} with my_tuple#0 made 1 modifications +debug: Found equivalence set: encoded_tuple_buffer%19#11, boolean_packing#0 +debug: Replacing {encoded_tuple_buffer%19#11} with boolean_packing#0 made 1 modifications +debug: Found equivalence set: item0%28#0, a#0 +debug: Replacing {item0%28#0} with a#0 made 1 modifications +debug: Found equivalence set: item1%30#0, b#0, ternary_result%53#0 +debug: Replacing {item1%30#0, ternary_result%53#0} with b#0 made 2 modifications +debug: Found equivalence set: item2%32#0, c#0, ternary_result%66#0 +debug: Replacing {item2%32#0, ternary_result%66#0} with c#0 made 2 modifications +debug: Found equivalence set: item3%34#0, d#0, ternary_result%55#0 +debug: Replacing {item3%34#0, ternary_result%55#0} with d#0 made 2 modifications +debug: Found equivalence set: item4%36#0, e#0, ternary_result%57#0 +debug: Replacing {item4%36#0, ternary_result%57#0} with e#0 made 2 modifications +debug: Found equivalence set: item5%38#0, f#0, ternary_result%59#0 +debug: Replacing {item5%38#0, ternary_result%59#0} with f#0 made 2 modifications +debug: Found equivalence set: item6%40#0, g#0, ternary_result%61#0 +debug: Replacing {item6%40#0, ternary_result%61#0} with g#0 made 2 modifications +debug: Found equivalence set: item7%42#0, h#0, ternary_result%66#1 +debug: Replacing {item7%42#0, ternary_result%66#1} with h#0 made 2 modifications +debug: Found equivalence set: item8%44#0, i#0, ternary_result%63#0 +debug: Replacing {item8%44#0, ternary_result%63#0} with i#0 made 2 modifications +debug: Found equivalence set: item9%46#0, j#0, ternary_result%63#1 +debug: Replacing {item9%46#0, ternary_result%63#1} with j#0 made 2 modifications +debug: Found equivalence set: item10%47#0, k#0 +debug: Replacing {item10%47#0} with k#0 made 1 modifications +debug: Found equivalence set: ternary_result%55#2, ternary_result%53#1 +debug: Replacing {ternary_result%53#1} with ternary_result%55#2 made 1 modifications +debug: Found equivalence set: ternary_result%57#2, ternary_result%55#1 +debug: Replacing {ternary_result%55#1} with ternary_result%57#2 made 1 modifications +debug: Found equivalence set: tuple_assignment%100#0, total#0 +debug: Replacing {tuple_assignment%100#0} with total#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%101#0, concat#0 +debug: Replacing {tuple_assignment%101#0} with concat#0 made 1 modifications +debug: Found equivalence set: ternary_result%59#2, ternary_result%57#1 +debug: Replacing {ternary_result%57#1} with ternary_result%59#2 made 1 modifications +debug: Found equivalence set: ternary_result%61#2, ternary_result%59#1 +debug: Replacing {ternary_result%59#1} with ternary_result%61#2 made 1 modifications +debug: Found equivalence set: ternary_result%63#2, ternary_result%61#1 +debug: Replacing {ternary_result%61#1} with ternary_result%63#2 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable current_tail_offset%0#0 +debug: Removing unused variable encoded_tuple_buffer%1#0 +debug: Removing unused variable data_length%4#0 +debug: Removing unused variable data_length%7#0 +debug: Removing unused variable tmp%9#0 +debug: Removing unused variable tmp%10#0 +debug: Removing unused variable tmp%11#0 +debug: Removing unused variable tmp%12#0 +debug: Removing unused variable tmp%13#0 +debug: Removing unused variable tmp%14#0 +debug: Removing unused variable tmp%15#0 +debug: Removing unused variable tmp%16#0 +debug: Removing unused variable tmp%17#0 +debug: Removing unused variable current_tail_offset%18#0 +debug: Removing unused variable encoded_tuple_buffer%19#0 +debug: Removing unused variable current_tail_offset%90#0 +debug: Removing unused variable encoded_tuple_buffer%91#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: item0%0#0, a#0 +debug: Replacing {item0%0#0} with a#0 made 1 modifications +debug: Found equivalence set: item1%1#0, b#0 +debug: Replacing {item1%1#0} with b#0 made 1 modifications +debug: Found equivalence set: item2%5#0, c#0 +debug: Replacing {item2%5#0} with c#0 made 1 modifications +debug: Found equivalence set: item3%9#0, d#0 +debug: Replacing {item3%9#0} with d#0 made 1 modifications +debug: Found equivalence set: item4%10#0, e#0 +debug: Replacing {item4%10#0} with e#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded 7 + 7 to 14 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: item0%70#0, encoded_tuple_buffer%91#1 +debug: Replacing {encoded_tuple_buffer%91#1} with item0%70#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%1#1 +debug: Removing unused variable current_tail_offset%0#1 +debug: Removing unused variable encoded_tuple_buffer%19#1 +debug: Removing unused variable is_true%20#0 +debug: Removing unused variable is_true%21#0 +debug: Removing unused variable is_true%22#0 +debug: Removing unused variable is_true%23#0 +debug: Removing unused variable is_true%24#0 +debug: Removing unused variable is_true%25#0 +debug: Removing unused variable is_true%26#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x01, 0x02) to b'/x01/x02' +debug: Folded 14 + 7 to 21 +debug: Folded concat(0x04, 0x80) to b'/x04/x80' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%1#2 +debug: Removing unused variable current_tail_offset%0#2 +debug: Removing unused variable encoded_tuple_buffer%19#2 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_3.ir +debug: Begin optimization pass 4/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#4 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#5 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#6 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_7.ir +debug: Begin optimization pass 8/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#7 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_8.ir +debug: Begin optimization pass 9/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#8 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_9.ir +debug: Begin optimization pass 10/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#9 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_10.ir +debug: Begin optimization pass 11/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x04bd, 0x80) to b'/x04/xbd/x80' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%19#10 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_11.ir +debug: Begin optimization pass 12/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x04bd80, 0x10) to b'/x04/xbd/x80/x10' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable boolean_packing#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_12.ir +debug: Begin optimization pass 13/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +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: Removing unused variable a#0 +debug: Removing unused variable is_true%29#0 +debug: Removing unused variable is_true%31#0 +debug: Removing unused variable is_true%33#0 +debug: Removing unused variable is_true%35#0 +debug: Removing unused variable is_true%37#0 +debug: Removing unused variable is_true%39#0 +debug: Removing unused variable is_true%41#0 +debug: Removing unused variable is_true%43#0 +debug: Removing unused variable is_true%45#0 +debug: Removing unused variable k#0 +debug: Removing unused variable tmp%48#0 +debug: Removing unused variable item0%70#0 +debug: Removing unused variable is_true%71#0 +debug: Removing unused variable is_true%73#0 +debug: Removing unused variable is_true%75#0 +debug: Removing unused variable is_true%77#0 +debug: Removing unused variable is_true%79#0 +debug: Removing unused variable is_true%81#0 +debug: Removing unused variable is_true%83#0 +debug: Removing unused variable is_true%85#0 +debug: Removing unused variable is_true%87#0 +debug: Removing unused variable item10%89#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_13.ir +debug: Begin optimization pass 14/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%49#0 +debug: Removing unused variable item1%72#0 +debug: Removing unused variable item2%74#0 +debug: Removing unused variable item3%76#0 +debug: Removing unused variable item4%78#0 +debug: Removing unused variable item5%80#0 +debug: Removing unused variable item6%82#0 +debug: Removing unused variable item7%84#0 +debug: Removing unused variable item8%86#0 +debug: Removing unused variable item9%88#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@3: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@7: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@9: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_true_L39 because it's used by phi nodes +info: Not removing empty block block@12: // ternary_false_L39 because it's used by phi nodes +info: Not removing empty block block@19: // ternary_true_L40 because it's used by phi nodes +info: Not removing empty block block@20: // ternary_false_L40 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_14.ir +debug: Begin optimization pass 15/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x04, 0x80) to b'/x04/x80' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%52#0 +debug: Removing unused variable tmp%54#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%65#0 +debug: Removing unused variable encoded_tuple_buffer%91#2 +debug: Removing unused variable is_true%92#0 +debug: Removing unused variable is_true%93#0 +debug: Removing unused variable is_true%94#0 +debug: Removing unused variable is_true%95#0 +debug: Removing unused variable is_true%96#0 +debug: Removing unused variable is_true%97#0 +debug: Removing unused variable is_true%98#0 +debug: Optimizer: Simplify Conditional Branches +debug: ConditionalBranch goto 0u ? block@1 : block@2 simplified to goto block@2 +debug: ConditionalBranch goto 0u ? block@3 : block@4 simplified to goto block@4 +debug: ConditionalBranch goto 0u ? block@5 : block@6 simplified to goto block@6 +debug: ConditionalBranch goto 0u ? block@7 : block@8 simplified to goto block@8 +debug: ConditionalBranch goto 0u ? block@9 : block@10 simplified to goto block@10 +debug: ConditionalBranch goto 0u ? block@11 : block@12 simplified to goto block@12 +debug: ConditionalBranch goto 0u ? block@19 : block@20 simplified to goto block@20 +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@2: // ternary_false_L39 with block@0: // L14 in block@4: // ternary_false_L39 +debug: Merged linear block@2: // ternary_false_L39 into block@0: // L14 +debug: Replaced predecessor block@4: // ternary_false_L39 with block@0: // L14 in block@6: // ternary_false_L39 +debug: Merged linear block@4: // ternary_false_L39 into block@0: // L14 +debug: Replaced predecessor block@6: // ternary_false_L39 with block@0: // L14 in block@8: // ternary_false_L39 +debug: Merged linear block@6: // ternary_false_L39 into block@0: // L14 +debug: Replaced predecessor block@8: // ternary_false_L39 with block@0: // L14 in block@10: // ternary_false_L39 +debug: Merged linear block@8: // ternary_false_L39 into block@0: // L14 +debug: Replaced predecessor block@10: // ternary_false_L39 with block@0: // L14 in block@12: // ternary_false_L39 +debug: Merged linear block@10: // ternary_false_L39 into block@0: // L14 +debug: Replaced predecessor block@12: // ternary_false_L39 with block@0: // L14 in block@13: // ternary_merge_L39 +debug: Merged linear block@12: // ternary_false_L39 into block@0: // L14 +debug: Replaced predecessor block@20: // ternary_false_L40 with block@18: // ternary_merge_L39 in block@21: // ternary_merge_L40 +debug: Merged linear block@20: // ternary_false_L40 into block@18: // ternary_merge_L39 +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@1: // ternary_true_L39 because it's currently unreachable +info: Not removing empty block block@3: // ternary_true_L39 because it's currently unreachable +info: Not removing empty block block@5: // ternary_true_L39 because it's currently unreachable +info: Not removing empty block block@7: // ternary_true_L39 because it's currently unreachable +info: Not removing empty block block@9: // ternary_true_L39 because it's currently unreachable +info: Not removing empty block block@11: // ternary_true_L39 because it's currently unreachable +info: Not removing empty block block@19: // ternary_true_L40 because it's currently unreachable +debug: Optimizer: Remove Unreachable Blocks +debug: Removing unreachable blocks: block@1: // ternary_true_L39, block@3: // ternary_true_L39, block@5: // ternary_true_L39, block@7: // ternary_true_L39, block@9: // ternary_true_L39, block@11: // ternary_true_L39, block@19: // ternary_true_L40 +debug: Removed unreachable predecessors from block@13: // ternary_merge_L39 +debug: Removed unreachable predecessors from block@14: // ternary_merge_L39 +debug: Removed unreachable predecessors from block@15: // ternary_merge_L39 +debug: Removed unreachable predecessors from block@16: // ternary_merge_L39 +debug: Removed unreachable predecessors from block@17: // ternary_merge_L39 +debug: Removed unreachable predecessors from block@18: // ternary_merge_L39 +debug: Removed unreachable predecessors from block@21: // ternary_merge_L40 +debug: Removing unreachable phi arguments: i#0 <- block@11 +debug: Replacing trivial Phi node: let ternary_result%63#2: bytes = φ(j#0 <- block@0) (ternary_result%63#2) with j#0 +debug: Deleting Phi assignment: let ternary_result%63#2: bytes = φ(j#0 <- block@0) +debug: Removing unreachable phi arguments: g#0 <- block@9 +debug: Replacing trivial Phi node: let ternary_result%61#2: bytes = φ(j#0 <- block@13) (ternary_result%61#2) with j#0 +debug: Deleting Phi assignment: let ternary_result%61#2: bytes = φ(j#0 <- block@13) +debug: Removing unreachable phi arguments: f#0 <- block@7 +debug: Replacing trivial Phi node: let ternary_result%59#2: bytes = φ(j#0 <- block@14) (ternary_result%59#2) with j#0 +debug: Deleting Phi assignment: let ternary_result%59#2: bytes = φ(j#0 <- block@14) +debug: Removing unreachable phi arguments: e#0 <- block@5 +debug: Replacing trivial Phi node: let ternary_result%57#2: bytes = φ(j#0 <- block@15) (ternary_result%57#2) with j#0 +debug: Deleting Phi assignment: let ternary_result%57#2: bytes = φ(j#0 <- block@15) +debug: Removing unreachable phi arguments: d#0 <- block@3 +debug: Replacing trivial Phi node: let ternary_result%55#2: bytes = φ(j#0 <- block@16) (ternary_result%55#2) with j#0 +debug: Deleting Phi assignment: let ternary_result%55#2: bytes = φ(j#0 <- block@16) +debug: Removing unreachable phi arguments: b#0 <- block@1 +debug: Replacing trivial Phi node: let ternary_result%53#2: bytes = φ(j#0 <- block@17) (ternary_result%53#2) with j#0 +debug: Deleting Phi assignment: let ternary_result%53#2: bytes = φ(j#0 <- block@17) +debug: Removing unreachable phi arguments: c#0 <- block@19 +debug: Replacing trivial Phi node: let ternary_result%66#2: bytes = φ(h#0 <- block@18) (ternary_result%66#2) with h#0 +debug: Deleting Phi assignment: let ternary_result%66#2: bytes = φ(h#0 <- block@18) +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_15.ir +debug: Begin optimization pass 16/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable b#0 +debug: Removing unused variable c#0 +debug: Removing unused variable d#0 +debug: Removing unused variable e#0 +debug: Removing unused variable f#0 +debug: Removing unused variable g#0 +debug: Removing unused variable h#0 +debug: Removing unused variable i#0 +debug: Removing unused variable j#0 +debug: Removing unused variable encoded_tuple_buffer%91#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@13: // ternary_merge_L39 with block@0: // L14 in block@14: // ternary_merge_L39 +debug: Merged linear block@13: // ternary_merge_L39 into block@0: // L14 +debug: Replaced predecessor block@14: // ternary_merge_L39 with block@0: // L14 in block@15: // ternary_merge_L39 +debug: Merged linear block@14: // ternary_merge_L39 into block@0: // L14 +debug: Replaced predecessor block@15: // ternary_merge_L39 with block@0: // L14 in block@16: // ternary_merge_L39 +debug: Merged linear block@15: // ternary_merge_L39 into block@0: // L14 +debug: Replaced predecessor block@16: // ternary_merge_L39 with block@0: // L14 in block@17: // ternary_merge_L39 +debug: Merged linear block@16: // ternary_merge_L39 into block@0: // L14 +debug: Replaced predecessor block@17: // ternary_merge_L39 with block@0: // L14 in block@18: // ternary_merge_L39 +debug: Merged linear block@17: // ternary_merge_L39 into block@0: // L14 +debug: Replaced predecessor block@18: // ternary_merge_L39 with block@0: // L14 in block@21: // ternary_merge_L40 +debug: Merged linear block@18: // ternary_merge_L39 into block@0: // L14 +debug: Merged linear block@21: // ternary_merge_L40 into block@0: // L14 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_16.ir +debug: Begin optimization pass 17/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%64#0 +debug: Removing unused variable tmp%67#0 +debug: Removing unused variable encoded_tuple_buffer%91#4 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_17.ir +debug: Begin optimization pass 18/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%91#5 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_18.ir +debug: Begin optimization pass 19/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%91#6 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_19.ir +debug: Begin optimization pass 20/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%91#7 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_20.ir +debug: Begin optimization pass 21/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%91#8 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_21.ir +debug: Begin optimization pass 22/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%91#9 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_22.ir +debug: Begin optimization pass 23/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x04bd, 0x80) to b'/x04/xbd/x80' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%91#10 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_23.ir +debug: Begin optimization pass 24/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded concat(0x04bd80, 0x10) to b'/x04/xbd/x80/x10' +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable encoded_tuple_buffer%91#11 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_24.ir +debug: Begin optimization pass 25/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%99#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_25.ir +debug: Begin optimization pass 26/100 +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 26, ending loop +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.cssa.ir +debug: Removing Phis from examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Removing Phis from examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Removing Phis from examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program +debug: Sequentializing parallel copies in examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff +debug: Sequentializing parallel copies in examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.parallel_copies.ir +debug: Coalescing local variables in examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program using strategy RootOperandGrouping +debug: Coalescing encoded_tuple_buffer%1#3 with [encoded_tuple_buffer%1#4, encoded_tuple_buffer%1#5, encoded_tuple_buffer%1#6] +debug: Coalescing resulted in 6 replacement/s +debug: Coalescing local variables in examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final.ir +debug: Inserted main_block@0.ops[2]: 'store value_as_bytes%2#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[4]: 'load value_as_bytes%2#0' with 'load value_as_bytes%2#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[13]: 'store value_as_bytes%5#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[15]: 'load value_as_bytes%5#0' with 'load value_as_bytes%5#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[21]: 'store encoded_tuple_buffer%1#3 to l-stack (copy)' +debug: Replaced main_block@0.ops[23]: 'load encoded_tuple_buffer%1#3' with 'load encoded_tuple_buffer%1#3 from l-stack (no copy)' +debug: Inserted main_block@0.ops[26]: 'store encoded_tuple_buffer%1#3 to l-stack (copy)' +debug: Replaced main_block@0.ops[28]: 'load encoded_tuple_buffer%1#3' with 'load encoded_tuple_buffer%1#3 from l-stack (no copy)' +debug: Inserted main_block@0.ops[31]: 'store encoded_tuple_buffer%1#3 to l-stack (copy)' +debug: Replaced main_block@0.ops[33]: 'load encoded_tuple_buffer%1#3' with 'load encoded_tuple_buffer%1#3 from l-stack (no copy)' +debug: Inserted main_block@0.ops[36]: 'store my_tuple#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[38]: 'load my_tuple#0' with 'load my_tuple#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[41]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[43]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[47]: 'store tmp%50#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[49]: 'load tmp%50#0' with 'load tmp%50#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[52]: 'store tmp%51#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[54]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[58]: 'store tmp%68#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[60]: 'load tmp%68#0' with 'load tmp%68#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[63]: 'store tmp%69#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[65]: 'load tmp%69#0' with 'load tmp%69#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[73]: 'store tmp%102#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[75]: 'load tmp%102#0' with 'load tmp%102#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[78]: 'store tmp%103#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[80]: 'load tmp%103#0' with 'load tmp%103#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[85]: 'store tmp%104#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[87]: 'load tmp%104#0' with 'load tmp%104#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[6]: 'store value_as_uint16%3#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[9]: 'load value_as_uint16%3#0' with 'load value_as_uint16%3#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[18]: 'store value_as_uint16%6#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[21]: 'load value_as_uint16%6#0' with 'load value_as_uint16%6#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[71]: 'store concat#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[74]: 'load concat#0' with 'load concat#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[11]: 'store encoded_tuple_buffer%1#3 to l-stack (copy)' +debug: Replaced main_block@0.ops[21]: 'load encoded_tuple_buffer%1#3' with 'load encoded_tuple_buffer%1#3 from l-stack (no copy)' +debug: Inserted main_block@0.ops[74]: 'store total#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[87]: 'load total#0' with 'load total#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[42]: 'store my_tuple#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[71]: 'load my_tuple#0' with 'load my_tuple#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[17]: 'store item_length%3#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[19]: 'load item_length%3#0' with 'load item_length%3#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[35]: 'store item_length%7#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[37]: 'load item_length%7#0' with 'load item_length%7#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[70]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[72]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[82]: 'store text#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[84]: 'load text#0' with 'load text#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[86]: 'store length%18#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[88]: 'load length%18#0' with 'load length%18#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[90]: 'store value_as_bytes%19#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[92]: 'load value_as_bytes%19#0' with 'load value_as_bytes%19#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[94]: 'store value_as_uint16%20#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[96]: 'load value_as_uint16%20#0' with 'load value_as_uint16%20#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[13]: 'store item_index%2#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[16]: 'load item_index%2#0' with 'load item_index%2#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[32]: 'store item_index%6#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[35]: 'load item_index%6#0' with 'load item_index%6#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[58]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[61]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[66]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[69]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[82]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[85]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[104]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[107]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[23]: 'store item_length_plus_2%4#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[27]: 'load item_length_plus_2%4#0' with 'load item_length_plus_2%4#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[43]: 'store item_length_plus_2%8#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[47]: 'load item_length_plus_2%8#0' with 'load item_length_plus_2%8#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[57]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[63]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[66]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[72]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[83]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[89]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[17]: 'store item_index%2#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[27]: 'load item_index%2#0' with 'load item_index%2#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[38]: 'store item_index%6#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[48]: 'load item_index%6#0' with 'load item_index%6#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[97]: 'store text#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[110]: 'load text#0' with 'load text#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[56]: 'store e#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[71]: 'load e#0' with 'load e#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[78]: 'store total#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[116]: 'load total#0' with 'load total#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[51]: 'store d#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[90]: 'load d#0' with 'load d#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[30]: 'store c#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[82]: 'load c#0' with 'load c#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[9]: 'store b#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[65]: 'load b#0' with 'load b#0 from l-stack (no copy)' +debug: Inserted test_stuff_block@0.ops[4]: 'store a#0 to l-stack (copy)' +debug: Replaced test_stuff_block@0.ops[62]: 'load a#0' with 'load a#0 from l-stack (no copy)' +debug: Simplified uncover 2; uncover 2 to cover 2 +debug: Simplified uncover 2; uncover 2 to cover 2 +info: Writing arc4_types/out/array.approval.teal +info: Writing arc4_types/out/array.approval.debug.teal +info: Writing arc4_types/out/array.clear.teal +info: Writing arc4_types/out/array.clear.debug.teal +info: Writing arc4_types/out/bool.approval.teal +info: Writing arc4_types/out/bool.approval.debug.teal +info: Writing arc4_types/out/bool.clear.teal +info: Writing arc4_types/out/bool.clear.debug.teal +info: Writing arc4_types/out/dynamic_string_array.approval.teal +info: Writing arc4_types/out/dynamic_string_array.approval.debug.teal +info: Writing arc4_types/out/dynamic_string_array.clear.teal +info: Writing arc4_types/out/dynamic_string_array.clear.debug.teal +info: Writing arc4_types/out/numeric.approval.teal +info: Writing arc4_types/out/numeric.approval.debug.teal +info: Writing arc4_types/out/numeric.clear.teal +info: Writing arc4_types/out/numeric.clear.debug.teal +info: Writing arc4_types/out/string.approval.teal +info: Writing arc4_types/out/string.approval.debug.teal +info: Writing arc4_types/out/string.clear.teal +info: Writing arc4_types/out/string.clear.debug.teal +info: Writing arc4_types/out/structs.approval.teal +info: Writing arc4_types/out/structs.approval.debug.teal +info: Writing arc4_types/out/structs.clear.teal +info: Writing arc4_types/out/structs.clear.debug.teal +info: Writing arc4_types/out/tuples.approval.teal +info: Writing arc4_types/out/tuples.approval.debug.teal +info: Writing arc4_types/out/tuples.clear.teal +info: Writing arc4_types/out/tuples.clear.debug.teal +info: Writing arc4_types/out/application.json +>> exit code = 0 \ No newline at end of file diff --git a/examples/arc4_types/array.py b/examples/arc4_types/array.py new file mode 100644 index 0000000000..172613b048 --- /dev/null +++ b/examples/arc4_types/array.py @@ -0,0 +1,71 @@ +import typing as t + +from algopy import Bytes, Contract, UInt64, uenumerate +from algopy.arc4 import ( + DynamicArray, + StaticArray, + String, + UFixedNxM, + UInt8, + UInt16, + UInt32, +) + +AliasedDynamicArray: t.TypeAlias = DynamicArray[UInt16] +AliasedStaticArray: t.TypeAlias = StaticArray[UInt8, t.Literal[1]] + +Decimal: t.TypeAlias = UFixedNxM[t.Literal[64], t.Literal[10]] + + +class Arc4ArraysContract(Contract): + def approval_program(self) -> bool: + dynamic_uint8_array = DynamicArray[UInt8](UInt8(1), UInt8(2)) + total = UInt64(0) + for uint8_item in dynamic_uint8_array: + total += uint8_item.decode() + + assert total == 3, "Total should be sum of dynamic_uint8_array items" + aliased_dynamic = AliasedDynamicArray(UInt16(1)) + for uint16_item in aliased_dynamic: + total += uint16_item.decode() + assert total == 4, "Total should now include sum of aliased_dynamic items" + dynamic_string_array = DynamicArray[String](String("Hello"), String("World")) + assert dynamic_string_array.length == 2 + assert dynamic_string_array[0] == String("Hello") + result = Bytes(b"") + for index, string_item in uenumerate(dynamic_string_array): + if index == 0: + result = string_item.decode() + else: + result += b" " + string_item.decode() + + assert result == b"Hello World" + + static_uint32_array = StaticArray(UInt32(1), UInt32(10), UInt32(255), UInt32(128)) + + for uint32_item in static_uint32_array: + total += uint32_item.decode() + + assert total == 4 + 1 + 10 + 255 + 128 + + aliased_static = AliasedStaticArray(UInt8(101)) + + index = UInt64(0) + + assert (aliased_static[0].decode() + aliased_static[index].decode()) == 202 + + static_string_array = StaticArray(String("Ping"), String("Pong")) + + result = Bytes(b"") + for index, string_item in uenumerate(static_string_array): + if index == 0: + result = string_item.decode() + else: + result += b" " + string_item.decode() + + assert result == b"Ping Pong" + + return True + + def clear_state_program(self) -> bool: + return True diff --git a/examples/arc4_types/bool.py b/examples/arc4_types/bool.py new file mode 100644 index 0000000000..acedf324e7 --- /dev/null +++ b/examples/arc4_types/bool.py @@ -0,0 +1,53 @@ +import typing as t + +from algopy import Bytes, Contract, subroutine +from algopy.arc4 import ( + Bool as ARC4Bool, + DynamicArray, + StaticArray, +) + + +class Arc4BoolTypeContract(Contract): + def approval_program(self) -> bool: + self.test_stuff(ARC4Bool(True), ARC4Bool(False)) + + static_boolean_array = StaticArray[ARC4Bool, t.Literal[12]]( + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ARC4Bool(True), + ) + + assert static_boolean_array.bytes == Bytes.from_hex("FFF0") + + assert static_boolean_array[0] == ARC4Bool(True), "Single boolean can be unpacked" + assert static_boolean_array[-1] == ARC4Bool(True), "Single boolean can be unpacked" + + dynamic_boolean_array = DynamicArray[ARC4Bool]( + ARC4Bool(True), ARC4Bool(False), ARC4Bool(True) + ) + + assert dynamic_boolean_array.bytes == Bytes.from_hex("0003A0") + + return True + + def clear_state_program(self) -> bool: + return True + + @subroutine + def test_stuff(self, true: ARC4Bool, false: ARC4Bool) -> None: + assert true.decode() + + assert not false.decode() + + assert true == ARC4Bool.encode(true.decode()) + assert false == ARC4Bool.encode(false.decode()) diff --git a/examples/arc4_types/dynamic_string_array.py b/examples/arc4_types/dynamic_string_array.py new file mode 100644 index 0000000000..09afc6a55a --- /dev/null +++ b/examples/arc4_types/dynamic_string_array.py @@ -0,0 +1,20 @@ +from algopy import ARC4Contract, arc4 + + +class Arc4DynamicStringArrayContract(ARC4Contract): + @arc4.abimethod + def xyz(self) -> arc4.DynamicArray[arc4.String]: + return arc4.DynamicArray( + arc4.String("X"), + arc4.String("Y"), + arc4.String("Z"), + ) + + @arc4.abimethod + def xyz_raw(self) -> arc4.DynamicArray[arc4.String]: + raw = arc4.DynamicArray( + arc4.DynamicArray(arc4.Byte(88)), + arc4.DynamicArray(arc4.Byte(89)), + arc4.DynamicArray(arc4.Byte(90)), + ) + return arc4.DynamicArray[arc4.String].from_bytes(raw.bytes) diff --git a/examples/arc4_types/numeric.py b/examples/arc4_types/numeric.py new file mode 100644 index 0000000000..e6e232d548 --- /dev/null +++ b/examples/arc4_types/numeric.py @@ -0,0 +1,69 @@ +import typing +import typing as t + +from algopy import BigUInt, Bytes, Contract, UInt64 +from algopy.arc4 import ( + BigUFixedNxM, + BigUIntN, + UFixedNxM, + UInt8, + UInt16, + UInt32, + UInt64 as ARC4UInt64, + UIntN, +) + +Decimal: t.TypeAlias = UFixedNxM[t.Literal[64], t.Literal[10]] + +ARC4BigUInt: t.TypeAlias = BigUIntN[t.Literal[128]] + + +sixty_four_byte_num = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF # noqa: E501 + + +class Arc4NumericTypesContract(Contract): + def approval_program(self) -> bool: + uint8 = UInt64(255) + + int8_encoded = UInt8.encode(uint8) + + int8_decoded = int8_encoded.decode() + + assert uint8 == int8_decoded + + test_bytes = Bytes.from_hex("7FFFFFFFFFFFFFFF00") + assert UInt8.from_bytes(test_bytes[:1]).decode() == 2**8 - 1 - 2**7 + assert ( + UIntN[typing.Literal[24]].from_bytes(test_bytes[:3]).decode() == 2**24 - 1 - 2**23 + ) + assert UInt16.from_bytes(test_bytes[:2]).decode() == 2**16 - 1 - 2**15 + assert UInt32.from_bytes(test_bytes[:4]).decode() == 2**32 - 1 - 2**31 + assert ARC4UInt64.from_bytes(test_bytes[:8]).decode() == 2**64 - 1 - 2**63 + + decimals = Decimal("145.6853943940") + + assert decimals.bytes.length == (64 // 8) + + really_big_int = BigUIntN[t.Literal[512]](sixty_four_byte_num) + + assert really_big_int.bytes.length == 64 + assert really_big_int == BigUIntN[t.Literal[512]].encode(really_big_int.decode()) + + really_big_decimal = BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( + BigUInt(sixty_four_byte_num) + ) + + biguint = BigUInt(1) + arc4_biguint_const = ARC4BigUInt(1) + arc4_biguint_dynamic = ARC4BigUInt.encode(biguint + 1) + + assert biguint == arc4_biguint_const.decode() + + assert arc4_biguint_dynamic.bytes.length == (128 // 8) + + assert really_big_decimal.bytes.length == 64 + + return True + + def clear_state_program(self) -> bool: + return True diff --git a/examples/arc4_types/out/application.json b/examples/arc4_types/out/application.json new file mode 100644 index 0000000000..a30d4bdce3 --- /dev/null +++ b/examples/arc4_types/out/application.json @@ -0,0 +1,61 @@ +{ + "hints": { + "xyz()string[]": { + "call_config": { + "no_op": "CALL" + } + }, + "xyz_raw()string[]": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmFyYzRfdHlwZXMuZHluYW1pY19zdHJpbmdfYXJyYXkuQXJjNER5bmFtaWNTdHJpbmdBcnJheUNvbnRyYWN0LmFwcHJvdmFsX3Byb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW5fYmxvY2tAMDoKICAgICAgICB0eG4gTnVtQXBwQXJncwogICAgICAgIGJ6IG1haW5fYmFyZV9yb3V0aW5nQDYKCm1haW5fYWJpX3JvdXRpbmdAMToKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAwCiAgICAgICAgbWV0aG9kICJ4eXooKXN0cmluZ1tdIgogICAgICAgIG1ldGhvZCAieHl6X3Jhdygpc3RyaW5nW10iCiAgICAgICAgdW5jb3ZlciAyCiAgICAgICAgbWF0Y2ggbWFpbl94eXpfcm91dGVAMiBtYWluX3h5el9yYXdfcm91dGVAMwogICAgICAgIGIgbWFpbl9zd2l0Y2hfY2FzZV9kZWZhdWx0QDQKCm1haW5feHl6X3JvdXRlQDI6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICBjYWxsc3ViIHh5egogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl94eXpfcmF3X3JvdXRlQDM6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICBjYWxsc3ViIHh5el9yYXcKICAgICAgICBieXRlIDB4MTUxZjdjNzUKICAgICAgICBzd2FwCiAgICAgICAgY29uY2F0CiAgICAgICAgbG9nCiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fc3dpdGNoX2Nhc2VfZGVmYXVsdEA0OgogICAgICAgIGVyciAvLyByZWplY3QgdHJhbnNhY3Rpb24KCm1haW5fYmFyZV9yb3V0aW5nQDY6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgIGJueiBtYWluX3JlamVjdF9iYXJlX29uX2NvbXBsZXRpb25AOAoKbWFpbl9jcmVhdGVANzoKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gaXMgY3JlYXRpbmcKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9yZWplY3RfYmFyZV9vbl9jb21wbGV0aW9uQDg6CiAgICAgICAgZXJyIC8vIHJlamVjdCB0cmFuc2FjdGlvbgoKCi8vIGV4YW1wbGVzLmFyYzRfdHlwZXMuZHluYW1pY19zdHJpbmdfYXJyYXkuQXJjNER5bmFtaWNTdHJpbmdBcnJheUNvbnRyYWN0Lnh5eigpIC0+IGJ5dGVzOgp4eXo6CiAgICAgICAgcHJvdG8gMCAxCgp4eXpfYmxvY2tAMDoKICAgICAgICBpbnQgNgogICAgICAgIGl0b2IKICAgICAgICBleHRyYWN0IDYgMgogICAgICAgIGJ5dGUgMHgwMDAzCiAgICAgICAgc3dhcAogICAgICAgIGNvbmNhdAogICAgICAgIGludCA5CiAgICAgICAgaXRvYgogICAgICAgIGV4dHJhY3QgNiAyCiAgICAgICAgY29uY2F0CiAgICAgICAgaW50IDEyCiAgICAgICAgaXRvYgogICAgICAgIGV4dHJhY3QgNiAyCiAgICAgICAgY29uY2F0CiAgICAgICAgYnl0ZSAiXHgwMFx4MDFYIgogICAgICAgIGNvbmNhdAogICAgICAgIGJ5dGUgIlx4MDBceDAxWSIKICAgICAgICBjb25jYXQKICAgICAgICBieXRlICJceDAwXHgwMVoiCiAgICAgICAgY29uY2F0CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuYXJjNF90eXBlcy5keW5hbWljX3N0cmluZ19hcnJheS5BcmM0RHluYW1pY1N0cmluZ0FycmF5Q29udHJhY3QueHl6X3JhdygpIC0+IGJ5dGVzOgp4eXpfcmF3OgogICAgICAgIHByb3RvIDAgMQoKeHl6X3Jhd19ibG9ja0AwOgogICAgICAgIGludCA2CiAgICAgICAgaXRvYgogICAgICAgIGV4dHJhY3QgNiAyCiAgICAgICAgYnl0ZSAweDAwMDMKICAgICAgICBzd2FwCiAgICAgICAgY29uY2F0CiAgICAgICAgaW50IDkKICAgICAgICBpdG9iCiAgICAgICAgZXh0cmFjdCA2IDIKICAgICAgICBjb25jYXQKICAgICAgICBpbnQgMTIKICAgICAgICBpdG9iCiAgICAgICAgZXh0cmFjdCA2IDIKICAgICAgICBjb25jYXQKICAgICAgICBieXRlIDB4MDAwMTU4CiAgICAgICAgY29uY2F0CiAgICAgICAgYnl0ZSAweDAwMDE1OQogICAgICAgIGNvbmNhdAogICAgICAgIGJ5dGUgMHgwMDAxNWEKICAgICAgICBjb25jYXQKICAgICAgICByZXRzdWIKCg==", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmFyYzRfdHlwZXMuZHluYW1pY19zdHJpbmdfYXJyYXkuQXJjNER5bmFtaWNTdHJpbmdBcnJheUNvbnRyYWN0LmNsZWFyX3N0YXRlX3Byb2dyYW0oKSAtPiB1aW50NjQ6Cm1haW5fYmxvY2tAMDoKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoK" + }, + "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": "Arc4DynamicStringArrayContract", + "methods": [ + { + "name": "xyz", + "args": [], + "returns": { + "type": "string[]" + } + }, + { + "name": "xyz_raw", + "args": [], + "returns": { + "type": "string[]" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/examples/arc4_types/out/array.O0.log b/examples/arc4_types/out/array.O0.log new file mode 100644 index 0000000000..3cd7319c01 --- /dev/null +++ b/examples/arc4_types/out/array.O0.log @@ -0,0 +1,485 @@ +PC Teal Stack +1 +7 +48 int 0 0 +49 dupn 4 0, 0, 0, 0, 0 +51 byte "" 0, 0, 0, 0, 0, 0x +52 dupn 5 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x +54 byte 0x0002 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x0002 +55 byte 0x01 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x0002, 0x01 +58 concat 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x000201 +59 byte 0x02 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x000201, 0x02 +62 concat 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x00020102 +63 int 0 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x00020102, 0 +64 swap 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 0x00020102 +65 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 0x00020102, 0x00020102 +66 int 0 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 0x00020102, 0x00020102, 0 +67 extract_uint16 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 0x00020102, 2 +68 swap 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x00020102 +69 extract 2 0 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102 +72 int 0 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0 +73 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0 +74 dig 3 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0, 2 +76 < 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 1 +77 bz main_after_for@4 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0 +80 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0 +81 int 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0, 1 +82 * 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0 +83 dig 2 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0, 0x0102 +85 swap 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0x0102, 0 +86 int 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0x0102, 0, 1 +87 extract3 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 0x01 +88 btoi 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 1 +89 dig 4 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 1, 0 +91 + 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0, 2, 0x0102, 0, 1 +92 bury 4 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 0 +94 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 0, 0 +95 int 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 0, 0, 1 +96 + 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 0, 1 +97 bury 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1 +99 b main_for_header@1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1 +73 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 1 +74 dig 3 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 1, 2 +76 < 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 1 +77 bz main_after_for@4 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1 +80 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 1 +81 int 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 1, 1 +82 * 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 1 +83 dig 2 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 1, 0x0102 +85 swap 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 0x0102, 1 +86 int 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 0x0102, 1, 1 +87 extract3 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 0x02 +88 btoi 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 2 +89 dig 4 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 2, 1 +91 + 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 1, 2, 0x0102, 1, 3 +92 bury 4 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 1 +94 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 1, 1 +95 int 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 1, 1, 1 +96 + 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 1, 2 +97 bury 1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2 +99 b main_for_header@1 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2 +73 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 2 +74 dig 3 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 2, 2 +76 < 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0 +77 bz main_after_for@4 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2 +102 dig 3 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 3 +104 int 3 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 3, 3 +106 == 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 1 +107 assert 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2 +108 byte 0x0001 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x0001 +109 byte 0x0001 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x0001, 0x0001 +110 concat 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x00010001 +111 dup 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x00010001, 0x00010001 +112 int 0 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x00010001, 0x00010001, 0 +113 extract_uint16 0, 0, 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x00010001, 1 +114 bury 10 0, 0, 0, 0, 0, 0x, 1, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x00010001 +116 extract 2 0 0, 0, 0, 0, 0, 0x, 1, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x0001 +119 bury 15 0x0001, 0, 0, 0, 0, 0x, 1, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2 +121 int 0 0x0001, 0, 0, 0, 0, 0x, 1, 0x, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0 +122 bury 8 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2 +124 dig 7 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0 +126 dig 9 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0, 1 +128 < 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 1 +129 bz main_after_for@8 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2 +132 dig 7 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0 +134 int 2 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0, 2 +135 * 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0 +136 dig 15 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0, 0x0001 +138 swap 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x0001, 0 +139 int 2 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x0001, 0, 2 +140 extract3 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 0x0001 +141 btoi 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 1 +142 dig 4 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 1, 3 +144 + 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 3, 2, 0x0102, 2, 4 +145 bury 4 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 4, 2, 0x0102, 2 +147 dig 7 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0 +149 int 1 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0, 1 +150 + 0x0001, 0, 0, 0, 0, 0x, 1, 0, 0x, 0x, 0x, 4, 2, 0x0102, 2, 1 +151 bury 8 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2 +153 b main_for_header@5 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2 +124 dig 7 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 1 +126 dig 9 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 1, 1 +128 < 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0 +129 bz main_after_for@8 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2 +156 dig 3 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 4 +158 int 4 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 4, 4 +159 == 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 1 +160 assert 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2 +161 byte 0x0002 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x0002 +162 int 4 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x0002, 4 +163 dup 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x0002, 4, 4 +164 itob 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x0002, 4, 0x0000000000000004 +165 extract 6 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x0002, 4, 0x0004 +168 uncover 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 4, 0x0004, 0x0002 +170 swap 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 4, 0x0002, 0x0004 +171 concat 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 4, 0x00020004 +172 swap 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004, 4 +173 byte "\x00\x05Hello" 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004, 4, 0x000548656C6C6F +174 len 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004, 4, 7 +175 + 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004, 11 +176 dup 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004, 11, 11 +177 itob 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004, 11, 0x000000000000000B +178 extract 6 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004, 11, 0x000B +181 uncover 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 11, 0x000B, 0x00020004 +183 swap 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 11, 0x00020004, 0x000B +184 concat 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 11, 0x00020004000B +185 byte "\x00\x05World" 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 11, 0x00020004000B, 0x0005576F726C64 +187 len 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 11, 0x00020004000B, 7 +188 uncover 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B, 7, 11 +190 + 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B, 18 +191 pop 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B +192 byte "\x00\x05Hello" 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B, 0x000548656C6C6F +193 concat 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F +194 byte "\x00\x05World" 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F, 0x0005576F726C64 +196 concat 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64 +197 dup 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +198 int 0 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +199 extract_uint16 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2 +200 int 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2, 2 +201 == 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 1 +202 assert 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64 +203 dup 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +204 int 0 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +205 extract_uint16 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2 +206 int 0 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2, 0 +207 > 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 1 +208 assert 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64 +209 dup 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +210 extract 2 0 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +213 int 0 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +214 int 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0, 2 +215 * 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +216 dig 1 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0, 0x0004000B000548656C6C6F0005576F726C64 +218 swap 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +219 extract_uint16 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4 +220 dig 1 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64 +222 dig 1 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64, 4 +224 extract_uint16 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 5 +225 int 2 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 5, 2 +226 + 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 7 +227 extract3 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x000548656C6C6F +228 byte "\x00\x05Hello" 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x000548656C6C6F, 0x000548656C6C6F +229 == 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 1 +230 assert 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64 +231 byte "" 0x0001, 0, 0, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x +232 bury 14 0x0001, 0, 0x, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64 +234 dup 0x0001, 0, 0x, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +235 int 0 0x0001, 0, 0x, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +236 extract_uint16 0x0001, 0, 0x, 0, 0, 0x, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2 +237 bury 11 0x0001, 0, 0x, 0, 0, 2, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x00020004000B000548656C6C6F0005576F726C64 +239 extract 2 0 0x0001, 0, 0x, 0, 0, 2, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0x0004000B000548656C6C6F0005576F726C64 +242 bury 14 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2 +244 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0x, 0x, 0x, 4, 2, 0x0102, 2, 0 +245 bury 7 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2 +247 dig 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0 +249 dig 10 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 2 +251 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 1 +252 bz main_after_for@15 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2 +255 dig 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0 +257 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0 +258 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0, 2 +259 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0 +260 dig 15 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64 +262 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +263 cover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 0, 0x0004000B000548656C6C6F0005576F726C64 +265 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +266 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4 +267 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64 +269 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64, 4 +271 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 5 +272 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 5, 2 +273 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 7 +274 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 0x000548656C6C6F +275 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0x000548656C6C6F, 0 +276 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0x000548656C6C6F, 0, 0 +277 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0x000548656C6C6F, 1 +278 bz main_else_body@12 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0x000548656C6C6F +281 extract 2 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, "Hello" +284 bury 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2 +286 b main_after_if_else@13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2 +302 dig 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0 +304 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 0, 1 +305 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 0, 0x, 0x, 4, 2, 0x0102, 2, 1 +306 bury 7 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2 +308 b main_for_header@9 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2 +247 dig 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1 +249 dig 10 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 2 +251 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1 +252 bz main_after_for@15 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2 +255 dig 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1 +257 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 1 +258 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 1, 2 +259 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 2 +260 dig 15 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 2, 0x0004000B000548656C6C6F0005576F726C64 +262 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 2, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +263 cover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 2, 0x0004000B000548656C6C6F0005576F726C64 +265 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 2 +266 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11 +267 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 0x0004000B000548656C6C6F0005576F726C64 +269 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 0x0004000B000548656C6C6F0005576F726C64, 11 +271 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 5 +272 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 5, 2 +273 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 7 +274 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 0x0005576F726C64 +275 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 0x0005576F726C64, 1 +276 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 0x0005576F726C64, 1, 0 +277 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 0x0005576F726C64, 0 +278 bz main_else_body@12 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 0x0005576F726C64 +289 extract 2 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, "World" +292 byte " " 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, "World", " " +294 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, " ", "World" +295 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, " World" +296 dig 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, " World", "Hello" +298 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, "Hello", " World" +299 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, "Hello World" +300 bury 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2 +302 dig 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1 +304 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 1, 1 +305 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 1, 0x, 0x, 4, 2, 0x0102, 2, 2 +306 bury 7 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2 +308 b main_for_header@9 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2 +247 dig 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 2 +249 dig 10 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 2, 2 +251 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0 +252 bz main_after_for@15 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2 +311 dig 12 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, "Hello World" +313 byte "Hello World" 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, "Hello World", "Hello World" +326 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 1 +327 assert 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2 +328 byte 0x 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x +329 byte 0x00000001 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x, 0x00000001 +335 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x00000001 +336 byte 0x0000000a 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x00000001, 0x0000000A +342 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x000000010000000A +343 byte 0x000000ff 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x000000010000000A, 0x000000FF +349 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x000000010000000A000000FF +350 byte 0x00000080 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x000000010000000A000000FF, 0x00000080 +356 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0x000000010000000A000000FF00000080 +357 bury 11 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2 +359 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0x, 0x, 4, 2, 0x0102, 2, 0 +360 bury 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2 +362 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0 +364 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0, 4 +365 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 1 +366 bz main_after_for@19 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2 +369 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0 +371 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0, 4 +372 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0 +373 dig 11 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0, 0x000000010000000A000000FF00000080 +375 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 0 +376 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 0, 4 +377 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 0x00000001 +378 btoi 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 1 +379 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 1, 4 +381 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 4, 2, 0x0102, 2, 5 +382 bury 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 5, 2, 0x0102, 2 +384 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 5, 2, 0x0102, 2, 0 +386 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 5, 2, 0x0102, 2, 0, 1 +387 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 0, 0x, 5, 2, 0x0102, 2, 1 +388 bury 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2 +390 b main_for_header@16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2 +362 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 1 +364 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 1, 4 +365 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 1 +366 bz main_after_for@19 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2 +369 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 1 +371 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 1, 4 +372 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 4 +373 dig 11 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 4, 0x000000010000000A000000FF00000080 +375 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 4 +376 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 4, 4 +377 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 0x0000000A +378 btoi 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 10 +379 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 10, 5 +381 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 5, 2, 0x0102, 2, 15 +382 bury 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 15, 2, 0x0102, 2 +384 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 15, 2, 0x0102, 2, 1 +386 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 15, 2, 0x0102, 2, 1, 1 +387 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 1, 0x, 15, 2, 0x0102, 2, 2 +388 bury 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2 +390 b main_for_header@16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2 +362 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 2 +364 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 2, 4 +365 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 1 +366 bz main_after_for@19 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2 +369 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 2 +371 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 2, 4 +372 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 8 +373 dig 11 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 8, 0x000000010000000A000000FF00000080 +375 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 8 +376 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 8, 4 +377 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 0x000000FF +378 btoi 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 255 +379 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 255, 15 +381 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 15, 2, 0x0102, 2, 270 +382 bury 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 270, 2, 0x0102, 2 +384 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 270, 2, 0x0102, 2, 2 +386 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 270, 2, 0x0102, 2, 2, 1 +387 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 2, 0x, 270, 2, 0x0102, 2, 3 +388 bury 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2 +390 b main_for_header@16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2 +362 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 3 +364 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 3, 4 +365 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 1 +366 bz main_after_for@19 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2 +369 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 3 +371 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 3, 4 +372 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 12 +373 dig 11 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 12, 0x000000010000000A000000FF00000080 +375 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 12 +376 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 0x000000010000000A000000FF00000080, 12, 4 +377 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 0x00000080 +378 btoi 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 128 +379 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 128, 270 +381 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 270, 2, 0x0102, 2, 398 +382 bury 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 398, 2, 0x0102, 2 +384 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 398, 2, 0x0102, 2, 3 +386 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 398, 2, 0x0102, 2, 3, 1 +387 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 3, 0x, 398, 2, 0x0102, 2, 4 +388 bury 6 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2 +390 b main_for_header@16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2 +362 dig 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 4 +364 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 4, 4 +365 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0 +366 bz main_after_for@19 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2 +393 dig 3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 398 +395 int 398 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 398, 398 +398 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 1 +399 assert 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2 +400 byte 0x 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x +401 byte 0x65 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x, "e" +404 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, "e" +405 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, "e", 0 +406 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e" +407 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", 0 +408 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", 0, 1 +409 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", 0 +410 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", 0, "e" +412 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", "e", 0 +413 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", "e", 0, 1 +414 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", "e" +415 btoi 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0, "e", 101 +416 cover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, 0, "e" +418 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, 0, "e", 1 +419 dig 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, 0, "e", 1, 0 +421 > 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, 0, "e", 1 +422 assert 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, 0, "e" +423 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, "e", 0 +424 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, "e", 0, 1 +425 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, "e", 0 +426 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, "e", 0, 1 +427 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, "e" +428 btoi 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 101, 101 +429 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 202 +430 int 202 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 202, 202 +433 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 1 +434 assert 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2 +435 byte 0x 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x +436 int 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x, 4 +437 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x, 4, 4 +438 itob 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x, 4, 0x0000000000000004 +439 extract 6 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x, 4, 0x0004 +442 uncover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 4, 0x0004, 0x +444 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 4, 0x, 0x0004 +445 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 4, 0x0004 +446 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004, 4 +447 byte "\x00\x04Ping" 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004, 4, 0x000450696E67 +449 len 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004, 4, 6 +450 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004, 10 +451 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004, 10, 10 +452 itob 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004, 10, 0x000000000000000A +453 extract 6 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004, 10, 0x000A +456 uncover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 10, 0x000A, 0x0004 +458 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 10, 0x0004, 0x000A +459 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 10, 0x0004000A +460 byte "\x00\x04Pong" 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 10, 0x0004000A, 0x0004506F6E67 +462 len 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 10, 0x0004000A, 6 +463 uncover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004000A, 6, 10 +465 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004000A, 16 +466 pop 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004000A +467 byte "\x00\x04Ping" 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004000A, 0x000450696E67 +469 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004000A000450696E67 +470 byte "\x00\x04Pong" 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004000A000450696E67, 0x0004506F6E67 +472 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x0004000A000450696E670004506F6E67 +473 bury 12 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2 +475 byte "" 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0x +476 bury 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2 +478 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0x, 398, 2, 0x0102, 2, 0 +479 bury 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2 +481 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0 +483 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 2 +484 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 1 +485 bz main_after_for@26 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2 +488 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0 +490 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0 +491 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0, 2 +492 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0 +493 dig 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0, 0x0004000A000450696E670004506F6E67 +495 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67 +496 cover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 0, 0x0004000A000450696E670004506F6E67 +498 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67, 0 +499 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 4 +500 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 0x0004000A000450696E670004506F6E67 +502 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 0x0004000A000450696E670004506F6E67, 4 +504 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 4 +505 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 4, 2 +506 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 6 +507 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 0x000450696E67 +508 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0x000450696E67, 0 +509 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0x000450696E67, 0, 0 +510 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0x000450696E67, 1 +511 bz main_else_body@23 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0x000450696E67 +514 extract 2 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, "Ping" +517 bury 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2 +519 b main_after_if_else@24 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2 +535 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0 +537 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 0, 1 +538 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 0, 398, 2, 0x0102, 2, 1 +539 bury 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2 +541 b main_for_header@20 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2 +481 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1 +483 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 2 +484 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1 +485 bz main_after_for@26 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2 +488 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1 +490 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 1 +491 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 1, 2 +492 * 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 2 +493 dig 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 2, 0x0004000A000450696E670004506F6E67 +495 dup 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 2, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67 +496 cover 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 2, 0x0004000A000450696E670004506F6E67 +498 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67, 2 +499 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 10 +500 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 0x0004000A000450696E670004506F6E67 +502 dig 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 0x0004000A000450696E670004506F6E67, 10 +504 extract_uint16 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 4 +505 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 4, 2 +506 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 6 +507 extract3 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 0x0004506F6E67 +508 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 0x0004506F6E67, 1 +509 int 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 0x0004506F6E67, 1, 0 +510 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 0x0004506F6E67, 0 +511 bz main_else_body@23 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 0x0004506F6E67 +522 extract 2 0 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, "Pong" +525 byte " " 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, "Pong", " " +527 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, " ", "Pong" +528 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, " Pong" +529 dig 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, " Pong", "Ping" +531 swap 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, "Ping", " Pong" +532 concat 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, "Ping Pong" +533 bury 13 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2 +535 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1 +537 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 1, 1 +538 + 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 1, 398, 2, 0x0102, 2, 2 +539 bury 5 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2 +541 b main_for_header@20 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2 +481 dig 4 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2, 2 +483 int 2 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2, 2, 2 +484 < 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2, 0 +485 bz main_after_for@26 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2 +544 dig 12 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2, "Ping Pong" +546 byte "Ping Pong" 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2, "Ping Pong", "Ping Pong" +557 == 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2, 1 +558 assert 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2 +559 int 1 0x0001, 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 0x000000010000000A000000FF00000080, 2, 1, 1, 2, 4, 2, 398, 2, 0x0102, 2, 1 +560 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/array.O1.log b/examples/arc4_types/out/array.O1.log new file mode 100644 index 0000000000..d15120523c --- /dev/null +++ b/examples/arc4_types/out/array.O1.log @@ -0,0 +1,402 @@ +PC Teal Stack +1 +7 +22 int 0 0 +23 dupn 2 0, 0, 0 +25 byte "" 0, 0, 0, 0x +26 dupn 4 0, 0, 0, 0x, 0x, 0x, 0x, 0x +28 int 0 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0 +29 byte 0x00020102 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 0x00020102 +35 int 0 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 0x00020102, 0 +36 extract_uint16 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2 +37 int 0 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0 +38 dup 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0 +39 dig 2 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0, 2 +41 < 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 1 +42 bz main_after_for@4 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0 +45 byte 0x0102 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0x0102 +49 dig 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0x0102, 0 +51 dup 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0x0102, 0, 0 +52 cover 2 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0, 0x0102, 0 +54 int 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0, 0x0102, 0, 1 +55 extract3 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0, 0x01 +56 btoi 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0, 1 +57 dig 4 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0, 1, 0 +59 + 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 0, 2, 0, 0, 1 +60 bury 4 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 0, 0 +62 int 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 0, 0, 1 +63 + 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 0, 1 +64 bury 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1 +66 b main_for_header@1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1 +38 dup 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1 +39 dig 2 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1, 2 +41 < 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1 +42 bz main_after_for@4 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1 +45 byte 0x0102 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 0x0102 +49 dig 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 0x0102, 1 +51 dup 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 0x0102, 1, 1 +52 cover 2 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1, 0x0102, 1 +54 int 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1, 0x0102, 1, 1 +55 extract3 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1, 0x02 +56 btoi 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1, 2 +57 dig 4 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1, 2, 1 +59 + 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 1, 2, 1, 1, 3 +60 bury 4 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 1, 1 +62 int 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 1, 1, 1 +63 + 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 1, 2 +64 bury 1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2 +66 b main_for_header@1 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2 +38 dup 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 2 +39 dig 2 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 2, 2 +41 < 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 0 +42 bz main_after_for@4 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2 +69 dig 2 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 3 +71 int 3 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 3, 3 +73 == 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 1 +74 assert 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2 +75 byte 0x00010001 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 0x00010001 +81 int 0 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 0x00010001, 0 +82 extract_uint16 0, 0, 0, 0x, 0x, 0x, 0x, 0x, 3, 2, 2, 1 +83 bury 7 0, 0, 0, 0x, 1, 0x, 0x, 0x, 3, 2, 2 +85 int 0 0, 0, 0, 0x, 1, 0x, 0x, 0x, 3, 2, 2, 0 +86 bury 5 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2 +88 dig 4 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0 +90 dig 7 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 1 +92 < 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 1 +93 bz main_after_for@8 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2 +96 dig 4 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0 +98 dup 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 0 +99 int 2 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 0, 2 +100 * 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 0 +101 byte 0x0001 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 0, 0x0001 +105 swap 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 0x0001, 0 +106 int 2 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 0x0001, 0, 2 +107 extract3 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 0x0001 +108 btoi 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 1 +109 dig 4 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 1, 3 +111 + 0, 0, 0, 0x, 1, 0x, 0, 0x, 3, 2, 2, 0, 4 +112 bury 4 0, 0, 0, 0x, 1, 0x, 0, 0x, 4, 2, 2, 0 +114 int 1 0, 0, 0, 0x, 1, 0x, 0, 0x, 4, 2, 2, 0, 1 +115 + 0, 0, 0, 0x, 1, 0x, 0, 0x, 4, 2, 2, 1 +116 bury 5 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2 +118 b main_for_header@5 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2 +88 dig 4 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 1 +90 dig 7 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 1, 1 +92 < 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0 +93 bz main_after_for@8 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2 +121 dig 2 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 4 +123 int 4 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 4, 4 +124 == 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 1 +125 assert 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2 +126 int 4 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 4 +127 itob 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x0000000000000004 +128 extract 6 2 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x0004 +131 byte 0x0002 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x0004, 0x0002 +135 swap 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x0002, 0x0004 +136 concat 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004 +137 int 11 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004, 11 +139 itob 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004, 0x000000000000000B +140 extract 6 2 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004, 0x000B +143 concat 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B +144 byte "\x00\x05Hello" 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B, 0x000548656C6C6F +145 concat 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F +146 byte "\x00\x05World" 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F, 0x0005576F726C64 +155 concat 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64 +156 dup 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +157 int 0 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +158 extract_uint16 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2 +159 int 2 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2, 2 +160 == 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 1 +161 assert 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64 +162 dup 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +163 int 0 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +164 extract_uint16 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2 +165 int 0 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2, 0 +166 > 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 1 +167 assert 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64 +168 dup 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +169 extract 2 0 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +172 dup 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +173 int 0 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +174 extract_uint16 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4 +175 dig 1 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64 +177 dig 1 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64, 4 +179 extract_uint16 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 5 +180 int 2 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 5, 2 +181 + 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 7 +182 extract3 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x000548656C6C6F +183 byte "\x00\x05Hello" 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x000548656C6C6F, 0x000548656C6C6F +184 == 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 1 +185 assert 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64 +186 byte "" 0, 0, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x +187 bury 11 0, 0x, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64 +189 dup 0, 0x, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +190 int 0 0, 0x, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +191 extract_uint16 0, 0x, 0, 0x, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64, 2 +192 bury 9 0, 0x, 0, 2, 1, 0x, 1, 0x, 4, 2, 2, 0x00020004000B000548656C6C6F0005576F726C64 +194 extract 2 0 0, 0x, 0, 2, 1, 0x, 1, 0x, 4, 2, 2, 0x0004000B000548656C6C6F0005576F726C64 +197 bury 11 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0x, 1, 0x, 4, 2, 2 +199 int 0 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0x, 1, 0x, 4, 2, 2, 0 +200 bury 6 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2 +202 dig 5 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0 +204 dig 8 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 2 +206 < 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 1 +207 bz main_after_for@15 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2 +210 dig 5 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0 +212 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0 +213 int 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0, 2 +214 * 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0 +215 dig 12 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64 +217 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +218 cover 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 0, 0x0004000B000548656C6C6F0005576F726C64 +220 swap 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +221 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4 +222 dig 1 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64 +224 dig 1 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64, 4 +226 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 5 +227 int 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 5, 2 +228 + 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 7 +229 extract3 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 0x000548656C6C6F +230 swap 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0x000548656C6C6F, 0 +231 ! 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0x000548656C6C6F, 1 +232 bz main_else_body@12 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0x000548656C6C6F +235 extract 2 0 0x0004000B000548656C6C6F0005576F726C64, 0x, 0, 2, 1, 0, 1, 0x, 4, 2, 2, "Hello" +238 bury 10 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 0, 1, 0x, 4, 2, 2 +240 b main_after_if_else@13 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 0, 1, 0x, 4, 2, 2 +255 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0 +257 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 0, 1, 0x, 4, 2, 2, 0, 1 +258 + 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 0, 1, 0x, 4, 2, 2, 1 +259 bury 6 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2 +261 b main_for_header@9 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2 +202 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1 +204 dig 8 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 2 +206 < 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1 +207 bz main_after_for@15 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2 +210 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1 +212 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 1 +213 int 2 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 1, 2 +214 * 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 2 +215 dig 12 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 2, 0x0004000B000548656C6C6F0005576F726C64 +217 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 2, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +218 cover 2 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 2, 0x0004000B000548656C6C6F0005576F726C64 +220 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 2 +221 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11 +222 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 0x0004000B000548656C6C6F0005576F726C64 +224 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 0x0004000B000548656C6C6F0005576F726C64, 11 +226 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 5 +227 int 2 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 5, 2 +228 + 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 7 +229 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 0x0005576F726C64 +230 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 0x0005576F726C64, 1 +231 ! 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 0x0005576F726C64, 0 +232 bz main_else_body@12 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 0x0005576F726C64 +243 extract 2 0 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, "World" +246 byte " " 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, "World", " " +247 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, " ", "World" +248 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, " World" +249 dig 10 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, " World", "Hello" +251 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, "Hello", " World" +252 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello", 0, 2, 1, 1, 1, 0x, 4, 2, 2, "Hello World" +253 bury 10 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 1, 1, 0x, 4, 2, 2 +255 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1 +257 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 1, 1 +258 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 1, 1, 0x, 4, 2, 2, 2 +259 bury 6 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2 +261 b main_for_header@9 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2 +202 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2, 2 +204 dig 8 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2, 2, 2 +206 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2, 0 +207 bz main_after_for@15 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2 +264 dig 9 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2, "Hello World" +266 byte "Hello World" 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2, "Hello World", "Hello World" +279 == 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2, 1 +280 assert 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2 +281 int 0 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0x, 4, 2, 2, 0 +282 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2 +284 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0 +286 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 4 +287 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 1 +288 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2 +291 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0 +293 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 0 +294 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 0, 4 +295 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 0 +296 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 0, 0x000000010000000A000000FF00000080 +314 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 0x000000010000000A000000FF00000080, 0 +315 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 0x000000010000000A000000FF00000080, 0, 4 +316 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 0x00000001 +317 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 1 +318 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 1, 4 +320 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 4, 2, 2, 0, 5 +321 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 5, 2, 2, 0 +323 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 5, 2, 2, 0, 1 +324 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 0, 5, 2, 2, 1 +325 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2 +327 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2 +284 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1 +286 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 4 +287 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1 +288 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2 +291 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1 +293 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 1 +294 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 1, 4 +295 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 4 +296 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 4, 0x000000010000000A000000FF00000080 +314 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 0x000000010000000A000000FF00000080, 4 +315 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 0x000000010000000A000000FF00000080, 4, 4 +316 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 0x0000000A +317 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 10 +318 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 10, 5 +320 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 5, 2, 2, 1, 15 +321 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 15, 2, 2, 1 +323 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 15, 2, 2, 1, 1 +324 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 1, 15, 2, 2, 2 +325 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2 +327 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2 +284 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2 +286 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 4 +287 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 1 +288 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2 +291 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2 +293 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 2 +294 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 2, 4 +295 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 8 +296 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 8, 0x000000010000000A000000FF00000080 +314 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 0x000000010000000A000000FF00000080, 8 +315 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 0x000000010000000A000000FF00000080, 8, 4 +316 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 0x000000FF +317 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 255 +318 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 255, 15 +320 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 15, 2, 2, 2, 270 +321 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 270, 2, 2, 2 +323 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 270, 2, 2, 2, 1 +324 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 2, 270, 2, 2, 3 +325 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2 +327 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2 +284 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3 +286 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 4 +287 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 1 +288 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2 +291 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3 +293 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 3 +294 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 3, 4 +295 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 12 +296 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 12, 0x000000010000000A000000FF00000080 +314 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 0x000000010000000A000000FF00000080, 12 +315 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 0x000000010000000A000000FF00000080, 12, 4 +316 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 0x00000080 +317 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 128 +318 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 128, 270 +320 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 270, 2, 2, 3, 398 +321 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 398, 2, 2, 3 +323 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 398, 2, 2, 3, 1 +324 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 3, 398, 2, 2, 4 +325 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2 +327 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2 +284 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 4 +286 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 4, 4 +287 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0 +288 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2 +330 dig 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 398 +332 int 398 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 398, 398 +335 == 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 1 +336 assert 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2 +337 byte 0x65 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, "e" +338 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 101 +339 byte 0x65 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 101, "e" +340 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 101, 101 +341 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 202 +342 int 202 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 202, 202 +345 == 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 1 +346 assert 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2 +347 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 4 +348 itob 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0000000000000004 +349 extract 6 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004 +352 int 10 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004, 10 +354 itob 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004, 0x000000000000000A +355 extract 6 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004, 0x000A +358 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004000A +359 byte "\x00\x04Ping" 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004000A, 0x000450696E67 +367 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004000A000450696E67 +368 byte "\x00\x04Pong" 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004000A000450696E67, 0x0004506F6E67 +376 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0, 2, 1, 2, 1, 4, 398, 2, 2, 0x0004000A000450696E670004506F6E67 +377 bury 9 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2 +379 byte "" 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, 0x +380 bury 10 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2 +382 int 0 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, 0 +383 bury 6 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2 +385 dig 5 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0 +387 int 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 2 +388 < 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 1 +389 bz main_after_for@26 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2 +392 dig 5 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0 +394 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0 +395 int 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0, 2 +396 * 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0 +397 dig 10 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0, 0x0004000A000450696E670004506F6E67 +399 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67 +400 cover 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 0, 0x0004000A000450696E670004506F6E67 +402 swap 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67, 0 +403 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 4 +404 dig 1 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 0x0004000A000450696E670004506F6E67 +406 dig 1 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 0x0004000A000450696E670004506F6E67, 4 +408 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 4 +409 int 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 4, 2 +410 + 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 6 +411 extract3 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 0x000450696E67 +412 swap 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0x000450696E67, 0 +413 ! 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0x000450696E67, 1 +414 bz main_else_body@23 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0x000450696E67 +417 extract 2 0 0x0004000B000548656C6C6F0005576F726C64, 0x, 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, "Ping" +420 bury 10 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2 +422 b main_after_if_else@24 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2 +437 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0 +439 int 1 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 0, 1 +440 + 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 0, 1, 4, 398, 2, 2, 1 +441 bury 6 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2 +443 b main_for_header@20 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2 +385 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1 +387 int 2 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 2 +388 < 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1 +389 bz main_after_for@26 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2 +392 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1 +394 dup 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 1 +395 int 2 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 1, 2 +396 * 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 2 +397 dig 10 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 2, 0x0004000A000450696E670004506F6E67 +399 dup 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 2, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67 +400 cover 2 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 2, 0x0004000A000450696E670004506F6E67 +402 swap 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67, 2 +403 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 10 +404 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 0x0004000A000450696E670004506F6E67 +406 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 0x0004000A000450696E670004506F6E67, 10 +408 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 4 +409 int 2 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 4, 2 +410 + 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 6 +411 extract3 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 0x0004506F6E67 +412 swap 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 0x0004506F6E67, 1 +413 ! 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 0x0004506F6E67, 0 +414 bz main_else_body@23 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 0x0004506F6E67 +425 extract 2 0 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, "Pong" +428 byte " " 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, "Pong", " " +429 swap 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, " ", "Pong" +430 concat 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, " Pong" +431 dig 10 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, " Pong", "Ping" +433 swap 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, "Ping", " Pong" +434 concat 0x0004000B000548656C6C6F0005576F726C64, "Ping", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, "Ping Pong" +435 bury 10 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2 +437 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1 +439 int 1 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 1, 1 +440 + 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 1, 1, 4, 398, 2, 2, 2 +441 bury 6 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2 +443 b main_for_header@20 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2 +385 dig 5 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, 2 +387 int 2 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, 2, 2 +388 < 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, 0 +389 bz main_after_for@26 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2 +446 dig 9 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, "Ping Pong" +448 byte "Ping Pong" 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, "Ping Pong", "Ping Pong" +459 == 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, 1 +460 assert 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2 +461 int 1 0x0004000B000548656C6C6F0005576F726C64, "Ping Pong", 0x0004000A000450696E670004506F6E67, 2, 1, 2, 1, 4, 398, 2, 2, 1 +462 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/array.O2.log b/examples/arc4_types/out/array.O2.log new file mode 100644 index 0000000000..4aef4cd707 --- /dev/null +++ b/examples/arc4_types/out/array.O2.log @@ -0,0 +1,396 @@ +PC Teal Stack +1 +7 +22 int 0 0 +23 dup 0, 0 +24 int 0 0, 0, 0 +25 byte 0x00020102 0, 0, 0, 0x00020102 +31 int 0 0, 0, 0, 0x00020102, 0 +32 extract_uint16 0, 0, 0, 2 +33 int 0 0, 0, 0, 2, 0 +34 dup 0, 0, 0, 2, 0, 0 +35 dig 2 0, 0, 0, 2, 0, 0, 2 +37 < 0, 0, 0, 2, 0, 1 +38 bz main_after_for@4 0, 0, 0, 2, 0 +41 byte 0x0102 0, 0, 0, 2, 0, 0x0102 +45 dig 1 0, 0, 0, 2, 0, 0x0102, 0 +47 dup 0, 0, 0, 2, 0, 0x0102, 0, 0 +48 cover 2 0, 0, 0, 2, 0, 0, 0x0102, 0 +50 int 1 0, 0, 0, 2, 0, 0, 0x0102, 0, 1 +51 extract3 0, 0, 0, 2, 0, 0, 0x01 +52 btoi 0, 0, 0, 2, 0, 0, 1 +53 dig 4 0, 0, 0, 2, 0, 0, 1, 0 +55 + 0, 0, 0, 2, 0, 0, 1 +56 bury 4 0, 0, 1, 2, 0, 0 +58 int 1 0, 0, 1, 2, 0, 0, 1 +59 + 0, 0, 1, 2, 0, 1 +60 bury 1 0, 0, 1, 2, 1 +62 b main_for_header@1 0, 0, 1, 2, 1 +34 dup 0, 0, 1, 2, 1, 1 +35 dig 2 0, 0, 1, 2, 1, 1, 2 +37 < 0, 0, 1, 2, 1, 1 +38 bz main_after_for@4 0, 0, 1, 2, 1 +41 byte 0x0102 0, 0, 1, 2, 1, 0x0102 +45 dig 1 0, 0, 1, 2, 1, 0x0102, 1 +47 dup 0, 0, 1, 2, 1, 0x0102, 1, 1 +48 cover 2 0, 0, 1, 2, 1, 1, 0x0102, 1 +50 int 1 0, 0, 1, 2, 1, 1, 0x0102, 1, 1 +51 extract3 0, 0, 1, 2, 1, 1, 0x02 +52 btoi 0, 0, 1, 2, 1, 1, 2 +53 dig 4 0, 0, 1, 2, 1, 1, 2, 1 +55 + 0, 0, 1, 2, 1, 1, 3 +56 bury 4 0, 0, 3, 2, 1, 1 +58 int 1 0, 0, 3, 2, 1, 1, 1 +59 + 0, 0, 3, 2, 1, 2 +60 bury 1 0, 0, 3, 2, 2 +62 b main_for_header@1 0, 0, 3, 2, 2 +34 dup 0, 0, 3, 2, 2, 2 +35 dig 2 0, 0, 3, 2, 2, 2, 2 +37 < 0, 0, 3, 2, 2, 0 +38 bz main_after_for@4 0, 0, 3, 2, 2 +65 dig 2 0, 0, 3, 2, 2, 3 +67 int 3 0, 0, 3, 2, 2, 3, 3 +69 == 0, 0, 3, 2, 2, 1 +70 assert 0, 0, 3, 2, 2 +71 byte 0x00010001 0, 0, 3, 2, 2, 0x00010001 +77 int 0 0, 0, 3, 2, 2, 0x00010001, 0 +78 extract_uint16 0, 0, 3, 2, 2, 1 +79 bury 2 0, 0, 3, 1, 2 +81 int 0 0, 0, 3, 1, 2, 0 +82 bury 1 0, 0, 3, 1, 0 +84 dup 0, 0, 3, 1, 0, 0 +85 dig 2 0, 0, 3, 1, 0, 0, 1 +87 < 0, 0, 3, 1, 0, 1 +88 bz main_after_for@8 0, 0, 3, 1, 0 +91 dup 0, 0, 3, 1, 0, 0 +92 dup 0, 0, 3, 1, 0, 0, 0 +93 int 2 0, 0, 3, 1, 0, 0, 0, 2 +94 * 0, 0, 3, 1, 0, 0, 0 +95 byte 0x0001 0, 0, 3, 1, 0, 0, 0, 0x0001 +99 swap 0, 0, 3, 1, 0, 0, 0x0001, 0 +100 int 2 0, 0, 3, 1, 0, 0, 0x0001, 0, 2 +101 extract3 0, 0, 3, 1, 0, 0, 0x0001 +102 btoi 0, 0, 3, 1, 0, 0, 1 +103 dig 4 0, 0, 3, 1, 0, 0, 1, 3 +105 + 0, 0, 3, 1, 0, 0, 4 +106 bury 4 0, 0, 4, 1, 0, 0 +108 int 1 0, 0, 4, 1, 0, 0, 1 +109 + 0, 0, 4, 1, 0, 1 +110 bury 1 0, 0, 4, 1, 1 +112 b main_for_header@5 0, 0, 4, 1, 1 +84 dup 0, 0, 4, 1, 1, 1 +85 dig 2 0, 0, 4, 1, 1, 1, 1 +87 < 0, 0, 4, 1, 1, 0 +88 bz main_after_for@8 0, 0, 4, 1, 1 +115 dig 2 0, 0, 4, 1, 1, 4 +117 int 4 0, 0, 4, 1, 1, 4, 4 +118 == 0, 0, 4, 1, 1, 1 +119 assert 0, 0, 4, 1, 1 +120 int 4 0, 0, 4, 1, 1, 4 +121 itob 0, 0, 4, 1, 1, 0x0000000000000004 +122 extract 6 2 0, 0, 4, 1, 1, 0x0004 +125 byte 0x0002 0, 0, 4, 1, 1, 0x0004, 0x0002 +129 swap 0, 0, 4, 1, 1, 0x0002, 0x0004 +130 concat 0, 0, 4, 1, 1, 0x00020004 +131 int 11 0, 0, 4, 1, 1, 0x00020004, 11 +133 itob 0, 0, 4, 1, 1, 0x00020004, 0x000000000000000B +134 extract 6 2 0, 0, 4, 1, 1, 0x00020004, 0x000B +137 concat 0, 0, 4, 1, 1, 0x00020004000B +138 byte "\x00\x05Hello" 0, 0, 4, 1, 1, 0x00020004000B, 0x000548656C6C6F +139 concat 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F +140 byte "\x00\x05World" 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F, 0x0005576F726C64 +149 concat 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64 +150 dup 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +151 int 0 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +152 extract_uint16 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 2 +153 int 2 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 2, 2 +154 == 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 1 +155 assert 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64 +156 dup 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +157 int 0 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +158 extract_uint16 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 2 +159 int 0 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 2, 0 +160 > 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 1 +161 assert 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64 +162 dup 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +163 extract 2 0 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +166 dup 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +167 int 0 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +168 extract_uint16 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4 +169 dig 1 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64 +171 dig 1 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64, 4 +173 extract_uint16 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 5 +174 int 2 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 5, 2 +175 + 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 4, 7 +176 extract3 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x000548656C6C6F +177 byte "\x00\x05Hello" 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x000548656C6C6F, 0x000548656C6C6F +178 == 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 1 +179 assert 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64 +180 byte "" 0, 0, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x +181 bury 5 0, 0x, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64 +183 dup 0, 0x, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64 +184 int 0 0, 0x, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 0x00020004000B000548656C6C6F0005576F726C64, 0 +185 extract_uint16 0, 0x, 4, 1, 1, 0x00020004000B000548656C6C6F0005576F726C64, 2 +186 bury 3 0, 0x, 4, 2, 1, 0x00020004000B000548656C6C6F0005576F726C64 +188 extract 2 0 0, 0x, 4, 2, 1, 0x0004000B000548656C6C6F0005576F726C64 +191 bury 5 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 1 +193 int 0 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 1, 0 +194 bury 1 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0 +196 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0 +197 dig 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 2 +199 < 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 1 +200 bz main_after_for@15 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0 +203 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0 +204 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0 +205 int 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0, 2 +206 * 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0 +207 dig 6 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0, 0x0004000B000548656C6C6F0005576F726C64 +209 dup 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +210 uncover 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 0 +212 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 4 +213 dig 1 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64 +215 dig 1 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 0x0004000B000548656C6C6F0005576F726C64, 4 +217 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 5 +218 int 2 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 5, 2 +219 + 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x0004000B000548656C6C6F0005576F726C64, 4, 7 +220 extract3 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0, 0x000548656C6C6F +221 swap 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0x000548656C6C6F, 0 +222 ! 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0x000548656C6C6F, 1 +223 bz main_else_body@12 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, 0x000548656C6C6F +226 extract 2 0 0x0004000B000548656C6C6F0005576F726C64, 0x, 4, 2, 0, "Hello" +229 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 0 +231 b main_after_if_else@13 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 0 +246 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 0, 0 +247 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 0, 0, 1 +248 + 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 0, 1 +249 bury 1 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1 +251 b main_for_header@9 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1 +196 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1 +197 dig 2 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 2 +199 < 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1 +200 bz main_after_for@15 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1 +203 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1 +204 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 1 +205 int 2 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 1, 2 +206 * 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 2 +207 dig 6 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 2, 0x0004000B000548656C6C6F0005576F726C64 +209 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 2, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64 +210 uncover 2 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0004000B000548656C6C6F0005576F726C64, 0x0004000B000548656C6C6F0005576F726C64, 2 +212 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0004000B000548656C6C6F0005576F726C64, 11 +213 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 0x0004000B000548656C6C6F0005576F726C64 +215 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 0x0004000B000548656C6C6F0005576F726C64, 11 +217 extract_uint16 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 5 +218 int 2 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 5, 2 +219 + 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0004000B000548656C6C6F0005576F726C64, 11, 7 +220 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 1, 0x0005576F726C64 +221 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 0x0005576F726C64, 1 +222 ! 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 0x0005576F726C64, 0 +223 bz main_else_body@12 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, 0x0005576F726C64 +234 extract 2 0 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, "World" +237 byte " " 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, "World", " " +238 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, " ", "World" +239 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, " World" +240 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, " World", "Hello" +242 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, "Hello", " World" +243 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello", 4, 2, 1, "Hello World" +244 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 1 +246 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 1, 1 +247 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 1, 1, 1 +248 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 1, 2 +249 bury 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2 +251 b main_for_header@9 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2 +196 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2, 2 +197 dig 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2, 2, 2 +199 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2, 0 +200 bz main_after_for@15 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2 +254 dig 3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2, "Hello World" +256 byte "Hello World" 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2, "Hello World", "Hello World" +269 == 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2, 1 +270 assert 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2 +271 int 0 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 2, 2, 0 +272 bury 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2 +274 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0 +276 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 4 +277 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 1 +278 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2 +281 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0 +283 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 0 +284 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 0, 4 +285 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 0 +286 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 0, 0x000000010000000A000000FF00000080 +304 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 0x000000010000000A000000FF00000080, 0 +305 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 0x000000010000000A000000FF00000080, 0, 4 +306 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 0x00000001 +307 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 1 +308 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 1, 4 +310 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 4, 0, 2, 0, 5 +311 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 0, 2, 0 +313 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 0, 2, 0, 1 +314 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 0, 2, 1 +315 bury 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2 +317 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2 +274 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1 +276 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 4 +277 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1 +278 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2 +281 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1 +283 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 1 +284 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 1, 4 +285 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 4 +286 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 4, 0x000000010000000A000000FF00000080 +304 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 0x000000010000000A000000FF00000080, 4 +305 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 0x000000010000000A000000FF00000080, 4, 4 +306 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 0x0000000A +307 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 10 +308 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 10, 5 +310 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 5, 1, 2, 1, 15 +311 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 1, 2, 1 +313 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 1, 2, 1, 1 +314 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 1, 2, 2 +315 bury 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2 +317 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2 +274 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2 +276 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 4 +277 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 1 +278 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2 +281 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2 +283 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 2 +284 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 2, 4 +285 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 8 +286 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 8, 0x000000010000000A000000FF00000080 +304 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 0x000000010000000A000000FF00000080, 8 +305 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 0x000000010000000A000000FF00000080, 8, 4 +306 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 0x000000FF +307 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 255 +308 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 255, 15 +310 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 15, 2, 2, 2, 270 +311 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 2, 2, 2 +313 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 2, 2, 2, 1 +314 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 2, 2, 3 +315 bury 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2 +317 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2 +274 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3 +276 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 4 +277 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 1 +278 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2 +281 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3 +283 dup 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 3 +284 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 3, 4 +285 * 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 12 +286 byte 0x000000010000000a000000ff00000080 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 12, 0x000000010000000A000000FF00000080 +304 swap 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 0x000000010000000A000000FF00000080, 12 +305 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 0x000000010000000A000000FF00000080, 12, 4 +306 extract3 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 0x00000080 +307 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 128 +308 dig 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 128, 270 +310 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 270, 3, 2, 3, 398 +311 bury 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 3, 2, 3 +313 int 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 3, 2, 3, 1 +314 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 3, 2, 4 +315 bury 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2 +317 b main_for_header@16 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2 +274 dig 1 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 4 +276 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 4, 4 +277 < 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0 +278 bz main_after_for@19 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2 +320 dig 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 398 +322 int 398 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 398, 398 +325 == 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 1 +326 assert 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2 +327 byte 0x65 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, "e" +328 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 101 +329 byte 0x65 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 101, "e" +330 btoi 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 101, 101 +331 + 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 202 +332 int 202 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 202, 202 +335 == 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 1 +336 assert 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2 +337 int 4 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 4 +338 itob 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0000000000000004 +339 extract 6 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004 +342 int 10 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004, 10 +344 itob 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004, 0x000000000000000A +345 extract 6 2 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004, 0x000A +348 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004000A +349 byte "\x00\x04Ping" 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004000A, 0x000450696E67 +357 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004000A000450696E67 +358 byte "\x00\x04Pong" 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004000A000450696E67, 0x0004506F6E67 +366 concat 0x0004000B000548656C6C6F0005576F726C64, "Hello World", 398, 4, 2, 0x0004000A000450696E670004506F6E67 +367 bury 5 0x0004000A000450696E670004506F6E67, "Hello World", 398, 4, 2 +369 byte "" 0x0004000A000450696E670004506F6E67, "Hello World", 398, 4, 2, 0x +370 bury 4 0x0004000A000450696E670004506F6E67, 0x, 398, 4, 2 +372 int 0 0x0004000A000450696E670004506F6E67, 0x, 398, 4, 2, 0 +373 bury 3 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2 +375 dig 2 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0 +377 int 2 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 2 +378 < 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 1 +379 bz main_after_for@26 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2 +382 dig 2 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0 +384 dup 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0 +385 int 2 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0, 2 +386 * 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0 +387 dig 6 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0, 0x0004000A000450696E670004506F6E67 +389 dup 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67 +390 uncover 2 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67, 0 +392 extract_uint16 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x0004000A000450696E670004506F6E67, 4 +393 dig 1 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 0x0004000A000450696E670004506F6E67 +395 dig 1 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 0x0004000A000450696E670004506F6E67, 4 +397 extract_uint16 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 4 +398 int 2 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 4, 2 +399 + 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x0004000A000450696E670004506F6E67, 4, 6 +400 extract3 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0, 0x000450696E67 +401 swap 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0x000450696E67, 0 +402 ! 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0x000450696E67, 1 +403 bz main_else_body@23 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, 0x000450696E67 +406 extract 2 0 0x0004000A000450696E670004506F6E67, 0x, 0, 4, 2, "Ping" +409 bury 4 0x0004000A000450696E670004506F6E67, "Ping", 0, 4, 2 +411 b main_after_if_else@24 0x0004000A000450696E670004506F6E67, "Ping", 0, 4, 2 +426 dig 2 0x0004000A000450696E670004506F6E67, "Ping", 0, 4, 2, 0 +428 int 1 0x0004000A000450696E670004506F6E67, "Ping", 0, 4, 2, 0, 1 +429 + 0x0004000A000450696E670004506F6E67, "Ping", 0, 4, 2, 1 +430 bury 3 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2 +432 b main_for_header@20 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2 +375 dig 2 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1 +377 int 2 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 2 +378 < 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1 +379 bz main_after_for@26 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2 +382 dig 2 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1 +384 dup 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 1 +385 int 2 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 1, 2 +386 * 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 2 +387 dig 6 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 2, 0x0004000A000450696E670004506F6E67 +389 dup 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 2, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67 +390 uncover 2 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004000A000450696E670004506F6E67, 0x0004000A000450696E670004506F6E67, 2 +392 extract_uint16 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004000A000450696E670004506F6E67, 10 +393 dig 1 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 0x0004000A000450696E670004506F6E67 +395 dig 1 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 0x0004000A000450696E670004506F6E67, 10 +397 extract_uint16 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 4 +398 int 2 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 4, 2 +399 + 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004000A000450696E670004506F6E67, 10, 6 +400 extract3 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 1, 0x0004506F6E67 +401 swap 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 0x0004506F6E67, 1 +402 ! 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 0x0004506F6E67, 0 +403 bz main_else_body@23 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, 0x0004506F6E67 +414 extract 2 0 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, "Pong" +417 byte " " 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, "Pong", " " +418 swap 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, " ", "Pong" +419 concat 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, " Pong" +420 dig 4 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, " Pong", "Ping" +422 swap 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, "Ping", " Pong" +423 concat 0x0004000A000450696E670004506F6E67, "Ping", 1, 4, 2, "Ping Pong" +424 bury 4 0x0004000A000450696E670004506F6E67, "Ping Pong", 1, 4, 2 +426 dig 2 0x0004000A000450696E670004506F6E67, "Ping Pong", 1, 4, 2, 1 +428 int 1 0x0004000A000450696E670004506F6E67, "Ping Pong", 1, 4, 2, 1, 1 +429 + 0x0004000A000450696E670004506F6E67, "Ping Pong", 1, 4, 2, 2 +430 bury 3 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2 +432 b main_for_header@20 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2 +375 dig 2 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2, 2 +377 int 2 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2, 2, 2 +378 < 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2, 0 +379 bz main_after_for@26 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2 +435 dig 3 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2, "Ping Pong" +437 byte "Ping Pong" 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2, "Ping Pong", "Ping Pong" +448 == 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2, 1 +449 assert 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2 +450 int 1 0x0004000A000450696E670004506F6E67, "Ping Pong", 2, 4, 2, 1 +451 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/array.approval.debug.teal b/examples/arc4_types/out/array.approval.debug.teal new file mode 100644 index 0000000000..25dfbef98b --- /dev/null +++ b/examples/arc4_types/out/array.approval.debug.teal @@ -0,0 +1,312 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: +main: + int 0 + dupn 2 + byte "" + dupn 4 // allocate 8 to stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0 | + +main_block@0: + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0 | 0 0 File "arc4_types/array.py", line 23 + byte 0x00020102 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0 | 0x00020102 DynamicArray[UInt8](UInt8(1), UInt8(2)) File "arc4_types/array.py", line 22 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0 | 0x00020102,0 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0 | {extract_uint16} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0 | 0 + // Implicit fall through to main_for_header@1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_for_header@1: + dup // load item_index_internal%3#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0 + dig 2 // load array_length%1#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,array_length%1#0 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + < // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {<} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + bz main_after_for@4 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + // Implicit fall through to main_for_body@2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + +main_for_body@2: + byte 0x0102 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0x0102 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + dig 1 // load item_index_internal%3#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0x0102,item_index_internal%3#0 + dup + cover 2 // store item_index_internal%3#0 to l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,0x0102,item_index_internal%3#0 + int 1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,0x0102,item_index_internal%3#0,1 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + extract3 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,{extract3} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + btoi // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,{btoi} uint8_item.decode() File "arc4_types/array.py", line 25 + dig 4 // load total#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,tmp%6#0,total#0 total File "arc4_types/array.py", line 23 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,{+} total += uint8_item.decode() File "arc4_types/array.py", line 25 + bury 4 // store total#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0 total File "arc4_types/array.py", line 23 + int 1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%3#0,1 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {+} + bury 1 // store item_index_internal%3#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + b main_for_header@1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_after_for@4: + dig 2 // load total#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | total#0 total File "arc4_types/array.py", line 23 + int 3 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | total#0,3 3 File "arc4_types/array.py", line 27 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {==} total == 3, "Total should be sum of dynamic_uint8_array items" File "arc4_types/array.py", line 27 + assert // Total should be sum of dynamic_uint8_array items // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | assert total == 3, "Total should be sum of dynamic_uint8_array items" File "arc4_types/array.py", line 27 + byte 0x00010001 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0x00010001 AliasedDynamicArray(UInt16(1)) File "arc4_types/array.py", line 28 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0x00010001,0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract_uint16} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + bury 7 // store array_length%9#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0 + bury 5 // store item_index_internal%11#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + // Implicit fall through to main_for_header@5 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_for_header@5: + dig 4 // load item_index_internal%11#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0 + dig 7 // load array_length%9#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,array_length%9#0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + < // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {<} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + bz main_after_for@8 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + // Implicit fall through to main_for_body@6 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + +main_for_body@6: + dig 4 // load item_index_internal%11#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0 + dup // store item_index_internal%11#0 to l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,item_index_internal%11#0 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,item_index_internal%11#0,2 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + * // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,{*} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + byte 0x0001 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,item_index%13#0,0x0001 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + swap // load item_index%13#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,0x0001,item_index%13#0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,0x0001,item_index%13#0,2 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + extract3 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,{extract3} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + btoi // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,{btoi} uint16_item.decode() File "arc4_types/array.py", line 30 + dig 4 // load total#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,tmp%14#0,total#0 total File "arc4_types/array.py", line 23 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,{+} total += uint16_item.decode() File "arc4_types/array.py", line 30 + bury 4 // store total#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0 total File "arc4_types/array.py", line 23 + int 1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%11#0,1 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {+} + bury 5 // store item_index_internal%11#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + b main_for_header@5 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_after_for@8: + dig 2 // load total#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | total#0 total File "arc4_types/array.py", line 23 + int 4 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | total#0,4 4 File "arc4_types/array.py", line 31 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {==} total == 4, "Total should now include sum of aliased_dynamic items" File "arc4_types/array.py", line 31 + assert // Total should now include sum of aliased_dynamic items // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | assert total == 4, "Total should now include sum of aliased_dynamic items" File "arc4_types/array.py", line 31 + int 4 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 4 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + itob // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {itob} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + extract 6 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + byte 0x0002 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | value_as_uint16%19#0,0x0002 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + swap // load value_as_uint16%19#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0x0002,value_as_uint16%19#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + int 11 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | array_data%16#1,11 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + itob // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | array_data%16#1,{itob} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + extract 6 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | array_data%16#1,{extract} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + byte "\x00\x05Hello" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | array_data%16#1,"\x00\x05Hello" String("Hello") File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + byte "\x00\x05World" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | array_data%16#1,"\x00\x05World" String("World") File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0,0 dynamic_string_array.length File "arc4_types/array.py", line 33 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{extract_uint16} dynamic_string_array.length File "arc4_types/array.py", line 33 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,tmp%24#0,2 2 File "arc4_types/array.py", line 33 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{==} dynamic_string_array.length == 2 File "arc4_types/array.py", line 33 + assert // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0 assert dynamic_string_array.length == 2 File "arc4_types/array.py", line 33 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0,0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{extract_uint16} dynamic_string_array[0] File "arc4_types/array.py", line 34 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_length%26#0,0 0 File "arc4_types/array.py", line 34 + > // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{>} dynamic_string_array[0] File "arc4_types/array.py", line 34 + assert // Index access is out of bounds // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + extract 2 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{extract} dynamic_string_array[0] File "arc4_types/array.py", line 34 + dup // load array_data_sans_header%28#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,array_data_sans_header%28#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,array_data_sans_header%28#0,0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,{extract_uint16} dynamic_string_array[0] File "arc4_types/array.py", line 34 + dig 1 // load array_data_sans_header%28#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,array_data_sans_header%28#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + dig 1 // load item_index%30#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,array_data_sans_header%28#0,item_index%30#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,{extract_uint16} dynamic_string_array[0] File "arc4_types/array.py", line 34 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,item_length%31#0,2 dynamic_string_array[0] File "arc4_types/array.py", line 34 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,{+} dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract3 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{extract3} dynamic_string_array[0] File "arc4_types/array.py", line 34 + byte "\x00\x05Hello" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,tmp%33#0,"\x00\x05Hello" String("Hello") File "arc4_types/array.py", line 34 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{==} dynamic_string_array[0] == String("Hello") File "arc4_types/array.py", line 34 + assert // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0 assert dynamic_string_array[0] == String("Hello") File "arc4_types/array.py", line 34 + byte "" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,"" b"" File "arc4_types/array.py", line 35 + bury 11 // store result#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0 result File "arc4_types/array.py", line 35 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0,0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0,{extract_uint16} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + bury 9 // store array_length%35#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | dynamic_string_array#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract 2 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + bury 11 // store array_value%36#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0 + bury 6 // store index#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index File "arc4_types/array.py", line 36 + // Implicit fall through to main_for_header@9 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_for_header@9: + dig 5 // load index#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0 index File "arc4_types/array.py", line 36 + dig 8 // load array_length%35#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_length%35#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + < // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {<} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + bz main_after_for@15 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + // Implicit fall through to main_for_body@10 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + +main_for_body@10: + dig 5 // load index#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0 index File "arc4_types/array.py", line 36 + dup // store index#0 to l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,index#0 index File "arc4_types/array.py", line 36 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,index#0,2 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + * // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,{*} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dig 12 // load array_value%36#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,item_index_index%39#0,array_value%36#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dup + cover 2 // store array_value%36#0 to l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,item_index_index%39#0,array_value%36#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + swap // load item_index_index%39#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,array_value%36#0,item_index_index%39#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,{extract_uint16} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dig 1 // load array_value%36#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,item_index%40#0,array_value%36#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dig 1 // load item_index%40#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,item_index%40#0,array_value%36#0,item_index%40#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,item_index%40#0,{extract_uint16} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,item_index%40#0,item_length%41#0,2 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,array_value%36#0,item_index%40#0,{+} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract3 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,{extract3} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + swap // store string_item#0 to x-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | index#0 string_item File "arc4_types/array.py", line 36 + ! // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | {!} index == 0: File "arc4_types/array.py", line 37 + bz main_else_body@12 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | if index == 0: File "arc4_types/array.py", line 37 + // Implicit fall through to main_if_body@11 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | string_item#0 if index == 0: File "arc4_types/array.py", line 37 + +main_if_body@11: + extract 2 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 38 + bury 10 // store result#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + b main_after_if_else@13 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_else_body@12: + extract 2 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 40 + byte " " // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | tmp%44#0," " b" " File "arc4_types/array.py", line 40 + swap // load tmp%44#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | " ",tmp%44#0 string_item.decode() File "arc4_types/array.py", line 40 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} b" " + string_item.decode() File "arc4_types/array.py", line 40 + dig 10 // load result#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | tmp%45#0,result#0 result File "arc4_types/array.py", line 35 + swap // load tmp%45#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result#0,tmp%45#0 b" " + string_item.decode() File "arc4_types/array.py", line 40 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} result += b" " + string_item.decode() File "arc4_types/array.py", line 40 + bury 10 // store result#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + // Implicit fall through to main_after_if_else@13 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_after_if_else@13: + dig 5 // load index#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0 index File "arc4_types/array.py", line 36 + int 1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,1 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {+} + bury 6 // store index#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index File "arc4_types/array.py", line 36 + b main_for_header@9 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_after_for@15: + dig 9 // load result#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result#0 result File "arc4_types/array.py", line 35 + byte "Hello World" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result#0,"Hello World" b"Hello World" File "arc4_types/array.py", line 42 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {==} result == b"Hello World" File "arc4_types/array.py", line 42 + assert // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | assert result == b"Hello World" File "arc4_types/array.py", line 42 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0 + bury 4 // store item_index_internal%48#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + // Implicit fall through to main_for_header@16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_for_header@16: + dig 3 // load item_index_internal%48#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0 + int 4 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,4 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + < // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {<} for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + bz main_after_for@19 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + // Implicit fall through to main_for_body@17 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + +main_for_body@17: + dig 3 // load item_index_internal%48#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0 + dup // store item_index_internal%48#0 to l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,item_index_internal%48#0 + int 4 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,item_index_internal%48#0,4 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + * // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,{*} for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + byte 0x000000010000000a000000ff00000080 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,item_index%50#0,0x000000010000000a000000ff00000080 StaticArray(UInt32(1), UInt32(10), UInt32(255), UInt32(128)) File "arc4_types/array.py", line 44 + swap // load item_index%50#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,0x000000010000000a000000ff00000080,item_index%50#0 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + int 4 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,0x000000010000000a000000ff00000080,item_index%50#0,4 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + extract3 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,{extract3} for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + btoi // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,{btoi} uint32_item.decode() File "arc4_types/array.py", line 47 + dig 4 // load total#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,tmp%51#0,total#0 total File "arc4_types/array.py", line 23 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,{+} total += uint32_item.decode() File "arc4_types/array.py", line 47 + bury 4 // store total#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0 total File "arc4_types/array.py", line 23 + int 1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | item_index_internal%48#0,1 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {+} + bury 4 // store item_index_internal%48#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + b main_for_header@16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_after_for@19: + dig 2 // load total#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | total#0 total File "arc4_types/array.py", line 23 + int 398 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | total#0,398 4 + 1 + 10 + 255 + 128 File "arc4_types/array.py", line 49 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {==} total == 4 + 1 + 10 + 255 + 128 File "arc4_types/array.py", line 49 + assert // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | assert total == 4 + 1 + 10 + 255 + 128 File "arc4_types/array.py", line 49 + byte 0x65 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0x65 aliased_static[0] File "arc4_types/array.py", line 55 + btoi // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {btoi} aliased_static[0].decode() File "arc4_types/array.py", line 55 + byte 0x65 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | tmp%56#0,0x65 aliased_static[index] File "arc4_types/array.py", line 55 + btoi // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | tmp%56#0,{btoi} aliased_static[index].decode() File "arc4_types/array.py", line 55 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {+} aliased_static[0].decode() + aliased_static[index].decode() File "arc4_types/array.py", line 55 + int 202 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | tmp%62#0,202 202 File "arc4_types/array.py", line 55 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {==} aliased_static[0].decode() + aliased_static[index].decode()) == 202 File "arc4_types/array.py", line 55 + assert // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | assert (aliased_static[0].decode() + aliased_static[index].decode()) == 202 File "arc4_types/array.py", line 55 + int 4 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 4 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + itob // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {itob} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + extract 6 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + int 10 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | value_as_uint16%67#0,10 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + itob // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | value_as_uint16%67#0,{itob} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + extract 6 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | value_as_uint16%67#0,{extract} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + byte "\x00\x04Ping" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | array_data%64#2,"\x00\x04Ping" String("Ping") File "arc4_types/array.py", line 57 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + byte "\x00\x04Pong" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | array_data%64#2,"\x00\x04Pong" String("Pong") File "arc4_types/array.py", line 57 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + bury 9 // store static_string_array#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | static_string_array File "arc4_types/array.py", line 57 + byte "" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | "" b"" File "arc4_types/array.py", line 59 + bury 10 // store result#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + int 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 0 + bury 6 // store index#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index File "arc4_types/array.py", line 36 + // Implicit fall through to main_for_header@20 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_for_header@20: + dig 5 // load index#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0 index File "arc4_types/array.py", line 36 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,2 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + < // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {<} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + bz main_after_for@26 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + // Implicit fall through to main_for_body@21 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + +main_for_body@21: + dig 5 // load index#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0 index File "arc4_types/array.py", line 36 + dup // store index#0 to l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,index#0 index File "arc4_types/array.py", line 36 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,index#0,2 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + * // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,{*} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + dig 10 // load static_string_array#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,item_index_index%74#0,static_string_array#0 static_string_array File "arc4_types/array.py", line 57 + dup + cover 2 // store static_string_array#0 to l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,item_index_index%74#0,static_string_array#0 static_string_array File "arc4_types/array.py", line 57 + swap // load item_index_index%74#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,static_string_array#0,item_index_index%74#0 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,{extract_uint16} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + dig 1 // load static_string_array#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,item_index%75#0,static_string_array#0 static_string_array File "arc4_types/array.py", line 57 + dig 1 // load item_index%75#0 from l-stack (copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,item_index%75#0,static_string_array#0,item_index%75#0 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + extract_uint16 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,item_index%75#0,{extract_uint16} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + int 2 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,item_index%75#0,item_length%76#0,2 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,static_string_array#0,item_index%75#0,{+} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + extract3 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,{extract3} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + swap // store string_item#0 to x-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | index#0 string_item File "arc4_types/array.py", line 36 + ! // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | {!} index == 0: File "arc4_types/array.py", line 61 + bz main_else_body@23 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | if index == 0: File "arc4_types/array.py", line 61 + // Implicit fall through to main_if_body@22 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | (𝕏) string_item#0 | string_item#0 if index == 0: File "arc4_types/array.py", line 61 + +main_if_body@22: + extract 2 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 62 + bury 10 // store result#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + b main_after_if_else@24 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_else_body@23: + extract 2 0 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 64 + byte " " // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | tmp%79#0," " b" " File "arc4_types/array.py", line 64 + swap // load tmp%79#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | " ",tmp%79#0 string_item.decode() File "arc4_types/array.py", line 64 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} b" " + string_item.decode() File "arc4_types/array.py", line 64 + dig 10 // load result#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | tmp%80#0,result#0 result File "arc4_types/array.py", line 35 + swap // load tmp%80#0 from l-stack (no copy) (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result#0,tmp%80#0 b" " + string_item.decode() File "arc4_types/array.py", line 64 + concat // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {concat} result += b" " + string_item.decode() File "arc4_types/array.py", line 64 + bury 10 // store result#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + // Implicit fall through to main_after_if_else@24 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_after_if_else@24: + dig 5 // load index#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0 index File "arc4_types/array.py", line 36 + int 1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index#0,1 + + // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {+} + bury 6 // store index#0 to f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | index File "arc4_types/array.py", line 36 + b main_for_header@20 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | + +main_after_for@26: + dig 9 // load result#0 from f-stack (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result#0 result File "arc4_types/array.py", line 35 + byte "Ping Pong" // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | result#0,"Ping Pong" b"Ping Pong" File "arc4_types/array.py", line 66 + == // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | {==} result == b"Ping Pong" File "arc4_types/array.py", line 66 + assert // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | assert result == b"Ping Pong" File "arc4_types/array.py", line 66 + int 1 // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | 1 True File "arc4_types/array.py", line 68 + return // (𝕗) array_value%36#0,result#0,static_string_array#0,array_length%35#0,array_length%9#0,index#0,item_index_internal%11#0,item_index_internal%48#0,total#0,array_length%1#0,item_index_internal%3#0 | return True File "arc4_types/array.py", line 68 + diff --git a/examples/arc4_types/out/array.approval.teal b/examples/arc4_types/out/array.approval.teal new file mode 100644 index 0000000000..e30b39d4a4 --- /dev/null +++ b/examples/arc4_types/out/array.approval.teal @@ -0,0 +1,296 @@ +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: +main: + int 0 + dupn 2 + byte "" + dupn 4 + +main_block@0: + int 0 + byte 0x00020102 + int 0 + extract_uint16 + int 0 + +main_for_header@1: + dup + dig 2 + < + bz main_after_for@4 + +main_for_body@2: + byte 0x0102 + dig 1 + dup + cover 2 + int 1 + extract3 + btoi + dig 4 + + + bury 4 + int 1 + + + bury 1 + b main_for_header@1 + +main_after_for@4: + dig 2 + int 3 + == + assert // Total should be sum of dynamic_uint8_array items + byte 0x00010001 + int 0 + extract_uint16 + bury 7 + int 0 + bury 5 + +main_for_header@5: + dig 4 + dig 7 + < + bz main_after_for@8 + +main_for_body@6: + dig 4 + dup + int 2 + * + byte 0x0001 + swap + int 2 + extract3 + btoi + dig 4 + + + bury 4 + int 1 + + + bury 5 + b main_for_header@5 + +main_after_for@8: + dig 2 + int 4 + == + assert // Total should now include sum of aliased_dynamic items + int 4 + itob + extract 6 2 + byte 0x0002 + swap + concat + int 11 + itob + extract 6 2 + concat + byte "\x00\x05Hello" + concat + byte "\x00\x05World" + concat + dup + int 0 + extract_uint16 + int 2 + == + assert + dup + int 0 + extract_uint16 + int 0 + > + assert // Index access is out of bounds + dup + extract 2 0 + dup + int 0 + extract_uint16 + dig 1 + dig 1 + extract_uint16 + int 2 + + + extract3 + byte "\x00\x05Hello" + == + assert + byte "" + bury 11 + dup + int 0 + extract_uint16 + bury 9 + extract 2 0 + bury 11 + int 0 + bury 6 + +main_for_header@9: + dig 5 + dig 8 + < + bz main_after_for@15 + +main_for_body@10: + dig 5 + dup + int 2 + * + dig 12 + dup + cover 2 + swap + extract_uint16 + dig 1 + dig 1 + extract_uint16 + int 2 + + + extract3 + swap + ! + bz main_else_body@12 + +main_if_body@11: + extract 2 0 + bury 10 + b main_after_if_else@13 + +main_else_body@12: + extract 2 0 + byte " " + swap + concat + dig 10 + swap + concat + bury 10 + +main_after_if_else@13: + dig 5 + int 1 + + + bury 6 + b main_for_header@9 + +main_after_for@15: + dig 9 + byte "Hello World" + == + assert + int 0 + bury 4 + +main_for_header@16: + dig 3 + int 4 + < + bz main_after_for@19 + +main_for_body@17: + dig 3 + dup + int 4 + * + byte 0x000000010000000a000000ff00000080 + swap + int 4 + extract3 + btoi + dig 4 + + + bury 4 + int 1 + + + bury 4 + b main_for_header@16 + +main_after_for@19: + dig 2 + int 398 + == + assert + byte 0x65 + btoi + byte 0x65 + btoi + + + int 202 + == + assert + int 4 + itob + extract 6 2 + int 10 + itob + extract 6 2 + concat + byte "\x00\x04Ping" + concat + byte "\x00\x04Pong" + concat + bury 9 + byte "" + bury 10 + int 0 + bury 6 + +main_for_header@20: + dig 5 + int 2 + < + bz main_after_for@26 + +main_for_body@21: + dig 5 + dup + int 2 + * + dig 10 + dup + cover 2 + swap + extract_uint16 + dig 1 + dig 1 + extract_uint16 + int 2 + + + extract3 + swap + ! + bz main_else_body@23 + +main_if_body@22: + extract 2 0 + bury 10 + b main_after_if_else@24 + +main_else_body@23: + extract 2 0 + byte " " + swap + concat + dig 10 + swap + concat + bury 10 + +main_after_if_else@24: + dig 5 + int 1 + + + bury 6 + b main_for_header@20 + +main_after_for@26: + dig 9 + byte "Ping Pong" + == + assert + int 1 + return + diff --git a/examples/arc4_types/out/array.approval_unoptimized.debug.teal b/examples/arc4_types/out/array.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..b68c5a99b8 --- /dev/null +++ b/examples/arc4_types/out/array.approval_unoptimized.debug.teal @@ -0,0 +1,406 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: +main: + int 0 + dupn 4 + byte "" + dupn 5 // allocate 11 to stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0 | + +main_block@0: + byte 0x0002 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0 | 0x0002 DynamicArray[UInt8](UInt8(1), UInt8(2)) File "arc4_types/array.py", line 22 + byte 0x01 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0 | array_data%0#0,0x01 1 File "arc4_types/array.py", line 22 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0 | {concat} DynamicArray[UInt8](UInt8(1), UInt8(2)) File "arc4_types/array.py", line 22 + byte 0x02 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0 | array_data%0#0,0x02 2 File "arc4_types/array.py", line 22 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0 | {concat} DynamicArray[UInt8](UInt8(1), UInt8(2)) File "arc4_types/array.py", line 22 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0 | dynamic_uint8_array#0,0 0 File "arc4_types/array.py", line 23 + swap // store total#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0 | dynamic_uint8_array#0 total File "arc4_types/array.py", line 23 + dup // load dynamic_uint8_array#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0 | dynamic_uint8_array#0,dynamic_uint8_array#0 dynamic_uint8_array File "arc4_types/array.py", line 22 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0 | dynamic_uint8_array#0,dynamic_uint8_array#0,0 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0 | dynamic_uint8_array#0,{extract_uint16} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + swap // store array_length%1#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0 | dynamic_uint8_array#0 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0 | {extract} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0 | 0 + // Implicit fall through to main_for_header@1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_header@1: + dup // load item_index_internal%3#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%3#0 + dig 3 // load array_length%1#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%3#0,array_length%1#0 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + < // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {<} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + bz main_after_for@4 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + // Implicit fall through to main_for_body@2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + +main_for_body@2: + dup // load item_index_internal%3#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%3#0 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%3#0,1 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {*} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + dig 2 // load array_value%2#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index%5#0,array_value%2#0 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + swap // load item_index%5#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_value%2#0,item_index%5#0 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_value%2#0,item_index%5#0,1 for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract3} for uint8_item in dynamic_uint8_array: File "arc4_types/array.py", line 24 + btoi // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {btoi} uint8_item.decode() File "arc4_types/array.py", line 25 + dig 4 // load total#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%6#0,total#0 total File "arc4_types/array.py", line 23 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} total += uint8_item.decode() File "arc4_types/array.py", line 25 + bury 4 // store total#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total File "arc4_types/array.py", line 23 + // Implicit fall through to main_for_footer@3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_footer@3: + dup // load item_index_internal%3#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%3#0 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%3#0,1 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} + bury 1 // store item_index_internal%3#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + b main_for_header@1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_after_for@4: + dig 3 // load total#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total#0 total File "arc4_types/array.py", line 23 + int 3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total#0,3 3 File "arc4_types/array.py", line 27 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {==} total == 3, "Total should be sum of dynamic_uint8_array items" File "arc4_types/array.py", line 27 + assert // Total should be sum of dynamic_uint8_array items // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | assert total == 3, "Total should be sum of dynamic_uint8_array items" File "arc4_types/array.py", line 27 + byte 0x0001 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0x0001 AliasedDynamicArray(UInt16(1)) File "arc4_types/array.py", line 28 + byte 0x0001 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%8#0,0x0001 1 File "arc4_types/array.py", line 28 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} AliasedDynamicArray(UInt16(1)) File "arc4_types/array.py", line 28 + dup // load aliased_dynamic#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | aliased_dynamic#0,aliased_dynamic#0 aliased_dynamic File "arc4_types/array.py", line 28 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | aliased_dynamic#0,aliased_dynamic#0,0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | aliased_dynamic#0,{extract_uint16} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + bury 10 // store array_length%9#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | aliased_dynamic#0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + bury 15 // store array_value%10#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0 + bury 8 // store item_index_internal%11#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + // Implicit fall through to main_for_header@5 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_header@5: + dig 7 // load item_index_internal%11#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%11#0 + dig 9 // load array_length%9#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%11#0,array_length%9#0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + < // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {<} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + bz main_after_for@8 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + // Implicit fall through to main_for_body@6 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + +main_for_body@6: + dig 7 // load item_index_internal%11#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%11#0 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%11#0,2 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {*} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + dig 15 // load array_value%10#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index%13#0,array_value%10#0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + swap // load item_index%13#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_value%10#0,item_index%13#0 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_value%10#0,item_index%13#0,2 for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract3} for uint16_item in aliased_dynamic: File "arc4_types/array.py", line 29 + btoi // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {btoi} uint16_item.decode() File "arc4_types/array.py", line 30 + dig 4 // load total#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%14#0,total#0 total File "arc4_types/array.py", line 23 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} total += uint16_item.decode() File "arc4_types/array.py", line 30 + bury 4 // store total#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total File "arc4_types/array.py", line 23 + // Implicit fall through to main_for_footer@7 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_footer@7: + dig 7 // load item_index_internal%11#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%11#0 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%11#0,1 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} + bury 8 // store item_index_internal%11#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + b main_for_header@5 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_after_for@8: + dig 3 // load total#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total#0 total File "arc4_types/array.py", line 23 + int 4 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total#0,4 4 File "arc4_types/array.py", line 31 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {==} total == 4, "Total should now include sum of aliased_dynamic items" File "arc4_types/array.py", line 31 + assert // Total should now include sum of aliased_dynamic items // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | assert total == 4, "Total should now include sum of aliased_dynamic items" File "arc4_types/array.py", line 31 + byte 0x0002 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0x0002 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + int 4 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,4 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + dup // load next_offset%17#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,next_offset%17#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + itob // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,{itob} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + extract 6 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,{extract} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + uncover 2 // load array_data%16#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,value_as_uint16%19#0,array_data%16#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + swap // load value_as_uint16%19#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,array_data%16#0,value_as_uint16%19#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,{concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + swap // store array_data%16#0 to l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + byte "\x00\x05Hello" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,"\x00\x05Hello" String("Hello") File "arc4_types/array.py", line 32 + len // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,{len} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,{+} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + dup // load next_offset%17#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,next_offset%17#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + itob // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,{itob} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + extract 6 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,next_offset%17#0,{extract} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + uncover 2 // load array_data%16#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,value_as_uint16%22#0,array_data%16#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + swap // load value_as_uint16%22#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,array_data%16#0,value_as_uint16%22#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,{concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + byte "\x00\x05World" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,array_data%16#0,"\x00\x05World" String("World") File "arc4_types/array.py", line 32 + len // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%17#0,array_data%16#0,{len} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + uncover 2 // load next_offset%17#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,element_length%23#0,next_offset%17#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,{+} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + pop // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0 DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + byte "\x00\x05Hello" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,"\x00\x05Hello" String("Hello") File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + byte "\x00\x05World" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%16#0,"\x00\x05World" String("World") File "arc4_types/array.py", line 32 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} DynamicArray[String](String("Hello"), String("World")) File "arc4_types/array.py", line 32 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0,0 dynamic_string_array.length File "arc4_types/array.py", line 33 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{extract_uint16} dynamic_string_array.length File "arc4_types/array.py", line 33 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,tmp%24#0,2 2 File "arc4_types/array.py", line 33 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{==} dynamic_string_array.length == 2 File "arc4_types/array.py", line 33 + assert // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0 assert dynamic_string_array.length == 2 File "arc4_types/array.py", line 33 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0,0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{extract_uint16} dynamic_string_array[0] File "arc4_types/array.py", line 34 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_length%26#0,0 0 File "arc4_types/array.py", line 34 + > // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{>} dynamic_string_array[0] File "arc4_types/array.py", line 34 + assert // Index access is out of bounds // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{extract} dynamic_string_array[0] File "arc4_types/array.py", line 34 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,0 0 File "arc4_types/array.py", line 34 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,0,2 dynamic_string_array[0] File "arc4_types/array.py", line 34 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,{*} dynamic_string_array[0] File "arc4_types/array.py", line 34 + dig 1 // load array_data_sans_header%28#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index_index%29#0,array_data_sans_header%28#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + swap // load item_index_index%29#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,array_data_sans_header%28#0,item_index_index%29#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,{extract_uint16} dynamic_string_array[0] File "arc4_types/array.py", line 34 + dig 1 // load array_data_sans_header%28#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,array_data_sans_header%28#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + dig 1 // load item_index%30#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,array_data_sans_header%28#0,item_index%30#0 dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,{extract_uint16} dynamic_string_array[0] File "arc4_types/array.py", line 34 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,item_length%31#0,2 dynamic_string_array[0] File "arc4_types/array.py", line 34 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,array_data_sans_header%28#0,item_index%30#0,{+} dynamic_string_array[0] File "arc4_types/array.py", line 34 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{extract3} dynamic_string_array[0] File "arc4_types/array.py", line 34 + byte "\x00\x05Hello" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,tmp%33#0,"\x00\x05Hello" String("Hello") File "arc4_types/array.py", line 34 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{==} dynamic_string_array[0] == String("Hello") File "arc4_types/array.py", line 34 + assert // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0 assert dynamic_string_array[0] == String("Hello") File "arc4_types/array.py", line 34 + byte "" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,"" b"" File "arc4_types/array.py", line 35 + bury 14 // store result#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0 result File "arc4_types/array.py", line 35 + dup // load dynamic_string_array#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0 dynamic_string_array File "arc4_types/array.py", line 32 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,dynamic_string_array#0,0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0,{extract_uint16} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + bury 11 // store array_length%35#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | dynamic_string_array#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + bury 14 // store array_value%36#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0 + bury 7 // store item_index_internal%37#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + // Implicit fall through to main_for_header@9 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_header@9: + dig 6 // load item_index_internal%37#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0 + dig 10 // load array_length%35#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_length%35#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + < // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {<} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + bz main_after_for@15 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + // Implicit fall through to main_for_body@10 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + +main_for_body@10: + dig 6 // load item_index_internal%37#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0 + dup // store item_index_internal%37#0 to l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,item_index_internal%37#0 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,item_index_internal%37#0,2 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,{*} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dig 15 // load array_value%36#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,item_index_index%39#0,array_value%36#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dup + cover 2 // store array_value%36#0 to l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,item_index_index%39#0,array_value%36#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + swap // load item_index_index%39#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,array_value%36#0,item_index_index%39#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,{extract_uint16} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dig 1 // load array_value%36#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,item_index%40#0,array_value%36#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + dig 1 // load item_index%40#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,item_index%40#0,array_value%36#0,item_index%40#0 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,item_index%40#0,{extract_uint16} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,item_index%40#0,item_length%41#0,2 for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,array_value%36#0,item_index%40#0,{+} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,{extract3} for index, string_item in uenumerate(dynamic_string_array): File "arc4_types/array.py", line 36 + swap // store string_item#0 to x-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | item_index_internal%37#0 string_item File "arc4_types/array.py", line 36 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | index#0,0 0 File "arc4_types/array.py", line 37 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | {==} index == 0: File "arc4_types/array.py", line 37 + bz main_else_body@12 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | if index == 0: File "arc4_types/array.py", line 37 + // Implicit fall through to main_if_body@11 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | string_item#0 if index == 0: File "arc4_types/array.py", line 37 + +main_if_body@11: + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 38 + bury 13 // store result#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + b main_after_if_else@13 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_else_body@12: + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 40 + byte " " // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%44#0," " b" " File "arc4_types/array.py", line 40 + swap // load tmp%44#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | " ",tmp%44#0 string_item.decode() File "arc4_types/array.py", line 40 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} b" " + string_item.decode() File "arc4_types/array.py", line 40 + dig 13 // load result#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%45#0,result#0 result File "arc4_types/array.py", line 35 + swap // load tmp%45#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result#0,tmp%45#0 b" " + string_item.decode() File "arc4_types/array.py", line 40 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} result += b" " + string_item.decode() File "arc4_types/array.py", line 40 + bury 13 // store result#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + // Implicit fall through to main_after_if_else@13 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_after_if_else@13: + // Implicit fall through to main_for_footer@14 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_footer@14: + dig 6 // load item_index_internal%37#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%37#0,1 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} + bury 7 // store item_index_internal%37#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + b main_for_header@9 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_after_for@15: + dig 12 // load result#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result#0 result File "arc4_types/array.py", line 35 + byte "Hello World" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result#0,"Hello World" b"Hello World" File "arc4_types/array.py", line 42 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {==} result == b"Hello World" File "arc4_types/array.py", line 42 + assert // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | assert result == b"Hello World" File "arc4_types/array.py", line 42 + byte 0x // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0x StaticArray(UInt32(1), UInt32(10), UInt32(255), UInt32(128)) File "arc4_types/array.py", line 44 + byte 0x00000001 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%47#0,0x00000001 1 File "arc4_types/array.py", line 44 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} StaticArray(UInt32(1), UInt32(10), UInt32(255), UInt32(128)) File "arc4_types/array.py", line 44 + byte 0x0000000a // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%47#0,0x0000000a 10 File "arc4_types/array.py", line 44 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} StaticArray(UInt32(1), UInt32(10), UInt32(255), UInt32(128)) File "arc4_types/array.py", line 44 + byte 0x000000ff // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%47#0,0x000000ff 255 File "arc4_types/array.py", line 44 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} StaticArray(UInt32(1), UInt32(10), UInt32(255), UInt32(128)) File "arc4_types/array.py", line 44 + byte 0x00000080 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%47#0,0x00000080 128 File "arc4_types/array.py", line 44 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} StaticArray(UInt32(1), UInt32(10), UInt32(255), UInt32(128)) File "arc4_types/array.py", line 44 + bury 11 // store static_uint32_array#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | static_uint32_array File "arc4_types/array.py", line 44 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0 + bury 6 // store item_index_internal%48#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + // Implicit fall through to main_for_header@16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_header@16: + dig 5 // load item_index_internal%48#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%48#0 + int 4 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%48#0,4 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + < // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {<} for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + bz main_after_for@19 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + // Implicit fall through to main_for_body@17 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + +main_for_body@17: + dig 5 // load item_index_internal%48#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%48#0 + int 4 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%48#0,4 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {*} for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + dig 11 // load static_uint32_array#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index%50#0,static_uint32_array#0 static_uint32_array File "arc4_types/array.py", line 44 + swap // load item_index%50#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | static_uint32_array#0,item_index%50#0 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + int 4 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | static_uint32_array#0,item_index%50#0,4 for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract3} for uint32_item in static_uint32_array: File "arc4_types/array.py", line 46 + btoi // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {btoi} uint32_item.decode() File "arc4_types/array.py", line 47 + dig 4 // load total#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%51#0,total#0 total File "arc4_types/array.py", line 23 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} total += uint32_item.decode() File "arc4_types/array.py", line 47 + bury 4 // store total#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total File "arc4_types/array.py", line 23 + // Implicit fall through to main_for_footer@18 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_footer@18: + dig 5 // load item_index_internal%48#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%48#0 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%48#0,1 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} + bury 6 // store item_index_internal%48#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + b main_for_header@16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_after_for@19: + dig 3 // load total#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total#0 total File "arc4_types/array.py", line 23 + int 398 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | total#0,398 4 + 1 + 10 + 255 + 128 File "arc4_types/array.py", line 49 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {==} total == 4 + 1 + 10 + 255 + 128 File "arc4_types/array.py", line 49 + assert // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | assert total == 4 + 1 + 10 + 255 + 128 File "arc4_types/array.py", line 49 + byte 0x // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0x AliasedStaticArray(UInt8(101)) File "arc4_types/array.py", line 51 + byte 0x65 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%53#0,0x65 101 File "arc4_types/array.py", line 51 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} AliasedStaticArray(UInt8(101)) File "arc4_types/array.py", line 51 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | aliased_static#0,0 0 File "arc4_types/array.py", line 53 + swap // store index#0 to l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0 index File "arc4_types/array.py", line 36 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,0 0 File "arc4_types/array.py", line 55 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,0,1 aliased_static[0] File "arc4_types/array.py", line 55 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,{*} aliased_static[0] File "arc4_types/array.py", line 55 + dig 1 // load aliased_static#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,item_index%54#0,aliased_static#0 aliased_static File "arc4_types/array.py", line 51 + swap // load item_index%54#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,aliased_static#0,item_index%54#0 aliased_static[0] File "arc4_types/array.py", line 55 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,aliased_static#0,item_index%54#0,1 aliased_static[0] File "arc4_types/array.py", line 55 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,{extract3} aliased_static[0] File "arc4_types/array.py", line 55 + btoi // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | index#0,aliased_static#0,{btoi} aliased_static[0].decode() File "arc4_types/array.py", line 55 + cover 2 // store tmp%56#0 to l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,index#0,aliased_static#0 aliased_static[0].decode() File "arc4_types/array.py", line 55 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,index#0,aliased_static#0,1 aliased_static[index] File "arc4_types/array.py", line 55 + dig 2 // load index#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,index#0,aliased_static#0,array_length%57#0,index#0 index File "arc4_types/array.py", line 36 + > // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,index#0,aliased_static#0,{>} aliased_static[index] File "arc4_types/array.py", line 55 + assert // Index access is out of bounds // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,index#0,aliased_static#0 aliased_static[index] File "arc4_types/array.py", line 55 + swap // load index#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,aliased_static#0,index#0 index File "arc4_types/array.py", line 36 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,aliased_static#0,index#0,1 aliased_static[index] File "arc4_types/array.py", line 55 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,aliased_static#0,{*} aliased_static[index] File "arc4_types/array.py", line 55 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,aliased_static#0,item_index%59#0,1 aliased_static[index] File "arc4_types/array.py", line 55 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,{extract3} aliased_static[index] File "arc4_types/array.py", line 55 + btoi // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%56#0,{btoi} aliased_static[index].decode() File "arc4_types/array.py", line 55 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} aliased_static[0].decode() + aliased_static[index].decode() File "arc4_types/array.py", line 55 + int 202 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%62#0,202 202 File "arc4_types/array.py", line 55 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {==} aliased_static[0].decode() + aliased_static[index].decode()) == 202 File "arc4_types/array.py", line 55 + assert // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | assert (aliased_static[0].decode() + aliased_static[index].decode()) == 202 File "arc4_types/array.py", line 55 + byte 0x // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0x StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + int 4 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,4 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + dup // load next_offset%65#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,next_offset%65#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + itob // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,{itob} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + extract 6 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,{extract} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + uncover 2 // load array_data%64#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,value_as_uint16%67#0,array_data%64#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + swap // load value_as_uint16%67#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,array_data%64#0,value_as_uint16%67#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,{concat} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + swap // store array_data%64#0 to l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + byte "\x00\x04Ping" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,"\x00\x04Ping" String("Ping") File "arc4_types/array.py", line 57 + len // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,{len} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,{+} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + dup // load next_offset%65#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,next_offset%65#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + itob // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,{itob} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + extract 6 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,next_offset%65#0,{extract} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + uncover 2 // load array_data%64#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,value_as_uint16%70#0,array_data%64#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + swap // load value_as_uint16%70#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,array_data%64#0,value_as_uint16%70#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,{concat} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + byte "\x00\x04Pong" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,array_data%64#0,"\x00\x04Pong" String("Pong") File "arc4_types/array.py", line 57 + len // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | next_offset%65#0,array_data%64#0,{len} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + uncover 2 // load next_offset%65#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,element_length%71#0,next_offset%65#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,{+} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + pop // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0 StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + byte "\x00\x04Ping" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,"\x00\x04Ping" String("Ping") File "arc4_types/array.py", line 57 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + byte "\x00\x04Pong" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | array_data%64#0,"\x00\x04Pong" String("Pong") File "arc4_types/array.py", line 57 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} StaticArray(String("Ping"), String("Pong")) File "arc4_types/array.py", line 57 + bury 12 // store static_string_array#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | static_string_array File "arc4_types/array.py", line 57 + byte "" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | "" b"" File "arc4_types/array.py", line 59 + bury 13 // store result#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 0 + bury 5 // store item_index_internal%72#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + // Implicit fall through to main_for_header@20 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_header@20: + dig 4 // load item_index_internal%72#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,2 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + < // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {<} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + bz main_after_for@26 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + // Implicit fall through to main_for_body@21 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + +main_for_body@21: + dig 4 // load item_index_internal%72#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0 + dup // store item_index_internal%72#0 to l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,item_index_internal%72#0 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,item_index_internal%72#0,2 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + * // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,{*} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + dig 13 // load static_string_array#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,item_index_index%74#0,static_string_array#0 static_string_array File "arc4_types/array.py", line 57 + dup + cover 2 // store static_string_array#0 to l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,item_index_index%74#0,static_string_array#0 static_string_array File "arc4_types/array.py", line 57 + swap // load item_index_index%74#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,static_string_array#0,item_index_index%74#0 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,{extract_uint16} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + dig 1 // load static_string_array#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,item_index%75#0,static_string_array#0 static_string_array File "arc4_types/array.py", line 57 + dig 1 // load item_index%75#0 from l-stack (copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,item_index%75#0,static_string_array#0,item_index%75#0 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + extract_uint16 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,item_index%75#0,{extract_uint16} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + int 2 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,item_index%75#0,item_length%76#0,2 for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,static_string_array#0,item_index%75#0,{+} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + extract3 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,{extract3} for index, string_item in uenumerate(static_string_array): File "arc4_types/array.py", line 60 + swap // store string_item#0 to x-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | item_index_internal%72#0 string_item File "arc4_types/array.py", line 36 + int 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | index#0,0 0 File "arc4_types/array.py", line 61 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | {==} index == 0: File "arc4_types/array.py", line 61 + bz main_else_body@23 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | if index == 0: File "arc4_types/array.py", line 61 + // Implicit fall through to main_if_body@22 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | (𝕏) string_item#0 | string_item#0 if index == 0: File "arc4_types/array.py", line 61 + +main_if_body@22: + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 62 + bury 13 // store result#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + b main_after_if_else@24 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_else_body@23: + extract 2 0 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {extract} string_item#0 string_item.decode() File "arc4_types/array.py", line 64 + byte " " // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%79#0," " b" " File "arc4_types/array.py", line 64 + swap // load tmp%79#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | " ",tmp%79#0 string_item.decode() File "arc4_types/array.py", line 64 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} b" " + string_item.decode() File "arc4_types/array.py", line 64 + dig 13 // load result#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | tmp%80#0,result#0 result File "arc4_types/array.py", line 35 + swap // load tmp%80#0 from l-stack (no copy) (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result#0,tmp%80#0 b" " + string_item.decode() File "arc4_types/array.py", line 64 + concat // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {concat} result += b" " + string_item.decode() File "arc4_types/array.py", line 64 + bury 13 // store result#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result File "arc4_types/array.py", line 35 + // Implicit fall through to main_after_if_else@24 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_after_if_else@24: + // Implicit fall through to main_for_footer@25 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_for_footer@25: + dig 4 // load item_index_internal%72#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | item_index_internal%72#0,1 + + // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {+} + bury 5 // store item_index_internal%72#0 to f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + b main_for_header@20 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | + +main_after_for@26: + dig 12 // load result#0 from f-stack (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result#0 result File "arc4_types/array.py", line 35 + byte "Ping Pong" // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | result#0,"Ping Pong" b"Ping Pong" File "arc4_types/array.py", line 66 + == // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | {==} result == b"Ping Pong" File "arc4_types/array.py", line 66 + assert // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | assert result == b"Ping Pong" File "arc4_types/array.py", line 66 + int 1 // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | 1 True File "arc4_types/array.py", line 68 + return // (𝕗) array_value%10#0,array_value%36#0,result#0,static_string_array#0,static_uint32_array#0,array_length%35#0,array_length%9#0,item_index_internal%11#0,item_index_internal%37#0,item_index_internal%48#0,item_index_internal%72#0,total#0,array_length%1#0,array_value%2#0,item_index_internal%3#0 | return True File "arc4_types/array.py", line 68 + diff --git a/examples/arc4_types/out/array.approval_unoptimized.teal b/examples/arc4_types/out/array.approval_unoptimized.teal new file mode 100644 index 0000000000..4e5f33a75b --- /dev/null +++ b/examples/arc4_types/out/array.approval_unoptimized.teal @@ -0,0 +1,385 @@ +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: +main: + int 0 + dupn 4 + byte "" + dupn 5 + +main_block@0: + byte 0x0002 + byte 0x01 + concat + byte 0x02 + concat + int 0 + swap + dup + int 0 + extract_uint16 + swap + extract 2 0 + int 0 + +main_for_header@1: + dup + dig 3 + < + bz main_after_for@4 + +main_for_body@2: + dup + int 1 + * + dig 2 + swap + int 1 + extract3 + btoi + dig 4 + + + bury 4 + +main_for_footer@3: + dup + int 1 + + + bury 1 + b main_for_header@1 + +main_after_for@4: + dig 3 + int 3 + == + assert // Total should be sum of dynamic_uint8_array items + byte 0x0001 + byte 0x0001 + concat + dup + int 0 + extract_uint16 + bury 10 + extract 2 0 + bury 15 + int 0 + bury 8 + +main_for_header@5: + dig 7 + dig 9 + < + bz main_after_for@8 + +main_for_body@6: + dig 7 + int 2 + * + dig 15 + swap + int 2 + extract3 + btoi + dig 4 + + + bury 4 + +main_for_footer@7: + dig 7 + int 1 + + + bury 8 + b main_for_header@5 + +main_after_for@8: + dig 3 + int 4 + == + assert // Total should now include sum of aliased_dynamic items + byte 0x0002 + int 4 + dup + itob + extract 6 2 + uncover 2 + swap + concat + swap + byte "\x00\x05Hello" + len + + + dup + itob + extract 6 2 + uncover 2 + swap + concat + byte "\x00\x05World" + len + uncover 2 + + + pop + byte "\x00\x05Hello" + concat + byte "\x00\x05World" + concat + dup + int 0 + extract_uint16 + int 2 + == + assert + dup + int 0 + extract_uint16 + int 0 + > + assert // Index access is out of bounds + dup + extract 2 0 + int 0 + int 2 + * + dig 1 + swap + extract_uint16 + dig 1 + dig 1 + extract_uint16 + int 2 + + + extract3 + byte "\x00\x05Hello" + == + assert + byte "" + bury 14 + dup + int 0 + extract_uint16 + bury 11 + extract 2 0 + bury 14 + int 0 + bury 7 + +main_for_header@9: + dig 6 + dig 10 + < + bz main_after_for@15 + +main_for_body@10: + dig 6 + dup + int 2 + * + dig 15 + dup + cover 2 + swap + extract_uint16 + dig 1 + dig 1 + extract_uint16 + int 2 + + + extract3 + swap + int 0 + == + bz main_else_body@12 + +main_if_body@11: + extract 2 0 + bury 13 + b main_after_if_else@13 + +main_else_body@12: + extract 2 0 + byte " " + swap + concat + dig 13 + swap + concat + bury 13 + +main_after_if_else@13: + +main_for_footer@14: + dig 6 + int 1 + + + bury 7 + b main_for_header@9 + +main_after_for@15: + dig 12 + byte "Hello World" + == + assert + byte 0x + byte 0x00000001 + concat + byte 0x0000000a + concat + byte 0x000000ff + concat + byte 0x00000080 + concat + bury 11 + int 0 + bury 6 + +main_for_header@16: + dig 5 + int 4 + < + bz main_after_for@19 + +main_for_body@17: + dig 5 + int 4 + * + dig 11 + swap + int 4 + extract3 + btoi + dig 4 + + + bury 4 + +main_for_footer@18: + dig 5 + int 1 + + + bury 6 + b main_for_header@16 + +main_after_for@19: + dig 3 + int 398 + == + assert + byte 0x + byte 0x65 + concat + int 0 + swap + int 0 + int 1 + * + dig 1 + swap + int 1 + extract3 + btoi + cover 2 + int 1 + dig 2 + > + assert // Index access is out of bounds + swap + int 1 + * + int 1 + extract3 + btoi + + + int 202 + == + assert + byte 0x + int 4 + dup + itob + extract 6 2 + uncover 2 + swap + concat + swap + byte "\x00\x04Ping" + len + + + dup + itob + extract 6 2 + uncover 2 + swap + concat + byte "\x00\x04Pong" + len + uncover 2 + + + pop + byte "\x00\x04Ping" + concat + byte "\x00\x04Pong" + concat + bury 12 + byte "" + bury 13 + int 0 + bury 5 + +main_for_header@20: + dig 4 + int 2 + < + bz main_after_for@26 + +main_for_body@21: + dig 4 + dup + int 2 + * + dig 13 + dup + cover 2 + swap + extract_uint16 + dig 1 + dig 1 + extract_uint16 + int 2 + + + extract3 + swap + int 0 + == + bz main_else_body@23 + +main_if_body@22: + extract 2 0 + bury 13 + b main_after_if_else@24 + +main_else_body@23: + extract 2 0 + byte " " + swap + concat + dig 13 + swap + concat + bury 13 + +main_after_if_else@24: + +main_for_footer@25: + dig 4 + int 1 + + + bury 5 + b main_for_header@20 + +main_after_for@26: + dig 12 + byte "Ping Pong" + == + assert + int 1 + return + diff --git a/examples/arc4_types/out/array.awst b/examples/arc4_types/out/array.awst new file mode 100644 index 0000000000..2cdae1ca5f --- /dev/null +++ b/examples/arc4_types/out/array.awst @@ -0,0 +1,53 @@ +contract Arc4ArraysContract +{ + approval_program(): bool + { + dynamic_uint8_array: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]] = arc4_array_encode([1arc4u8, 2arc4u8], algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]) + total: algopy.UInt64 = 0u + for uint8_item in dynamic_uint8_array { + total += arc4_decode(uint8_item, algopy.UInt64) + } + assert(total == 3u, comment="Total should be sum of dynamic_uint8_array items") + aliased_dynamic: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[16]]] = arc4_array_encode([1arc4u16], algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[16]]]) + for uint16_item in aliased_dynamic { + total += arc4_decode(uint16_item, algopy.UInt64) + } + assert(total == 4u, comment="Total should now include sum of aliased_dynamic items") + dynamic_string_array: algopy.arc4.DynamicArray[algopy.arc4.String] = arc4_array_encode([arc4_encode('Hello', algopy.arc4.String), arc4_encode('World', algopy.arc4.String)], algopy.arc4.DynamicArray[algopy.arc4.String]) + assert(extract_uint16(dynamic_string_array, 0u) == 2u) + assert(reinterpret_cast(dynamic_string_array[0u]) == reinterpret_cast(arc4_encode('Hello', algopy.arc4.String))) + result: algopy.Bytes = '' + for (index, string_item) in enumerate(dynamic_string_array) { + if (index == 0u) { + result: algopy.Bytes = arc4_decode(string_item, algopy.Bytes) + } else { + result += ' ' + arc4_decode(string_item, algopy.Bytes) + } + } + assert(result == 'Hello World') + static_uint32_array: algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[32]], typing.Literal[4]] = arc4_array_encode([1arc4u32, 10arc4u32, 255arc4u32, 128arc4u32], algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[32]], typing.Literal[4]]) + for uint32_item in static_uint32_array { + total += arc4_decode(uint32_item, algopy.UInt64) + } + assert(total == 398u) + aliased_static: algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[8]], typing.Literal[1]] = arc4_array_encode([101arc4u8], algopy.arc4.StaticArray[algopy.arc4.UIntN[typing.Literal[8]], typing.Literal[1]]) + index: algopy.UInt64 = 0u + assert(arc4_decode(aliased_static[0u], algopy.UInt64) + arc4_decode(aliased_static[index], algopy.UInt64) == 202u) + static_string_array: algopy.arc4.StaticArray[algopy.arc4.String, typing.Literal[2]] = arc4_array_encode([arc4_encode('Ping', algopy.arc4.String), arc4_encode('Pong', algopy.arc4.String)], algopy.arc4.StaticArray[algopy.arc4.String, typing.Literal[2]]) + result: algopy.Bytes = '' + for (index, string_item) in enumerate(static_string_array) { + if (index == 0u) { + result: algopy.Bytes = arc4_decode(string_item, algopy.Bytes) + } else { + result += ' ' + arc4_decode(string_item, algopy.Bytes) + } + } + assert(result == 'Ping Pong') + return true + } + + clear_state_program(): bool + { + return true + } +} \ No newline at end of file diff --git a/examples/arc4_types/out/array.clear.debug.teal b/examples/arc4_types/out/array.clear.debug.teal new file mode 100644 index 0000000000..67f2f2b202 --- /dev/null +++ b/examples/arc4_types/out/array.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/array.py", line 71 + return // return True File "arc4_types/array.py", line 71 + diff --git a/examples/arc4_types/out/array.clear.teal b/examples/arc4_types/out/array.clear.teal new file mode 100644 index 0000000000..beb9bbeafe --- /dev/null +++ b/examples/arc4_types/out/array.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/array.clear_unoptimized.debug.teal b/examples/arc4_types/out/array.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..67f2f2b202 --- /dev/null +++ b/examples/arc4_types/out/array.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/array.py", line 71 + return // return True File "arc4_types/array.py", line 71 + diff --git a/examples/arc4_types/out/array.clear_unoptimized.teal b/examples/arc4_types/out/array.clear_unoptimized.teal new file mode 100644 index 0000000000..beb9bbeafe --- /dev/null +++ b/examples/arc4_types/out/array.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.cssa.ir b/examples/arc4_types/out/array_Arc4ArraysContract.cssa.ir new file mode 100644 index 0000000000..3c72b2d28d --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.cssa.ir @@ -0,0 +1,181 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 0x00020102 0u) + let item_index_internal%3#0: uint64 = 0u + let (total#7: uint64, item_index_internal%3#3: uint64) = (total#0, item_index_internal%3#0) + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#5: uint64 = φ(item_index_internal%3#3 <- block@0, item_index_internal%3#4 <- block@2) + let total#9: uint64 = φ(total#7 <- block@0, total#8 <- block@2) + let (total#1: uint64, item_index_internal%3#1: uint64) = (total#9, item_index_internal%3#5) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 0x0102 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + let (total#8: uint64, item_index_internal%3#4: uint64) = (total#2, item_index_internal%3#2) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let item_index_internal%11#0: uint64 = 0u + let (total#10: uint64, item_index_internal%11#3: uint64) = (total#1, item_index_internal%11#0) + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#5: uint64 = φ(item_index_internal%11#3 <- block@4, item_index_internal%11#4 <- block@6) + let total#12: uint64 = φ(total#10 <- block@4, total#11 <- block@6) + let (total#3: uint64, item_index_internal%11#1: uint64) = (total#12, item_index_internal%11#5) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 0x0001 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + let (total#11: uint64, item_index_internal%11#4: uint64) = (total#4, item_index_internal%11#2) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + let (result#10: bytes, item_index_internal%37#4: uint64) = (result#0, item_index_internal%37#0) + goto block@9 + block@9: // for_header_L36 + let index#3: uint64 = φ(item_index_internal%37#4 <- block@8, item_index_internal%37#5 <- block@13) + let result#12: bytes = φ(result#10 <- block@8, result#11 <- block@13) + let (result#2: bytes, index#0: uint64) = (result#12, index#3) + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + let result#13: bytes = result#1 + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + let result#14: bytes = result#3 + goto block@13 + block@13: // after_if_else_L37 + let result#15: bytes = φ(result#13 <- block@11, result#14 <- block@12) + let result#4: bytes = result#15 + let item_index_internal%37#3: uint64 = (+ index#0 1u) + let (result#11: bytes, item_index_internal%37#5: uint64) = (result#4, item_index_internal%37#3) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let item_index_internal%48#0: uint64 = 0u + let (total#13: uint64, item_index_internal%48#3: uint64) = (total#3, item_index_internal%48#0) + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#5: uint64 = φ(item_index_internal%48#3 <- block@15, item_index_internal%48#4 <- block@17) + let total#15: uint64 = φ(total#13 <- block@15, total#14 <- block@17) + let (total#5: uint64, item_index_internal%48#1: uint64) = (total#15, item_index_internal%48#5) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 0x000000010000000a000000ff00000080 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + let (total#14: uint64, item_index_internal%48#4: uint64) = (total#6, item_index_internal%48#2) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let tmp%56#0: uint64 = (btoi 0x65) + let tmp%61#0: uint64 = (btoi 0x65) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + let (result#16: bytes, item_index_internal%72#4: uint64) = (result#5, item_index_internal%72#0) + goto block@20 + block@20: // for_header_L60 + let index#4: uint64 = φ(item_index_internal%72#4 <- block@19, item_index_internal%72#5 <- block@24) + let result#18: bytes = φ(result#16 <- block@19, result#17 <- block@24) + let (result#7: bytes, index#2: uint64) = (result#18, index#4) + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + let result#19: bytes = result#6 + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + let result#20: bytes = result#8 + goto block@24 + block@24: // after_if_else_L61 + let result#21: bytes = φ(result#19 <- block@22, result#20 <- block@23) + let result#9: bytes = result#21 + let item_index_internal%72#3: uint64 = (+ index#2 1u) + let (result#17: bytes, item_index_internal%72#5: uint64) = (result#9, item_index_internal%72#3) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.final.ir b/examples/arc4_types/out/array_Arc4ArraysContract.final.ir new file mode 100644 index 0000000000..f3a75c09fa --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.final.ir @@ -0,0 +1,152 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 0x00020102 0u) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let continue_looping%4#0: uint64 = (< item_index_internal%3#0 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 0x0102 item_index_internal%3#0 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%6#0) + let item_index_internal%3#0: uint64 = (+ item_index_internal%3#0 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#0 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let continue_looping%12#0: uint64 = (< item_index_internal%11#0 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#0 2u) + let uint16_item#0: bytes = (extract3 0x0001 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#0: uint64 = (+ total#0 tmp%14#0) + let item_index_internal%11#0: uint64 = (+ item_index_internal%11#0 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#0 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#1: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let array_data%16#1: bytes = (concat array_data%16#1 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#1 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + let index#0: uint64 = item_index_internal%37#0 + goto block@9 + block@9: // for_header_L36 + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#0: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#0: bytes = (concat result#0 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + let item_index_internal%37#0: uint64 = (+ index#0 1u) + let index#0: uint64 = item_index_internal%37#0 + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#0 "Hello World") + (assert tmp%46#0) + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let continue_looping%49#0: uint64 = (< item_index_internal%48#0 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#0 4u) + let uint32_item#0: bytes = (extract3 0x000000010000000a000000ff00000080 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#0: uint64 = (+ total#0 tmp%51#0) + let item_index_internal%48#0: uint64 = (+ item_index_internal%48#0 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#0 398u) + (assert tmp%52#0) + let tmp%56#0: uint64 = (btoi 0x65) + let tmp%61#0: uint64 = (btoi 0x65) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let array_data%64#2: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#2 "\x00\x04Pong") + let result#0: bytes = "" + let item_index_internal%72#0: uint64 = 0u + let index#0: uint64 = item_index_internal%72#0 + goto block@20 + block@20: // for_header_L60 + let continue_looping%73#0: uint64 = (< index#0 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#0 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#0: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#0) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#0: bytes = ((extract 2 0) string_item#0) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#0) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#0: bytes = (concat result#0 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + let item_index_internal%72#0: uint64 = (+ index#0 1u) + let index#0: uint64 = item_index_internal%72#0 + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#0 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.final_unoptimized.ir b/examples/arc4_types/out/array_Arc4ArraysContract.final_unoptimized.ir new file mode 100644 index 0000000000..06122a0452 --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.final_unoptimized.ir @@ -0,0 +1,203 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let array_data%0#0: bytes = 0x0002 + let array_data%0#0: bytes = (concat array_data%0#0 0x01) + let array_data%0#0: bytes = (concat array_data%0#0 0x02) + let dynamic_uint8_array#0: bytes = array_data%0#0 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 dynamic_uint8_array#0 0u) + let array_value%2#0: bytes = ((extract 2 0) dynamic_uint8_array#0) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let continue_looping%4#0: uint64 = (< item_index_internal%3#0 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let item_index%5#0: uint64 = (* item_index_internal%3#0 1u) + let uint8_item#0: bytes = (extract3 array_value%2#0 item_index%5#0 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#0: uint64 = (+ total#0 tmp%6#0) + goto block@3 + block@3: // for_footer_L24 + let item_index_internal%3#0: uint64 = (+ item_index_internal%3#0 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#0 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_data%8#0: bytes = 0x0001 + let array_data%8#0: bytes = (concat array_data%8#0 0x0001) + let aliased_dynamic#0: bytes = array_data%8#0 + let array_length%9#0: uint64 = (extract_uint16 aliased_dynamic#0 0u) + let array_value%10#0: bytes = ((extract 2 0) aliased_dynamic#0) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let continue_looping%12#0: uint64 = (< item_index_internal%11#0 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#0 2u) + let uint16_item#0: bytes = (extract3 array_value%10#0 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#0: uint64 = (+ total#0 tmp%14#0) + goto block@7 + block@7: // for_footer_L29 + let item_index_internal%11#0: uint64 = (+ item_index_internal%11#0 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#0 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let array_data%16#0: bytes = 0x0002 + let next_offset%17#0: uint64 = 4u + let value_as_bytes%18#0: bytes = (itob next_offset%17#0) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#0: bytes = (concat array_data%16#0 value_as_uint16%19#0) + let element_length%20#0: uint64 = (len "\x00\x05Hello") + let next_offset%17#0: uint64 = (+ next_offset%17#0 element_length%20#0) + let value_as_bytes%21#0: bytes = (itob next_offset%17#0) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#0: bytes = (concat array_data%16#0 value_as_uint16%22#0) + let element_length%23#0: uint64 = (len "\x00\x05World") + let next_offset%17#0: uint64 = (+ next_offset%17#0 element_length%23#0) + let array_data%16#0: bytes = (concat array_data%16#0 "\x00\x05Hello") + let array_data%16#0: bytes = (concat array_data%16#0 "\x00\x05World") + let dynamic_string_array#0: bytes = array_data%16#0 + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_index%29#0: uint64 = (* 0u 2u) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index_index%29#0) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + goto block@9 + block@9: // for_header_L36 + let continue_looping%38#0: uint64 = (< item_index_internal%37#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* item_index_internal%37#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let index#0: uint64 = item_index_internal%37#0 + let tmp%43#0: uint64 = (== index#0 0u) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#0: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#0: bytes = (concat result#0 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + goto block@14 + block@14: // for_footer_L36 + let item_index_internal%37#0: uint64 = (+ item_index_internal%37#0 1u) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#0 "Hello World") + (assert tmp%46#0) + let array_data%47#0: bytes = 0x + let array_data%47#0: bytes = (concat array_data%47#0 0x00000001) + let array_data%47#0: bytes = (concat array_data%47#0 0x0000000a) + let array_data%47#0: bytes = (concat array_data%47#0 0x000000ff) + let array_data%47#0: bytes = (concat array_data%47#0 0x00000080) + let static_uint32_array#0: bytes = array_data%47#0 + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let continue_looping%49#0: uint64 = (< item_index_internal%48#0 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#0 4u) + let uint32_item#0: bytes = (extract3 static_uint32_array#0 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#0: uint64 = (+ total#0 tmp%51#0) + goto block@18 + block@18: // for_footer_L46 + let item_index_internal%48#0: uint64 = (+ item_index_internal%48#0 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#0 398u) + (assert tmp%52#0) + let array_data%53#0: bytes = 0x + let array_data%53#0: bytes = (concat array_data%53#0 0x65) + let aliased_static#0: bytes = array_data%53#0 + let index#0: uint64 = 0u + let item_index%54#0: uint64 = (* 0u 1u) + let tmp%55#0: bytes = (extract3 aliased_static#0 item_index%54#0 1u) + let tmp%56#0: uint64 = (btoi tmp%55#0) + let array_length%57#0: uint64 = 1u + let index_is_in_bounds%58#0: uint64 = (< index#0 array_length%57#0) + (assert index_is_in_bounds%58#0) // Index access is out of bounds + let item_index%59#0: uint64 = (* index#0 1u) + let tmp%60#0: bytes = (extract3 aliased_static#0 item_index%59#0 1u) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let array_data%64#0: bytes = 0x + let next_offset%65#0: uint64 = 4u + let value_as_bytes%66#0: bytes = (itob next_offset%65#0) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let array_data%64#0: bytes = (concat array_data%64#0 value_as_uint16%67#0) + let element_length%68#0: uint64 = (len "\x00\x04Ping") + let next_offset%65#0: uint64 = (+ next_offset%65#0 element_length%68#0) + let value_as_bytes%69#0: bytes = (itob next_offset%65#0) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#0: bytes = (concat array_data%64#0 value_as_uint16%70#0) + let element_length%71#0: uint64 = (len "\x00\x04Pong") + let next_offset%65#0: uint64 = (+ next_offset%65#0 element_length%71#0) + let array_data%64#0: bytes = (concat array_data%64#0 "\x00\x04Ping") + let array_data%64#0: bytes = (concat array_data%64#0 "\x00\x04Pong") + let static_string_array#0: bytes = array_data%64#0 + let result#0: bytes = "" + let item_index_internal%72#0: uint64 = 0u + goto block@20 + block@20: // for_header_L60 + let continue_looping%73#0: uint64 = (< item_index_internal%72#0 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* item_index_internal%72#0 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#0: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let index#0: uint64 = item_index_internal%72#0 + let tmp%78#0: uint64 = (== index#0 0u) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#0: bytes = ((extract 2 0) string_item#0) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#0) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#0: bytes = (concat result#0 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + goto block@25 + block@25: // for_footer_L60 + let item_index_internal%72#0: uint64 = (+ item_index_internal%72#0 1u) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#0 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.parallel_copies.ir b/examples/arc4_types/out/array_Arc4ArraysContract.parallel_copies.ir new file mode 100644 index 0000000000..b737bf5298 --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.parallel_copies.ir @@ -0,0 +1,184 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 0x00020102 0u) + let item_index_internal%3#0: uint64 = 0u + let item_index_internal%3#5: uint64 = item_index_internal%3#0 + let total#9: uint64 = total#0 + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#1: uint64 = item_index_internal%3#5 + let total#1: uint64 = total#9 + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 0x0102 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + let item_index_internal%3#5: uint64 = item_index_internal%3#2 + let total#9: uint64 = total#2 + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let item_index_internal%11#0: uint64 = 0u + let item_index_internal%11#5: uint64 = item_index_internal%11#0 + let total#12: uint64 = total#1 + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#1: uint64 = item_index_internal%11#5 + let total#3: uint64 = total#12 + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 0x0001 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + let item_index_internal%11#5: uint64 = item_index_internal%11#2 + let total#12: uint64 = total#4 + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + let index#3: uint64 = item_index_internal%37#0 + let result#12: bytes = result#0 + goto block@9 + block@9: // for_header_L36 + let index#0: uint64 = index#3 + let result#2: bytes = result#12 + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + let result#15: bytes = result#1 + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + let result#15: bytes = result#3 + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = result#15 + let item_index_internal%37#3: uint64 = (+ index#0 1u) + let index#3: uint64 = item_index_internal%37#3 + let result#12: bytes = result#4 + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let item_index_internal%48#0: uint64 = 0u + let item_index_internal%48#5: uint64 = item_index_internal%48#0 + let total#15: uint64 = total#3 + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#1: uint64 = item_index_internal%48#5 + let total#5: uint64 = total#15 + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 0x000000010000000a000000ff00000080 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + let item_index_internal%48#5: uint64 = item_index_internal%48#2 + let total#15: uint64 = total#6 + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let tmp%56#0: uint64 = (btoi 0x65) + let tmp%61#0: uint64 = (btoi 0x65) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + let index#4: uint64 = item_index_internal%72#0 + let result#18: bytes = result#5 + goto block@20 + block@20: // for_header_L60 + let index#2: uint64 = index#4 + let result#7: bytes = result#18 + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + let result#21: bytes = result#6 + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + let result#21: bytes = result#8 + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = result#21 + let item_index_internal%72#3: uint64 = (+ index#2 1u) + let index#4: uint64 = item_index_internal%72#3 + let result#18: bytes = result#9 + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.post_ssa.ir b/examples/arc4_types/out/array_Arc4ArraysContract.post_ssa.ir new file mode 100644 index 0000000000..ad74c1a098 --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.post_ssa.ir @@ -0,0 +1,169 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 0x00020102 0u) + let item_index_internal%3#0: uint64 = 0u + let (total#9: uint64, item_index_internal%3#5: uint64) = (total#0, item_index_internal%3#0) + goto block@1 + block@1: // for_header_L24 + let (total#1: uint64, item_index_internal%3#1: uint64) = (total#9, item_index_internal%3#5) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 0x0102 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + let (total#9: uint64, item_index_internal%3#5: uint64) = (total#2, item_index_internal%3#2) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let item_index_internal%11#0: uint64 = 0u + let (total#12: uint64, item_index_internal%11#5: uint64) = (total#1, item_index_internal%11#0) + goto block@5 + block@5: // for_header_L29 + let (total#3: uint64, item_index_internal%11#1: uint64) = (total#12, item_index_internal%11#5) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 0x0001 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + let (total#12: uint64, item_index_internal%11#5: uint64) = (total#4, item_index_internal%11#2) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + let (result#12: bytes, index#3: uint64) = (result#0, item_index_internal%37#0) + goto block@9 + block@9: // for_header_L36 + let (result#2: bytes, index#0: uint64) = (result#12, index#3) + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + let result#15: bytes = result#1 + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + let result#15: bytes = result#3 + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = result#15 + let item_index_internal%37#3: uint64 = (+ index#0 1u) + let (result#12: bytes, index#3: uint64) = (result#4, item_index_internal%37#3) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let item_index_internal%48#0: uint64 = 0u + let (total#15: uint64, item_index_internal%48#5: uint64) = (total#3, item_index_internal%48#0) + goto block@16 + block@16: // for_header_L46 + let (total#5: uint64, item_index_internal%48#1: uint64) = (total#15, item_index_internal%48#5) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 0x000000010000000a000000ff00000080 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + let (total#15: uint64, item_index_internal%48#5: uint64) = (total#6, item_index_internal%48#2) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let tmp%56#0: uint64 = (btoi 0x65) + let tmp%61#0: uint64 = (btoi 0x65) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + let (result#18: bytes, index#4: uint64) = (result#5, item_index_internal%72#0) + goto block@20 + block@20: // for_header_L60 + let (result#7: bytes, index#2: uint64) = (result#18, index#4) + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + let result#21: bytes = result#6 + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + let result#21: bytes = result#8 + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = result#21 + let item_index_internal%72#3: uint64 = (+ index#2 1u) + let (result#18: bytes, index#4: uint64) = (result#9, item_index_internal%72#3) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.ssa.ir b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.ir new file mode 100644 index 0000000000..3665f59323 --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.ir @@ -0,0 +1,215 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let array_data%0#0: bytes = 0x0002 + let array_data%0#1: bytes = (concat array_data%0#0 0x01) + let array_data%0#2: bytes = (concat array_data%0#1 0x02) + let dynamic_uint8_array#0: bytes = array_data%0#2 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 dynamic_uint8_array#0 0u) + let array_value%2#0: bytes = ((extract 2 0) dynamic_uint8_array#0) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0, item_index_internal%3#2 <- block@3) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@3) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let item_index%5#0: uint64 = (* item_index_internal%3#1 1u) + let uint8_item#0: bytes = (extract3 array_value%2#0 item_index%5#0 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + goto block@3 + block@3: // for_footer_L24 + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_data%8#0: bytes = 0x0001 + let array_data%8#1: bytes = (concat array_data%8#0 0x0001) + let aliased_dynamic#0: bytes = array_data%8#1 + let array_length%9#0: uint64 = (extract_uint16 aliased_dynamic#0 0u) + let array_value%10#0: bytes = ((extract 2 0) aliased_dynamic#0) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4, item_index_internal%11#2 <- block@7) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@7) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 array_value%10#0 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + goto block@7 + block@7: // for_footer_L29 + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let array_data%16#0: bytes = 0x0002 + let next_offset%17#0: uint64 = 4u + let value_as_bytes%18#0: bytes = (itob next_offset%17#0) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat array_data%16#0 value_as_uint16%19#0) + let element_length%20#0: uint64 = (len "\x00\x05Hello") + let next_offset%17#1: uint64 = (+ next_offset%17#0 element_length%20#0) + let value_as_bytes%21#0: bytes = (itob next_offset%17#1) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let element_length%23#0: uint64 = (len "\x00\x05World") + let next_offset%17#2: uint64 = (+ next_offset%17#1 element_length%23#0) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let array_data%16#4: bytes = (concat array_data%16#3 "\x00\x05World") + let dynamic_string_array#0: bytes = array_data%16#4 + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_index%29#0: uint64 = (* 0u 2u) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index_index%29#0) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + goto block@9 + block@9: // for_header_L36 + let item_index_internal%37#1: uint64 = φ(item_index_internal%37#0 <- block@8, item_index_internal%37#3 <- block@14) + let result#2: bytes = φ(result#0 <- block@8, result#4 <- block@14) + let continue_looping%38#0: uint64 = (< item_index_internal%37#1 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* item_index_internal%37#1 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let index#0: uint64 = item_index_internal%37#1 + let tmp%43#0: uint64 = (== index#0 0u) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = φ(result#1 <- block@11, result#3 <- block@12) + goto block@14 + block@14: // for_footer_L36 + let item_index_internal%37#3: uint64 = (+ item_index_internal%37#1 1u) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let array_data%47#0: bytes = 0x + let array_data%47#1: bytes = (concat array_data%47#0 0x00000001) + let array_data%47#2: bytes = (concat array_data%47#1 0x0000000a) + let array_data%47#3: bytes = (concat array_data%47#2 0x000000ff) + let array_data%47#4: bytes = (concat array_data%47#3 0x00000080) + let static_uint32_array#0: bytes = array_data%47#4 + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15, item_index_internal%48#2 <- block@18) + let total#5: uint64 = φ(total#3 <- block@15, total#6 <- block@18) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 static_uint32_array#0 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + goto block@18 + block@18: // for_footer_L46 + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let array_data%53#0: bytes = 0x + let array_data%53#1: bytes = (concat array_data%53#0 0x65) + let aliased_static#0: bytes = array_data%53#1 + let index#1: uint64 = 0u + let item_index%54#0: uint64 = (* 0u 1u) + let tmp%55#0: bytes = (extract3 aliased_static#0 item_index%54#0 1u) + let tmp%56#0: uint64 = (btoi tmp%55#0) + let array_length%57#0: uint64 = 1u + let index_is_in_bounds%58#0: uint64 = (< index#1 array_length%57#0) + (assert index_is_in_bounds%58#0) // Index access is out of bounds + let item_index%59#0: uint64 = (* index#1 1u) + let tmp%60#0: bytes = (extract3 aliased_static#0 item_index%59#0 1u) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let array_data%64#0: bytes = 0x + let next_offset%65#0: uint64 = 4u + let value_as_bytes%66#0: bytes = (itob next_offset%65#0) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let array_data%64#1: bytes = (concat array_data%64#0 value_as_uint16%67#0) + let element_length%68#0: uint64 = (len "\x00\x04Ping") + let next_offset%65#1: uint64 = (+ next_offset%65#0 element_length%68#0) + let value_as_bytes%69#0: bytes = (itob next_offset%65#1) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat array_data%64#1 value_as_uint16%70#0) + let element_length%71#0: uint64 = (len "\x00\x04Pong") + let next_offset%65#2: uint64 = (+ next_offset%65#1 element_length%71#0) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let array_data%64#4: bytes = (concat array_data%64#3 "\x00\x04Pong") + let static_string_array#0: bytes = array_data%64#4 + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + goto block@20 + block@20: // for_header_L60 + let item_index_internal%72#1: uint64 = φ(item_index_internal%72#0 <- block@19, item_index_internal%72#3 <- block@25) + let result#7: bytes = φ(result#5 <- block@19, result#9 <- block@25) + let continue_looping%73#0: uint64 = (< item_index_internal%72#1 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* item_index_internal%72#1 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let index#2: uint64 = item_index_internal%72#1 + let tmp%78#0: uint64 = (== index#2 0u) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = φ(result#6 <- block@22, result#8 <- block@23) + goto block@25 + block@25: // for_footer_L60 + let item_index_internal%72#3: uint64 = (+ item_index_internal%72#1 1u) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_1.ir b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..211672ac8a --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_1.ir @@ -0,0 +1,179 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let array_data%0#1: bytes = (concat 0x0002 0x01) + let dynamic_uint8_array#0: bytes = (concat array_data%0#1 0x02) + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 dynamic_uint8_array#0 0u) + let array_value%2#0: bytes = ((extract 2 0) dynamic_uint8_array#0) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0, item_index_internal%3#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 array_value%2#0 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let aliased_dynamic#0: bytes = (concat 0x0001 0x0001) + let array_length%9#0: uint64 = (extract_uint16 aliased_dynamic#0 0u) + let array_value%10#0: bytes = ((extract 2 0) aliased_dynamic#0) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4, item_index_internal%11#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 array_value%10#0 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let next_offset%17#1: uint64 = (+ 4u 7u) + let value_as_bytes%21#0: bytes = (itob next_offset%17#1) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let next_offset%17#2: uint64 = (+ next_offset%17#1 7u) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + goto block@9 + block@9: // for_header_L36 + let index#0: uint64 = φ(item_index_internal%37#0 <- block@8, item_index_internal%37#3 <- block@13) + let result#2: bytes = φ(result#0 <- block@8, result#4 <- block@13) + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = φ(result#1 <- block@11, result#3 <- block@12) + let item_index_internal%37#3: uint64 = (+ index#0 1u) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let array_data%47#1: bytes = (concat 0x 0x00000001) + let array_data%47#2: bytes = (concat array_data%47#1 0x0000000a) + let array_data%47#3: bytes = (concat array_data%47#2 0x000000ff) + let static_uint32_array#0: bytes = (concat array_data%47#3 0x00000080) + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15, item_index_internal%48#2 <- block@17) + let total#5: uint64 = φ(total#3 <- block@15, total#6 <- block@17) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 static_uint32_array#0 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let aliased_static#0: bytes = (concat 0x 0x65) + let tmp%55#0: bytes = (extract3 aliased_static#0 0u 1u) + let tmp%56#0: uint64 = (btoi tmp%55#0) + let index_is_in_bounds%58#0: uint64 = (< 0u 1u) + (assert index_is_in_bounds%58#0) // Index access is out of bounds + let tmp%60#0: bytes = (extract3 aliased_static#0 0u 1u) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let array_data%64#1: bytes = (concat 0x value_as_uint16%67#0) + let next_offset%65#1: uint64 = (+ 4u 6u) + let value_as_bytes%69#0: bytes = (itob next_offset%65#1) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat array_data%64#1 value_as_uint16%70#0) + let next_offset%65#2: uint64 = (+ next_offset%65#1 6u) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + goto block@20 + block@20: // for_header_L60 + let index#2: uint64 = φ(item_index_internal%72#0 <- block@19, item_index_internal%72#3 <- block@24) + let result#7: bytes = φ(result#5 <- block@19, result#9 <- block@24) + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = φ(result#6 <- block@22, result#8 <- block@23) + let item_index_internal%72#3: uint64 = (+ index#2 1u) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_2.ir b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..a6cbb1fbce --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_2.ir @@ -0,0 +1,170 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let dynamic_uint8_array#0: bytes = (concat 0x000201 0x02) + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 dynamic_uint8_array#0 0u) + let array_value%2#0: bytes = ((extract 2 0) dynamic_uint8_array#0) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0, item_index_internal%3#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 array_value%2#0 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let array_value%10#0: bytes = ((extract 2 0) 0x00010001) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4, item_index_internal%11#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 array_value%10#0 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let next_offset%17#2: uint64 = (+ 11u 7u) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + goto block@9 + block@9: // for_header_L36 + let index#0: uint64 = φ(item_index_internal%37#0 <- block@8, item_index_internal%37#3 <- block@13) + let result#2: bytes = φ(result#0 <- block@8, result#4 <- block@13) + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = φ(result#1 <- block@11, result#3 <- block@12) + let item_index_internal%37#3: uint64 = (+ index#0 1u) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let array_data%47#2: bytes = (concat 0x00000001 0x0000000a) + let array_data%47#3: bytes = (concat array_data%47#2 0x000000ff) + let static_uint32_array#0: bytes = (concat array_data%47#3 0x00000080) + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15, item_index_internal%48#2 <- block@17) + let total#5: uint64 = φ(total#3 <- block@15, total#6 <- block@17) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 static_uint32_array#0 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let tmp%55#0: bytes = (extract3 0x65 0u 1u) + let tmp%56#0: uint64 = (btoi tmp%55#0) + let tmp%60#0: bytes = (extract3 0x65 0u 1u) + let tmp%61#0: uint64 = (btoi tmp%60#0) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let next_offset%65#2: uint64 = (+ 10u 6u) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + goto block@20 + block@20: // for_header_L60 + let index#2: uint64 = φ(item_index_internal%72#0 <- block@19, item_index_internal%72#3 <- block@24) + let result#7: bytes = φ(result#5 <- block@19, result#9 <- block@24) + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = φ(result#6 <- block@22, result#8 <- block@23) + let item_index_internal%72#3: uint64 = (+ index#2 1u) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_3.ir b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..c0de6c2c0e --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_3.ir @@ -0,0 +1,163 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 0x00020102 0u) + let array_value%2#0: bytes = ((extract 2 0) 0x00020102) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0, item_index_internal%3#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 array_value%2#0 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4, item_index_internal%11#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 0x0001 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + goto block@9 + block@9: // for_header_L36 + let index#0: uint64 = φ(item_index_internal%37#0 <- block@8, item_index_internal%37#3 <- block@13) + let result#2: bytes = φ(result#0 <- block@8, result#4 <- block@13) + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = φ(result#1 <- block@11, result#3 <- block@12) + let item_index_internal%37#3: uint64 = (+ index#0 1u) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let array_data%47#3: bytes = (concat 0x000000010000000a 0x000000ff) + let static_uint32_array#0: bytes = (concat array_data%47#3 0x00000080) + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15, item_index_internal%48#2 <- block@17) + let total#5: uint64 = φ(total#3 <- block@15, total#6 <- block@17) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 static_uint32_array#0 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let tmp%56#0: uint64 = (btoi 0x65) + let tmp%61#0: uint64 = (btoi 0x65) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + goto block@20 + block@20: // for_header_L60 + let index#2: uint64 = φ(item_index_internal%72#0 <- block@19, item_index_internal%72#3 <- block@24) + let result#7: bytes = φ(result#5 <- block@19, result#9 <- block@24) + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = φ(result#6 <- block@22, result#8 <- block@23) + let item_index_internal%72#3: uint64 = (+ index#2 1u) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_4.ir b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..ddd827b2ea --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_4.ir @@ -0,0 +1,161 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 0x00020102 0u) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0, item_index_internal%3#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 0x0102 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4, item_index_internal%11#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 0x0001 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + goto block@9 + block@9: // for_header_L36 + let index#0: uint64 = φ(item_index_internal%37#0 <- block@8, item_index_internal%37#3 <- block@13) + let result#2: bytes = φ(result#0 <- block@8, result#4 <- block@13) + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = φ(result#1 <- block@11, result#3 <- block@12) + let item_index_internal%37#3: uint64 = (+ index#0 1u) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let static_uint32_array#0: bytes = (concat 0x000000010000000a000000ff 0x00000080) + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15, item_index_internal%48#2 <- block@17) + let total#5: uint64 = φ(total#3 <- block@15, total#6 <- block@17) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 static_uint32_array#0 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let tmp%56#0: uint64 = (btoi 0x65) + let tmp%61#0: uint64 = (btoi 0x65) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + goto block@20 + block@20: // for_header_L60 + let index#2: uint64 = φ(item_index_internal%72#0 <- block@19, item_index_internal%72#3 <- block@24) + let result#7: bytes = φ(result#5 <- block@19, result#9 <- block@24) + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = φ(result#6 <- block@22, result#8 <- block@23) + let item_index_internal%72#3: uint64 = (+ index#2 1u) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_5.ir b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..a933aad259 --- /dev/null +++ b/examples/arc4_types/out/array_Arc4ArraysContract.ssa.opt_pass_5.ir @@ -0,0 +1,160 @@ +contract examples.arc4_types.array.Arc4ArraysContract: + program approval: + subroutine examples.arc4_types.array.Arc4ArraysContract.approval_program() -> uint64: + block@0: // L21 + let total#0: uint64 = 0u + let array_length%1#0: uint64 = (extract_uint16 0x00020102 0u) + let item_index_internal%3#0: uint64 = 0u + goto block@1 + block@1: // for_header_L24 + let item_index_internal%3#1: uint64 = φ(item_index_internal%3#0 <- block@0, item_index_internal%3#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%4#0: uint64 = (< item_index_internal%3#1 array_length%1#0) + goto continue_looping%4#0 ? block@2 : block@4 + block@2: // for_body_L24 + let uint8_item#0: bytes = (extract3 0x0102 item_index_internal%3#1 1u) + let tmp%6#0: uint64 = (btoi uint8_item#0) + let total#2: uint64 = (+ total#1 tmp%6#0) + let item_index_internal%3#2: uint64 = (+ item_index_internal%3#1 1u) + goto block@1 + block@4: // after_for_L24 + let tmp%7#0: uint64 = (== total#1 3u) + (assert tmp%7#0) // Total should be sum of dynamic_uint8_array items + let array_length%9#0: uint64 = (extract_uint16 0x00010001 0u) + let item_index_internal%11#0: uint64 = 0u + goto block@5 + block@5: // for_header_L29 + let item_index_internal%11#1: uint64 = φ(item_index_internal%11#0 <- block@4, item_index_internal%11#2 <- block@6) + let total#3: uint64 = φ(total#1 <- block@4, total#4 <- block@6) + let continue_looping%12#0: uint64 = (< item_index_internal%11#1 array_length%9#0) + goto continue_looping%12#0 ? block@6 : block@8 + block@6: // for_body_L29 + let item_index%13#0: uint64 = (* item_index_internal%11#1 2u) + let uint16_item#0: bytes = (extract3 0x0001 item_index%13#0 2u) + let tmp%14#0: uint64 = (btoi uint16_item#0) + let total#4: uint64 = (+ total#3 tmp%14#0) + let item_index_internal%11#2: uint64 = (+ item_index_internal%11#1 1u) + goto block@5 + block@8: // after_for_L29 + let tmp%15#0: uint64 = (== total#3 4u) + (assert tmp%15#0) // Total should now include sum of aliased_dynamic items + let value_as_bytes%18#0: bytes = (itob 4u) + let value_as_uint16%19#0: bytes = ((extract 6 2) value_as_bytes%18#0) + let array_data%16#1: bytes = (concat 0x0002 value_as_uint16%19#0) + let value_as_bytes%21#0: bytes = (itob 11u) + let value_as_uint16%22#0: bytes = ((extract 6 2) value_as_bytes%21#0) + let array_data%16#2: bytes = (concat array_data%16#1 value_as_uint16%22#0) + let array_data%16#3: bytes = (concat array_data%16#2 "\x00\x05Hello") + let dynamic_string_array#0: bytes = (concat array_data%16#3 "\x00\x05World") + let tmp%24#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let tmp%25#0: uint64 = (== tmp%24#0 2u) + (assert tmp%25#0) + let array_length%26#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let index_is_in_bounds%27#0: uint64 = (< 0u array_length%26#0) + (assert index_is_in_bounds%27#0) // Index access is out of bounds + let array_data_sans_header%28#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index%30#0: uint64 = (extract_uint16 array_data_sans_header%28#0 0u) + let item_length%31#0: uint64 = (extract_uint16 array_data_sans_header%28#0 item_index%30#0) + let item_length_plus_2%32#0: uint64 = (+ item_length%31#0 2u) + let tmp%33#0: bytes = (extract3 array_data_sans_header%28#0 item_index%30#0 item_length_plus_2%32#0) + let tmp%34#0: uint64 = (== tmp%33#0 "\x00\x05Hello") + (assert tmp%34#0) + let result#0: bytes = "" + let array_length%35#0: uint64 = (extract_uint16 dynamic_string_array#0 0u) + let array_value%36#0: bytes = ((extract 2 0) dynamic_string_array#0) + let item_index_internal%37#0: uint64 = 0u + goto block@9 + block@9: // for_header_L36 + let index#0: uint64 = φ(item_index_internal%37#0 <- block@8, item_index_internal%37#3 <- block@13) + let result#2: bytes = φ(result#0 <- block@8, result#4 <- block@13) + let continue_looping%38#0: uint64 = (< index#0 array_length%35#0) + goto continue_looping%38#0 ? block@10 : block@15 + block@10: // for_body_L36 + let item_index_index%39#0: uint64 = (* index#0 2u) + let item_index%40#0: uint64 = (extract_uint16 array_value%36#0 item_index_index%39#0) + let item_length%41#0: uint64 = (extract_uint16 array_value%36#0 item_index%40#0) + let item_length_plus_2%42#0: uint64 = (+ item_length%41#0 2u) + let string_item#0: bytes = (extract3 array_value%36#0 item_index%40#0 item_length_plus_2%42#0) + let tmp%43#0: uint64 = (! index#0) + goto tmp%43#0 ? block@11 : block@12 + block@11: // if_body_L37 + let result#1: bytes = ((extract 2 0) string_item#0) + goto block@13 + block@12: // else_body_L37 + let tmp%44#0: bytes = ((extract 2 0) string_item#0) + let tmp%45#0: bytes = (concat " " tmp%44#0) + let result#3: bytes = (concat result#2 tmp%45#0) + goto block@13 + block@13: // after_if_else_L37 + let result#4: bytes = φ(result#1 <- block@11, result#3 <- block@12) + let item_index_internal%37#3: uint64 = (+ index#0 1u) + goto block@9 + block@15: // after_for_L36 + let tmp%46#0: uint64 = (== result#2 "Hello World") + (assert tmp%46#0) + let item_index_internal%48#0: uint64 = 0u + goto block@16 + block@16: // for_header_L46 + let item_index_internal%48#1: uint64 = φ(item_index_internal%48#0 <- block@15, item_index_internal%48#2 <- block@17) + let total#5: uint64 = φ(total#3 <- block@15, total#6 <- block@17) + let continue_looping%49#0: uint64 = (< item_index_internal%48#1 4u) + goto continue_looping%49#0 ? block@17 : block@19 + block@17: // for_body_L46 + let item_index%50#0: uint64 = (* item_index_internal%48#1 4u) + let uint32_item#0: bytes = (extract3 0x000000010000000a000000ff00000080 item_index%50#0 4u) + let tmp%51#0: uint64 = (btoi uint32_item#0) + let total#6: uint64 = (+ total#5 tmp%51#0) + let item_index_internal%48#2: uint64 = (+ item_index_internal%48#1 1u) + goto block@16 + block@19: // after_for_L46 + let tmp%52#0: uint64 = (== total#5 398u) + (assert tmp%52#0) + let tmp%56#0: uint64 = (btoi 0x65) + let tmp%61#0: uint64 = (btoi 0x65) + let tmp%62#0: uint64 = (+ tmp%56#0 tmp%61#0) + let tmp%63#0: uint64 = (== tmp%62#0 202u) + (assert tmp%63#0) + let value_as_bytes%66#0: bytes = (itob 4u) + let value_as_uint16%67#0: bytes = ((extract 6 2) value_as_bytes%66#0) + let value_as_bytes%69#0: bytes = (itob 10u) + let value_as_uint16%70#0: bytes = ((extract 6 2) value_as_bytes%69#0) + let array_data%64#2: bytes = (concat value_as_uint16%67#0 value_as_uint16%70#0) + let array_data%64#3: bytes = (concat array_data%64#2 "\x00\x04Ping") + let static_string_array#0: bytes = (concat array_data%64#3 "\x00\x04Pong") + let result#5: bytes = "" + let item_index_internal%72#0: uint64 = 0u + goto block@20 + block@20: // for_header_L60 + let index#2: uint64 = φ(item_index_internal%72#0 <- block@19, item_index_internal%72#3 <- block@24) + let result#7: bytes = φ(result#5 <- block@19, result#9 <- block@24) + let continue_looping%73#0: uint64 = (< index#2 2u) + goto continue_looping%73#0 ? block@21 : block@26 + block@21: // for_body_L60 + let item_index_index%74#0: uint64 = (* index#2 2u) + let item_index%75#0: uint64 = (extract_uint16 static_string_array#0 item_index_index%74#0) + let item_length%76#0: uint64 = (extract_uint16 static_string_array#0 item_index%75#0) + let item_length_plus_2%77#0: uint64 = (+ item_length%76#0 2u) + let string_item#1: bytes = (extract3 static_string_array#0 item_index%75#0 item_length_plus_2%77#0) + let tmp%78#0: uint64 = (! index#2) + goto tmp%78#0 ? block@22 : block@23 + block@22: // if_body_L61 + let result#6: bytes = ((extract 2 0) string_item#1) + goto block@24 + block@23: // else_body_L61 + let tmp%79#0: bytes = ((extract 2 0) string_item#1) + let tmp%80#0: bytes = (concat " " tmp%79#0) + let result#8: bytes = (concat result#7 tmp%80#0) + goto block@24 + block@24: // after_if_else_L61 + let result#9: bytes = φ(result#6 <- block@22, result#8 <- block@23) + let item_index_internal%72#3: uint64 = (+ index#2 1u) + goto block@20 + block@26: // after_for_L60 + let tmp%81#0: uint64 = (== result#7 "Ping Pong") + (assert tmp%81#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.array.Arc4ArraysContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool.O0.log b/examples/arc4_types/out/bool.O0.log new file mode 100644 index 0000000000..304e2fb391 --- /dev/null +++ b/examples/arc4_types/out/bool.O0.log @@ -0,0 +1,251 @@ +PC Teal Stack +1 +6 +10 byte 0x00 0x00 +11 int 0 0x00, 0 +12 int 1 0x00, 0, 1 +13 setbit 0x80 +14 byte 0x00 0x80, 0x00 +15 int 0 0x80, 0x00, 0 +16 int 0 0x80, 0x00, 0, 0 +17 setbit 0x80, 0x00 +18 callsub test_stuff 0x80, 0x00 +281 proto 2 0 0x80, 0x00 +284 frame_dig -2 0x80, 0x00, 0x80 +286 int 0 0x80, 0x00, 0x80, 0 +287 getbit 0x80, 0x00, 1 +288 assert 0x80, 0x00 +289 frame_dig -1 0x80, 0x00, 0x00 +291 int 0 0x80, 0x00, 0x00, 0 +292 getbit 0x80, 0x00, 0 +293 ! 0x80, 0x00, 1 +294 assert 0x80, 0x00 +295 frame_dig -2 0x80, 0x00, 0x80 +297 int 0 0x80, 0x00, 0x80, 0 +298 getbit 0x80, 0x00, 1 +299 byte 0x00 0x80, 0x00, 1, 0x00 +300 int 0 0x80, 0x00, 1, 0x00, 0 +301 uncover 2 0x80, 0x00, 0x00, 0, 1 +303 setbit 0x80, 0x00, 0x80 +304 frame_dig -2 0x80, 0x00, 0x80, 0x80 +306 == 0x80, 0x00, 1 +307 assert 0x80, 0x00 +308 frame_dig -1 0x80, 0x00, 0x00 +310 int 0 0x80, 0x00, 0x00, 0 +311 getbit 0x80, 0x00, 0 +312 byte 0x00 0x80, 0x00, 0, 0x00 +313 int 0 0x80, 0x00, 0, 0x00, 0 +314 uncover 2 0x80, 0x00, 0x00, 0, 0 +316 setbit 0x80, 0x00, 0x00 +317 frame_dig -1 0x80, 0x00, 0x00, 0x00 +319 == 0x80, 0x00, 1 +320 assert 0x80, 0x00 +321 retsub +21 byte 0x00 0x00 +22 int 0 0x00, 0 +23 int 1 0x00, 0, 1 +24 setbit 0x80 +25 byte 0x00 0x80, 0x00 +26 int 0 0x80, 0x00, 0 +27 int 1 0x80, 0x00, 0, 1 +28 setbit 0x80, 0x80 +29 byte 0x00 0x80, 0x80, 0x00 +30 int 0 0x80, 0x80, 0x00, 0 +31 int 1 0x80, 0x80, 0x00, 0, 1 +32 setbit 0x80, 0x80, 0x80 +33 cover 2 0x80, 0x80, 0x80 +35 byte 0x00 0x80, 0x80, 0x80, 0x00 +36 int 0 0x80, 0x80, 0x80, 0x00, 0 +37 int 1 0x80, 0x80, 0x80, 0x00, 0, 1 +38 setbit 0x80, 0x80, 0x80, 0x80 +39 cover 3 0x80, 0x80, 0x80, 0x80 +41 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x00 +42 int 0 0x80, 0x80, 0x80, 0x80, 0x00, 0 +43 int 1 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +44 setbit 0x80, 0x80, 0x80, 0x80, 0x80 +45 cover 4 0x80, 0x80, 0x80, 0x80, 0x80 +47 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +48 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0 +49 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +50 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +51 cover 5 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +53 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +54 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0 +55 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +56 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +57 cover 6 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +59 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +60 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0 +61 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +62 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +63 cover 7 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +65 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +66 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0 +67 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +68 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +69 cover 8 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +71 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +72 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0 +73 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +74 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +75 cover 8 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +77 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +78 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0 +79 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +80 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +81 cover 10 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +83 byte 0x00 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +84 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0 +85 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0, 1 +86 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +87 cover 11 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +89 byte 0x 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x +91 uncover 2 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x, 0x80 +93 concat 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +94 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 +95 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0 +96 getbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1 +97 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0x80 +98 int 1 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0x80, 1 +99 uncover 2 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 1 +101 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0 +102 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80 +103 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x80, 0 +104 getbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 1 +105 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xC0 +106 int 2 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xC0, 2 +108 uncover 2 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 2, 1 +110 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0 +111 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x80 +112 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 0x80, 0 +113 getbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 1 +114 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xE0 +115 int 3 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xE0, 3 +117 uncover 2 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xE0, 3, 1 +119 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF0 +120 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF0, 0x80 +121 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF0, 0x80, 0 +122 getbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF0, 1 +123 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xF0 +124 int 4 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xF0, 4 +126 uncover 2 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF0, 4, 1 +128 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF8 +129 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF8, 0x80 +130 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF8, 0x80, 0 +131 getbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF8, 1 +132 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xF8 +133 int 5 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xF8, 5 +135 uncover 2 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xF8, 5, 1 +137 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFC +138 swap 0x80, 0x80, 0x80, 0x80, 0x80, 0xFC, 0x80 +139 int 0 0x80, 0x80, 0x80, 0x80, 0x80, 0xFC, 0x80, 0 +140 getbit 0x80, 0x80, 0x80, 0x80, 0x80, 0xFC, 1 +141 swap 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xFC +142 int 6 0x80, 0x80, 0x80, 0x80, 0x80, 1, 0xFC, 6 +144 uncover 2 0x80, 0x80, 0x80, 0x80, 0x80, 0xFC, 6, 1 +146 setbit 0x80, 0x80, 0x80, 0x80, 0x80, 0xFE +147 swap 0x80, 0x80, 0x80, 0x80, 0xFE, 0x80 +148 int 0 0x80, 0x80, 0x80, 0x80, 0xFE, 0x80, 0 +149 getbit 0x80, 0x80, 0x80, 0x80, 0xFE, 1 +150 swap 0x80, 0x80, 0x80, 0x80, 1, 0xFE +151 int 7 0x80, 0x80, 0x80, 0x80, 1, 0xFE, 7 +153 uncover 2 0x80, 0x80, 0x80, 0x80, 0xFE, 7, 1 +155 setbit 0x80, 0x80, 0x80, 0x80, 0xFF +156 uncover 2 0x80, 0x80, 0x80, 0xFF, 0x80 +158 concat 0x80, 0x80, 0x80, 0xFF80 +159 swap 0x80, 0x80, 0xFF80, 0x80 +160 int 0 0x80, 0x80, 0xFF80, 0x80, 0 +161 getbit 0x80, 0x80, 0xFF80, 1 +162 swap 0x80, 0x80, 1, 0xFF80 +163 int 9 0x80, 0x80, 1, 0xFF80, 9 +165 uncover 2 0x80, 0x80, 0xFF80, 9, 1 +167 setbit 0x80, 0x80, 0xFFC0 +168 swap 0x80, 0xFFC0, 0x80 +169 int 0 0x80, 0xFFC0, 0x80, 0 +170 getbit 0x80, 0xFFC0, 1 +171 swap 0x80, 1, 0xFFC0 +172 int 10 0x80, 1, 0xFFC0, 10 +174 uncover 2 0x80, 0xFFC0, 10, 1 +176 setbit 0x80, 0xFFE0 +177 swap 0xFFE0, 0x80 +178 int 0 0xFFE0, 0x80, 0 +179 getbit 0xFFE0, 1 +180 swap 1, 0xFFE0 +181 int 11 1, 0xFFE0, 11 +183 uncover 2 0xFFE0, 11, 1 +185 setbit 0xFFF0 +186 dup 0xFFF0, 0xFFF0 +187 byte 0xfff0 0xFFF0, 0xFFF0, 0xFFF0 +191 == 0xFFF0, 1 +192 assert 0xFFF0 +193 int 0 0xFFF0, 0 +194 int 1 0xFFF0, 0, 1 +195 * 0xFFF0, 0 +196 dig 1 0xFFF0, 0, 0xFFF0 +198 swap 0xFFF0, 0xFFF0, 0 +199 getbit 0xFFF0, 1 +200 byte 0x00 0xFFF0, 1, 0x00 +201 int 0 0xFFF0, 1, 0x00, 0 +202 uncover 2 0xFFF0, 0x00, 0, 1 +204 setbit 0xFFF0, 0x80 +205 byte 0x00 0xFFF0, 0x80, 0x00 +206 int 0 0xFFF0, 0x80, 0x00, 0 +207 int 1 0xFFF0, 0x80, 0x00, 0, 1 +208 setbit 0xFFF0, 0x80, 0x80 +209 == 0xFFF0, 1 +210 assert 0xFFF0 +211 int 12 0xFFF0, 12 +212 int 1 0xFFF0, 12, 1 +213 - 0xFFF0, 11 +214 int 12 0xFFF0, 11, 12 +215 dig 1 0xFFF0, 11, 12, 11 +217 > 0xFFF0, 11, 1 +218 assert 0xFFF0, 11 +219 int 1 0xFFF0, 11, 1 +220 * 0xFFF0, 11 +221 getbit 1 +222 byte 0x00 1, 0x00 +223 int 0 1, 0x00, 0 +224 uncover 2 0x00, 0, 1 +226 setbit 0x80 +227 byte 0x00 0x80, 0x00 +228 int 0 0x80, 0x00, 0 +229 int 1 0x80, 0x00, 0, 1 +230 setbit 0x80, 0x80 +231 == 1 +232 assert +233 byte 0x00 0x00 +234 int 0 0x00, 0 +235 int 1 0x00, 0, 1 +236 setbit 0x80 +237 byte 0x00 0x80, 0x00 +238 int 0 0x80, 0x00, 0 +239 int 0 0x80, 0x00, 0, 0 +240 setbit 0x80, 0x00 +241 byte 0x00 0x80, 0x00, 0x00 +242 int 0 0x80, 0x00, 0x00, 0 +243 int 1 0x80, 0x00, 0x00, 0, 1 +244 setbit 0x80, 0x00, 0x80 +245 cover 2 0x80, 0x80, 0x00 +247 byte 0x0003 0x80, 0x80, 0x00, 0x0003 +251 uncover 2 0x80, 0x00, 0x0003, 0x80 +253 concat 0x80, 0x00, 0x000380 +254 swap 0x80, 0x000380, 0x00 +255 int 0 0x80, 0x000380, 0x00, 0 +256 getbit 0x80, 0x000380, 0 +257 swap 0x80, 0, 0x000380 +258 int 17 0x80, 0, 0x000380, 17 +260 uncover 2 0x80, 0x000380, 17, 0 +262 setbit 0x80, 0x000380 +263 swap 0x000380, 0x80 +264 int 0 0x000380, 0x80, 0 +265 getbit 0x000380, 1 +266 swap 1, 0x000380 +267 int 18 1, 0x000380, 18 +269 uncover 2 0x000380, 18, 1 +271 setbit 0x0003A0 +272 byte 0x0003a0 0x0003A0, 0x0003A0 +277 == 1 +278 assert +279 int 1 1 +280 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/bool.O1.log b/examples/arc4_types/out/bool.O1.log new file mode 100644 index 0000000000..687244e100 --- /dev/null +++ b/examples/arc4_types/out/bool.O1.log @@ -0,0 +1,39 @@ +PC Teal Stack +1 +4 +8 byte 0x80 0x80 +11 byte 0x00 0x80, 0x00 +12 callsub test_stuff 0x80, 0x00 +18 proto 2 0 0x80, 0x00 +21 frame_dig -2 0x80, 0x00, 0x80 +23 int 0 0x80, 0x00, 0x80, 0 +24 getbit 0x80, 0x00, 1 +25 assert 0x80, 0x00 +26 frame_dig -1 0x80, 0x00, 0x00 +28 int 0 0x80, 0x00, 0x00, 0 +29 getbit 0x80, 0x00, 0 +30 ! 0x80, 0x00, 1 +31 assert 0x80, 0x00 +32 frame_dig -2 0x80, 0x00, 0x80 +34 int 0 0x80, 0x00, 0x80, 0 +35 getbit 0x80, 0x00, 1 +36 byte 0x00 0x80, 0x00, 1, 0x00 +37 int 0 0x80, 0x00, 1, 0x00, 0 +38 uncover 2 0x80, 0x00, 0x00, 0, 1 +40 setbit 0x80, 0x00, 0x80 +41 frame_dig -2 0x80, 0x00, 0x80, 0x80 +43 == 0x80, 0x00, 1 +44 assert 0x80, 0x00 +45 frame_dig -1 0x80, 0x00, 0x00 +47 int 0 0x80, 0x00, 0x00, 0 +48 getbit 0x80, 0x00, 0 +49 byte 0x00 0x80, 0x00, 0, 0x00 +50 int 0 0x80, 0x00, 0, 0x00, 0 +51 uncover 2 0x80, 0x00, 0x00, 0, 0 +53 setbit 0x80, 0x00, 0x00 +54 frame_dig -1 0x80, 0x00, 0x00, 0x00 +56 == 0x80, 0x00, 1 +57 assert 0x80, 0x00 +58 retsub +15 int 1 1 +17 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/bool.O2.log b/examples/arc4_types/out/bool.O2.log new file mode 100644 index 0000000000..687244e100 --- /dev/null +++ b/examples/arc4_types/out/bool.O2.log @@ -0,0 +1,39 @@ +PC Teal Stack +1 +4 +8 byte 0x80 0x80 +11 byte 0x00 0x80, 0x00 +12 callsub test_stuff 0x80, 0x00 +18 proto 2 0 0x80, 0x00 +21 frame_dig -2 0x80, 0x00, 0x80 +23 int 0 0x80, 0x00, 0x80, 0 +24 getbit 0x80, 0x00, 1 +25 assert 0x80, 0x00 +26 frame_dig -1 0x80, 0x00, 0x00 +28 int 0 0x80, 0x00, 0x00, 0 +29 getbit 0x80, 0x00, 0 +30 ! 0x80, 0x00, 1 +31 assert 0x80, 0x00 +32 frame_dig -2 0x80, 0x00, 0x80 +34 int 0 0x80, 0x00, 0x80, 0 +35 getbit 0x80, 0x00, 1 +36 byte 0x00 0x80, 0x00, 1, 0x00 +37 int 0 0x80, 0x00, 1, 0x00, 0 +38 uncover 2 0x80, 0x00, 0x00, 0, 1 +40 setbit 0x80, 0x00, 0x80 +41 frame_dig -2 0x80, 0x00, 0x80, 0x80 +43 == 0x80, 0x00, 1 +44 assert 0x80, 0x00 +45 frame_dig -1 0x80, 0x00, 0x00 +47 int 0 0x80, 0x00, 0x00, 0 +48 getbit 0x80, 0x00, 0 +49 byte 0x00 0x80, 0x00, 0, 0x00 +50 int 0 0x80, 0x00, 0, 0x00, 0 +51 uncover 2 0x80, 0x00, 0x00, 0, 0 +53 setbit 0x80, 0x00, 0x00 +54 frame_dig -1 0x80, 0x00, 0x00, 0x00 +56 == 0x80, 0x00, 1 +57 assert 0x80, 0x00 +58 retsub +15 int 1 1 +17 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/bool.approval.debug.teal b/examples/arc4_types/out/bool.approval.debug.teal new file mode 100644 index 0000000000..700af03059 --- /dev/null +++ b/examples/arc4_types/out/bool.approval.debug.teal @@ -0,0 +1,49 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: +main_block@0: + byte 0x80 // 0x80 ARC4Bool(True) File "arc4_types/bool.py", line 13 + byte 0x00 // 0x80,0x00 ARC4Bool(False) File "arc4_types/bool.py", line 13 + callsub test_stuff // self.test_stuff(ARC4Bool(True), ARC4Bool(False)) File "arc4_types/bool.py", line 13 + int 1 // 1 True File "arc4_types/bool.py", line 41 + return // return True File "arc4_types/bool.py", line 41 + + +// examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true#0: bytes, false#0: bytes) -> void: +test_stuff: + proto 2 0 // (𝕡) true#0,false#0 | def test_stuff(self, true: ARC4Bool, false: ARC4Bool) -> None: File "arc4_types/bool.py", line 47 + +test_stuff_block@0: + frame_dig -2 // load true#0 from parameters (𝕡) true#0,false#0 | true#0 true: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | true#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} true.decode() File "arc4_types/bool.py", line 48 + assert // (𝕡) true#0,false#0 | assert true.decode() File "arc4_types/bool.py", line 48 + frame_dig -1 // load false#0 from parameters (𝕡) true#0,false#0 | false#0 false: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | false#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} false.decode() File "arc4_types/bool.py", line 50 + ! // (𝕡) true#0,false#0 | {!} not false.decode() File "arc4_types/bool.py", line 50 + assert // (𝕡) true#0,false#0 | assert not false.decode() File "arc4_types/bool.py", line 50 + frame_dig -2 // load true#0 from parameters (𝕡) true#0,false#0 | true#0 true: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | true#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} true.decode() File "arc4_types/bool.py", line 52 + byte 0x00 // (𝕡) true#0,false#0 | tmp%3#0,0x00 ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + int 0 // (𝕡) true#0,false#0 | tmp%3#0,0x00,0 + uncover 2 // load tmp%3#0 from l-stack (no copy) (𝕡) true#0,false#0 | 0x00,0,tmp%3#0 true.decode() File "arc4_types/bool.py", line 52 + setbit // (𝕡) true#0,false#0 | {setbit} ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + frame_dig -2 // load true#0 from parameters (𝕡) true#0,false#0 | tmp%4#0,true#0 true: ARC4Bool File "arc4_types/bool.py", line 47 + == // (𝕡) true#0,false#0 | {==} true == ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + assert // (𝕡) true#0,false#0 | assert true == ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + frame_dig -1 // load false#0 from parameters (𝕡) true#0,false#0 | false#0 false: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | false#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} false.decode() File "arc4_types/bool.py", line 53 + byte 0x00 // (𝕡) true#0,false#0 | tmp%6#0,0x00 ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + int 0 // (𝕡) true#0,false#0 | tmp%6#0,0x00,0 + uncover 2 // load tmp%6#0 from l-stack (no copy) (𝕡) true#0,false#0 | 0x00,0,tmp%6#0 false.decode() File "arc4_types/bool.py", line 53 + setbit // (𝕡) true#0,false#0 | {setbit} ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + frame_dig -1 // load false#0 from parameters (𝕡) true#0,false#0 | tmp%7#0,false#0 false: ARC4Bool File "arc4_types/bool.py", line 47 + == // (𝕡) true#0,false#0 | {==} false == ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + assert // (𝕡) true#0,false#0 | assert false == ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + retsub // + diff --git a/examples/arc4_types/out/bool.approval.teal b/examples/arc4_types/out/bool.approval.teal new file mode 100644 index 0000000000..8badb44f2f --- /dev/null +++ b/examples/arc4_types/out/bool.approval.teal @@ -0,0 +1,47 @@ +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: +main_block@0: + byte 0x80 + byte 0x00 + callsub test_stuff + int 1 + return + + +// examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true#0: bytes, false#0: bytes) -> void: +test_stuff: + proto 2 0 + +test_stuff_block@0: + frame_dig -2 + int 0 + getbit + assert + frame_dig -1 + int 0 + getbit + ! + assert + frame_dig -2 + int 0 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + frame_dig -2 + == + assert + frame_dig -1 + int 0 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + frame_dig -1 + == + assert + retsub + diff --git a/examples/arc4_types/out/bool.approval_unoptimized.debug.teal b/examples/arc4_types/out/bool.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..c0b3678b04 --- /dev/null +++ b/examples/arc4_types/out/bool.approval_unoptimized.debug.teal @@ -0,0 +1,261 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: +main_block@0: + byte 0x00 // 0x00 ARC4Bool(True) File "arc4_types/bool.py", line 13 + int 0 // 0x00,0 + int 1 // 0x00,0,1 True File "arc4_types/bool.py", line 13 + setbit // {setbit} ARC4Bool(True) File "arc4_types/bool.py", line 13 + byte 0x00 // tmp%0#0,0x00 ARC4Bool(False) File "arc4_types/bool.py", line 13 + int 0 // tmp%0#0,0x00,0 + int 0 // tmp%0#0,0x00,0,0 False File "arc4_types/bool.py", line 13 + setbit // tmp%0#0,{setbit} ARC4Bool(False) File "arc4_types/bool.py", line 13 + callsub test_stuff // self.test_stuff(ARC4Bool(True), ARC4Bool(False)) File "arc4_types/bool.py", line 13 + byte 0x00 // 0x00 ARC4Bool(True) File "arc4_types/bool.py", line 16 + int 0 // 0x00,0 + int 1 // 0x00,0,1 True File "arc4_types/bool.py", line 16 + setbit // {setbit} ARC4Bool(True) File "arc4_types/bool.py", line 16 + byte 0x00 // tmp%2#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 17 + int 0 // tmp%2#0,0x00,0 + int 1 // tmp%2#0,0x00,0,1 True File "arc4_types/bool.py", line 17 + setbit // tmp%2#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 17 + byte 0x00 // tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 18 + int 0 // tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 18 + setbit // tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 18 + cover 2 // store tmp%4#0 to l-stack (no copy) tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 18 + byte 0x00 // tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 19 + int 0 // tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 19 + setbit // tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 19 + cover 3 // store tmp%5#0 to l-stack (no copy) tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 19 + byte 0x00 // tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 20 + int 0 // tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 20 + setbit // tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 20 + cover 4 // store tmp%6#0 to l-stack (no copy) tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 20 + byte 0x00 // tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 21 + int 0 // tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 21 + setbit // tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 21 + cover 5 // store tmp%7#0 to l-stack (no copy) tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 21 + byte 0x00 // tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 22 + int 0 // tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 22 + setbit // tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 22 + cover 6 // store tmp%8#0 to l-stack (no copy) tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 22 + byte 0x00 // tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 23 + int 0 // tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 23 + setbit // tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 23 + cover 7 // store tmp%9#0 to l-stack (no copy) tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 23 + byte 0x00 // tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 24 + int 0 // tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 24 + setbit // tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 24 + cover 8 // store tmp%10#0 to l-stack (no copy) tmp%10#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 24 + byte 0x00 // tmp%10#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 25 + int 0 // tmp%10#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%10#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 25 + setbit // tmp%10#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 25 + cover 8 // store tmp%11#0 to l-stack (no copy) tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 25 + byte 0x00 // tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 26 + int 0 // tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 26 + setbit // tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 26 + cover 10 // store tmp%12#0 to l-stack (no copy) tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 26 + byte 0x00 // tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 27 + int 0 // tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0 + int 1 // tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x00,0,1 True File "arc4_types/bool.py", line 27 + setbit // tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 27 + cover 11 // store tmp%13#0 to l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 27 + byte 0x // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%2#0,tmp%3#0,0x StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load tmp%2#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%3#0,array_data%14#0,tmp%2#0 ARC4Bool(True) File "arc4_types/bool.py", line 16 + concat // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,tmp%3#0,{concat} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%3#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,array_data%14#0,tmp%3#0 ARC4Bool(True) File "arc4_types/bool.py", line 17 + int 0 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,array_data%14#0,tmp%3#0,0 + getbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,is_true%15#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 1 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,is_true%15#0,array_data%14#0,1 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%15#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,array_data%14#0,1,is_true%15#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,tmp%4#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%4#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,array_data%14#0,tmp%4#0 ARC4Bool(True) File "arc4_types/bool.py", line 18 + int 0 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,array_data%14#0,tmp%4#0,0 + getbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,is_true%16#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 2 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,is_true%16#0,array_data%14#0,2 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%16#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,array_data%14#0,2,is_true%16#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,tmp%5#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%5#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,array_data%14#0,tmp%5#0 ARC4Bool(True) File "arc4_types/bool.py", line 19 + int 0 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,array_data%14#0,tmp%5#0,0 + getbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,is_true%17#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 3 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,is_true%17#0,array_data%14#0,3 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%17#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,array_data%14#0,3,is_true%17#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,tmp%6#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%6#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,array_data%14#0,tmp%6#0 ARC4Bool(True) File "arc4_types/bool.py", line 20 + int 0 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,array_data%14#0,tmp%6#0,0 + getbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,is_true%18#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 4 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,is_true%18#0,array_data%14#0,4 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%18#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,array_data%14#0,4,is_true%18#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,tmp%7#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%7#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,array_data%14#0,tmp%7#0 ARC4Bool(True) File "arc4_types/bool.py", line 21 + int 0 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,array_data%14#0,tmp%7#0,0 + getbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,is_true%19#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 5 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,is_true%19#0,array_data%14#0,5 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%19#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,array_data%14#0,5,is_true%19#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,tmp%8#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%8#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,array_data%14#0,tmp%8#0 ARC4Bool(True) File "arc4_types/bool.py", line 22 + int 0 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,array_data%14#0,tmp%8#0,0 + getbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,is_true%20#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 6 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,is_true%20#0,array_data%14#0,6 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%20#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,array_data%14#0,6,is_true%20#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,tmp%9#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%9#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,array_data%14#0,tmp%9#0 ARC4Bool(True) File "arc4_types/bool.py", line 23 + int 0 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,array_data%14#0,tmp%9#0,0 + getbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,is_true%21#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 7 // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,is_true%21#0,array_data%14#0,7 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%21#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,array_data%14#0,7,is_true%21#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,tmp%10#0,tmp%11#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load tmp%10#0 from l-stack (no copy) tmp%13#0,tmp%12#0,tmp%11#0,array_data%14#0,tmp%10#0 ARC4Bool(True) File "arc4_types/bool.py", line 24 + concat // tmp%13#0,tmp%12#0,tmp%11#0,{concat} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%11#0 from l-stack (no copy) tmp%13#0,tmp%12#0,array_data%14#0,tmp%11#0 ARC4Bool(True) File "arc4_types/bool.py", line 25 + int 0 // tmp%13#0,tmp%12#0,array_data%14#0,tmp%11#0,0 + getbit // tmp%13#0,tmp%12#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,tmp%12#0,is_true%22#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 9 // tmp%13#0,tmp%12#0,is_true%22#0,array_data%14#0,9 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%22#0 from l-stack (no copy) tmp%13#0,tmp%12#0,array_data%14#0,9,is_true%22#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,tmp%12#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%12#0 from l-stack (no copy) tmp%13#0,array_data%14#0,tmp%12#0 ARC4Bool(True) File "arc4_types/bool.py", line 26 + int 0 // tmp%13#0,array_data%14#0,tmp%12#0,0 + getbit // tmp%13#0,array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) tmp%13#0,is_true%23#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 10 // tmp%13#0,is_true%23#0,array_data%14#0,10 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%23#0 from l-stack (no copy) tmp%13#0,array_data%14#0,10,is_true%23#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // tmp%13#0,{setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load tmp%13#0 from l-stack (no copy) array_data%14#0,tmp%13#0 ARC4Bool(True) File "arc4_types/bool.py", line 27 + int 0 // array_data%14#0,tmp%13#0,0 + getbit // array_data%14#0,{getbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + swap // load array_data%14#0 from l-stack (no copy) is_true%24#0,array_data%14#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + int 11 // is_true%24#0,array_data%14#0,11 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + uncover 2 // load is_true%24#0 from l-stack (no copy) array_data%14#0,11,is_true%24#0 StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + setbit // {setbit} StaticArray[ARC4Bool, t.Literal[12]]( File "arc4_types/bool.py", line 15 + dup // load static_boolean_array#0 from l-stack (copy) static_boolean_array#0,static_boolean_array#0 static_boolean_array File "arc4_types/bool.py", line 15 + byte 0xfff0 // static_boolean_array#0,static_boolean_array#0,0xfff0 Bytes.from_hex("FFF0") File "arc4_types/bool.py", line 30 + == // static_boolean_array#0,{==} static_boolean_array.bytes == Bytes.from_hex("FFF0") File "arc4_types/bool.py", line 30 + assert // static_boolean_array#0 assert static_boolean_array.bytes == Bytes.from_hex("FFF0") File "arc4_types/bool.py", line 30 + int 0 // static_boolean_array#0,0 0 File "arc4_types/bool.py", line 32 + int 1 // static_boolean_array#0,0,1 static_boolean_array[0] File "arc4_types/bool.py", line 32 + * // static_boolean_array#0,{*} static_boolean_array[0] File "arc4_types/bool.py", line 32 + dig 1 // load static_boolean_array#0 from l-stack (copy) static_boolean_array#0,item_index%26#0,static_boolean_array#0 static_boolean_array File "arc4_types/bool.py", line 15 + swap // load item_index%26#0 from l-stack (no copy) static_boolean_array#0,static_boolean_array#0,item_index%26#0 static_boolean_array[0] File "arc4_types/bool.py", line 32 + getbit // static_boolean_array#0,{getbit} static_boolean_array[0] File "arc4_types/bool.py", line 32 + byte 0x00 // static_boolean_array#0,is_true%27#0,0x00 static_boolean_array[0] File "arc4_types/bool.py", line 32 + int 0 // static_boolean_array#0,is_true%27#0,0x00,0 + uncover 2 // load is_true%27#0 from l-stack (no copy) static_boolean_array#0,0x00,0,is_true%27#0 static_boolean_array[0] File "arc4_types/bool.py", line 32 + setbit // static_boolean_array#0,{setbit} static_boolean_array[0] File "arc4_types/bool.py", line 32 + byte 0x00 // static_boolean_array#0,tmp%28#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 32 + int 0 // static_boolean_array#0,tmp%28#0,0x00,0 + int 1 // static_boolean_array#0,tmp%28#0,0x00,0,1 True File "arc4_types/bool.py", line 32 + setbit // static_boolean_array#0,tmp%28#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 32 + == // static_boolean_array#0,{==} static_boolean_array[0] == ARC4Bool(True), "Single boolean can be unpacked" File "arc4_types/bool.py", line 32 + assert // Single boolean can be unpacked // static_boolean_array#0 assert static_boolean_array[0] == ARC4Bool(True), "Single boolean can be unpacked" File "arc4_types/bool.py", line 32 + int 12 // static_boolean_array#0,12 -1 File "arc4_types/bool.py", line 33 + int 1 // static_boolean_array#0,12,1 -1 File "arc4_types/bool.py", line 33 + - // static_boolean_array#0,{-} -1 File "arc4_types/bool.py", line 33 + int 12 // static_boolean_array#0,tmp%31#0,12 static_boolean_array[-1] File "arc4_types/bool.py", line 33 + dig 1 // load tmp%31#0 from l-stack (copy) static_boolean_array#0,tmp%31#0,array_length%32#0,tmp%31#0 -1 File "arc4_types/bool.py", line 33 + > // static_boolean_array#0,tmp%31#0,{>} static_boolean_array[-1] File "arc4_types/bool.py", line 33 + assert // Index access is out of bounds // static_boolean_array#0,tmp%31#0 static_boolean_array[-1] File "arc4_types/bool.py", line 33 + int 1 // static_boolean_array#0,tmp%31#0,1 static_boolean_array[-1] File "arc4_types/bool.py", line 33 + * // static_boolean_array#0,{*} static_boolean_array[-1] File "arc4_types/bool.py", line 33 + getbit // {getbit} static_boolean_array[-1] File "arc4_types/bool.py", line 33 + byte 0x00 // is_true%35#0,0x00 static_boolean_array[-1] File "arc4_types/bool.py", line 33 + int 0 // is_true%35#0,0x00,0 + uncover 2 // load is_true%35#0 from l-stack (no copy) 0x00,0,is_true%35#0 static_boolean_array[-1] File "arc4_types/bool.py", line 33 + setbit // {setbit} static_boolean_array[-1] File "arc4_types/bool.py", line 33 + byte 0x00 // tmp%36#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 33 + int 0 // tmp%36#0,0x00,0 + int 1 // tmp%36#0,0x00,0,1 True File "arc4_types/bool.py", line 33 + setbit // tmp%36#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 33 + == // {==} static_boolean_array[-1] == ARC4Bool(True), "Single boolean can be unpacked" File "arc4_types/bool.py", line 33 + assert // Single boolean can be unpacked // assert static_boolean_array[-1] == ARC4Bool(True), "Single boolean can be unpacked" File "arc4_types/bool.py", line 33 + byte 0x00 // 0x00 ARC4Bool(True) File "arc4_types/bool.py", line 36 + int 0 // 0x00,0 + int 1 // 0x00,0,1 True File "arc4_types/bool.py", line 36 + setbit // {setbit} ARC4Bool(True) File "arc4_types/bool.py", line 36 + byte 0x00 // tmp%39#0,0x00 ARC4Bool(False) File "arc4_types/bool.py", line 36 + int 0 // tmp%39#0,0x00,0 + int 0 // tmp%39#0,0x00,0,0 False File "arc4_types/bool.py", line 36 + setbit // tmp%39#0,{setbit} ARC4Bool(False) File "arc4_types/bool.py", line 36 + byte 0x00 // tmp%39#0,tmp%40#0,0x00 ARC4Bool(True) File "arc4_types/bool.py", line 36 + int 0 // tmp%39#0,tmp%40#0,0x00,0 + int 1 // tmp%39#0,tmp%40#0,0x00,0,1 True File "arc4_types/bool.py", line 36 + setbit // tmp%39#0,tmp%40#0,{setbit} ARC4Bool(True) File "arc4_types/bool.py", line 36 + cover 2 // store tmp%41#0 to l-stack (no copy) tmp%41#0,tmp%39#0,tmp%40#0 ARC4Bool(True) File "arc4_types/bool.py", line 36 + byte 0x0003 // tmp%41#0,tmp%39#0,tmp%40#0,0x0003 DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + uncover 2 // load tmp%39#0 from l-stack (no copy) tmp%41#0,tmp%40#0,array_data%42#0,tmp%39#0 ARC4Bool(True) File "arc4_types/bool.py", line 36 + concat // tmp%41#0,tmp%40#0,{concat} DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + swap // load tmp%40#0 from l-stack (no copy) tmp%41#0,array_data%42#0,tmp%40#0 ARC4Bool(False) File "arc4_types/bool.py", line 36 + int 0 // tmp%41#0,array_data%42#0,tmp%40#0,0 + getbit // tmp%41#0,array_data%42#0,{getbit} DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + swap // load array_data%42#0 from l-stack (no copy) tmp%41#0,is_true%43#0,array_data%42#0 DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + int 17 // tmp%41#0,is_true%43#0,array_data%42#0,17 DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + uncover 2 // load is_true%43#0 from l-stack (no copy) tmp%41#0,array_data%42#0,17,is_true%43#0 DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + setbit // tmp%41#0,{setbit} DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + swap // load tmp%41#0 from l-stack (no copy) array_data%42#0,tmp%41#0 ARC4Bool(True) File "arc4_types/bool.py", line 36 + int 0 // array_data%42#0,tmp%41#0,0 + getbit // array_data%42#0,{getbit} DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + swap // load array_data%42#0 from l-stack (no copy) is_true%44#0,array_data%42#0 DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + int 18 // is_true%44#0,array_data%42#0,18 DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + uncover 2 // load is_true%44#0 from l-stack (no copy) array_data%42#0,18,is_true%44#0 DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + setbit // {setbit} DynamicArray[ARC4Bool]( File "arc4_types/bool.py", line 35 + byte 0x0003a0 // dynamic_boolean_array#0,0x0003a0 Bytes.from_hex("0003A0") File "arc4_types/bool.py", line 39 + == // {==} dynamic_boolean_array.bytes == Bytes.from_hex("0003A0") File "arc4_types/bool.py", line 39 + assert // assert dynamic_boolean_array.bytes == Bytes.from_hex("0003A0") File "arc4_types/bool.py", line 39 + int 1 // 1 True File "arc4_types/bool.py", line 41 + return // return True File "arc4_types/bool.py", line 41 + + +// examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true#0: bytes, false#0: bytes) -> void: +test_stuff: + proto 2 0 // (𝕡) true#0,false#0 | def test_stuff(self, true: ARC4Bool, false: ARC4Bool) -> None: File "arc4_types/bool.py", line 47 + +test_stuff_block@0: + frame_dig -2 // load true#0 from parameters (𝕡) true#0,false#0 | true#0 true: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | true#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} true.decode() File "arc4_types/bool.py", line 48 + assert // (𝕡) true#0,false#0 | assert true.decode() File "arc4_types/bool.py", line 48 + frame_dig -1 // load false#0 from parameters (𝕡) true#0,false#0 | false#0 false: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | false#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} false.decode() File "arc4_types/bool.py", line 50 + ! // (𝕡) true#0,false#0 | {!} not false.decode() File "arc4_types/bool.py", line 50 + assert // (𝕡) true#0,false#0 | assert not false.decode() File "arc4_types/bool.py", line 50 + frame_dig -2 // load true#0 from parameters (𝕡) true#0,false#0 | true#0 true: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | true#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} true.decode() File "arc4_types/bool.py", line 52 + byte 0x00 // (𝕡) true#0,false#0 | tmp%3#0,0x00 ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + int 0 // (𝕡) true#0,false#0 | tmp%3#0,0x00,0 + uncover 2 // load tmp%3#0 from l-stack (no copy) (𝕡) true#0,false#0 | 0x00,0,tmp%3#0 true.decode() File "arc4_types/bool.py", line 52 + setbit // (𝕡) true#0,false#0 | {setbit} ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + frame_dig -2 // load true#0 from parameters (𝕡) true#0,false#0 | tmp%4#0,true#0 true: ARC4Bool File "arc4_types/bool.py", line 47 + == // (𝕡) true#0,false#0 | {==} true == ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + assert // (𝕡) true#0,false#0 | assert true == ARC4Bool.encode(true.decode()) File "arc4_types/bool.py", line 52 + frame_dig -1 // load false#0 from parameters (𝕡) true#0,false#0 | false#0 false: ARC4Bool File "arc4_types/bool.py", line 47 + int 0 // (𝕡) true#0,false#0 | false#0,0 + getbit // (𝕡) true#0,false#0 | {getbit} false.decode() File "arc4_types/bool.py", line 53 + byte 0x00 // (𝕡) true#0,false#0 | tmp%6#0,0x00 ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + int 0 // (𝕡) true#0,false#0 | tmp%6#0,0x00,0 + uncover 2 // load tmp%6#0 from l-stack (no copy) (𝕡) true#0,false#0 | 0x00,0,tmp%6#0 false.decode() File "arc4_types/bool.py", line 53 + setbit // (𝕡) true#0,false#0 | {setbit} ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + frame_dig -1 // load false#0 from parameters (𝕡) true#0,false#0 | tmp%7#0,false#0 false: ARC4Bool File "arc4_types/bool.py", line 47 + == // (𝕡) true#0,false#0 | {==} false == ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + assert // (𝕡) true#0,false#0 | assert false == ARC4Bool.encode(false.decode()) File "arc4_types/bool.py", line 53 + retsub // + diff --git a/examples/arc4_types/out/bool.approval_unoptimized.teal b/examples/arc4_types/out/bool.approval_unoptimized.teal new file mode 100644 index 0000000000..103730068c --- /dev/null +++ b/examples/arc4_types/out/bool.approval_unoptimized.teal @@ -0,0 +1,259 @@ +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: +main_block@0: + byte 0x00 + int 0 + int 1 + setbit + byte 0x00 + int 0 + int 0 + setbit + callsub test_stuff + byte 0x00 + int 0 + int 1 + setbit + byte 0x00 + int 0 + int 1 + setbit + byte 0x00 + int 0 + int 1 + setbit + cover 2 + byte 0x00 + int 0 + int 1 + setbit + cover 3 + byte 0x00 + int 0 + int 1 + setbit + cover 4 + byte 0x00 + int 0 + int 1 + setbit + cover 5 + byte 0x00 + int 0 + int 1 + setbit + cover 6 + byte 0x00 + int 0 + int 1 + setbit + cover 7 + byte 0x00 + int 0 + int 1 + setbit + cover 8 + byte 0x00 + int 0 + int 1 + setbit + cover 8 + byte 0x00 + int 0 + int 1 + setbit + cover 10 + byte 0x00 + int 0 + int 1 + setbit + cover 11 + byte 0x + uncover 2 + concat + swap + int 0 + getbit + swap + int 1 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 2 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 3 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 4 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 5 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 6 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 7 + uncover 2 + setbit + uncover 2 + concat + swap + int 0 + getbit + swap + int 9 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 10 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 11 + uncover 2 + setbit + dup + byte 0xfff0 + == + assert + int 0 + int 1 + * + dig 1 + swap + getbit + byte 0x00 + int 0 + uncover 2 + setbit + byte 0x00 + int 0 + int 1 + setbit + == + assert // Single boolean can be unpacked + int 12 + int 1 + - + int 12 + dig 1 + > + assert // Index access is out of bounds + int 1 + * + getbit + byte 0x00 + int 0 + uncover 2 + setbit + byte 0x00 + int 0 + int 1 + setbit + == + assert // Single boolean can be unpacked + byte 0x00 + int 0 + int 1 + setbit + byte 0x00 + int 0 + int 0 + setbit + byte 0x00 + int 0 + int 1 + setbit + cover 2 + byte 0x0003 + uncover 2 + concat + swap + int 0 + getbit + swap + int 17 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 18 + uncover 2 + setbit + byte 0x0003a0 + == + assert + int 1 + return + + +// examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true#0: bytes, false#0: bytes) -> void: +test_stuff: + proto 2 0 + +test_stuff_block@0: + frame_dig -2 + int 0 + getbit + assert + frame_dig -1 + int 0 + getbit + ! + assert + frame_dig -2 + int 0 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + frame_dig -2 + == + assert + frame_dig -1 + int 0 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + frame_dig -1 + == + assert + retsub + diff --git a/examples/arc4_types/out/bool.awst b/examples/arc4_types/out/bool.awst new file mode 100644 index 0000000000..955fc3aff5 --- /dev/null +++ b/examples/arc4_types/out/bool.awst @@ -0,0 +1,27 @@ +contract Arc4BoolTypeContract +{ + approval_program(): bool + { + this::test_stuff(arc4_encode(true, algopy.arc4.Bool), arc4_encode(false, algopy.arc4.Bool)) + static_boolean_array: algopy.arc4.StaticArray[algopy.arc4.Bool, typing.Literal[12]] = arc4_array_encode([arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool)], algopy.arc4.StaticArray[algopy.arc4.Bool, typing.Literal[12]]) + assert(reinterpret_cast(static_boolean_array) == hex<"FFF0">) + assert(reinterpret_cast(static_boolean_array[0u]) == reinterpret_cast(arc4_encode(true, algopy.arc4.Bool)), comment="Single boolean can be unpacked") + assert(reinterpret_cast(static_boolean_array[12u - 1u]) == reinterpret_cast(arc4_encode(true, algopy.arc4.Bool)), comment="Single boolean can be unpacked") + dynamic_boolean_array: algopy.arc4.DynamicArray[algopy.arc4.Bool] = arc4_array_encode([arc4_encode(true, algopy.arc4.Bool), arc4_encode(false, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool)], algopy.arc4.DynamicArray[algopy.arc4.Bool]) + assert(reinterpret_cast(dynamic_boolean_array) == hex<"0003A0">) + return true + } + + clear_state_program(): bool + { + return true + } + + subroutine test_stuff(true: algopy.arc4.Bool, false: algopy.arc4.Bool): None + { + assert(arc4_decode(true, bool)) + assert(!(arc4_decode(false, bool))) + assert(reinterpret_cast(true) == reinterpret_cast(arc4_encode(arc4_decode(true, bool), algopy.arc4.Bool))) + assert(reinterpret_cast(false) == reinterpret_cast(arc4_encode(arc4_decode(false, bool), algopy.arc4.Bool))) + } +} \ No newline at end of file diff --git a/examples/arc4_types/out/bool.clear.debug.teal b/examples/arc4_types/out/bool.clear.debug.teal new file mode 100644 index 0000000000..33916b5770 --- /dev/null +++ b/examples/arc4_types/out/bool.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/bool.py", line 44 + return // return True File "arc4_types/bool.py", line 44 + diff --git a/examples/arc4_types/out/bool.clear.teal b/examples/arc4_types/out/bool.clear.teal new file mode 100644 index 0000000000..215f37d278 --- /dev/null +++ b/examples/arc4_types/out/bool.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/bool.clear_unoptimized.debug.teal b/examples/arc4_types/out/bool.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..33916b5770 --- /dev/null +++ b/examples/arc4_types/out/bool.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/bool.py", line 44 + return // return True File "arc4_types/bool.py", line 44 + diff --git a/examples/arc4_types/out/bool.clear_unoptimized.teal b/examples/arc4_types/out/bool.clear_unoptimized.teal new file mode 100644 index 0000000000..215f37d278 --- /dev/null +++ b/examples/arc4_types/out/bool.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.cssa.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.cssa.ir new file mode 100644 index 0000000000..a655ff46d9 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.cssa.ir @@ -0,0 +1,28 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.final.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.final.ir new file mode 100644 index 0000000000..a655ff46d9 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.final.ir @@ -0,0 +1,28 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.final_unoptimized.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.final_unoptimized.ir new file mode 100644 index 0000000000..3fc0eec6f7 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.final_unoptimized.ir @@ -0,0 +1,96 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + let tmp%0#0: any = (setbit 0x00 0u 1u) + let tmp%1#0: any = (setbit 0x00 0u 0u) + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(tmp%0#0, tmp%1#0) + let tmp%2#0: any = (setbit 0x00 0u 1u) + let tmp%3#0: any = (setbit 0x00 0u 1u) + let tmp%4#0: any = (setbit 0x00 0u 1u) + let tmp%5#0: any = (setbit 0x00 0u 1u) + let tmp%6#0: any = (setbit 0x00 0u 1u) + let tmp%7#0: any = (setbit 0x00 0u 1u) + let tmp%8#0: any = (setbit 0x00 0u 1u) + let tmp%9#0: any = (setbit 0x00 0u 1u) + let tmp%10#0: any = (setbit 0x00 0u 1u) + let tmp%11#0: any = (setbit 0x00 0u 1u) + let tmp%12#0: any = (setbit 0x00 0u 1u) + let tmp%13#0: any = (setbit 0x00 0u 1u) + let array_data%14#0: bytes = 0x + let array_data%14#0: bytes = (concat array_data%14#0 tmp%2#0) + let is_true%15#0: uint64 = (getbit tmp%3#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 1u is_true%15#0) + let is_true%16#0: uint64 = (getbit tmp%4#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 2u is_true%16#0) + let is_true%17#0: uint64 = (getbit tmp%5#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 3u is_true%17#0) + let is_true%18#0: uint64 = (getbit tmp%6#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 4u is_true%18#0) + let is_true%19#0: uint64 = (getbit tmp%7#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 5u is_true%19#0) + let is_true%20#0: uint64 = (getbit tmp%8#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 6u is_true%20#0) + let is_true%21#0: uint64 = (getbit tmp%9#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 7u is_true%21#0) + let array_data%14#0: bytes = (concat array_data%14#0 tmp%10#0) + let is_true%22#0: uint64 = (getbit tmp%11#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 9u is_true%22#0) + let is_true%23#0: uint64 = (getbit tmp%12#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 10u is_true%23#0) + let is_true%24#0: uint64 = (getbit tmp%13#0 0u) + let array_data%14#0: bytes = (setbit array_data%14#0 11u is_true%24#0) + let static_boolean_array#0: any = array_data%14#0 + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let item_index%26#0: uint64 = (* 0u 1u) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 item_index%26#0) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%29#0: any = (setbit 0x00 0u 1u) + let tmp%30#0: uint64 = (== tmp%28#0 tmp%29#0) + (assert tmp%30#0) // Single boolean can be unpacked + let tmp%31#0: uint64 = (- 12u 1u) + let array_length%32#0: uint64 = 12u + let index_is_in_bounds%33#0: uint64 = (< tmp%31#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let item_index%34#0: uint64 = (* tmp%31#0 1u) + let is_true%35#0: uint64 = (getbit static_boolean_array#0 item_index%34#0) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%37#0: any = (setbit 0x00 0u 1u) + let tmp%38#0: uint64 = (== tmp%36#0 tmp%37#0) + (assert tmp%38#0) // Single boolean can be unpacked + let tmp%39#0: any = (setbit 0x00 0u 1u) + let tmp%40#0: any = (setbit 0x00 0u 0u) + let tmp%41#0: any = (setbit 0x00 0u 1u) + let array_data%42#0: bytes = 0x0003 + let array_data%42#0: bytes = (concat array_data%42#0 tmp%39#0) + let is_true%43#0: uint64 = (getbit tmp%40#0 0u) + let array_data%42#0: bytes = (setbit array_data%42#0 17u is_true%43#0) + let is_true%44#0: uint64 = (getbit tmp%41#0 0u) + let array_data%42#0: bytes = (setbit array_data%42#0 18u is_true%44#0) + let dynamic_boolean_array#0: any = array_data%42#0 + let tmp%45#0: uint64 = (== dynamic_boolean_array#0 0x0003a0) + (assert tmp%45#0) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.parallel_copies.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.parallel_copies.ir new file mode 100644 index 0000000000..a655ff46d9 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.parallel_copies.ir @@ -0,0 +1,28 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.post_ssa.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.post_ssa.ir new file mode 100644 index 0000000000..a655ff46d9 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.post_ssa.ir @@ -0,0 +1,28 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.ir new file mode 100644 index 0000000000..65ccb463f8 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.ir @@ -0,0 +1,96 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + let tmp%0#0: any = (setbit 0x00 0u 1u) + let tmp%1#0: any = (setbit 0x00 0u 0u) + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(tmp%0#0, tmp%1#0) + let tmp%2#0: any = (setbit 0x00 0u 1u) + let tmp%3#0: any = (setbit 0x00 0u 1u) + let tmp%4#0: any = (setbit 0x00 0u 1u) + let tmp%5#0: any = (setbit 0x00 0u 1u) + let tmp%6#0: any = (setbit 0x00 0u 1u) + let tmp%7#0: any = (setbit 0x00 0u 1u) + let tmp%8#0: any = (setbit 0x00 0u 1u) + let tmp%9#0: any = (setbit 0x00 0u 1u) + let tmp%10#0: any = (setbit 0x00 0u 1u) + let tmp%11#0: any = (setbit 0x00 0u 1u) + let tmp%12#0: any = (setbit 0x00 0u 1u) + let tmp%13#0: any = (setbit 0x00 0u 1u) + let array_data%14#0: bytes = 0x + let array_data%14#1: bytes = (concat array_data%14#0 tmp%2#0) + let is_true%15#0: uint64 = (getbit tmp%3#0 0u) + let array_data%14#2: any = (setbit array_data%14#1 1u is_true%15#0) + let is_true%16#0: uint64 = (getbit tmp%4#0 0u) + let array_data%14#3: any = (setbit array_data%14#2 2u is_true%16#0) + let is_true%17#0: uint64 = (getbit tmp%5#0 0u) + let array_data%14#4: any = (setbit array_data%14#3 3u is_true%17#0) + let is_true%18#0: uint64 = (getbit tmp%6#0 0u) + let array_data%14#5: any = (setbit array_data%14#4 4u is_true%18#0) + let is_true%19#0: uint64 = (getbit tmp%7#0 0u) + let array_data%14#6: any = (setbit array_data%14#5 5u is_true%19#0) + let is_true%20#0: uint64 = (getbit tmp%8#0 0u) + let array_data%14#7: any = (setbit array_data%14#6 6u is_true%20#0) + let is_true%21#0: uint64 = (getbit tmp%9#0 0u) + let array_data%14#8: any = (setbit array_data%14#7 7u is_true%21#0) + let array_data%14#9: bytes = (concat array_data%14#8 tmp%10#0) + let is_true%22#0: uint64 = (getbit tmp%11#0 0u) + let array_data%14#10: any = (setbit array_data%14#9 9u is_true%22#0) + let is_true%23#0: uint64 = (getbit tmp%12#0 0u) + let array_data%14#11: any = (setbit array_data%14#10 10u is_true%23#0) + let is_true%24#0: uint64 = (getbit tmp%13#0 0u) + let array_data%14#12: any = (setbit array_data%14#11 11u is_true%24#0) + let static_boolean_array#0: any = array_data%14#12 + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let item_index%26#0: uint64 = (* 0u 1u) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 item_index%26#0) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%29#0: any = (setbit 0x00 0u 1u) + let tmp%30#0: uint64 = (== tmp%28#0 tmp%29#0) + (assert tmp%30#0) // Single boolean can be unpacked + let tmp%31#0: uint64 = (- 12u 1u) + let array_length%32#0: uint64 = 12u + let index_is_in_bounds%33#0: uint64 = (< tmp%31#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let item_index%34#0: uint64 = (* tmp%31#0 1u) + let is_true%35#0: uint64 = (getbit static_boolean_array#0 item_index%34#0) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%37#0: any = (setbit 0x00 0u 1u) + let tmp%38#0: uint64 = (== tmp%36#0 tmp%37#0) + (assert tmp%38#0) // Single boolean can be unpacked + let tmp%39#0: any = (setbit 0x00 0u 1u) + let tmp%40#0: any = (setbit 0x00 0u 0u) + let tmp%41#0: any = (setbit 0x00 0u 1u) + let array_data%42#0: bytes = 0x0003 + let array_data%42#1: bytes = (concat array_data%42#0 tmp%39#0) + let is_true%43#0: uint64 = (getbit tmp%40#0 0u) + let array_data%42#2: any = (setbit array_data%42#1 17u is_true%43#0) + let is_true%44#0: uint64 = (getbit tmp%41#0 0u) + let array_data%42#3: any = (setbit array_data%42#2 18u is_true%44#0) + let dynamic_boolean_array#0: any = array_data%42#3 + let tmp%45#0: uint64 = (== dynamic_boolean_array#0 0x0003a0) + (assert tmp%45#0) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_1.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..1f076b27d7 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_1.ir @@ -0,0 +1,69 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#1: bytes = (concat 0x 0x80) + let is_true%15#0: uint64 = (getbit 0x80 0u) + let array_data%14#2: any = (setbit array_data%14#1 1u is_true%15#0) + let is_true%16#0: uint64 = (getbit 0x80 0u) + let array_data%14#3: any = (setbit array_data%14#2 2u is_true%16#0) + let is_true%17#0: uint64 = (getbit 0x80 0u) + let array_data%14#4: any = (setbit array_data%14#3 3u is_true%17#0) + let is_true%18#0: uint64 = (getbit 0x80 0u) + let array_data%14#5: any = (setbit array_data%14#4 4u is_true%18#0) + let is_true%19#0: uint64 = (getbit 0x80 0u) + let array_data%14#6: any = (setbit array_data%14#5 5u is_true%19#0) + let is_true%20#0: uint64 = (getbit 0x80 0u) + let array_data%14#7: any = (setbit array_data%14#6 6u is_true%20#0) + let is_true%21#0: uint64 = (getbit 0x80 0u) + let array_data%14#8: any = (setbit array_data%14#7 7u is_true%21#0) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let is_true%22#0: uint64 = (getbit 0x80 0u) + let array_data%14#10: any = (setbit array_data%14#9 9u is_true%22#0) + let is_true%23#0: uint64 = (getbit 0x80 0u) + let array_data%14#11: any = (setbit array_data%14#10 10u is_true%23#0) + let is_true%24#0: uint64 = (getbit 0x80 0u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u is_true%24#0) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let index_is_in_bounds%33#0: uint64 = (< 11u 12u) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + let array_data%42#1: bytes = (concat 0x0003 0x80) + let is_true%43#0: uint64 = (getbit 0x00 0u) + let array_data%42#2: any = (setbit array_data%42#1 17u is_true%43#0) + let is_true%44#0: uint64 = (getbit 0x80 0u) + let dynamic_boolean_array#0: any = (setbit array_data%42#2 18u is_true%44#0) + let tmp%45#0: uint64 = (== dynamic_boolean_array#0 0x0003a0) + (assert tmp%45#0) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_10.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_10.ir new file mode 100644 index 0000000000..291a5a0412 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_10.ir @@ -0,0 +1,41 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#10: any = (setbit 0xff80 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_11.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_11.ir new file mode 100644 index 0000000000..ccb6016aec --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_11.ir @@ -0,0 +1,40 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#11: any = (setbit 0xffc0 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_12.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_12.ir new file mode 100644 index 0000000000..046e642e2f --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_12.ir @@ -0,0 +1,39 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let static_boolean_array#0: any = (setbit 0xffe0 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_13.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_13.ir new file mode 100644 index 0000000000..07cb29b42d --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_13.ir @@ -0,0 +1,38 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let tmp%25#0: uint64 = (== 0xfff0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit 0xfff0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit 0xfff0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_14.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_14.ir new file mode 100644 index 0000000000..38e0c53162 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_14.ir @@ -0,0 +1,34 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let tmp%28#0: any = (setbit 0x00 0u 1u) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let tmp%36#0: any = (setbit 0x00 0u 1u) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_15.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_15.ir new file mode 100644 index 0000000000..990a4bce82 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_15.ir @@ -0,0 +1,32 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let tmp%30#0: uint64 = (== 0x80 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let tmp%38#0: uint64 = (== 0x80 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_16.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_16.ir new file mode 100644 index 0000000000..a655ff46d9 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_16.ir @@ -0,0 +1,28 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_2.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..b8fa71da89 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_2.ir @@ -0,0 +1,53 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#2: any = (setbit 0x80 1u 1u) + let array_data%14#3: any = (setbit array_data%14#2 2u 1u) + let array_data%14#4: any = (setbit array_data%14#3 3u 1u) + let array_data%14#5: any = (setbit array_data%14#4 4u 1u) + let array_data%14#6: any = (setbit array_data%14#5 5u 1u) + let array_data%14#7: any = (setbit array_data%14#6 6u 1u) + let array_data%14#8: any = (setbit array_data%14#7 7u 1u) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + let array_data%42#2: any = (setbit 0x000380 17u 0u) + let dynamic_boolean_array#0: any = (setbit array_data%42#2 18u 1u) + let tmp%45#0: uint64 = (== dynamic_boolean_array#0 0x0003a0) + (assert tmp%45#0) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_3.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..7dca1f484e --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_3.ir @@ -0,0 +1,51 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#3: any = (setbit 0xc0 2u 1u) + let array_data%14#4: any = (setbit array_data%14#3 3u 1u) + let array_data%14#5: any = (setbit array_data%14#4 4u 1u) + let array_data%14#6: any = (setbit array_data%14#5 5u 1u) + let array_data%14#7: any = (setbit array_data%14#6 6u 1u) + let array_data%14#8: any = (setbit array_data%14#7 7u 1u) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + let dynamic_boolean_array#0: any = (setbit 0x000380 18u 1u) + let tmp%45#0: uint64 = (== dynamic_boolean_array#0 0x0003a0) + (assert tmp%45#0) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_4.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..81034dfaf5 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_4.ir @@ -0,0 +1,49 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#4: any = (setbit 0xe0 3u 1u) + let array_data%14#5: any = (setbit array_data%14#4 4u 1u) + let array_data%14#6: any = (setbit array_data%14#5 5u 1u) + let array_data%14#7: any = (setbit array_data%14#6 6u 1u) + let array_data%14#8: any = (setbit array_data%14#7 7u 1u) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + let tmp%45#0: uint64 = (== 0x0003a0 0x0003a0) + (assert tmp%45#0) + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_5.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..5953cf1c0c --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_5.ir @@ -0,0 +1,46 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#5: any = (setbit 0xf0 4u 1u) + let array_data%14#6: any = (setbit array_data%14#5 5u 1u) + let array_data%14#7: any = (setbit array_data%14#6 6u 1u) + let array_data%14#8: any = (setbit array_data%14#7 7u 1u) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_6.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..e3ed384733 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_6.ir @@ -0,0 +1,45 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#6: any = (setbit 0xf8 5u 1u) + let array_data%14#7: any = (setbit array_data%14#6 6u 1u) + let array_data%14#8: any = (setbit array_data%14#7 7u 1u) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_7.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_7.ir new file mode 100644 index 0000000000..33ec49ed40 --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_7.ir @@ -0,0 +1,44 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#7: any = (setbit 0xfc 6u 1u) + let array_data%14#8: any = (setbit array_data%14#7 7u 1u) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_8.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_8.ir new file mode 100644 index 0000000000..8f496df18d --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_8.ir @@ -0,0 +1,43 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#8: any = (setbit 0xfe 7u 1u) + let array_data%14#9: bytes = (concat array_data%14#8 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_9.ir b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_9.ir new file mode 100644 index 0000000000..7e968cf04f --- /dev/null +++ b/examples/arc4_types/out/bool_Arc4BoolTypeContract.ssa.opt_pass_9.ir @@ -0,0 +1,42 @@ +contract examples.arc4_types.bool.Arc4BoolTypeContract: + program approval: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.approval_program() -> uint64: + block@0: // L12 + examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(0x80, 0x00) + let array_data%14#9: bytes = (concat 0xff 0x80) + let array_data%14#10: any = (setbit array_data%14#9 9u 1u) + let array_data%14#11: any = (setbit array_data%14#10 10u 1u) + let static_boolean_array#0: any = (setbit array_data%14#11 11u 1u) + let tmp%25#0: uint64 = (== static_boolean_array#0 0xfff0) + (assert tmp%25#0) + let is_true%27#0: uint64 = (getbit static_boolean_array#0 0u) + let tmp%28#0: any = (setbit 0x00 0u is_true%27#0) + let tmp%30#0: uint64 = (== tmp%28#0 0x80) + (assert tmp%30#0) // Single boolean can be unpacked + let is_true%35#0: uint64 = (getbit static_boolean_array#0 11u) + let tmp%36#0: any = (setbit 0x00 0u is_true%35#0) + let tmp%38#0: uint64 = (== tmp%36#0 0x80) + (assert tmp%38#0) // Single boolean can be unpacked + return 1u + + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.test_stuff(true: bytes, false: bytes) -> void: + block@0: // L47 + let tmp%0#0: uint64 = (getbit true#0 0u) + (assert tmp%0#0) + let tmp%1#0: uint64 = (getbit false#0 0u) + let tmp%2#0: uint64 = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: uint64 = (getbit true#0 0u) + let tmp%4#0: any = (setbit 0x00 0u tmp%3#0) + let tmp%5#0: uint64 = (== true#0 tmp%4#0) + (assert tmp%5#0) + let tmp%6#0: uint64 = (getbit false#0 0u) + let tmp%7#0: any = (setbit 0x00 0u tmp%6#0) + let tmp%8#0: uint64 = (== false#0 tmp%7#0) + (assert tmp%8#0) + return + + program clear-state: + subroutine examples.arc4_types.bool.Arc4BoolTypeContract.clear_state_program() -> uint64: + block@0: // L43 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array.approval.debug.teal b/examples/arc4_types/out/dynamic_string_array.approval.debug.teal new file mode 100644 index 0000000000..c547ee3720 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.approval.debug.teal @@ -0,0 +1,120 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + bz main_bare_routing@6 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + // Implicit fall through to main_abi_routing@1 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_abi_routing@1: + txna ApplicationArgs 0 // {txna} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + method "xyz()string[]" // tmp%1#0,method<"xyz()string[]"> arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + method "xyz_raw()string[]" // tmp%1#0,method<"xyz()string[]">,method<"xyz_raw()string[]"> arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + uncover 2 // load tmp%1#0 from l-stack (no copy) method<"xyz()string[]">,method<"xyz_raw()string[]">,tmp%1#0 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + match main_xyz_route@2 main_xyz_raw_route@3 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + b main_switch_case_default@4 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_xyz_route@2: + txn OnCompletion // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + ! // {!} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + assert // OnCompletion is NoOp // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + txn ApplicationID // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + assert // is not creating // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + callsub xyz // {xyz} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + byte 0x151f7c75 // tmp%5#0,0x151f7c75 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + swap // load tmp%5#0 from l-stack (no copy) 0x151f7c75,tmp%5#0 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + concat // {concat} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + log // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + int 1 // 1 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + return // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + +main_xyz_raw_route@3: + txn OnCompletion // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + ! // {!} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + assert // OnCompletion is NoOp // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + txn ApplicationID // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + assert // is not creating // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + callsub xyz_raw // {xyz_raw} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + byte 0x151f7c75 // tmp%10#0,0x151f7c75 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + swap // load tmp%10#0 from l-stack (no copy) 0x151f7c75,tmp%10#0 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + concat // {concat} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + log // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + int 1 // 1 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + return // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + +main_switch_case_default@4: + err // reject transaction // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_bare_routing@6: + txn OnCompletion // {txn} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + bnz main_reject_bare_on_completion@8 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + // Implicit fall through to main_create@7 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_create@7: + txn ApplicationID // {txn} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + ! // {!} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + assert // is creating // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + int 1 // 1 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + return // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_reject_bare_on_completion@8: + err // reject transaction // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: +xyz: + proto 0 1 // def xyz(self) -> arc4.DynamicArray[arc4.String]: File "arc4_types/dynamic_string_array.py", line 6 + +xyz_block@0: + int 6 // 6 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + itob // {itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + extract 6 2 // {extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte 0x0003 // value_as_uint16%3#0,0x0003 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + swap // load value_as_uint16%3#0 from l-stack (no copy) 0x0003,value_as_uint16%3#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + int 9 // array_data%0#1,9 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + itob // array_data%0#1,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + extract 6 2 // array_data%0#1,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + int 12 // array_data%0#1,12 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + itob // array_data%0#1,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + extract 6 2 // array_data%0#1,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01X" // array_data%0#1,"\x00\x01X" arc4.String("X") File "arc4_types/dynamic_string_array.py", line 8 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01Y" // array_data%0#1,"\x00\x01Y" arc4.String("Y") File "arc4_types/dynamic_string_array.py", line 9 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01Z" // array_data%0#1,"\x00\x01Z" arc4.String("Z") File "arc4_types/dynamic_string_array.py", line 10 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + retsub // array_data%0#1 return arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: +xyz_raw: + proto 0 1 // def xyz_raw(self) -> arc4.DynamicArray[arc4.String]: File "arc4_types/dynamic_string_array.py", line 14 + +xyz_raw_block@0: + int 6 // 6 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + itob // {itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + extract 6 2 // {extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + byte 0x0003 // value_as_uint16%6#0,0x0003 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // load value_as_uint16%6#0 from l-stack (no copy) 0x0003,value_as_uint16%6#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + int 9 // array_data%3#1,9 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + itob // array_data%3#1,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + extract 6 2 // array_data%3#1,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + int 12 // array_data%3#1,12 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + itob // array_data%3#1,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + extract 6 2 // array_data%3#1,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + byte 0x000158 // array_data%3#1,0x000158 arc4.DynamicArray(arc4.Byte(88)) File "arc4_types/dynamic_string_array.py", line 16 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + byte 0x000159 // array_data%3#1,0x000159 arc4.DynamicArray(arc4.Byte(89)) File "arc4_types/dynamic_string_array.py", line 17 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + byte 0x00015a // array_data%3#1,0x00015a arc4.DynamicArray(arc4.Byte(90)) File "arc4_types/dynamic_string_array.py", line 18 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + retsub // raw#0 return arc4.DynamicArray[arc4.String].from_bytes(raw.bytes) File "arc4_types/dynamic_string_array.py", line 20 + diff --git a/examples/arc4_types/out/dynamic_string_array.approval.teal b/examples/arc4_types/out/dynamic_string_array.approval.teal new file mode 100644 index 0000000000..78df98a46c --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.approval.teal @@ -0,0 +1,116 @@ +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs + bz main_bare_routing@6 + +main_abi_routing@1: + txna ApplicationArgs 0 + method "xyz()string[]" + method "xyz_raw()string[]" + uncover 2 + match main_xyz_route@2 main_xyz_raw_route@3 + b main_switch_case_default@4 + +main_xyz_route@2: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub xyz + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_xyz_raw_route@3: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub xyz_raw + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_switch_case_default@4: + err // reject transaction + +main_bare_routing@6: + txn OnCompletion + bnz main_reject_bare_on_completion@8 + +main_create@7: + txn ApplicationID + ! + assert // is creating + int 1 + return + +main_reject_bare_on_completion@8: + err // reject transaction + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: +xyz: + proto 0 1 + +xyz_block@0: + int 6 + itob + extract 6 2 + byte 0x0003 + swap + concat + int 9 + itob + extract 6 2 + concat + int 12 + itob + extract 6 2 + concat + byte "\x00\x01X" + concat + byte "\x00\x01Y" + concat + byte "\x00\x01Z" + concat + retsub + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: +xyz_raw: + proto 0 1 + +xyz_raw_block@0: + int 6 + itob + extract 6 2 + byte 0x0003 + swap + concat + int 9 + itob + extract 6 2 + concat + int 12 + itob + extract 6 2 + concat + byte 0x000158 + concat + byte 0x000159 + concat + byte 0x00015a + concat + retsub + diff --git a/examples/arc4_types/out/dynamic_string_array.approval_unoptimized.debug.teal b/examples/arc4_types/out/dynamic_string_array.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..06d430daa8 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.approval_unoptimized.debug.teal @@ -0,0 +1,179 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + bz main_bare_routing@6 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + // Implicit fall through to main_abi_routing@1 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_abi_routing@1: + txna ApplicationArgs 0 // {txna} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + method "xyz()string[]" // tmp%1#0,method<"xyz()string[]"> arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + method "xyz_raw()string[]" // tmp%1#0,method<"xyz()string[]">,method<"xyz_raw()string[]"> arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + uncover 2 // load tmp%1#0 from l-stack (no copy) method<"xyz()string[]">,method<"xyz_raw()string[]">,tmp%1#0 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + match main_xyz_route@2 main_xyz_raw_route@3 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + b main_switch_case_default@4 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_xyz_route@2: + txn OnCompletion // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + int NoOp // tmp%2#0,NoOp arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + == // {==} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + assert // OnCompletion is NoOp // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + txn ApplicationID // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + assert // is not creating // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + callsub xyz // {xyz} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + byte 0x151f7c75 // tmp%5#0,0x151f7c75 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + swap // load tmp%5#0 from l-stack (no copy) 0x151f7c75,tmp%5#0 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + concat // {concat} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + log // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + int 1 // 1 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + return // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 5 + +main_xyz_raw_route@3: + txn OnCompletion // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + int NoOp // tmp%7#0,NoOp arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + == // {==} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + assert // OnCompletion is NoOp // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + txn ApplicationID // {txn} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + assert // is not creating // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + callsub xyz_raw // {xyz_raw} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + byte 0x151f7c75 // tmp%10#0,0x151f7c75 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + swap // load tmp%10#0 from l-stack (no copy) 0x151f7c75,tmp%10#0 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + concat // {concat} arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + log // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + int 1 // 1 arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + return // arc4.abimethod File "arc4_types/dynamic_string_array.py", line 13 + +main_switch_case_default@4: + // Implicit fall through to main_switch_case_next@5 // + +main_switch_case_next@5: + b main_after_if_else@9 // + +main_bare_routing@6: + txn OnCompletion // {txn} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + int 0 // tmp%12#0,0 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + swap // load tmp%12#0 from l-stack (no copy) 0,tmp%12#0 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + match main_create@7 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + b main_reject_bare_on_completion@8 // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_create@7: + txn ApplicationID // {txn} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + ! // {!} class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + assert // is creating // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + int 1 // 1 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + return // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_reject_bare_on_completion@8: + err // reject transaction // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + +main_after_if_else@9: + err // reject transaction // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: +xyz: + proto 0 1 // def xyz(self) -> arc4.DynamicArray[arc4.String]: File "arc4_types/dynamic_string_array.py", line 6 + +xyz_block@0: + byte 0x0003 // 0x0003 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + int 6 // array_data%0#0,6 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + dup // load next_offset%1#0 from l-stack (copy) array_data%0#0,next_offset%1#0,next_offset%1#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + itob // array_data%0#0,next_offset%1#0,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + extract 6 2 // array_data%0#0,next_offset%1#0,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + uncover 2 // load array_data%0#0 from l-stack (no copy) next_offset%1#0,value_as_uint16%3#0,array_data%0#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + swap // load value_as_uint16%3#0 from l-stack (no copy) next_offset%1#0,array_data%0#0,value_as_uint16%3#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + concat // next_offset%1#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + swap // store array_data%0#0 to l-stack (no copy) array_data%0#0,next_offset%1#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01X" // array_data%0#0,next_offset%1#0,"\x00\x01X" arc4.String("X") File "arc4_types/dynamic_string_array.py", line 8 + len // array_data%0#0,next_offset%1#0,{len} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + + // array_data%0#0,{+} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + dup // load next_offset%1#0 from l-stack (copy) array_data%0#0,next_offset%1#0,next_offset%1#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + itob // array_data%0#0,next_offset%1#0,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + extract 6 2 // array_data%0#0,next_offset%1#0,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + uncover 2 // load array_data%0#0 from l-stack (no copy) next_offset%1#0,value_as_uint16%6#0,array_data%0#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + swap // load value_as_uint16%6#0 from l-stack (no copy) next_offset%1#0,array_data%0#0,value_as_uint16%6#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + concat // next_offset%1#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + swap // store array_data%0#0 to l-stack (no copy) array_data%0#0,next_offset%1#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01Y" // array_data%0#0,next_offset%1#0,"\x00\x01Y" arc4.String("Y") File "arc4_types/dynamic_string_array.py", line 9 + len // array_data%0#0,next_offset%1#0,{len} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + + // array_data%0#0,{+} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + dup // load next_offset%1#0 from l-stack (copy) array_data%0#0,next_offset%1#0,next_offset%1#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + itob // array_data%0#0,next_offset%1#0,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + extract 6 2 // array_data%0#0,next_offset%1#0,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + uncover 2 // load array_data%0#0 from l-stack (no copy) next_offset%1#0,value_as_uint16%9#0,array_data%0#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + swap // load value_as_uint16%9#0 from l-stack (no copy) next_offset%1#0,array_data%0#0,value_as_uint16%9#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + concat // next_offset%1#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01Z" // next_offset%1#0,array_data%0#0,"\x00\x01Z" arc4.String("Z") File "arc4_types/dynamic_string_array.py", line 10 + len // next_offset%1#0,array_data%0#0,{len} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + uncover 2 // load next_offset%1#0 from l-stack (no copy) array_data%0#0,element_length%10#0,next_offset%1#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + + // array_data%0#0,{+} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + pop // array_data%0#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01X" // array_data%0#0,"\x00\x01X" arc4.String("X") File "arc4_types/dynamic_string_array.py", line 8 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01Y" // array_data%0#0,"\x00\x01Y" arc4.String("Y") File "arc4_types/dynamic_string_array.py", line 9 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + byte "\x00\x01Z" // array_data%0#0,"\x00\x01Z" arc4.String("Z") File "arc4_types/dynamic_string_array.py", line 10 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + retsub // array_data%0#0 return arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 7 + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: +xyz_raw: + proto 0 1 // def xyz_raw(self) -> arc4.DynamicArray[arc4.String]: File "arc4_types/dynamic_string_array.py", line 14 + +xyz_raw_block@0: + byte 0x0001 // 0x0001 arc4.DynamicArray(arc4.Byte(88)) File "arc4_types/dynamic_string_array.py", line 16 + byte 0x58 // array_data%0#0,0x58 88 File "arc4_types/dynamic_string_array.py", line 16 + concat // {concat} arc4.DynamicArray(arc4.Byte(88)) File "arc4_types/dynamic_string_array.py", line 16 + byte 0x0001 // array_data%0#0,0x0001 arc4.DynamicArray(arc4.Byte(89)) File "arc4_types/dynamic_string_array.py", line 17 + byte 0x59 // array_data%0#0,array_data%1#0,0x59 89 File "arc4_types/dynamic_string_array.py", line 17 + concat // array_data%0#0,{concat} arc4.DynamicArray(arc4.Byte(89)) File "arc4_types/dynamic_string_array.py", line 17 + swap // store array_data%1#0 to l-stack (no copy) array_data%1#0,array_data%0#0 arc4.DynamicArray(arc4.Byte(89)) File "arc4_types/dynamic_string_array.py", line 17 + byte 0x0001 // array_data%1#0,array_data%0#0,0x0001 arc4.DynamicArray(arc4.Byte(90)) File "arc4_types/dynamic_string_array.py", line 18 + byte 0x5a // array_data%1#0,array_data%0#0,array_data%2#0,0x5a 90 File "arc4_types/dynamic_string_array.py", line 18 + concat // array_data%1#0,array_data%0#0,{concat} arc4.DynamicArray(arc4.Byte(90)) File "arc4_types/dynamic_string_array.py", line 18 + cover 2 // store array_data%2#0 to l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0 arc4.DynamicArray(arc4.Byte(90)) File "arc4_types/dynamic_string_array.py", line 18 + byte 0x0003 // array_data%2#0,array_data%1#0,array_data%0#0,0x0003 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + int 6 // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,6 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + dup // load next_offset%4#0 from l-stack (copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,next_offset%4#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + itob // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + extract 6 2 // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + uncover 2 // load array_data%3#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,value_as_uint16%6#0,array_data%3#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // load value_as_uint16%6#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,array_data%3#0,value_as_uint16%6#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + concat // array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // store array_data%3#0 to l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + dig 2 // load array_data%0#0 from l-stack (copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,array_data%0#0 arc4.DynamicArray(arc4.Byte(88)) File "arc4_types/dynamic_string_array.py", line 16 + len // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{len} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + + // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,{+} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + dup // load next_offset%4#0 from l-stack (copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,next_offset%4#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + itob // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + extract 6 2 // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + uncover 2 // load array_data%3#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,value_as_uint16%9#0,array_data%3#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // load value_as_uint16%9#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,array_data%3#0,value_as_uint16%9#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + concat // array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // store array_data%3#0 to l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + dig 3 // load array_data%1#0 from l-stack (copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,array_data%1#0 arc4.DynamicArray(arc4.Byte(89)) File "arc4_types/dynamic_string_array.py", line 17 + len // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{len} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + + // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,{+} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + dup // load next_offset%4#0 from l-stack (copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,next_offset%4#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + itob // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{itob} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + extract 6 2 // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,next_offset%4#0,{extract} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + uncover 2 // load array_data%3#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,value_as_uint16%12#0,array_data%3#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // load value_as_uint16%12#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,array_data%3#0,value_as_uint16%12#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + concat // array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + dig 4 // load array_data%2#0 from l-stack (copy) array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,array_data%3#0,array_data%2#0 arc4.DynamicArray(arc4.Byte(90)) File "arc4_types/dynamic_string_array.py", line 18 + len // array_data%2#0,array_data%1#0,array_data%0#0,next_offset%4#0,array_data%3#0,{len} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + uncover 2 // load next_offset%4#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,element_length%13#0,next_offset%4#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + + // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0,{+} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + pop // array_data%2#0,array_data%1#0,array_data%0#0,array_data%3#0 arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // load array_data%0#0 from l-stack (no copy) array_data%2#0,array_data%1#0,array_data%3#0,array_data%0#0 arc4.DynamicArray(arc4.Byte(88)) File "arc4_types/dynamic_string_array.py", line 16 + concat // array_data%2#0,array_data%1#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // load array_data%1#0 from l-stack (no copy) array_data%2#0,array_data%3#0,array_data%1#0 arc4.DynamicArray(arc4.Byte(89)) File "arc4_types/dynamic_string_array.py", line 17 + concat // array_data%2#0,{concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + swap // load array_data%2#0 from l-stack (no copy) array_data%3#0,array_data%2#0 arc4.DynamicArray(arc4.Byte(90)) File "arc4_types/dynamic_string_array.py", line 18 + concat // {concat} arc4.DynamicArray( File "arc4_types/dynamic_string_array.py", line 15 + retsub // raw#0 return arc4.DynamicArray[arc4.String].from_bytes(raw.bytes) File "arc4_types/dynamic_string_array.py", line 20 + diff --git a/examples/arc4_types/out/dynamic_string_array.approval_unoptimized.teal b/examples/arc4_types/out/dynamic_string_array.approval_unoptimized.teal new file mode 100644 index 0000000000..d68e9be99d --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.approval_unoptimized.teal @@ -0,0 +1,175 @@ +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs + bz main_bare_routing@6 + +main_abi_routing@1: + txna ApplicationArgs 0 + method "xyz()string[]" + method "xyz_raw()string[]" + uncover 2 + match main_xyz_route@2 main_xyz_raw_route@3 + b main_switch_case_default@4 + +main_xyz_route@2: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub xyz + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_xyz_raw_route@3: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub xyz_raw + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_switch_case_default@4: + +main_switch_case_next@5: + b main_after_if_else@9 + +main_bare_routing@6: + txn OnCompletion + int 0 + swap + match main_create@7 + b main_reject_bare_on_completion@8 + +main_create@7: + txn ApplicationID + ! + assert // is creating + int 1 + return + +main_reject_bare_on_completion@8: + err // reject transaction + +main_after_if_else@9: + err // reject transaction + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: +xyz: + proto 0 1 + +xyz_block@0: + byte 0x0003 + int 6 + dup + itob + extract 6 2 + uncover 2 + swap + concat + swap + byte "\x00\x01X" + len + + + dup + itob + extract 6 2 + uncover 2 + swap + concat + swap + byte "\x00\x01Y" + len + + + dup + itob + extract 6 2 + uncover 2 + swap + concat + byte "\x00\x01Z" + len + uncover 2 + + + pop + byte "\x00\x01X" + concat + byte "\x00\x01Y" + concat + byte "\x00\x01Z" + concat + retsub + + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: +xyz_raw: + proto 0 1 + +xyz_raw_block@0: + byte 0x0001 + byte 0x58 + concat + byte 0x0001 + byte 0x59 + concat + swap + byte 0x0001 + byte 0x5a + concat + cover 2 + byte 0x0003 + int 6 + dup + itob + extract 6 2 + uncover 2 + swap + concat + swap + dig 2 + len + + + dup + itob + extract 6 2 + uncover 2 + swap + concat + swap + dig 3 + len + + + dup + itob + extract 6 2 + uncover 2 + swap + concat + dig 4 + len + uncover 2 + + + pop + swap + concat + swap + concat + swap + concat + retsub + diff --git a/examples/arc4_types/out/dynamic_string_array.awst b/examples/arc4_types/out/dynamic_string_array.awst new file mode 100644 index 0000000000..44ea17a775 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.awst @@ -0,0 +1,13 @@ +contract Arc4DynamicStringArrayContract +{ + abimethod xyz(): algopy.arc4.DynamicArray[algopy.arc4.String] + { + return arc4_array_encode([arc4_encode('X', algopy.arc4.String), arc4_encode('Y', algopy.arc4.String), arc4_encode('Z', algopy.arc4.String)], algopy.arc4.DynamicArray[algopy.arc4.String]) + } + + abimethod xyz_raw(): algopy.arc4.DynamicArray[algopy.arc4.String] + { + raw: algopy.arc4.DynamicArray[algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]] = arc4_array_encode([arc4_array_encode([88arc4u8], algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]), arc4_array_encode([89arc4u8], algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]), arc4_array_encode([90arc4u8], algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]])], algopy.arc4.DynamicArray[algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]]) + return reinterpret_cast(reinterpret_cast(raw)) + } +} \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array.clear.debug.teal b/examples/arc4_types/out/dynamic_string_array.clear.debug.teal new file mode 100644 index 0000000000..822c27875f --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + return // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + diff --git a/examples/arc4_types/out/dynamic_string_array.clear.teal b/examples/arc4_types/out/dynamic_string_array.clear.teal new file mode 100644 index 0000000000..74b39e23a4 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/dynamic_string_array.clear_unoptimized.debug.teal b/examples/arc4_types/out/dynamic_string_array.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..822c27875f --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + return // class Arc4DynamicStringArrayContract(ARC4Contract): File "arc4_types/dynamic_string_array.py", line 4 + diff --git a/examples/arc4_types/out/dynamic_string_array.clear_unoptimized.teal b/examples/arc4_types/out/dynamic_string_array.clear_unoptimized.teal new file mode 100644 index 0000000000..74b39e23a4 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.cssa.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.cssa.ir new file mode 100644 index 0000000000..ef7f035f4a --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.cssa.ir @@ -0,0 +1,78 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 9u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let value_as_bytes%11#0: bytes = (itob 12u) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final.ir new file mode 100644 index 0000000000..497b88623d --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final.ir @@ -0,0 +1,78 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#1: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#1: bytes = (concat array_data%0#1 value_as_uint16%9#0) + let array_data%0#1: bytes = (concat array_data%0#1 "\x00\x01X") + let array_data%0#1: bytes = (concat array_data%0#1 "\x00\x01Y") + let array_data%0#1: bytes = (concat array_data%0#1 "\x00\x01Z") + return array_data%0#1 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 9u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#1: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let value_as_bytes%11#0: bytes = (itob 12u) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#1: bytes = (concat array_data%3#1 value_as_uint16%12#0) + let array_data%3#1: bytes = (concat array_data%3#1 0x000158) + let array_data%3#1: bytes = (concat array_data%3#1 0x000159) + let raw#0: bytes = (concat array_data%3#1 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final_unoptimized.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final_unoptimized.ir new file mode 100644 index 0000000000..b3b7fabc9b --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.final_unoptimized.ir @@ -0,0 +1,105 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (== tmp%7#0 NoOp) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + goto block@5 + block@5: // switch_case_next_L4 + goto block@9 + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + switch tmp%12#0 {0u => block@7, * => block@8} + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + block@9: // after_if_else_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let array_data%0#0: bytes = 0x0003 + let next_offset%1#0: uint64 = 6u + let value_as_bytes%2#0: bytes = (itob next_offset%1#0) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#0: bytes = (concat array_data%0#0 value_as_uint16%3#0) + let element_length%4#0: uint64 = (len "\x00\x01X") + let next_offset%1#0: uint64 = (+ next_offset%1#0 element_length%4#0) + let value_as_bytes%5#0: bytes = (itob next_offset%1#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#0: bytes = (concat array_data%0#0 value_as_uint16%6#0) + let element_length%7#0: uint64 = (len "\x00\x01Y") + let next_offset%1#0: uint64 = (+ next_offset%1#0 element_length%7#0) + let value_as_bytes%8#0: bytes = (itob next_offset%1#0) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#0: bytes = (concat array_data%0#0 value_as_uint16%9#0) + let element_length%10#0: uint64 = (len "\x00\x01Z") + let next_offset%1#0: uint64 = (+ next_offset%1#0 element_length%10#0) + let array_data%0#0: bytes = (concat array_data%0#0 "\x00\x01X") + let array_data%0#0: bytes = (concat array_data%0#0 "\x00\x01Y") + let array_data%0#0: bytes = (concat array_data%0#0 "\x00\x01Z") + return array_data%0#0 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let array_data%0#0: bytes = 0x0001 + let array_data%0#0: bytes = (concat array_data%0#0 0x58) + let array_data%1#0: bytes = 0x0001 + let array_data%1#0: bytes = (concat array_data%1#0 0x59) + let array_data%2#0: bytes = 0x0001 + let array_data%2#0: bytes = (concat array_data%2#0 0x5a) + let array_data%3#0: bytes = 0x0003 + let next_offset%4#0: uint64 = 6u + let value_as_bytes%5#0: bytes = (itob next_offset%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#0: bytes = (concat array_data%3#0 value_as_uint16%6#0) + let element_length%7#0: uint64 = (len array_data%0#0) + let next_offset%4#0: uint64 = (+ next_offset%4#0 element_length%7#0) + let value_as_bytes%8#0: bytes = (itob next_offset%4#0) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#0: bytes = (concat array_data%3#0 value_as_uint16%9#0) + let element_length%10#0: uint64 = (len array_data%1#0) + let next_offset%4#0: uint64 = (+ next_offset%4#0 element_length%10#0) + let value_as_bytes%11#0: bytes = (itob next_offset%4#0) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#0: bytes = (concat array_data%3#0 value_as_uint16%12#0) + let element_length%13#0: uint64 = (len array_data%2#0) + let next_offset%4#0: uint64 = (+ next_offset%4#0 element_length%13#0) + let array_data%3#0: bytes = (concat array_data%3#0 array_data%0#0) + let array_data%3#0: bytes = (concat array_data%3#0 array_data%1#0) + let array_data%3#0: bytes = (concat array_data%3#0 array_data%2#0) + let raw#0: bytes = array_data%3#0 + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.parallel_copies.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.parallel_copies.ir new file mode 100644 index 0000000000..ef7f035f4a --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.parallel_copies.ir @@ -0,0 +1,78 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 9u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let value_as_bytes%11#0: bytes = (itob 12u) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.post_ssa.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.post_ssa.ir new file mode 100644 index 0000000000..ef7f035f4a --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.post_ssa.ir @@ -0,0 +1,78 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 9u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let value_as_bytes%11#0: bytes = (itob 12u) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.ir new file mode 100644 index 0000000000..a18f25427f --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.ir @@ -0,0 +1,105 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (== tmp%7#0 NoOp) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + goto block@5 + block@5: // switch_case_next_L4 + goto block@9 + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + switch tmp%12#0 {0u => block@7, * => block@8} + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + block@9: // after_if_else_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let array_data%0#0: bytes = 0x0003 + let next_offset%1#0: uint64 = 6u + let value_as_bytes%2#0: bytes = (itob next_offset%1#0) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat array_data%0#0 value_as_uint16%3#0) + let element_length%4#0: uint64 = (len "\x00\x01X") + let next_offset%1#1: uint64 = (+ next_offset%1#0 element_length%4#0) + let value_as_bytes%5#0: bytes = (itob next_offset%1#1) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let element_length%7#0: uint64 = (len "\x00\x01Y") + let next_offset%1#2: uint64 = (+ next_offset%1#1 element_length%7#0) + let value_as_bytes%8#0: bytes = (itob next_offset%1#2) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let element_length%10#0: uint64 = (len "\x00\x01Z") + let next_offset%1#3: uint64 = (+ next_offset%1#2 element_length%10#0) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let array_data%0#0: bytes = 0x0001 + let array_data%0#1: bytes = (concat array_data%0#0 0x58) + let array_data%1#0: bytes = 0x0001 + let array_data%1#1: bytes = (concat array_data%1#0 0x59) + let array_data%2#0: bytes = 0x0001 + let array_data%2#1: bytes = (concat array_data%2#0 0x5a) + let array_data%3#0: bytes = 0x0003 + let next_offset%4#0: uint64 = 6u + let value_as_bytes%5#0: bytes = (itob next_offset%4#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat array_data%3#0 value_as_uint16%6#0) + let element_length%7#0: uint64 = (len array_data%0#1) + let next_offset%4#1: uint64 = (+ next_offset%4#0 element_length%7#0) + let value_as_bytes%8#0: bytes = (itob next_offset%4#1) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let element_length%10#0: uint64 = (len array_data%1#1) + let next_offset%4#2: uint64 = (+ next_offset%4#1 element_length%10#0) + let value_as_bytes%11#0: bytes = (itob next_offset%4#2) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let element_length%13#0: uint64 = (len array_data%2#1) + let next_offset%4#3: uint64 = (+ next_offset%4#2 element_length%13#0) + let array_data%3#4: bytes = (concat array_data%3#3 array_data%0#1) + let array_data%3#5: bytes = (concat array_data%3#4 array_data%1#1) + let array_data%3#6: bytes = (concat array_data%3#5 array_data%2#1) + let raw#0: bytes = array_data%3#6 + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_1.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..e4efca3f74 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_1.ir @@ -0,0 +1,90 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto [block@7, ...block@8][tmp%12#0] + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let next_offset%1#1: uint64 = (+ 6u 3u) + let value_as_bytes%5#0: bytes = (itob next_offset%1#1) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let next_offset%1#2: uint64 = (+ next_offset%1#1 3u) + let value_as_bytes%8#0: bytes = (itob next_offset%1#2) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let next_offset%1#3: uint64 = (+ next_offset%1#2 3u) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let array_data%0#1: bytes = (concat 0x0001 0x58) + let array_data%1#1: bytes = (concat 0x0001 0x59) + let array_data%2#1: bytes = (concat 0x0001 0x5a) + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let element_length%7#0: uint64 = (len array_data%0#1) + let next_offset%4#1: uint64 = (+ 6u element_length%7#0) + let value_as_bytes%8#0: bytes = (itob next_offset%4#1) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let element_length%10#0: uint64 = (len array_data%1#1) + let next_offset%4#2: uint64 = (+ next_offset%4#1 element_length%10#0) + let value_as_bytes%11#0: bytes = (itob next_offset%4#2) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let element_length%13#0: uint64 = (len array_data%2#1) + let next_offset%4#3: uint64 = (+ next_offset%4#2 element_length%13#0) + let array_data%3#4: bytes = (concat array_data%3#3 array_data%0#1) + let array_data%3#5: bytes = (concat array_data%3#4 array_data%1#1) + let raw#0: bytes = (concat array_data%3#5 array_data%2#1) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_2.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..22857accbe --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_2.ir @@ -0,0 +1,86 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let next_offset%1#2: uint64 = (+ 9u 3u) + let value_as_bytes%8#0: bytes = (itob next_offset%1#2) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let next_offset%1#3: uint64 = (+ next_offset%1#2 3u) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let element_length%7#0: uint64 = (len 0x000158) + let next_offset%4#1: uint64 = (+ 6u element_length%7#0) + let value_as_bytes%8#0: bytes = (itob next_offset%4#1) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let element_length%10#0: uint64 = (len 0x000159) + let next_offset%4#2: uint64 = (+ next_offset%4#1 element_length%10#0) + let value_as_bytes%11#0: bytes = (itob next_offset%4#2) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let element_length%13#0: uint64 = (len 0x00015a) + let next_offset%4#3: uint64 = (+ next_offset%4#2 element_length%13#0) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_3.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..da44144e7c --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_3.ir @@ -0,0 +1,82 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let next_offset%1#3: uint64 = (+ 12u 3u) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let next_offset%4#1: uint64 = (+ 6u 3u) + let value_as_bytes%8#0: bytes = (itob next_offset%4#1) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let next_offset%4#2: uint64 = (+ next_offset%4#1 3u) + let value_as_bytes%11#0: bytes = (itob next_offset%4#2) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let next_offset%4#3: uint64 = (+ next_offset%4#2 3u) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_4.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..605afd7174 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_4.ir @@ -0,0 +1,80 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 9u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let next_offset%4#2: uint64 = (+ 9u 3u) + let value_as_bytes%11#0: bytes = (itob next_offset%4#2) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let next_offset%4#3: uint64 = (+ next_offset%4#2 3u) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_5.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..f994642e93 --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_5.ir @@ -0,0 +1,79 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 9u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let value_as_bytes%11#0: bytes = (itob 12u) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let next_offset%4#3: uint64 = (+ 12u 3u) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_6.ir b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..ef7f035f4a --- /dev/null +++ b/examples/arc4_types/out/dynamic_string_array_Arc4DynamicStringArrayContract.ssa.opt_pass_6.ir @@ -0,0 +1,78 @@ +contract examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract: + program approval: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.approval_program() -> uint64: + block@0: // L4 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@6 + block@1: // abi_routing_L4 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "xyz()string[]" => block@2, method "xyz_raw()string[]" => block@3, * => block@4} + block@2: // xyz_route_L5 + 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 = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() + let tmp%6#0: bytes = (concat 0x151f7c75 tmp%5#0) + (log tmp%6#0) + return 1u + block@3: // xyz_raw_route_L13 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // OnCompletion is NoOp + let tmp%9#0: uint64 = (txn ApplicationID) + (assert tmp%9#0) // is not creating + let tmp%10#0: bytes = examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() + let tmp%11#0: bytes = (concat 0x151f7c75 tmp%10#0) + (log tmp%11#0) + return 1u + block@4: // switch_case_default_L4 + fail // reject transaction + block@6: // bare_routing_L4 + let tmp%12#0: uint64 = (txn OnCompletion) + goto tmp%12#0 ? block@8 : block@7 + block@7: // create_L4 + let tmp%13#0: uint64 = (txn ApplicationID) + let tmp%14#0: uint64 = (! tmp%13#0) + (assert tmp%14#0) // is creating + return 1u + block@8: // reject_bare_on_completion_L4 + fail // reject transaction + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz() -> bytes: + block@0: // L6 + let value_as_bytes%2#0: bytes = (itob 6u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let array_data%0#1: bytes = (concat 0x0003 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 9u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%0#2: bytes = (concat array_data%0#1 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 12u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%0#3: bytes = (concat array_data%0#2 value_as_uint16%9#0) + let array_data%0#4: bytes = (concat array_data%0#3 "\x00\x01X") + let array_data%0#5: bytes = (concat array_data%0#4 "\x00\x01Y") + let array_data%0#6: bytes = (concat array_data%0#5 "\x00\x01Z") + return array_data%0#6 + + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.xyz_raw() -> bytes: + block@0: // L14 + let value_as_bytes%5#0: bytes = (itob 6u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let array_data%3#1: bytes = (concat 0x0003 value_as_uint16%6#0) + let value_as_bytes%8#0: bytes = (itob 9u) + let value_as_uint16%9#0: bytes = ((extract 6 2) value_as_bytes%8#0) + let array_data%3#2: bytes = (concat array_data%3#1 value_as_uint16%9#0) + let value_as_bytes%11#0: bytes = (itob 12u) + let value_as_uint16%12#0: bytes = ((extract 6 2) value_as_bytes%11#0) + let array_data%3#3: bytes = (concat array_data%3#2 value_as_uint16%12#0) + let array_data%3#4: bytes = (concat array_data%3#3 0x000158) + let array_data%3#5: bytes = (concat array_data%3#4 0x000159) + let raw#0: bytes = (concat array_data%3#5 0x00015a) + return raw#0 + + program clear-state: + subroutine examples.arc4_types.dynamic_string_array.Arc4DynamicStringArrayContract.clear_state_program() -> uint64: + block@0: // L4 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/named_tuples.O0.log b/examples/arc4_types/out/named_tuples.O0.log new file mode 100644 index 0000000000..fa4e6709c5 --- /dev/null +++ b/examples/arc4_types/out/named_tuples.O0.log @@ -0,0 +1,97 @@ +PC Teal Stack +1 +19 byte "" 0x +21 dup 0x, 0x +22 int 35382882839 0x, 0x, 35382882839 +23 itob 0x, 0x, 0x000000083CFBF217 +24 int 0 0x, 0x, 0x000000083CFBF217, 0 +25 int 8 0x, 0x, 0x000000083CFBF217, 0, 8 +26 substring3 0x, 0x, 0x000000083CFBF217 +27 int 150382884930 0x, 0x, 0x000000083CFBF217, 150382884930 +29 itob 0x, 0x, 0x000000083CFBF217, 0x000000230384B842 +30 int 0 0x, 0x, 0x000000083CFBF217, 0x000000230384B842, 0 +31 int 8 0x, 0x, 0x000000083CFBF217, 0x000000230384B842, 0, 8 +32 substring3 0x, 0x, 0x000000083CFBF217, 0x000000230384B842 +33 int 16 0x, 0x, 0x000000083CFBF217, 0x000000230384B842, 16 +34 pop 0x, 0x, 0x000000083CFBF217, 0x000000230384B842 +35 concat 0x, 0x, 0x000000083CFBF217000000230384B842 +36 int 35382882839 0x, 0x, 0x000000083CFBF217000000230384B842, 35382882839 +37 itob 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +38 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0 +39 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0, 8 +40 substring3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +41 int 150382884930 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 150382884930 +43 itob 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +44 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842, 0 +45 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842, 0, 8 +46 substring3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +47 int 16 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842, 16 +48 pop 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +49 concat 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +50 callsub add 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +89 proto 2 1 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +92 frame_dig -2 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +94 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0 +95 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0, 8 +96 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +97 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839 +98 frame_dig -1 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842 +100 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0 +101 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0, 8 +102 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217 +103 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 35382882839 +104 + 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 70765765678 +105 itob 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +106 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0 +107 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0, 8 +108 substring3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +109 frame_dig -2 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842 +111 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8 +112 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8, 8 +113 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000230384B842 +114 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930 +115 frame_dig -1 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842 +117 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8 +118 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8, 8 +119 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000230384B842 +120 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 150382884930 +121 + 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 300765769860 +122 itob 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +123 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 0 +124 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 0, 8 +125 substring3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +126 int 16 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 16 +127 pop 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +128 concat 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084 +129 retsub 0x, 0x, 0x0000001079F7E42E0000004607097084 +53 dup 0x, 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 +54 int 0 0x, 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0 +55 int 8 0x, 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0, 8 +56 extract3 0x, 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E +57 swap 0x, 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 +58 int 8 0x, 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8 +59 int 8 0x, 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8, 8 +60 extract3 0x, 0x, 0x0000001079F7E42E, 0x0000004607097084 +61 swap 0x, 0x, 0x0000004607097084, 0x0000001079F7E42E +62 int 0 0x, 0x, 0x0000004607097084, 0x0000001079F7E42E, 0 +63 bury 4 0, 0x, 0x0000004607097084, 0x0000001079F7E42E +65 b main_for_body@3 0, 0x, 0x0000004607097084, 0x0000001079F7E42E +73 log 0, 0x, 0x0000004607097084 +74 dig 2 0, 0x, 0x0000004607097084, 0 +76 dup 0, 0x, 0x0000004607097084, 0, 0 +77 int 1 0, 0x, 0x0000004607097084, 0, 0, 1 +79 + 0, 0x, 0x0000004607097084, 0, 1 +80 bury 3 0, 1, 0x0000004607097084, 0 +82 switch main_for_header_1@2 0, 1, 0x0000004607097084 +68 dup 0, 1, 0x0000004607097084, 0x0000004607097084 +69 dig 2 0, 1, 0x0000004607097084, 0x0000004607097084, 1 +71 bury 4 1, 1, 0x0000004607097084, 0x0000004607097084 +73 log 1, 1, 0x0000004607097084 +74 dig 2 1, 1, 0x0000004607097084, 1 +76 dup 1, 1, 0x0000004607097084, 1, 1 +77 int 1 1, 1, 0x0000004607097084, 1, 1, 1 +79 + 1, 1, 0x0000004607097084, 1, 2 +80 bury 3 1, 2, 0x0000004607097084, 1 +82 switch main_for_header_1@2 1, 2, 0x0000004607097084 +86 int 1 1, 2, 0x0000004607097084, 1 +88 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/named_tuples.O1.log b/examples/arc4_types/out/named_tuples.O1.log new file mode 100644 index 0000000000..bd8e68e6c8 --- /dev/null +++ b/examples/arc4_types/out/named_tuples.O1.log @@ -0,0 +1,90 @@ +PC Teal Stack +1 +18 byte "" 0x +20 int 35382882839 0x, 35382882839 +21 itob 0x, 0x000000083CFBF217 +22 int 0 0x, 0x000000083CFBF217, 0 +23 int 8 0x, 0x000000083CFBF217, 0, 8 +24 substring3 0x, 0x000000083CFBF217 +25 int 150382884930 0x, 0x000000083CFBF217, 150382884930 +26 itob 0x, 0x000000083CFBF217, 0x000000230384B842 +27 int 0 0x, 0x000000083CFBF217, 0x000000230384B842, 0 +28 int 8 0x, 0x000000083CFBF217, 0x000000230384B842, 0, 8 +29 substring3 0x, 0x000000083CFBF217, 0x000000230384B842 +30 concat 0x, 0x000000083CFBF217000000230384B842 +31 int 35382882839 0x, 0x000000083CFBF217000000230384B842, 35382882839 +32 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +33 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0 +34 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0, 8 +35 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +36 int 150382884930 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 150382884930 +37 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +38 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842, 0 +39 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842, 0, 8 +40 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +41 concat 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +42 callsub add 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +79 proto 2 1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +82 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +84 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0 +85 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0, 8 +86 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +87 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839 +88 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842 +90 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0 +91 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0, 8 +92 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217 +93 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 35382882839 +94 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 70765765678 +95 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +96 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0 +97 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0, 8 +98 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +99 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842 +101 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8 +102 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8, 8 +103 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000230384B842 +104 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930 +105 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842 +107 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8 +108 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8, 8 +109 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000230384B842 +110 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 150382884930 +111 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 300765769860 +112 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +113 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 0 +114 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 0, 8 +115 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +116 concat 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084 +117 retsub 0x, 0x0000001079F7E42E0000004607097084 +45 dup 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 +46 int 0 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0 +47 int 8 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0, 8 +48 extract3 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E +49 swap 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 +50 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8 +51 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8, 8 +52 extract3 0x, 0x0000001079F7E42E, 0x0000004607097084 +53 swap 0x, 0x0000004607097084, 0x0000001079F7E42E +54 int 0 0x, 0x0000004607097084, 0x0000001079F7E42E, 0 +55 swap 0x, 0x0000004607097084, 0, 0x0000001079F7E42E +56 b main_for_body@3 0x, 0x0000004607097084, 0, 0x0000001079F7E42E +65 log 0x, 0x0000004607097084, 0 +66 dup 0x, 0x0000004607097084, 0, 0 +67 dup 0x, 0x0000004607097084, 0, 0, 0 +68 int 1 0x, 0x0000004607097084, 0, 0, 0, 1 +70 + 0x, 0x0000004607097084, 0, 0, 1 +71 bury 4 1, 0x0000004607097084, 0, 0 +73 bz main_for_header_1@2 1, 0x0000004607097084, 0 +59 dig 1 1, 0x0000004607097084, 0, 0x0000004607097084 +61 dig 3 1, 0x0000004607097084, 0, 0x0000004607097084, 1 +63 bury 2 1, 0x0000004607097084, 1, 0x0000004607097084 +65 log 1, 0x0000004607097084, 1 +66 dup 1, 0x0000004607097084, 1, 1 +67 dup 1, 0x0000004607097084, 1, 1, 1 +68 int 1 1, 0x0000004607097084, 1, 1, 1, 1 +70 + 1, 0x0000004607097084, 1, 1, 2 +71 bury 4 2, 0x0000004607097084, 1, 1 +73 bz main_for_header_1@2 2, 0x0000004607097084, 1 +76 int 1 2, 0x0000004607097084, 1, 1 +78 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/named_tuples.O2.log b/examples/arc4_types/out/named_tuples.O2.log new file mode 100644 index 0000000000..4ae1ffb312 --- /dev/null +++ b/examples/arc4_types/out/named_tuples.O2.log @@ -0,0 +1,88 @@ +PC Teal Stack +1 +18 byte "" 0x +20 int 35382882839 0x, 35382882839 +21 itob 0x, 0x000000083CFBF217 +22 int 0 0x, 0x000000083CFBF217, 0 +23 int 8 0x, 0x000000083CFBF217, 0, 8 +24 substring3 0x, 0x000000083CFBF217 +25 int 150382884930 0x, 0x000000083CFBF217, 150382884930 +26 itob 0x, 0x000000083CFBF217, 0x000000230384B842 +27 int 0 0x, 0x000000083CFBF217, 0x000000230384B842, 0 +28 int 8 0x, 0x000000083CFBF217, 0x000000230384B842, 0, 8 +29 substring3 0x, 0x000000083CFBF217, 0x000000230384B842 +30 concat 0x, 0x000000083CFBF217000000230384B842 +31 int 35382882839 0x, 0x000000083CFBF217000000230384B842, 35382882839 +32 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +33 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0 +34 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0, 8 +35 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +36 int 150382884930 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 150382884930 +37 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +38 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842, 0 +39 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842, 0, 8 +40 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +41 concat 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +42 callsub add 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +77 proto 2 1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +80 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +82 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0 +83 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0, 8 +84 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +85 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839 +86 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842 +88 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0 +89 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0, 8 +90 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217 +91 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 35382882839 +92 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 70765765678 +93 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +94 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0 +95 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0, 8 +96 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +97 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842 +99 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8 +100 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8, 8 +101 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000230384B842 +102 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930 +103 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842 +105 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8 +106 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8, 8 +107 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000230384B842 +108 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 150382884930 +109 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 300765769860 +110 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +111 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 0 +112 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 0, 8 +113 substring3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +114 concat 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084 +115 retsub 0x, 0x0000001079F7E42E0000004607097084 +45 dup 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 +46 int 0 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0 +47 int 8 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0, 8 +48 extract3 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E +49 swap 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 +50 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8 +51 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8, 8 +52 extract3 0x, 0x0000001079F7E42E, 0x0000004607097084 +53 int 0 0x, 0x0000001079F7E42E, 0x0000004607097084, 0 +54 b main_for_body@3 0x, 0x0000001079F7E42E, 0x0000004607097084, 0 +62 dig 2 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 0x0000001079F7E42E +64 log 0x, 0x0000001079F7E42E, 0x0000004607097084, 0 +65 dup 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 0 +66 int 1 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 0, 1 +68 + 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 1 +69 bury 4 1, 0x0000001079F7E42E, 0x0000004607097084, 0 +71 bz main_for_header_1@2 1, 0x0000001079F7E42E, 0x0000004607097084 +57 dup 1, 0x0000001079F7E42E, 0x0000004607097084, 0x0000004607097084 +58 bury 2 1, 0x0000004607097084, 0x0000004607097084 +60 dig 2 1, 0x0000004607097084, 0x0000004607097084, 1 +62 dig 2 1, 0x0000004607097084, 0x0000004607097084, 1, 0x0000004607097084 +64 log 1, 0x0000004607097084, 0x0000004607097084, 1 +65 dup 1, 0x0000004607097084, 0x0000004607097084, 1, 1 +66 int 1 1, 0x0000004607097084, 0x0000004607097084, 1, 1, 1 +68 + 1, 0x0000004607097084, 0x0000004607097084, 1, 2 +69 bury 4 2, 0x0000004607097084, 0x0000004607097084, 1 +71 bz main_for_header_1@2 2, 0x0000004607097084, 0x0000004607097084 +74 int 1 2, 0x0000004607097084, 0x0000004607097084, 1 +76 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/numeric.O0.log b/examples/arc4_types/out/numeric.O0.log new file mode 100644 index 0000000000..5b491bb577 --- /dev/null +++ b/examples/arc4_types/out/numeric.O0.log @@ -0,0 +1,158 @@ +PC Teal Stack +1 +11 +80 byte "" 0x +82 dupn 3 0x, 0x, 0x, 0x +84 int 255 0x, 0x, 0x, 0x, 255 +87 dup 0x, 0x, 0x, 0x, 255, 255 +88 itob 0x, 0x, 0x, 0x, 255, 0x00000000000000FF +89 extract 7 1 0x, 0x, 0x, 0x, 255, 0xFF +92 btoi 0x, 0x, 0x, 0x, 255, 255 +93 == 0x, 0x, 0x, 0x, 1 +94 assert 0x, 0x, 0x, 0x +95 byte 0x7fffffffffffffff00 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00 +106 dup 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00 +107 swap 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00 +108 len 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9 +109 dup 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 9 +110 swap 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 9 +111 int 1 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 9, 1 +112 > 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 1 +113 bz main_ternary_false@2 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9 +116 int 1 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 1 +117 b main_ternary_merge@3 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 1 +121 dig 2 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 1, 0x7FFFFFFFFFFFFFFF00 +123 dup 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 1, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00 +124 int 0 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 1, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0 +125 uncover 3 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0, 1 +127 substring3 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7F +128 btoi 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 127 +129 int 127 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 127, 127 +131 == 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 1 +132 assert 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00 +133 len 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 9 +134 dup 0x, 0x, 0x, 0x, 0x7FFFFFFFFFFFFFFF00, 9, 9, 9 +135 bury 4 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9 +137 int 3 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9, 3 +139 > 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +140 bz main_ternary_false@5 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9 +143 int 3 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 3 +145 b main_ternary_merge@6 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 3 +150 dig 2 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 3, 0x7FFFFFFFFFFFFFFF00 +152 dup 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 3, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00 +153 int 0 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 3, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0 +154 uncover 3 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0, 3 +156 substring3 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFF +157 btoi 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 8388607 +158 int 8388607 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 8388607, 8388607 +163 == 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 1 +164 assert 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00 +165 len 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9 +166 dup 0x, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9, 9 +167 bury 7 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9 +169 int 2 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9, 2 +171 > 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +172 bz main_ternary_false@8 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9 +175 int 2 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 2 +177 b main_ternary_merge@9 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 2 +182 dig 2 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 2, 0x7FFFFFFFFFFFFFFF00 +184 dup 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 2, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00 +185 int 0 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 2, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0 +186 uncover 3 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0, 2 +188 substring3 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7FFF +189 btoi 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 32767 +190 int 32767 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 32767, 32767 +194 == 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 1 +195 assert 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00 +196 len 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9 +197 dup 9, 0x, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9, 9 +198 bury 6 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9 +200 int 4 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9, 4 +202 > 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +203 bz main_ternary_false@11 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9 +206 int 4 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 4 +208 b main_ternary_merge@12 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 4 +213 dig 2 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 4, 0x7FFFFFFFFFFFFFFF00 +215 dup 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 4, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00 +216 int 0 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 4, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0 +217 uncover 3 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFFFFFFFFFF00, 0, 4 +219 substring3 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0x7FFFFFFF +220 btoi 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 2147483647 +221 int 2147483647 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 2147483647, 2147483647 +227 == 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 1 +228 assert 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00 +229 len 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9 +230 dup 9, 9, 0x, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9, 9 +231 bury 5 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9 +233 int 8 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9, 8 +234 > 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +235 bz main_ternary_false@14 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9 +238 int 8 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 8 +239 b main_ternary_merge@15 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 8 +244 dig 2 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 8, 0x7FFFFFFFFFFFFFFF00 +246 int 0 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 8, 0x7FFFFFFFFFFFFFFF00, 0 +247 uncover 2 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF00, 0, 8 +249 substring3 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x7FFFFFFFFFFFFFFF +250 btoi 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9223372036854775807 +251 int 9223372036854775807 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 9223372036854775807, 9223372036854775807 +261 == 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +262 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9 +263 byte 0x0000015333430684 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x0000015333430684 +273 len 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 8 +274 int 8 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 8, 8 +275 == 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +276 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9 +277 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +278 dup 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +279 len 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 +280 int 64 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64, 64 +281 == 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +282 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +283 dup 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +284 len 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 +285 int 64 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64, 64 +286 <= 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +287 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +288 int 64 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 64 +289 bzero 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +290 dig 1 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +292 b| 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +293 == 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +294 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9 +295 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +296 len 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 64 +297 int 64 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 64, 64 +298 <= 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +299 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9 +300 int 64 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 64 +301 bzero 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +302 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +303 b| 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +304 byte 0x01 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x01 +305 byte 0x00000000000000000000000000000001 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x01, 0x00000000000000000000000000000001 +323 swap 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01 +324 dup 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x01 +325 byte 0x01 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x01, 0x01 +326 b+ 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02 +327 dup 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 0x02 +328 len 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1 +329 int 16 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1, 16 +331 <= 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 1 +332 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02 +333 int 16 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 16 +335 bzero 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x02, 0x00000000000000000000000000000000 +336 b| 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x01, 0x00000000000000000000000000000002 +337 swap 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000001, 0x00000000000000000000000000000002, 0x01 +338 uncover 2 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 0x01, 0x00000000000000000000000000000001 +340 b== 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 1 +341 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002 +342 len 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16 +343 int 16 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16, 16 +345 == 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +346 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +347 len 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 64 +348 int 64 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 64, 64 +349 == 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +350 assert 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9 +351 int 1 9, 9, 9, 9, 0x7FFFFFFFFFFFFFFF00, 9, 1 +352 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/numeric.O1.log b/examples/arc4_types/out/numeric.O1.log new file mode 100644 index 0000000000..69a3760ca7 --- /dev/null +++ b/examples/arc4_types/out/numeric.O1.log @@ -0,0 +1,74 @@ +PC Teal Stack +1 +7 +76 int 255 255 +77 itob 0x00000000000000FF +78 extract 7 1 0xFF +81 btoi 255 +82 int 255 255, 255 +83 == 1 +84 assert +85 byte 0x7f 0x7F +88 btoi 127 +89 int 127 127, 127 +91 == 1 +92 assert +93 byte 0x7fffff 0x7FFFFF +98 btoi 8388607 +99 int 8388607 8388607, 8388607 +104 == 1 +105 assert +106 byte 0x7fff 0x7FFF +110 btoi 32767 +111 int 32767 32767, 32767 +115 == 1 +116 assert +117 byte 0x7fffffff 0x7FFFFFFF +123 btoi 2147483647 +124 int 2147483647 2147483647, 2147483647 +130 == 1 +131 assert +132 byte 0x7fffffffffffffff 0x7FFFFFFFFFFFFFFF +142 btoi 9223372036854775807 +143 int 9223372036854775807 9223372036854775807, 9223372036854775807 +153 == 1 +154 assert +155 int 64 64 +156 bzero 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +157 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +158 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +159 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +160 == 1 +161 assert +162 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +163 len 64 +164 int 64 64, 64 +165 <= 1 +166 assert +167 int 64 64 +168 bzero 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +169 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +170 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +171 byte 0x02 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x02 +172 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +173 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1, 16 +174 <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +175 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +176 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16 +177 bzero 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000 +178 byte 0x02 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000, 0x02 +179 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002 +180 byte 0x01 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 0x01 +183 byte 0x00000000000000000000000000000001 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 0x01, 0x00000000000000000000000000000001 +201 b== 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 1 +202 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002 +203 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16 +204 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16, 16 +205 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +206 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +207 len 64 +208 int 64 64, 64 +209 == 1 +210 assert +211 int 1 1 +213 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/numeric.O2.log b/examples/arc4_types/out/numeric.O2.log new file mode 100644 index 0000000000..69a3760ca7 --- /dev/null +++ b/examples/arc4_types/out/numeric.O2.log @@ -0,0 +1,74 @@ +PC Teal Stack +1 +7 +76 int 255 255 +77 itob 0x00000000000000FF +78 extract 7 1 0xFF +81 btoi 255 +82 int 255 255, 255 +83 == 1 +84 assert +85 byte 0x7f 0x7F +88 btoi 127 +89 int 127 127, 127 +91 == 1 +92 assert +93 byte 0x7fffff 0x7FFFFF +98 btoi 8388607 +99 int 8388607 8388607, 8388607 +104 == 1 +105 assert +106 byte 0x7fff 0x7FFF +110 btoi 32767 +111 int 32767 32767, 32767 +115 == 1 +116 assert +117 byte 0x7fffffff 0x7FFFFFFF +123 btoi 2147483647 +124 int 2147483647 2147483647, 2147483647 +130 == 1 +131 assert +132 byte 0x7fffffffffffffff 0x7FFFFFFFFFFFFFFF +142 btoi 9223372036854775807 +143 int 9223372036854775807 9223372036854775807, 9223372036854775807 +153 == 1 +154 assert +155 int 64 64 +156 bzero 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +157 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +158 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +159 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +160 == 1 +161 assert +162 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +163 len 64 +164 int 64 64, 64 +165 <= 1 +166 assert +167 int 64 64 +168 bzero 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +169 byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +170 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +171 byte 0x02 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x02 +172 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +173 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1, 16 +174 <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +175 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +176 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16 +177 bzero 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000 +178 byte 0x02 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000000, 0x02 +179 b| 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002 +180 byte 0x01 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 0x01 +183 byte 0x00000000000000000000000000000001 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 0x01, 0x00000000000000000000000000000001 +201 b== 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002, 1 +202 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 0x00000000000000000000000000000002 +203 len 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16 +204 int 16 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 16, 16 +205 == 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, 1 +206 assert 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +207 len 64 +208 int 64 64, 64 +209 == 1 +210 assert +211 int 1 1 +213 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/numeric.approval.debug.teal b/examples/arc4_types/out/numeric.approval.debug.teal new file mode 100644 index 0000000000..dfb733b3ba --- /dev/null +++ b/examples/arc4_types/out/numeric.approval.debug.teal @@ -0,0 +1,78 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: +main_block@0: + int 255 // 255 255 File "arc4_types/numeric.py", line 26 + itob // {itob} UInt8.encode(uint8) File "arc4_types/numeric.py", line 28 + extract 7 1 // {extract} UInt8.encode(uint8) File "arc4_types/numeric.py", line 28 + btoi // {btoi} int8_encoded.decode() File "arc4_types/numeric.py", line 30 + int 255 // int8_decoded#0,255 255 File "arc4_types/numeric.py", line 26 + == // {==} uint8 == int8_decoded File "arc4_types/numeric.py", line 32 + assert // assert uint8 == int8_decoded File "arc4_types/numeric.py", line 32 + byte 0x7f // 0x7f test_bytes[:1] File "arc4_types/numeric.py", line 35 + btoi // {btoi} UInt8.from_bytes(test_bytes[:1]).decode() File "arc4_types/numeric.py", line 35 + int 127 // tmp%6#0,127 2**8 - 1 - 2**7 File "arc4_types/numeric.py", line 35 + == // {==} UInt8.from_bytes(test_bytes[:1]).decode() == 2**8 - 1 - 2**7 File "arc4_types/numeric.py", line 35 + assert // assert UInt8.from_bytes(test_bytes[:1]).decode() == 2**8 - 1 - 2**7 File "arc4_types/numeric.py", line 35 + byte 0x7fffff // 0x7fffff test_bytes[:3] File "arc4_types/numeric.py", line 37 + btoi // {btoi} UIntN[typing.Literal[24]].from_bytes(test_bytes[:3]).decode() File "arc4_types/numeric.py", line 37 + int 8388607 // tmp%12#0,8388607 2**24 - 1 - 2**23 File "arc4_types/numeric.py", line 37 + == // {==} UIntN[typing.Literal[24]].from_bytes(test_bytes[:3]).decode() == 2**24 - 1 - 2**23 File "arc4_types/numeric.py", line 37 + assert // assert ( File "arc4_types/numeric.py", line 36 + byte 0x7fff // 0x7fff test_bytes[:2] File "arc4_types/numeric.py", line 39 + btoi // {btoi} UInt16.from_bytes(test_bytes[:2]).decode() File "arc4_types/numeric.py", line 39 + int 32767 // tmp%18#0,32767 2**16 - 1 - 2**15 File "arc4_types/numeric.py", line 39 + == // {==} UInt16.from_bytes(test_bytes[:2]).decode() == 2**16 - 1 - 2**15 File "arc4_types/numeric.py", line 39 + assert // assert UInt16.from_bytes(test_bytes[:2]).decode() == 2**16 - 1 - 2**15 File "arc4_types/numeric.py", line 39 + byte 0x7fffffff // 0x7fffffff test_bytes[:4] File "arc4_types/numeric.py", line 40 + btoi // {btoi} UInt32.from_bytes(test_bytes[:4]).decode() File "arc4_types/numeric.py", line 40 + int 2147483647 // tmp%24#0,2147483647 2**32 - 1 - 2**31 File "arc4_types/numeric.py", line 40 + == // {==} UInt32.from_bytes(test_bytes[:4]).decode() == 2**32 - 1 - 2**31 File "arc4_types/numeric.py", line 40 + assert // assert UInt32.from_bytes(test_bytes[:4]).decode() == 2**32 - 1 - 2**31 File "arc4_types/numeric.py", line 40 + byte 0x7fffffffffffffff // 0x7fffffffffffffff test_bytes[:8] File "arc4_types/numeric.py", line 41 + btoi // {btoi} ARC4UInt64.from_bytes(test_bytes[:8]).decode() File "arc4_types/numeric.py", line 41 + int 9223372036854775807 // tmp%30#0,9223372036854775807 2**64 - 1 - 2**63 File "arc4_types/numeric.py", line 41 + == // {==} ARC4UInt64.from_bytes(test_bytes[:8]).decode() == 2**64 - 1 - 2**63 File "arc4_types/numeric.py", line 41 + assert // assert ARC4UInt64.from_bytes(test_bytes[:8]).decode() == 2**64 - 1 - 2**63 File "arc4_types/numeric.py", line 41 + int 64 // 64 BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + bzero // {bzero} BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // b_zeros%38#0,0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff sixty_four_byte_num File "arc4_types/numeric.py", line 47 + b| // {b|} BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // tmp%39#0,0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff sixty_four_byte_num File "arc4_types/numeric.py", line 47 + == // {==} really_big_int == BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + assert // assert really_big_int == BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff sixty_four_byte_num File "arc4_types/numeric.py", line 53 + len // {len} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + int 64 // len_%41#0,64 BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + <= // {<=} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + assert // overflow // BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + int 64 // 64 BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + bzero // {bzero} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // b_zeros%43#0,0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff sixty_four_byte_num File "arc4_types/numeric.py", line 53 + b| // {b|} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + byte 0x02 // really_big_decimal#0,0x02 biguint + 1 File "arc4_types/numeric.py", line 58 + len // really_big_decimal#0,{len} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + int 16 // really_big_decimal#0,len_%45#0,16 ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + <= // really_big_decimal#0,{<=} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + assert // overflow // really_big_decimal#0 ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + int 16 // really_big_decimal#0,16 ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + bzero // really_big_decimal#0,{bzero} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + byte 0x02 // really_big_decimal#0,b_zeros%47#0,0x02 biguint + 1 File "arc4_types/numeric.py", line 58 + b| // really_big_decimal#0,{b|} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + byte 0x01 // really_big_decimal#0,arc4_biguint_dynamic#0,0x01 1 File "arc4_types/numeric.py", line 56 + byte 0x00000000000000000000000000000001 // really_big_decimal#0,arc4_biguint_dynamic#0,0x01,0x00000000000000000000000000000001 1 File "arc4_types/numeric.py", line 57 + b== // really_big_decimal#0,arc4_biguint_dynamic#0,{b==} biguint == arc4_biguint_const.decode() File "arc4_types/numeric.py", line 60 + assert // really_big_decimal#0,arc4_biguint_dynamic#0 assert biguint == arc4_biguint_const.decode() File "arc4_types/numeric.py", line 60 + len // really_big_decimal#0,{len} arc4_biguint_dynamic.bytes.length File "arc4_types/numeric.py", line 62 + int 16 // really_big_decimal#0,tmp%49#0,16 128 // 8 File "arc4_types/numeric.py", line 62 + == // really_big_decimal#0,{==} arc4_biguint_dynamic.bytes.length == (128 // 8) File "arc4_types/numeric.py", line 62 + assert // really_big_decimal#0 assert arc4_biguint_dynamic.bytes.length == (128 // 8) File "arc4_types/numeric.py", line 62 + len // {len} really_big_decimal.bytes.length File "arc4_types/numeric.py", line 64 + int 64 // tmp%51#0,64 64 File "arc4_types/numeric.py", line 64 + == // {==} really_big_decimal.bytes.length == 64 File "arc4_types/numeric.py", line 64 + assert // assert really_big_decimal.bytes.length == 64 File "arc4_types/numeric.py", line 64 + int 1 // 1 True File "arc4_types/numeric.py", line 66 + return // return True File "arc4_types/numeric.py", line 66 + diff --git a/examples/arc4_types/out/numeric.approval.teal b/examples/arc4_types/out/numeric.approval.teal new file mode 100644 index 0000000000..38662e5a37 --- /dev/null +++ b/examples/arc4_types/out/numeric.approval.teal @@ -0,0 +1,76 @@ +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: +main_block@0: + int 255 + itob + extract 7 1 + btoi + int 255 + == + assert + byte 0x7f + btoi + int 127 + == + assert + byte 0x7fffff + btoi + int 8388607 + == + assert + byte 0x7fff + btoi + int 32767 + == + assert + byte 0x7fffffff + btoi + int 2147483647 + == + assert + byte 0x7fffffffffffffff + btoi + int 9223372036854775807 + == + assert + int 64 + bzero + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + b| + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + == + assert + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + len + int 64 + <= + assert // overflow + int 64 + bzero + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + b| + byte 0x02 + len + int 16 + <= + assert // overflow + int 16 + bzero + byte 0x02 + b| + byte 0x01 + byte 0x00000000000000000000000000000001 + b== + assert + len + int 16 + == + assert + len + int 64 + == + assert + int 1 + return + diff --git a/examples/arc4_types/out/numeric.approval_unoptimized.debug.teal b/examples/arc4_types/out/numeric.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..d945f5cbf0 --- /dev/null +++ b/examples/arc4_types/out/numeric.approval_unoptimized.debug.teal @@ -0,0 +1,209 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: +main: + byte "" + dupn 3 // allocate 4 to stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | + +main_block@0: + int 255 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | 255 255 File "arc4_types/numeric.py", line 26 + dup // load uint8#0 from l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | uint8#0,uint8#0 uint8 File "arc4_types/numeric.py", line 26 + itob // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | uint8#0,{itob} UInt8.encode(uint8) File "arc4_types/numeric.py", line 28 + extract 7 1 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | uint8#0,{extract} UInt8.encode(uint8) File "arc4_types/numeric.py", line 28 + btoi // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | uint8#0,{btoi} int8_encoded.decode() File "arc4_types/numeric.py", line 30 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | {==} uint8 == int8_decoded File "arc4_types/numeric.py", line 32 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | assert uint8 == int8_decoded File "arc4_types/numeric.py", line 32 + byte 0x7fffffffffffffff00 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | 0x7fffffffffffffff00 Bytes.from_hex("7FFFFFFFFFFFFFFF00") File "arc4_types/numeric.py", line 34 + dup // store test_bytes#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0 | test_bytes#0,test_bytes#0 test_bytes File "arc4_types/numeric.py", line 34 + swap // store test_bytes#0 to f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0 | test_bytes#0 test_bytes File "arc4_types/numeric.py", line 34 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0 | {len} test_bytes[:1] File "arc4_types/numeric.py", line 35 + dup // store awst_tmp%2#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0 | awst_tmp%2#0,awst_tmp%2#0 test_bytes[:1] File "arc4_types/numeric.py", line 35 + swap // store awst_tmp%2#0 to f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%2#0 test_bytes[:1] File "arc4_types/numeric.py", line 35 + int 1 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%2#0,1 1 File "arc4_types/numeric.py", line 35 + > // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {>} test_bytes[:1] File "arc4_types/numeric.py", line 35 + bz main_ternary_false@2 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:1] File "arc4_types/numeric.py", line 35 + // Implicit fall through to main_ternary_true@1 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:1] File "arc4_types/numeric.py", line 35 + +main_ternary_true@1: + int 1 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 1 1 File "arc4_types/numeric.py", line 35 + b main_ternary_merge@3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | ternary_result%4#0 + +main_ternary_false@2: + dup // load awst_tmp%2#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%2#0 test_bytes[:1] File "arc4_types/numeric.py", line 35 + // Implicit fall through to main_ternary_merge@3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | ternary_result%4#0 + +main_ternary_merge@3: + dig 2 // load test_bytes#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | test_bytes#0 ternary_result%4#0 test_bytes File "arc4_types/numeric.py", line 34 + dup // store test_bytes#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | test_bytes#0,test_bytes#0 test_bytes File "arc4_types/numeric.py", line 34 + int 0 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | test_bytes#0,test_bytes#0,0 test_bytes[:1] File "arc4_types/numeric.py", line 35 + uncover 3 // load ternary_result%4#0 from x-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,test_bytes#0,0,ternary_result%4#0 1 File "arc4_types/numeric.py", line 35 + substring3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{substring3} test_bytes[:1] File "arc4_types/numeric.py", line 35 + btoi // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{btoi} UInt8.from_bytes(test_bytes[:1]).decode() File "arc4_types/numeric.py", line 35 + int 127 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,tmp%6#0,127 2**8 - 1 - 2**7 File "arc4_types/numeric.py", line 35 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{==} UInt8.from_bytes(test_bytes[:1]).decode() == 2**8 - 1 - 2**7 File "arc4_types/numeric.py", line 35 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0 assert UInt8.from_bytes(test_bytes[:1]).decode() == 2**8 - 1 - 2**7 File "arc4_types/numeric.py", line 35 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {len} test_bytes[:3] File "arc4_types/numeric.py", line 37 + dup // store awst_tmp%8#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%8#0,awst_tmp%8#0 test_bytes[:3] File "arc4_types/numeric.py", line 37 + bury 4 // store awst_tmp%8#0 to f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%8#0 test_bytes[:3] File "arc4_types/numeric.py", line 37 + int 3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%8#0,3 3 File "arc4_types/numeric.py", line 37 + > // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {>} test_bytes[:3] File "arc4_types/numeric.py", line 37 + bz main_ternary_false@5 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:3] File "arc4_types/numeric.py", line 37 + // Implicit fall through to main_ternary_true@4 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:3] File "arc4_types/numeric.py", line 37 + +main_ternary_true@4: + int 3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 3 3 File "arc4_types/numeric.py", line 37 + b main_ternary_merge@6 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%10#0 | ternary_result%10#0 + +main_ternary_false@5: + dig 2 // load awst_tmp%8#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%8#0 test_bytes[:3] File "arc4_types/numeric.py", line 37 + // Implicit fall through to main_ternary_merge@6 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%10#0 | ternary_result%10#0 + +main_ternary_merge@6: + dig 2 // load test_bytes#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%10#0 | test_bytes#0 ternary_result%10#0 test_bytes File "arc4_types/numeric.py", line 34 + dup // store test_bytes#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%10#0 | test_bytes#0,test_bytes#0 test_bytes File "arc4_types/numeric.py", line 34 + int 0 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%10#0 | test_bytes#0,test_bytes#0,0 test_bytes[:3] File "arc4_types/numeric.py", line 37 + uncover 3 // load ternary_result%10#0 from x-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,test_bytes#0,0,ternary_result%10#0 3 File "arc4_types/numeric.py", line 37 + substring3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{substring3} test_bytes[:3] File "arc4_types/numeric.py", line 37 + btoi // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{btoi} UIntN[typing.Literal[24]].from_bytes(test_bytes[:3]).decode() File "arc4_types/numeric.py", line 37 + int 8388607 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,tmp%12#0,8388607 2**24 - 1 - 2**23 File "arc4_types/numeric.py", line 37 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{==} UIntN[typing.Literal[24]].from_bytes(test_bytes[:3]).decode() == 2**24 - 1 - 2**23 File "arc4_types/numeric.py", line 37 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0 assert ( File "arc4_types/numeric.py", line 36 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {len} test_bytes[:2] File "arc4_types/numeric.py", line 39 + dup // store awst_tmp%14#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%14#0,awst_tmp%14#0 test_bytes[:2] File "arc4_types/numeric.py", line 39 + bury 7 // store awst_tmp%14#0 to f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%14#0 test_bytes[:2] File "arc4_types/numeric.py", line 39 + int 2 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%14#0,2 2 File "arc4_types/numeric.py", line 39 + > // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {>} test_bytes[:2] File "arc4_types/numeric.py", line 39 + bz main_ternary_false@8 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:2] File "arc4_types/numeric.py", line 39 + // Implicit fall through to main_ternary_true@7 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:2] File "arc4_types/numeric.py", line 39 + +main_ternary_true@7: + int 2 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 2 2 File "arc4_types/numeric.py", line 39 + b main_ternary_merge@9 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%16#0 | ternary_result%16#0 + +main_ternary_false@8: + dig 5 // load awst_tmp%14#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%14#0 test_bytes[:2] File "arc4_types/numeric.py", line 39 + // Implicit fall through to main_ternary_merge@9 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%16#0 | ternary_result%16#0 + +main_ternary_merge@9: + dig 2 // load test_bytes#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%16#0 | test_bytes#0 ternary_result%16#0 test_bytes File "arc4_types/numeric.py", line 34 + dup // store test_bytes#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%16#0 | test_bytes#0,test_bytes#0 test_bytes File "arc4_types/numeric.py", line 34 + int 0 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%16#0 | test_bytes#0,test_bytes#0,0 test_bytes[:2] File "arc4_types/numeric.py", line 39 + uncover 3 // load ternary_result%16#0 from x-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,test_bytes#0,0,ternary_result%16#0 2 File "arc4_types/numeric.py", line 39 + substring3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{substring3} test_bytes[:2] File "arc4_types/numeric.py", line 39 + btoi // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{btoi} UInt16.from_bytes(test_bytes[:2]).decode() File "arc4_types/numeric.py", line 39 + int 32767 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,tmp%18#0,32767 2**16 - 1 - 2**15 File "arc4_types/numeric.py", line 39 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{==} UInt16.from_bytes(test_bytes[:2]).decode() == 2**16 - 1 - 2**15 File "arc4_types/numeric.py", line 39 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0 assert UInt16.from_bytes(test_bytes[:2]).decode() == 2**16 - 1 - 2**15 File "arc4_types/numeric.py", line 39 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {len} test_bytes[:4] File "arc4_types/numeric.py", line 40 + dup // store awst_tmp%20#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%20#0,awst_tmp%20#0 test_bytes[:4] File "arc4_types/numeric.py", line 40 + bury 6 // store awst_tmp%20#0 to f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%20#0 test_bytes[:4] File "arc4_types/numeric.py", line 40 + int 4 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%20#0,4 4 File "arc4_types/numeric.py", line 40 + > // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {>} test_bytes[:4] File "arc4_types/numeric.py", line 40 + bz main_ternary_false@11 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:4] File "arc4_types/numeric.py", line 40 + // Implicit fall through to main_ternary_true@10 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:4] File "arc4_types/numeric.py", line 40 + +main_ternary_true@10: + int 4 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 4 4 File "arc4_types/numeric.py", line 40 + b main_ternary_merge@12 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%22#0 | ternary_result%22#0 + +main_ternary_false@11: + dig 4 // load awst_tmp%20#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%20#0 test_bytes[:4] File "arc4_types/numeric.py", line 40 + // Implicit fall through to main_ternary_merge@12 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%22#0 | ternary_result%22#0 + +main_ternary_merge@12: + dig 2 // load test_bytes#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%22#0 | test_bytes#0 ternary_result%22#0 test_bytes File "arc4_types/numeric.py", line 34 + dup // store test_bytes#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%22#0 | test_bytes#0,test_bytes#0 test_bytes File "arc4_types/numeric.py", line 34 + int 0 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%22#0 | test_bytes#0,test_bytes#0,0 test_bytes[:4] File "arc4_types/numeric.py", line 40 + uncover 3 // load ternary_result%22#0 from x-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,test_bytes#0,0,ternary_result%22#0 4 File "arc4_types/numeric.py", line 40 + substring3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{substring3} test_bytes[:4] File "arc4_types/numeric.py", line 40 + btoi // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{btoi} UInt32.from_bytes(test_bytes[:4]).decode() File "arc4_types/numeric.py", line 40 + int 2147483647 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,tmp%24#0,2147483647 2**32 - 1 - 2**31 File "arc4_types/numeric.py", line 40 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,{==} UInt32.from_bytes(test_bytes[:4]).decode() == 2**32 - 1 - 2**31 File "arc4_types/numeric.py", line 40 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0 assert UInt32.from_bytes(test_bytes[:4]).decode() == 2**32 - 1 - 2**31 File "arc4_types/numeric.py", line 40 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {len} test_bytes[:8] File "arc4_types/numeric.py", line 41 + dup // store awst_tmp%26#0 to l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%26#0,awst_tmp%26#0 test_bytes[:8] File "arc4_types/numeric.py", line 41 + bury 5 // store awst_tmp%26#0 to f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%26#0 test_bytes[:8] File "arc4_types/numeric.py", line 41 + int 8 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%26#0,8 8 File "arc4_types/numeric.py", line 41 + > // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {>} test_bytes[:8] File "arc4_types/numeric.py", line 41 + bz main_ternary_false@14 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:8] File "arc4_types/numeric.py", line 41 + // Implicit fall through to main_ternary_true@13 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes[:8] File "arc4_types/numeric.py", line 41 + +main_ternary_true@13: + int 8 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 8 8 File "arc4_types/numeric.py", line 41 + b main_ternary_merge@15 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%28#0 | ternary_result%28#0 + +main_ternary_false@14: + dig 3 // load awst_tmp%26#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | awst_tmp%26#0 test_bytes[:8] File "arc4_types/numeric.py", line 41 + // Implicit fall through to main_ternary_merge@15 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%28#0 | ternary_result%28#0 + +main_ternary_merge@15: + dig 2 // load test_bytes#0 from f-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%28#0 | test_bytes#0 ternary_result%28#0 test_bytes File "arc4_types/numeric.py", line 34 + int 0 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | (𝕏) ternary_result%28#0 | test_bytes#0,0 test_bytes[:8] File "arc4_types/numeric.py", line 41 + uncover 2 // load ternary_result%28#0 from x-stack (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | test_bytes#0,0,ternary_result%28#0 8 File "arc4_types/numeric.py", line 41 + substring3 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {substring3} test_bytes[:8] File "arc4_types/numeric.py", line 41 + btoi // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {btoi} ARC4UInt64.from_bytes(test_bytes[:8]).decode() File "arc4_types/numeric.py", line 41 + int 9223372036854775807 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | tmp%30#0,9223372036854775807 2**64 - 1 - 2**63 File "arc4_types/numeric.py", line 41 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {==} ARC4UInt64.from_bytes(test_bytes[:8]).decode() == 2**64 - 1 - 2**63 File "arc4_types/numeric.py", line 41 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | assert ARC4UInt64.from_bytes(test_bytes[:8]).decode() == 2**64 - 1 - 2**63 File "arc4_types/numeric.py", line 41 + byte 0x0000015333430684 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 0x0000015333430684 "145.6853943940" File "arc4_types/numeric.py", line 43 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {len} decimals.bytes.length File "arc4_types/numeric.py", line 45 + int 8 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | tmp%32#0,8 64 // 8 File "arc4_types/numeric.py", line 45 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {==} decimals.bytes.length == (64 // 8) File "arc4_types/numeric.py", line 45 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | assert decimals.bytes.length == (64 // 8) File "arc4_types/numeric.py", line 45 + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff sixty_four_byte_num File "arc4_types/numeric.py", line 47 + dup // load really_big_int#0 from l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,really_big_int#0 really_big_int File "arc4_types/numeric.py", line 47 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,{len} really_big_int.bytes.length File "arc4_types/numeric.py", line 49 + int 64 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,tmp%34#0,64 64 File "arc4_types/numeric.py", line 49 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,{==} really_big_int.bytes.length == 64 File "arc4_types/numeric.py", line 49 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0 assert really_big_int.bytes.length == 64 File "arc4_types/numeric.py", line 49 + dup // load really_big_int#0 from l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,really_big_int#0 really_big_int File "arc4_types/numeric.py", line 47 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,{len} BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + int 64 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,len_%36#0,64 BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + <= // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,{<=} BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + assert // overflow // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0 BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + int 64 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,64 BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + bzero // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,{bzero} BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + dig 1 // load really_big_int#0 from l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,b_zeros%38#0,really_big_int#0 really_big_int File "arc4_types/numeric.py", line 47 + b| // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_int#0,{b|} BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {==} really_big_int == BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | assert really_big_int == BigUIntN[t.Literal[512]].encode(really_big_int.decode()) File "arc4_types/numeric.py", line 50 + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff sixty_four_byte_num File "arc4_types/numeric.py", line 53 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {len} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + int 64 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | len_%41#0,64 BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + <= // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {<=} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + assert // overflow // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + int 64 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 64 BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + bzero // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {bzero} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | b_zeros%43#0,0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff sixty_four_byte_num File "arc4_types/numeric.py", line 53 + b| // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {b|} BigUFixedNxM[t.Literal[512], t.Literal[2]].encode( File "arc4_types/numeric.py", line 52 + byte 0x01 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,0x01 1 File "arc4_types/numeric.py", line 56 + byte 0x00000000000000000000000000000001 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,biguint#0,0x00000000000000000000000000000001 1 File "arc4_types/numeric.py", line 57 + swap // store arc4_biguint_const#0 to l-stack (no copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0 arc4_biguint_const File "arc4_types/numeric.py", line 57 + dup // load biguint#0 from l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,biguint#0 biguint File "arc4_types/numeric.py", line 56 + byte 0x01 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,biguint#0,0x01 1 File "arc4_types/numeric.py", line 58 + b+ // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,{b+} biguint + 1 File "arc4_types/numeric.py", line 58 + dup // load tmp%44#0 from l-stack (copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,tmp%44#0,tmp%44#0 biguint + 1 File "arc4_types/numeric.py", line 58 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,tmp%44#0,{len} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + int 16 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,tmp%44#0,len_%45#0,16 ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + <= // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,tmp%44#0,{<=} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + assert // overflow // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,tmp%44#0 ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + int 16 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,tmp%44#0,16 ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + bzero // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,tmp%44#0,{bzero} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + b| // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,biguint#0,{b|} ARC4BigUInt.encode(biguint + 1) File "arc4_types/numeric.py", line 58 + swap // load biguint#0 from l-stack (no copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_const#0,arc4_biguint_dynamic#0,biguint#0 biguint File "arc4_types/numeric.py", line 56 + uncover 2 // load arc4_biguint_const#0 from l-stack (no copy) (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_dynamic#0,biguint#0,arc4_biguint_const#0 arc4_biguint_const File "arc4_types/numeric.py", line 57 + b== // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_dynamic#0,{b==} biguint == arc4_biguint_const.decode() File "arc4_types/numeric.py", line 60 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,arc4_biguint_dynamic#0 assert biguint == arc4_biguint_const.decode() File "arc4_types/numeric.py", line 60 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,{len} arc4_biguint_dynamic.bytes.length File "arc4_types/numeric.py", line 62 + int 16 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,tmp%49#0,16 128 // 8 File "arc4_types/numeric.py", line 62 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0,{==} arc4_biguint_dynamic.bytes.length == (128 // 8) File "arc4_types/numeric.py", line 62 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | really_big_decimal#0 assert arc4_biguint_dynamic.bytes.length == (128 // 8) File "arc4_types/numeric.py", line 62 + len // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {len} really_big_decimal.bytes.length File "arc4_types/numeric.py", line 64 + int 64 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | tmp%51#0,64 64 File "arc4_types/numeric.py", line 64 + == // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | {==} really_big_decimal.bytes.length == 64 File "arc4_types/numeric.py", line 64 + assert // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | assert really_big_decimal.bytes.length == 64 File "arc4_types/numeric.py", line 64 + int 1 // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | 1 True File "arc4_types/numeric.py", line 66 + return // (𝕗) awst_tmp%14#0,awst_tmp%20#0,awst_tmp%26#0,awst_tmp%8#0,test_bytes#0,awst_tmp%2#0 | return True File "arc4_types/numeric.py", line 66 + diff --git a/examples/arc4_types/out/numeric.approval_unoptimized.teal b/examples/arc4_types/out/numeric.approval_unoptimized.teal new file mode 100644 index 0000000000..4e0e6180d9 --- /dev/null +++ b/examples/arc4_types/out/numeric.approval_unoptimized.teal @@ -0,0 +1,197 @@ +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: +main: + byte "" + dupn 3 + +main_block@0: + int 255 + dup + itob + extract 7 1 + btoi + == + assert + byte 0x7fffffffffffffff00 + dup + swap + len + dup + swap + int 1 + > + bz main_ternary_false@2 + +main_ternary_true@1: + int 1 + b main_ternary_merge@3 + +main_ternary_false@2: + dup + +main_ternary_merge@3: + dig 2 + dup + int 0 + uncover 3 + substring3 + btoi + int 127 + == + assert + len + dup + bury 4 + int 3 + > + bz main_ternary_false@5 + +main_ternary_true@4: + int 3 + b main_ternary_merge@6 + +main_ternary_false@5: + dig 2 + +main_ternary_merge@6: + dig 2 + dup + int 0 + uncover 3 + substring3 + btoi + int 8388607 + == + assert + len + dup + bury 7 + int 2 + > + bz main_ternary_false@8 + +main_ternary_true@7: + int 2 + b main_ternary_merge@9 + +main_ternary_false@8: + dig 5 + +main_ternary_merge@9: + dig 2 + dup + int 0 + uncover 3 + substring3 + btoi + int 32767 + == + assert + len + dup + bury 6 + int 4 + > + bz main_ternary_false@11 + +main_ternary_true@10: + int 4 + b main_ternary_merge@12 + +main_ternary_false@11: + dig 4 + +main_ternary_merge@12: + dig 2 + dup + int 0 + uncover 3 + substring3 + btoi + int 2147483647 + == + assert + len + dup + bury 5 + int 8 + > + bz main_ternary_false@14 + +main_ternary_true@13: + int 8 + b main_ternary_merge@15 + +main_ternary_false@14: + dig 3 + +main_ternary_merge@15: + dig 2 + int 0 + uncover 2 + substring3 + btoi + int 9223372036854775807 + == + assert + byte 0x0000015333430684 + len + int 8 + == + assert + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + dup + len + int 64 + == + assert + dup + len + int 64 + <= + assert // overflow + int 64 + bzero + dig 1 + b| + == + assert + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + len + int 64 + <= + assert // overflow + int 64 + bzero + byte 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + b| + byte 0x01 + byte 0x00000000000000000000000000000001 + swap + dup + byte 0x01 + b+ + dup + len + int 16 + <= + assert // overflow + int 16 + bzero + b| + swap + uncover 2 + b== + assert + len + int 16 + == + assert + len + int 64 + == + assert + int 1 + return + diff --git a/examples/arc4_types/out/numeric.awst b/examples/arc4_types/out/numeric.awst new file mode 100644 index 0000000000..410950bf62 --- /dev/null +++ b/examples/arc4_types/out/numeric.awst @@ -0,0 +1,36 @@ +sixty_four_byte_num = 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095 + +contract Arc4NumericTypesContract +{ + approval_program(): bool + { + uint8: algopy.UInt64 = 255u + int8_encoded: algopy.arc4.UIntN[typing.Literal[8]] = arc4_encode(uint8, algopy.arc4.UIntN[typing.Literal[8]]) + int8_decoded: algopy.UInt64 = arc4_decode(int8_encoded, algopy.UInt64) + assert(uint8 == int8_decoded) + test_bytes: algopy.Bytes = hex<"7FFFFFFFFFFFFFFF00"> + assert(arc4_decode(reinterpret_cast(test_bytes[:(1u < tmp$0: algopy.UInt64 := len(test_bytes)) ? (1u) : (tmp$0)]), algopy.UInt64) == 127u) + assert(arc4_decode(reinterpret_cast(test_bytes[:(3u < tmp$1: algopy.UInt64 := len(test_bytes)) ? (3u) : (tmp$1)]), algopy.UInt64) == 8388607u) + assert(arc4_decode(reinterpret_cast(test_bytes[:(2u < tmp$2: algopy.UInt64 := len(test_bytes)) ? (2u) : (tmp$2)]), algopy.UInt64) == 32767u) + assert(arc4_decode(reinterpret_cast(test_bytes[:(4u < tmp$3: algopy.UInt64 := len(test_bytes)) ? (4u) : (tmp$3)]), algopy.UInt64) == 2147483647u) + assert(arc4_decode(reinterpret_cast(test_bytes[:(8u < tmp$4: algopy.UInt64 := len(test_bytes)) ? (8u) : (tmp$4)]), algopy.UInt64) == 9223372036854775807u) + decimals: algopy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[10]] = 145.6853943940arc4u64x10 + assert(len(reinterpret_cast(decimals)) == 8u) + really_big_int: algopy.arc4.BigUIntN[typing.Literal[512]] = 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095arc4n512 + assert(len(reinterpret_cast(really_big_int)) == 64u) + assert(reinterpret_cast(really_big_int) == reinterpret_cast(arc4_encode(arc4_decode(really_big_int, algopy.BigUInt), algopy.arc4.BigUIntN[typing.Literal[512]]))) + really_big_decimal: algopy.arc4.BigUFixedNxM[typing.Literal[512], typing.Literal[2]] = arc4_encode(13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095n, algopy.arc4.BigUFixedNxM[typing.Literal[512], typing.Literal[2]]) + biguint: algopy.BigUInt = 1n + arc4_biguint_const: algopy.arc4.BigUIntN[typing.Literal[128]] = 1arc4n128 + arc4_biguint_dynamic: algopy.arc4.BigUIntN[typing.Literal[128]] = arc4_encode(biguint b+ 1n, algopy.arc4.BigUIntN[typing.Literal[128]]) + assert(biguint == arc4_decode(arc4_biguint_const, algopy.BigUInt)) + assert(len(reinterpret_cast(arc4_biguint_dynamic)) == 16u) + assert(len(reinterpret_cast(really_big_decimal)) == 64u) + return true + } + + clear_state_program(): bool + { + return true + } +} \ No newline at end of file diff --git a/examples/arc4_types/out/numeric.clear.debug.teal b/examples/arc4_types/out/numeric.clear.debug.teal new file mode 100644 index 0000000000..aaa5d1fdaf --- /dev/null +++ b/examples/arc4_types/out/numeric.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/numeric.py", line 69 + return // return True File "arc4_types/numeric.py", line 69 + diff --git a/examples/arc4_types/out/numeric.clear.teal b/examples/arc4_types/out/numeric.clear.teal new file mode 100644 index 0000000000..6c0a4226cb --- /dev/null +++ b/examples/arc4_types/out/numeric.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/numeric.clear_unoptimized.debug.teal b/examples/arc4_types/out/numeric.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..aaa5d1fdaf --- /dev/null +++ b/examples/arc4_types/out/numeric.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/numeric.py", line 69 + return // return True File "arc4_types/numeric.py", line 69 + diff --git a/examples/arc4_types/out/numeric.clear_unoptimized.teal b/examples/arc4_types/out/numeric.clear_unoptimized.teal new file mode 100644 index 0000000000..6c0a4226cb --- /dev/null +++ b/examples/arc4_types/out/numeric.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.cssa.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.cssa.ir new file mode 100644 index 0000000000..eaa727db7f --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.cssa.ir @@ -0,0 +1,52 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let tmp%6#0: uint64 = (btoi 0x7f) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let tmp%12#0: uint64 = (btoi 0x7fffff) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let tmp%18#0: uint64 = (btoi 0x7fff) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let tmp%24#0: uint64 = (btoi 0x7fffffff) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let tmp%30#0: uint64 = (btoi 0x7fffffffffffffff) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.final.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.final.ir new file mode 100644 index 0000000000..eaa727db7f --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.final.ir @@ -0,0 +1,52 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let tmp%6#0: uint64 = (btoi 0x7f) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let tmp%12#0: uint64 = (btoi 0x7fffff) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let tmp%18#0: uint64 = (btoi 0x7fff) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let tmp%24#0: uint64 = (btoi 0x7fffffff) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let tmp%30#0: uint64 = (btoi 0x7fffffffffffffff) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.final_unoptimized.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.final_unoptimized.ir new file mode 100644 index 0000000000..179513ac15 --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.final_unoptimized.ir @@ -0,0 +1,123 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let uint8#0: uint64 = 255u + let val_as_bytes%0#0: bytes = (itob uint8#0) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== uint8#0 int8_decoded#0) + (assert tmp%1#0) + let test_bytes#0: bytes = 0x7fffffffffffffff00 + let awst_tmp%2#0: uint64 = (len test_bytes#0) + let tmp%3#0: uint64 = (< 1u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L35 + let ternary_result%4#0: uint64 = 1u + goto block@3 + block@2: // ternary_false_L35 + let ternary_result%4#0: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L35 + let tmp%5#0: bytes = (substring3 test_bytes#0 0u ternary_result%4#0) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let awst_tmp%8#0: uint64 = (len test_bytes#0) + let tmp%9#0: uint64 = (< 3u awst_tmp%8#0) + goto tmp%9#0 ? block@4 : block@5 + block@4: // ternary_true_L37 + let ternary_result%10#0: uint64 = 3u + goto block@6 + block@5: // ternary_false_L37 + let ternary_result%10#0: uint64 = awst_tmp%8#0 + goto block@6 + block@6: // ternary_merge_L37 + let tmp%11#0: bytes = (substring3 test_bytes#0 0u ternary_result%10#0) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let awst_tmp%14#0: uint64 = (len test_bytes#0) + let tmp%15#0: uint64 = (< 2u awst_tmp%14#0) + goto tmp%15#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + let ternary_result%16#0: uint64 = 2u + goto block@9 + block@8: // ternary_false_L39 + let ternary_result%16#0: uint64 = awst_tmp%14#0 + goto block@9 + block@9: // ternary_merge_L39 + let tmp%17#0: bytes = (substring3 test_bytes#0 0u ternary_result%16#0) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let awst_tmp%20#0: uint64 = (len test_bytes#0) + let tmp%21#0: uint64 = (< 4u awst_tmp%20#0) + goto tmp%21#0 ? block@10 : block@11 + block@10: // ternary_true_L40 + let ternary_result%22#0: uint64 = 4u + goto block@12 + block@11: // ternary_false_L40 + let ternary_result%22#0: uint64 = awst_tmp%20#0 + goto block@12 + block@12: // ternary_merge_L40 + let tmp%23#0: bytes = (substring3 test_bytes#0 0u ternary_result%22#0) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let awst_tmp%26#0: uint64 = (len test_bytes#0) + let tmp%27#0: uint64 = (< 8u awst_tmp%26#0) + goto tmp%27#0 ? block@13 : block@14 + block@13: // ternary_true_L41 + let ternary_result%28#0: uint64 = 8u + goto block@15 + block@14: // ternary_false_L41 + let ternary_result%28#0: uint64 = awst_tmp%26#0 + goto block@15 + block@15: // ternary_merge_L41 + let tmp%29#0: bytes = (substring3 test_bytes#0 0u ternary_result%28#0) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let decimals#0: bytes = 0x0000015333430684 + let tmp%32#0: uint64 = (len decimals#0) + let tmp%33#0: uint64 = (== tmp%32#0 8u) + (assert tmp%33#0) + let really_big_int#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + let tmp%34#0: uint64 = (len really_big_int#0) + let tmp%35#0: uint64 = (== tmp%34#0 64u) + (assert tmp%35#0) + let len_%36#0: uint64 = (len really_big_int#0) + let no_overflow%37#0: uint64 = (<= len_%36#0 64u) + (assert no_overflow%37#0) // overflow + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| really_big_int#0 b_zeros%38#0) + let tmp%40#0: uint64 = (== really_big_int#0 tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let biguint#0: bytes = 1b + let arc4_biguint_const#0: bytes = 0x00000000000000000000000000000001 + let tmp%44#0: bytes = (b+ biguint#0 1b) + let len_%45#0: uint64 = (len tmp%44#0) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| tmp%44#0 b_zeros%47#0) + let tmp%48#0: uint64 = (b== biguint#0 arc4_biguint_const#0) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.parallel_copies.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.parallel_copies.ir new file mode 100644 index 0000000000..eaa727db7f --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.parallel_copies.ir @@ -0,0 +1,52 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let tmp%6#0: uint64 = (btoi 0x7f) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let tmp%12#0: uint64 = (btoi 0x7fffff) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let tmp%18#0: uint64 = (btoi 0x7fff) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let tmp%24#0: uint64 = (btoi 0x7fffffff) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let tmp%30#0: uint64 = (btoi 0x7fffffffffffffff) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.post_ssa.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.post_ssa.ir new file mode 100644 index 0000000000..eaa727db7f --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.post_ssa.ir @@ -0,0 +1,52 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let tmp%6#0: uint64 = (btoi 0x7f) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let tmp%12#0: uint64 = (btoi 0x7fffff) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let tmp%18#0: uint64 = (btoi 0x7fff) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let tmp%24#0: uint64 = (btoi 0x7fffffff) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let tmp%30#0: uint64 = (btoi 0x7fffffffffffffff) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.ir new file mode 100644 index 0000000000..3e233feb6f --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.ir @@ -0,0 +1,128 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let uint8#0: uint64 = 255u + let val_as_bytes%0#0: bytes = (itob uint8#0) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== uint8#0 int8_decoded#0) + (assert tmp%1#0) + let test_bytes#0: bytes = 0x7fffffffffffffff00 + let awst_tmp%2#0: uint64 = (len test_bytes#0) + let tmp%3#0: uint64 = (< 1u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L35 + let ternary_result%4#0: uint64 = 1u + goto block@3 + block@2: // ternary_false_L35 + let ternary_result%4#1: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L35 + let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, ternary_result%4#1 <- block@2) + let tmp%5#0: bytes = (substring3 test_bytes#0 0u ternary_result%4#2) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let awst_tmp%8#0: uint64 = (len test_bytes#0) + let tmp%9#0: uint64 = (< 3u awst_tmp%8#0) + goto tmp%9#0 ? block@4 : block@5 + block@4: // ternary_true_L37 + let ternary_result%10#0: uint64 = 3u + goto block@6 + block@5: // ternary_false_L37 + let ternary_result%10#1: uint64 = awst_tmp%8#0 + goto block@6 + block@6: // ternary_merge_L37 + let ternary_result%10#2: uint64 = φ(ternary_result%10#0 <- block@4, ternary_result%10#1 <- block@5) + let tmp%11#0: bytes = (substring3 test_bytes#0 0u ternary_result%10#2) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let awst_tmp%14#0: uint64 = (len test_bytes#0) + let tmp%15#0: uint64 = (< 2u awst_tmp%14#0) + goto tmp%15#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + let ternary_result%16#0: uint64 = 2u + goto block@9 + block@8: // ternary_false_L39 + let ternary_result%16#1: uint64 = awst_tmp%14#0 + goto block@9 + block@9: // ternary_merge_L39 + let ternary_result%16#2: uint64 = φ(ternary_result%16#0 <- block@7, ternary_result%16#1 <- block@8) + let tmp%17#0: bytes = (substring3 test_bytes#0 0u ternary_result%16#2) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let awst_tmp%20#0: uint64 = (len test_bytes#0) + let tmp%21#0: uint64 = (< 4u awst_tmp%20#0) + goto tmp%21#0 ? block@10 : block@11 + block@10: // ternary_true_L40 + let ternary_result%22#0: uint64 = 4u + goto block@12 + block@11: // ternary_false_L40 + let ternary_result%22#1: uint64 = awst_tmp%20#0 + goto block@12 + block@12: // ternary_merge_L40 + let ternary_result%22#2: uint64 = φ(ternary_result%22#0 <- block@10, ternary_result%22#1 <- block@11) + let tmp%23#0: bytes = (substring3 test_bytes#0 0u ternary_result%22#2) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let awst_tmp%26#0: uint64 = (len test_bytes#0) + let tmp%27#0: uint64 = (< 8u awst_tmp%26#0) + goto tmp%27#0 ? block@13 : block@14 + block@13: // ternary_true_L41 + let ternary_result%28#0: uint64 = 8u + goto block@15 + block@14: // ternary_false_L41 + let ternary_result%28#1: uint64 = awst_tmp%26#0 + goto block@15 + block@15: // ternary_merge_L41 + let ternary_result%28#2: uint64 = φ(ternary_result%28#0 <- block@13, ternary_result%28#1 <- block@14) + let tmp%29#0: bytes = (substring3 test_bytes#0 0u ternary_result%28#2) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let decimals#0: bytes = 0x0000015333430684 + let tmp%32#0: uint64 = (len decimals#0) + let tmp%33#0: uint64 = (== tmp%32#0 8u) + (assert tmp%33#0) + let really_big_int#0: bytes = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + let tmp%34#0: uint64 = (len really_big_int#0) + let tmp%35#0: uint64 = (== tmp%34#0 64u) + (assert tmp%35#0) + let len_%36#0: uint64 = (len really_big_int#0) + let no_overflow%37#0: uint64 = (<= len_%36#0 64u) + (assert no_overflow%37#0) // overflow + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| really_big_int#0 b_zeros%38#0) + let tmp%40#0: uint64 = (== really_big_int#0 tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let biguint#0: bytes = 1b + let arc4_biguint_const#0: bytes = 0x00000000000000000000000000000001 + let tmp%44#0: bytes = (b+ biguint#0 1b) + let len_%45#0: uint64 = (len tmp%44#0) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| tmp%44#0 b_zeros%47#0) + let tmp%48#0: uint64 = (b== biguint#0 arc4_biguint_const#0) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_1.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..af9286662c --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_1.ir @@ -0,0 +1,117 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let awst_tmp%2#0: uint64 = (len 0x7fffffffffffffff00) + let tmp%3#0: uint64 = (< 1u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L35 + let ternary_result%4#0: uint64 = 1u + goto block@3 + block@2: // ternary_false_L35 + goto block@3 + block@3: // ternary_merge_L35 + let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, awst_tmp%2#0 <- block@2) + let tmp%5#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%4#2) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let awst_tmp%8#0: uint64 = (len 0x7fffffffffffffff00) + let tmp%9#0: uint64 = (< 3u awst_tmp%8#0) + goto tmp%9#0 ? block@4 : block@5 + block@4: // ternary_true_L37 + let ternary_result%10#0: uint64 = 3u + goto block@6 + block@5: // ternary_false_L37 + goto block@6 + block@6: // ternary_merge_L37 + let ternary_result%10#2: uint64 = φ(ternary_result%10#0 <- block@4, awst_tmp%8#0 <- block@5) + let tmp%11#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%10#2) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let awst_tmp%14#0: uint64 = (len 0x7fffffffffffffff00) + let tmp%15#0: uint64 = (< 2u awst_tmp%14#0) + goto tmp%15#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + let ternary_result%16#0: uint64 = 2u + goto block@9 + block@8: // ternary_false_L39 + goto block@9 + block@9: // ternary_merge_L39 + let ternary_result%16#2: uint64 = φ(ternary_result%16#0 <- block@7, awst_tmp%14#0 <- block@8) + let tmp%17#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%16#2) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let awst_tmp%20#0: uint64 = (len 0x7fffffffffffffff00) + let tmp%21#0: uint64 = (< 4u awst_tmp%20#0) + goto tmp%21#0 ? block@10 : block@11 + block@10: // ternary_true_L40 + let ternary_result%22#0: uint64 = 4u + goto block@12 + block@11: // ternary_false_L40 + goto block@12 + block@12: // ternary_merge_L40 + let ternary_result%22#2: uint64 = φ(ternary_result%22#0 <- block@10, awst_tmp%20#0 <- block@11) + let tmp%23#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%22#2) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let awst_tmp%26#0: uint64 = (len 0x7fffffffffffffff00) + let tmp%27#0: uint64 = (< 8u awst_tmp%26#0) + goto tmp%27#0 ? block@13 : block@14 + block@13: // ternary_true_L41 + let ternary_result%28#0: uint64 = 8u + goto block@15 + block@14: // ternary_false_L41 + goto block@15 + block@15: // ternary_merge_L41 + let ternary_result%28#2: uint64 = φ(ternary_result%28#0 <- block@13, awst_tmp%26#0 <- block@14) + let tmp%29#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%28#2) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let tmp%32#0: uint64 = (len 0x0000015333430684) + let tmp%33#0: uint64 = (== tmp%32#0 8u) + (assert tmp%33#0) + let tmp%34#0: uint64 = (len 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) + let tmp%35#0: uint64 = (== tmp%34#0 64u) + (assert tmp%35#0) + let len_%36#0: uint64 = (len 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) + let no_overflow%37#0: uint64 = (<= len_%36#0 64u) + (assert no_overflow%37#0) // overflow + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let tmp%44#0: bytes = (b+ 1b 1b) + let len_%45#0: uint64 = (len tmp%44#0) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| tmp%44#0 b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_2.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..3923e7e246 --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_2.ir @@ -0,0 +1,113 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let awst_tmp%2#0: uint64 = 9u + let tmp%3#0: uint64 = (< 1u 9u) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L35 + let ternary_result%4#0: uint64 = 1u + goto block@3 + block@2: // ternary_false_L35 + goto block@3 + block@3: // ternary_merge_L35 + let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, awst_tmp%2#0 <- block@2) + let tmp%5#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%4#2) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let awst_tmp%8#0: uint64 = 9u + let tmp%9#0: uint64 = (< 3u 9u) + goto tmp%9#0 ? block@4 : block@5 + block@4: // ternary_true_L37 + let ternary_result%10#0: uint64 = 3u + goto block@6 + block@5: // ternary_false_L37 + goto block@6 + block@6: // ternary_merge_L37 + let ternary_result%10#2: uint64 = φ(ternary_result%10#0 <- block@4, awst_tmp%8#0 <- block@5) + let tmp%11#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%10#2) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let awst_tmp%14#0: uint64 = 9u + let tmp%15#0: uint64 = (< 2u 9u) + goto tmp%15#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + let ternary_result%16#0: uint64 = 2u + goto block@9 + block@8: // ternary_false_L39 + goto block@9 + block@9: // ternary_merge_L39 + let ternary_result%16#2: uint64 = φ(ternary_result%16#0 <- block@7, awst_tmp%14#0 <- block@8) + let tmp%17#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%16#2) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let awst_tmp%20#0: uint64 = 9u + let tmp%21#0: uint64 = (< 4u 9u) + goto tmp%21#0 ? block@10 : block@11 + block@10: // ternary_true_L40 + let ternary_result%22#0: uint64 = 4u + goto block@12 + block@11: // ternary_false_L40 + goto block@12 + block@12: // ternary_merge_L40 + let ternary_result%22#2: uint64 = φ(ternary_result%22#0 <- block@10, awst_tmp%20#0 <- block@11) + let tmp%23#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%22#2) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let awst_tmp%26#0: uint64 = 9u + let tmp%27#0: uint64 = (< 8u 9u) + goto tmp%27#0 ? block@13 : block@14 + block@13: // ternary_true_L41 + let ternary_result%28#0: uint64 = 8u + goto block@15 + block@14: // ternary_false_L41 + goto block@15 + block@15: // ternary_merge_L41 + let ternary_result%28#2: uint64 = φ(ternary_result%28#0 <- block@13, awst_tmp%26#0 <- block@14) + let tmp%29#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%28#2) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let tmp%33#0: uint64 = (== 8u 8u) + (assert tmp%33#0) + let tmp%35#0: uint64 = (== 64u 64u) + (assert tmp%35#0) + let no_overflow%37#0: uint64 = (<= 64u 64u) + (assert no_overflow%37#0) // overflow + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_3.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..4b473237d3 --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_3.ir @@ -0,0 +1,77 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let awst_tmp%2#0: uint64 = 9u + let ternary_result%4#0: uint64 = 1u + goto block@3 + block@3: // ternary_merge_L35 + let tmp%5#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%4#0) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let awst_tmp%8#0: uint64 = 9u + let ternary_result%10#0: uint64 = 3u + goto block@6 + block@6: // ternary_merge_L37 + let tmp%11#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%10#0) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let awst_tmp%14#0: uint64 = 9u + let ternary_result%16#0: uint64 = 2u + goto block@9 + block@9: // ternary_merge_L39 + let tmp%17#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%16#0) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let awst_tmp%20#0: uint64 = 9u + let ternary_result%22#0: uint64 = 4u + goto block@12 + block@12: // ternary_merge_L40 + let tmp%23#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%22#0) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let awst_tmp%26#0: uint64 = 9u + let ternary_result%28#0: uint64 = 8u + goto block@15 + block@15: // ternary_merge_L41 + let tmp%29#0: bytes = (substring3 0x7fffffffffffffff00 0u ternary_result%28#0) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_4.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..aa50d5a03a --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_4.ir @@ -0,0 +1,57 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let tmp%5#0: bytes = (substring3 0x7fffffffffffffff00 0u 1u) + let tmp%6#0: uint64 = (btoi tmp%5#0) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let tmp%11#0: bytes = (substring3 0x7fffffffffffffff00 0u 3u) + let tmp%12#0: uint64 = (btoi tmp%11#0) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let tmp%17#0: bytes = (substring3 0x7fffffffffffffff00 0u 2u) + let tmp%18#0: uint64 = (btoi tmp%17#0) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let tmp%23#0: bytes = (substring3 0x7fffffffffffffff00 0u 4u) + let tmp%24#0: uint64 = (btoi tmp%23#0) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let tmp%29#0: bytes = (substring3 0x7fffffffffffffff00 0u 8u) + let tmp%30#0: uint64 = (btoi tmp%29#0) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_5.ir b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..eaa727db7f --- /dev/null +++ b/examples/arc4_types/out/numeric_Arc4NumericTypesContract.ssa.opt_pass_5.ir @@ -0,0 +1,52 @@ +contract examples.arc4_types.numeric.Arc4NumericTypesContract: + program approval: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.approval_program() -> uint64: + block@0: // L25 + let val_as_bytes%0#0: bytes = (itob 255u) + let int8_encoded#0: bytes = ((extract 7 1) val_as_bytes%0#0) + let int8_decoded#0: uint64 = (btoi int8_encoded#0) + let tmp%1#0: uint64 = (== 255u int8_decoded#0) + (assert tmp%1#0) + let tmp%6#0: uint64 = (btoi 0x7f) + let tmp%7#0: uint64 = (== tmp%6#0 127u) + (assert tmp%7#0) + let tmp%12#0: uint64 = (btoi 0x7fffff) + let tmp%13#0: uint64 = (== tmp%12#0 8388607u) + (assert tmp%13#0) + let tmp%18#0: uint64 = (btoi 0x7fff) + let tmp%19#0: uint64 = (== tmp%18#0 32767u) + (assert tmp%19#0) + let tmp%24#0: uint64 = (btoi 0x7fffffff) + let tmp%25#0: uint64 = (== tmp%24#0 2147483647u) + (assert tmp%25#0) + let tmp%30#0: uint64 = (btoi 0x7fffffffffffffff) + let tmp%31#0: uint64 = (== tmp%30#0 9223372036854775807u) + (assert tmp%31#0) + let b_zeros%38#0: bytes = (bzero 64u) + let tmp%39#0: bytes = (b| 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff b_zeros%38#0) + let tmp%40#0: uint64 = (== 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff tmp%39#0) + (assert tmp%40#0) + let len_%41#0: uint64 = (len 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b) + let no_overflow%42#0: uint64 = (<= len_%41#0 64u) + (assert no_overflow%42#0) // overflow + let b_zeros%43#0: bytes = (bzero 64u) + let really_big_decimal#0: bytes = (b| 13407807929942597099574024998205846127479365820592393377723561443721764030073546976801874298166903427690031858186486050853753882811946569946433649006084095b b_zeros%43#0) + let len_%45#0: uint64 = (len 2b) + let no_overflow%46#0: uint64 = (<= len_%45#0 16u) + (assert no_overflow%46#0) // overflow + let b_zeros%47#0: bytes = (bzero 16u) + let arc4_biguint_dynamic#0: bytes = (b| 2b b_zeros%47#0) + let tmp%48#0: uint64 = (b== 1b 0x00000000000000000000000000000001) + (assert tmp%48#0) + let tmp%49#0: uint64 = (len arc4_biguint_dynamic#0) + let tmp%50#0: uint64 = (== tmp%49#0 16u) + (assert tmp%50#0) + let tmp%51#0: uint64 = (len really_big_decimal#0) + let tmp%52#0: uint64 = (== tmp%51#0 64u) + (assert tmp%52#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.numeric.Arc4NumericTypesContract.clear_state_program() -> uint64: + block@0: // L68 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string.O0.log b/examples/arc4_types/out/string.O0.log new file mode 100644 index 0000000000..d0e369b6dc --- /dev/null +++ b/examples/arc4_types/out/string.O0.log @@ -0,0 +1,44 @@ +PC Teal Stack +1 +4 byte "Hello World!" "Hello World!" +18 dup "Hello World!", "Hello World!" +19 swap "Hello World!", "Hello World!" +20 dup "Hello World!", "Hello World!", "Hello World!" +21 len "Hello World!", "Hello World!", 12 +22 itob "Hello World!", "Hello World!", 0x000000000000000C +23 extract 6 2 "Hello World!", "Hello World!", 0x000C +26 dig 1 "Hello World!", "Hello World!", 0x000C, "Hello World!" +28 concat "Hello World!", "Hello World!", 0x000C48656C6C6F20576F726C6421 +29 dup "Hello World!", "Hello World!", 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +30 cover 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +32 dup "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +33 extract 2 0 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!" +36 cover 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", "Hello World!", 0x000C48656C6C6F20576F726C6421 +38 dup "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", "Hello World!", 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +39 cover 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +41 != "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, 1 +42 assert "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +43 len "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +44 dup "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14 +45 swap "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14 +46 int 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14, 2 +47 > "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +48 bz main_ternary_false@2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +51 int 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2 +52 b main_ternary_merge@3 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2 +56 dig 3 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 0x000C48656C6C6F20576F726C6421 +58 dup "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +59 len "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 0x000C48656C6C6F20576F726C6421, 14 +60 swap "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 14, 0x000C48656C6C6F20576F726C6421 +61 cover 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 0x000C48656C6C6F20576F726C6421, 2, 14 +63 substring3 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!" +64 dig 4 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!", "Hello World!" +66 dup "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!", "Hello World!", "Hello World!" +67 cover 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!", "Hello World!", "Hello World!" +69 == "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!", 1 +70 assert "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!" +71 dig 2 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!", "Hello World!" +73 == "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +74 assert "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +75 int 1 "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +77 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/string.O1.log b/examples/arc4_types/out/string.O1.log new file mode 100644 index 0000000000..4a2d834e85 --- /dev/null +++ b/examples/arc4_types/out/string.O1.log @@ -0,0 +1,40 @@ +PC Teal Stack +1 +4 +19 int 12 12 +21 itob 0x000000000000000C +22 extract 6 2 0x000C +25 byte "Hello World!" 0x000C, "Hello World!" +26 concat 0x000C48656C6C6F20576F726C6421 +27 dup 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +28 swap 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +29 dup 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +30 extract 2 0 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421, "Hello World!" +33 swap 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +34 byte "Hello World!" 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!" +35 dig 1 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +37 != 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, 1 +38 assert 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +39 len 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +40 dup 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14 +41 swap 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14 +42 int 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14, 2 +43 > 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +44 bz main_ternary_false@2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +47 int 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2 +48 b main_ternary_merge@3 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2 +52 dig 3 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 0x000C48656C6C6F20576F726C6421 +54 dup 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +55 len 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 0x000C48656C6C6F20576F726C6421, 14 +56 swap 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2, 14, 0x000C48656C6C6F20576F726C6421 +57 cover 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 0x000C48656C6C6F20576F726C6421, 2, 14 +59 substring3 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!" +60 byte "Hello World!" 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!", "Hello World!" +61 == 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +62 assert 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +63 byte "Hello World!" 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!" +64 dig 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, "Hello World!", "Hello World!" +66 == 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +67 assert 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +68 int 1 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +70 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/string.O2.log b/examples/arc4_types/out/string.O2.log new file mode 100644 index 0000000000..9ef35f3d2c --- /dev/null +++ b/examples/arc4_types/out/string.O2.log @@ -0,0 +1,39 @@ +PC Teal Stack +1 +4 +19 int 12 12 +21 itob 0x000000000000000C +22 extract 6 2 0x000C +25 byte "Hello World!" 0x000C, "Hello World!" +26 concat 0x000C48656C6C6F20576F726C6421 +27 dup 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +28 dup 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +29 extract 2 0 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421, "Hello World!" +32 swap 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +33 byte "Hello World!" 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!" +34 dig 1 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +36 != 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421, 1 +37 assert 0x000C48656C6C6F20576F726C6421, "Hello World!", 0x000C48656C6C6F20576F726C6421 +38 len 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +39 dup 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14 +40 int 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 14, 2 +41 > 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 1 +42 bz main_ternary_false@2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14 +45 int 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 14, 2 +46 bury 1 0x000C48656C6C6F20576F726C6421, "Hello World!", 2 +48 b main_ternary_merge@3 0x000C48656C6C6F20576F726C6421, "Hello World!", 2 +51 dig 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 0x000C48656C6C6F20576F726C6421 +53 dup 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 0x000C48656C6C6F20576F726C6421, 0x000C48656C6C6F20576F726C6421 +54 len 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 0x000C48656C6C6F20576F726C6421, 14 +55 dig 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 0x000C48656C6C6F20576F726C6421, 14, 2 +57 swap 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 0x000C48656C6C6F20576F726C6421, 2, 14 +58 substring3 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, "Hello World!" +59 byte "Hello World!" 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, "Hello World!", "Hello World!" +60 == 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 1 +61 assert 0x000C48656C6C6F20576F726C6421, "Hello World!", 2 +62 byte "Hello World!" 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, "Hello World!" +63 dig 2 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, "Hello World!", "Hello World!" +65 == 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 1 +66 assert 0x000C48656C6C6F20576F726C6421, "Hello World!", 2 +67 int 1 0x000C48656C6C6F20576F726C6421, "Hello World!", 2, 1 +69 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/string.approval.debug.teal b/examples/arc4_types/out/string.approval.debug.teal new file mode 100644 index 0000000000..0a4da9cfaa --- /dev/null +++ b/examples/arc4_types/out/string.approval.debug.teal @@ -0,0 +1,53 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: +main_block@0: + int 12 // 12 String.encode(some_bytes) File "arc4_types/string.py", line 11 + itob // {itob} String.encode(some_bytes) File "arc4_types/string.py", line 11 + extract 6 2 // {extract} String.encode(some_bytes) File "arc4_types/string.py", line 11 + byte "Hello World!" // value_as_uint16%2#0,"Hello World!" b"Hello World!" File "arc4_types/string.py", line 9 + concat // {concat} String.encode(some_bytes) File "arc4_types/string.py", line 11 + dup // store some_bytes_as_string#0 to l-stack (copy) some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + swap // store some_bytes_as_string#0 to f-stack (𝕗) some_bytes_as_string#0 | some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + dup // load some_bytes_as_string#0 from l-stack (copy) (𝕗) some_bytes_as_string#0 | some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + extract 2 0 // (𝕗) some_bytes_as_string#0 | some_bytes_as_string#0,{extract} some_bytes_as_string.decode() File "arc4_types/string.py", line 13 + swap // store some_bytes_as_bytes_again#0 to f-stack (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0 some_bytes_as_bytes_again File "arc4_types/string.py", line 13 + byte "Hello World!" // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0,"Hello World!" b"Hello World!" File "arc4_types/string.py", line 9 + dig 1 // load some_bytes_as_string#0 from l-stack (copy) (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0,"Hello World!",some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + != // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0,{!=} some_bytes != some_bytes_as_string.bytes File "arc4_types/string.py", line 16 + assert // Original bytes should not match encoded bytes // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0 assert ( File "arc4_types/string.py", line 15 + len // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0 | {len} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + dup // store awst_tmp%4#0 to l-stack (copy) (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0 | awst_tmp%4#0,awst_tmp%4#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + swap // store awst_tmp%4#0 to f-stack (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | awst_tmp%4#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + int 2 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | awst_tmp%4#0,2 2 File "arc4_types/string.py", line 20 + > // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | {>} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + bz main_ternary_false@2 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + // Implicit fall through to main_ternary_true@1 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + +main_ternary_true@1: + int 2 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | 2 2 File "arc4_types/string.py", line 20 + b main_ternary_merge@3 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +main_ternary_false@2: + dup // load awst_tmp%4#0 from f-stack (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | awst_tmp%4#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + // Implicit fall through to main_ternary_merge@3 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +main_ternary_merge@3: + dig 3 // load some_bytes_as_string#0 from f-stack (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | some_bytes_as_string#0 ternary_result%6#0 some_bytes_as_string File "arc4_types/string.py", line 11 + dup // store some_bytes_as_string#0 to l-stack (copy) (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + len // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | some_bytes_as_string#0,{len} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + swap // store base_length%7#0 to l-stack (no copy) (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | base_length%7#0,some_bytes_as_string#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + cover 2 // virtual: 2 ops (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes_as_string#0,ternary_result%6#0,base_length%7#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + substring3 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | {substring3} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + byte "Hello World!" // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | tmp%8#0,"Hello World!" b"Hello World!" File "arc4_types/string.py", line 9 + == // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | {==} some_bytes == some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + assert // Original bytes should match encoded if we strip the length header // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | assert ( File "arc4_types/string.py", line 19 + byte "Hello World!" // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | "Hello World!" b"Hello World!" File "arc4_types/string.py", line 9 + dig 2 // load some_bytes_as_bytes_again#0 from f-stack (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | "Hello World!",some_bytes_as_bytes_again#0 some_bytes_as_bytes_again File "arc4_types/string.py", line 13 + == // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | {==} some_bytes == some_bytes_as_bytes_again File "arc4_types/string.py", line 23 + assert // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | assert some_bytes == some_bytes_as_bytes_again File "arc4_types/string.py", line 23 + int 1 // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | 1 True File "arc4_types/string.py", line 25 + return // (𝕗) some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | return True File "arc4_types/string.py", line 25 + diff --git a/examples/arc4_types/out/string.approval.teal b/examples/arc4_types/out/string.approval.teal new file mode 100644 index 0000000000..36547728a6 --- /dev/null +++ b/examples/arc4_types/out/string.approval.teal @@ -0,0 +1,49 @@ +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: +main_block@0: + int 12 + itob + extract 6 2 + byte "Hello World!" + concat + dup + swap + dup + extract 2 0 + swap + byte "Hello World!" + dig 1 + != + assert // Original bytes should not match encoded bytes + len + dup + swap + int 2 + > + bz main_ternary_false@2 + +main_ternary_true@1: + int 2 + b main_ternary_merge@3 + +main_ternary_false@2: + dup + +main_ternary_merge@3: + dig 3 + dup + len + swap + cover 2 + substring3 + byte "Hello World!" + == + assert // Original bytes should match encoded if we strip the length header + byte "Hello World!" + dig 2 + == + assert + int 1 + return + diff --git a/examples/arc4_types/out/string.approval_unoptimized.debug.teal b/examples/arc4_types/out/string.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..0b3b0ec015 --- /dev/null +++ b/examples/arc4_types/out/string.approval_unoptimized.debug.teal @@ -0,0 +1,58 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: +main_block@0: + byte "Hello World!" // "Hello World!" b"Hello World!" File "arc4_types/string.py", line 9 + dup // store some_bytes#0 to l-stack (copy) some_bytes#0,some_bytes#0 some_bytes File "arc4_types/string.py", line 9 + swap // store some_bytes#0 to f-stack (𝕗) some_bytes#0 | some_bytes#0 some_bytes File "arc4_types/string.py", line 9 + dup // load some_bytes#0 from l-stack (copy) (𝕗) some_bytes#0 | some_bytes#0,some_bytes#0 some_bytes File "arc4_types/string.py", line 9 + len // (𝕗) some_bytes#0 | some_bytes#0,{len} String.encode(some_bytes) File "arc4_types/string.py", line 11 + itob // (𝕗) some_bytes#0 | some_bytes#0,{itob} String.encode(some_bytes) File "arc4_types/string.py", line 11 + extract 6 2 // (𝕗) some_bytes#0 | some_bytes#0,{extract} String.encode(some_bytes) File "arc4_types/string.py", line 11 + dig 1 // load some_bytes#0 from l-stack (copy) (𝕗) some_bytes#0 | some_bytes#0,value_as_uint16%2#0,some_bytes#0 some_bytes File "arc4_types/string.py", line 9 + concat // (𝕗) some_bytes#0 | some_bytes#0,{concat} String.encode(some_bytes) File "arc4_types/string.py", line 11 + dup // store some_bytes_as_string#0 to l-stack (copy) (𝕗) some_bytes#0 | some_bytes#0,some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + cover 2 // store some_bytes_as_string#0 to f-stack (𝕗) some_bytes#0,some_bytes_as_string#0 | some_bytes#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + dup // load some_bytes_as_string#0 from l-stack (copy) (𝕗) some_bytes#0,some_bytes_as_string#0 | some_bytes#0,some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + extract 2 0 // (𝕗) some_bytes#0,some_bytes_as_string#0 | some_bytes#0,some_bytes_as_string#0,{extract} some_bytes_as_string.decode() File "arc4_types/string.py", line 13 + cover 2 // store some_bytes_as_bytes_again#0 to f-stack (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes#0,some_bytes_as_string#0 some_bytes_as_bytes_again File "arc4_types/string.py", line 13 + dup + cover 2 // store some_bytes_as_string#0 to l-stack (copy) (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0,some_bytes#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + != // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0,{!=} some_bytes != some_bytes_as_string.bytes File "arc4_types/string.py", line 16 + assert // Original bytes should not match encoded bytes // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0 | some_bytes_as_string#0 assert ( File "arc4_types/string.py", line 15 + len // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0 | {len} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + dup // store awst_tmp%4#0 to l-stack (copy) (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0 | awst_tmp%4#0,awst_tmp%4#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + swap // store awst_tmp%4#0 to f-stack (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | awst_tmp%4#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + int 2 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | awst_tmp%4#0,2 2 File "arc4_types/string.py", line 20 + > // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | {>} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + bz main_ternary_false@2 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + // Implicit fall through to main_ternary_true@1 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + +main_ternary_true@1: + int 2 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | 2 2 File "arc4_types/string.py", line 20 + b main_ternary_merge@3 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +main_ternary_false@2: + dup // load awst_tmp%4#0 from f-stack (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | awst_tmp%4#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + // Implicit fall through to main_ternary_merge@3 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +main_ternary_merge@3: + dig 3 // load some_bytes_as_string#0 from f-stack (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | some_bytes_as_string#0 ternary_result%6#0 some_bytes_as_string File "arc4_types/string.py", line 11 + dup // store some_bytes_as_string#0 to l-stack (copy) (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | some_bytes_as_string#0,some_bytes_as_string#0 some_bytes_as_string File "arc4_types/string.py", line 11 + len // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | some_bytes_as_string#0,{len} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + swap // store base_length%7#0 to l-stack (no copy) (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | base_length%7#0,some_bytes_as_string#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + cover 2 // virtual: 2 ops (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes_as_string#0,ternary_result%6#0,base_length%7#0 some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + substring3 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | {substring3} some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + dig 4 // load some_bytes#0 from f-stack (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | tmp%8#0,some_bytes#0 some_bytes File "arc4_types/string.py", line 9 + dup + cover 2 // store some_bytes#0 to l-stack (copy) (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes#0,tmp%8#0,some_bytes#0 some_bytes File "arc4_types/string.py", line 9 + == // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes#0,{==} some_bytes == some_bytes_as_string.bytes[2:] File "arc4_types/string.py", line 20 + assert // Original bytes should match encoded if we strip the length header // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes#0 assert ( File "arc4_types/string.py", line 19 + dig 2 // load some_bytes_as_bytes_again#0 from f-stack (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | some_bytes#0,some_bytes_as_bytes_again#0 some_bytes_as_bytes_again File "arc4_types/string.py", line 13 + == // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | {==} some_bytes == some_bytes_as_bytes_again File "arc4_types/string.py", line 23 + assert // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | assert some_bytes == some_bytes_as_bytes_again File "arc4_types/string.py", line 23 + int 1 // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | 1 True File "arc4_types/string.py", line 25 + return // (𝕗) some_bytes#0,some_bytes_as_string#0,some_bytes_as_bytes_again#0,awst_tmp%4#0 | return True File "arc4_types/string.py", line 25 + diff --git a/examples/arc4_types/out/string.approval_unoptimized.teal b/examples/arc4_types/out/string.approval_unoptimized.teal new file mode 100644 index 0000000000..46c825bf13 --- /dev/null +++ b/examples/arc4_types/out/string.approval_unoptimized.teal @@ -0,0 +1,54 @@ +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: +main_block@0: + byte "Hello World!" + dup + swap + dup + len + itob + extract 6 2 + dig 1 + concat + dup + cover 2 + dup + extract 2 0 + cover 2 + dup + cover 2 + != + assert // Original bytes should not match encoded bytes + len + dup + swap + int 2 + > + bz main_ternary_false@2 + +main_ternary_true@1: + int 2 + b main_ternary_merge@3 + +main_ternary_false@2: + dup + +main_ternary_merge@3: + dig 3 + dup + len + swap + cover 2 + substring3 + dig 4 + dup + cover 2 + == + assert // Original bytes should match encoded if we strip the length header + dig 2 + == + assert + int 1 + return + diff --git a/examples/arc4_types/out/string.awst b/examples/arc4_types/out/string.awst new file mode 100644 index 0000000000..775f6891d1 --- /dev/null +++ b/examples/arc4_types/out/string.awst @@ -0,0 +1,18 @@ +contract Arc4StringTypesContract +{ + approval_program(): bool + { + some_bytes: algopy.Bytes = 'Hello World!' + some_bytes_as_string: algopy.arc4.String = arc4_encode(some_bytes, algopy.arc4.String) + some_bytes_as_bytes_again: algopy.Bytes = arc4_decode(some_bytes_as_string, algopy.Bytes) + assert(some_bytes != reinterpret_cast(some_bytes_as_string), comment="Original bytes should not match encoded bytes") + assert(some_bytes == reinterpret_cast(some_bytes_as_string)[(2u < tmp$0: algopy.UInt64 := len(reinterpret_cast(some_bytes_as_string))) ? (2u) : (tmp$0):], comment="Original bytes should match encoded if we strip the length header") + assert(some_bytes == some_bytes_as_bytes_again) + return true + } + + clear_state_program(): bool + { + return true + } +} \ No newline at end of file diff --git a/examples/arc4_types/out/string.clear.debug.teal b/examples/arc4_types/out/string.clear.debug.teal new file mode 100644 index 0000000000..82948cdc69 --- /dev/null +++ b/examples/arc4_types/out/string.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/string.py", line 28 + return // return True File "arc4_types/string.py", line 28 + diff --git a/examples/arc4_types/out/string.clear.teal b/examples/arc4_types/out/string.clear.teal new file mode 100644 index 0000000000..5b8ef8245a --- /dev/null +++ b/examples/arc4_types/out/string.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/string.clear_unoptimized.debug.teal b/examples/arc4_types/out/string.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..82948cdc69 --- /dev/null +++ b/examples/arc4_types/out/string.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/string.py", line 28 + return // return True File "arc4_types/string.py", line 28 + diff --git a/examples/arc4_types/out/string.clear_unoptimized.teal b/examples/arc4_types/out/string.clear_unoptimized.teal new file mode 100644 index 0000000000..5b8ef8245a --- /dev/null +++ b/examples/arc4_types/out/string.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.cssa.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.cssa.ir new file mode 100644 index 0000000000..3263c81eb6 --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.cssa.ir @@ -0,0 +1,35 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let value_as_bytes%1#0: bytes = (itob 12u) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + let ternary_result%6#3: uint64 = ternary_result%6#0 + goto block@3 + block@2: // ternary_false_L20 + let awst_tmp%4#1: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L20 + let ternary_result%6#4: uint64 = φ(ternary_result%6#3 <- block@1, awst_tmp%4#1 <- block@2) + let ternary_result%6#2: uint64 = ternary_result%6#4 + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#2 base_length%7#0) + let tmp%9#0: uint64 = (== "Hello World!" tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.final.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.final.ir new file mode 100644 index 0000000000..009f0aba28 --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.final.ir @@ -0,0 +1,32 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let value_as_bytes%1#0: bytes = (itob 12u) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L20 + let ternary_result%6#0: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L20 + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#0 base_length%7#0) + let tmp%9#0: uint64 = (== "Hello World!" tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.final_unoptimized.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.final_unoptimized.ir new file mode 100644 index 0000000000..87fbcd3afb --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.final_unoptimized.ir @@ -0,0 +1,34 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let some_bytes#0: bytes = "Hello World!" + let length%0#0: uint64 = (len some_bytes#0) + let value_as_bytes%1#0: bytes = (itob length%0#0) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 some_bytes#0) + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= some_bytes#0 some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L20 + let ternary_result%6#0: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L20 + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#0 base_length%7#0) + let tmp%9#0: uint64 = (== some_bytes#0 tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== some_bytes#0 some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.parallel_copies.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.parallel_copies.ir new file mode 100644 index 0000000000..d8b33ed618 --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.parallel_copies.ir @@ -0,0 +1,34 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let value_as_bytes%1#0: bytes = (itob 12u) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + let ternary_result%6#4: uint64 = ternary_result%6#0 + goto block@3 + block@2: // ternary_false_L20 + let ternary_result%6#4: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L20 + let ternary_result%6#2: uint64 = ternary_result%6#4 + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#2 base_length%7#0) + let tmp%9#0: uint64 = (== "Hello World!" tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.post_ssa.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.post_ssa.ir new file mode 100644 index 0000000000..d8b33ed618 --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.post_ssa.ir @@ -0,0 +1,34 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let value_as_bytes%1#0: bytes = (itob 12u) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + let ternary_result%6#4: uint64 = ternary_result%6#0 + goto block@3 + block@2: // ternary_false_L20 + let ternary_result%6#4: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L20 + let ternary_result%6#2: uint64 = ternary_result%6#4 + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#2 base_length%7#0) + let tmp%9#0: uint64 = (== "Hello World!" tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.ir new file mode 100644 index 0000000000..6a5f8d53d0 --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.ir @@ -0,0 +1,35 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let some_bytes#0: bytes = "Hello World!" + let length%0#0: uint64 = (len some_bytes#0) + let value_as_bytes%1#0: bytes = (itob length%0#0) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 some_bytes#0) + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= some_bytes#0 some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L20 + let ternary_result%6#1: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L20 + let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, ternary_result%6#1 <- block@2) + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#2 base_length%7#0) + let tmp%9#0: uint64 = (== some_bytes#0 tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== some_bytes#0 some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_1.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..689d71c228 --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_1.ir @@ -0,0 +1,33 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let length%0#0: uint64 = (len "Hello World!") + let value_as_bytes%1#0: bytes = (itob length%0#0) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L20 + goto block@3 + block@3: // ternary_merge_L20 + let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, awst_tmp%4#0 <- block@2) + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#2 base_length%7#0) + let tmp%9#0: uint64 = (== "Hello World!" tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_2.ir b/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..7ba4a23355 --- /dev/null +++ b/examples/arc4_types/out/string_Arc4StringTypesContract.ssa.opt_pass_2.ir @@ -0,0 +1,32 @@ +contract examples.arc4_types.string.Arc4StringTypesContract: + program approval: + subroutine examples.arc4_types.string.Arc4StringTypesContract.approval_program() -> uint64: + block@0: // L8 + let value_as_bytes%1#0: bytes = (itob 12u) + let value_as_uint16%2#0: bytes = ((extract 6 2) value_as_bytes%1#0) + let some_bytes_as_string#0: bytes = (concat value_as_uint16%2#0 "Hello World!") + let some_bytes_as_bytes_again#0: bytes = ((extract 2 0) some_bytes_as_string#0) + let tmp%3#0: uint64 = (!= "Hello World!" some_bytes_as_string#0) + (assert tmp%3#0) // Original bytes should not match encoded bytes + let awst_tmp%4#0: uint64 = (len some_bytes_as_string#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L20 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L20 + goto block@3 + block@3: // ternary_merge_L20 + let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, awst_tmp%4#0 <- block@2) + let base_length%7#0: uint64 = (len some_bytes_as_string#0) + let tmp%8#0: bytes = (substring3 some_bytes_as_string#0 ternary_result%6#2 base_length%7#0) + let tmp%9#0: uint64 = (== "Hello World!" tmp%8#0) + (assert tmp%9#0) // Original bytes should match encoded if we strip the length header + let tmp%10#0: uint64 = (== "Hello World!" some_bytes_as_bytes_again#0) + (assert tmp%10#0) + return 1u + + program clear-state: + subroutine examples.arc4_types.string.Arc4StringTypesContract.clear_state_program() -> uint64: + block@0: // L27 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs.O0.log b/examples/arc4_types/out/structs.O0.log new file mode 100644 index 0000000000..71e7c52a3d --- /dev/null +++ b/examples/arc4_types/out/structs.O0.log @@ -0,0 +1,212 @@ +PC Teal Stack +1 +9 +32 byte "" 0x +33 dup 0x, 0x +34 int 16 0x, 0x, 16 +35 pop 0x, 0x +36 byte 0x 0x, 0x, 0x +37 byte 0x000000083cfbf217 0x, 0x, 0x, 0x000000083CFBF217 +38 concat 0x, 0x, 0x000000083CFBF217 +39 byte 0x000000230384b842 0x, 0x, 0x000000083CFBF217, 0x000000230384B842 +40 concat 0x, 0x, 0x000000083CFBF217000000230384B842 +41 dup 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +42 swap 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +43 int 16 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 16 +44 pop 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +45 byte 0x 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x +46 byte 0x000000083cfbf217 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x, 0x000000083CFBF217 +47 concat 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +48 byte 0x000000230384b842 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217, 0x000000230384B842 +49 concat 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +50 callsub add 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +157 proto 2 1 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +160 frame_dig -2 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +162 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0 +163 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0, 8 +164 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +165 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839 +166 frame_dig -1 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842 +168 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0 +169 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0, 8 +170 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217 +171 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 35382882839 +172 + 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 70765765678 +173 itob 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +174 frame_dig -2 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842 +176 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8 +177 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8, 8 +178 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000230384B842 +179 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930 +180 frame_dig -1 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842 +182 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8 +183 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8, 8 +184 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000230384B842 +185 btoi 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 150382884930 +186 + 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 300765769860 +187 itob 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +188 int 16 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 16 +189 pop 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +190 byte 0x 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084, 0x +191 uncover 2 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x, 0x0000001079F7E42E +193 concat 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000001079F7E42E +194 swap 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +195 concat 0x, 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084 +196 retsub 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084 +53 dup 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 +54 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0 +55 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0, 8 +56 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E +57 swap 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 +58 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8 +59 int 8 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8, 8 +60 extract3 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +61 swap 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000001079F7E42E +62 int 0 0x, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000001079F7E42E, 0 +63 bury 5 0, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000001079F7E42E +65 b main_for_body@3 0, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000001079F7E42E +73 log 0, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084 +74 dig 3 0, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0 +76 dup 0, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0, 0 +77 int 1 0, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0, 0, 1 +78 + 0, 0x, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0, 1 +79 bury 4 0, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0 +81 switch main_for_header_1@2 0, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084 +68 dup 0, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000004607097084 +69 dig 3 0, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000004607097084, 1 +71 bury 5 1, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x0000004607097084 +73 log 1, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084 +74 dig 3 1, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 1 +76 dup 1, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 1, 1 +77 int 1 1, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 1, 1, 1 +78 + 1, 1, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 1, 2 +79 bury 4 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 1 +81 switch main_for_header_1@2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084 +85 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00 +86 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0 +87 int 1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0, 1 +88 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80 +89 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00 +90 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00, 0 +91 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00, 0, 0 +92 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00 +93 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00, 0x00 +94 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00, 0x00, 0 +95 int 1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00, 0x00, 0, 1 +96 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x00, 0x80 +97 cover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x80, 0x00 +99 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x80, 0x00, 0x00 +100 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x80, 0x00, 0x00, 0 +101 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x80, 0x00, 0x00, 0, 0 +102 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x80, 0x80, 0x00, 0x00 +103 cover 3 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0x00 +105 int 1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0x00, 1 +106 pop 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0x00 +107 byte 0x 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0x00, 0x +108 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x00, 0x, 0x80 +110 concat 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x00, 0x80 +111 swap 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0x00 +112 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0x00, 0 +113 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0 +114 swap 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0, 0x80 +115 int 1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0, 0x80, 1 +116 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 1, 0 +118 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80 +119 swap 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80 +120 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 0x80, 0 +121 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 1 +122 swap 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 1, 0x80 +123 int 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 1, 0x80, 2 +125 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0x80, 2, 1 +127 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x00, 0xA0 +128 swap 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0x00 +129 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0x00, 0 +130 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0 +131 swap 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0, 0xA0 +132 int 3 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0, 0xA0, 3 +134 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 3, 0 +136 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0 +137 dup 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +138 callsub check 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +197 proto 1 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +200 frame_dig -1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0 +202 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0, 0 +203 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1 +204 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1, 0x00 +205 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1, 0x00, 0 +206 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00, 0, 1 +208 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x80 +209 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x80, 0 +210 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1 +211 assert 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +212 frame_dig -1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0 +214 int 1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0, 1 +215 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0 +216 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0, 0x00 +217 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0, 0x00, 0 +218 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00, 0, 0 +220 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00 +221 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00, 0 +222 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0 +223 ! 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1 +224 assert 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +225 frame_dig -1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0 +227 int 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0, 2 +229 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1 +230 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1, 0x00 +231 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1, 0x00, 0 +232 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00, 0, 1 +234 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x80 +235 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x80, 0 +236 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1 +237 assert 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +238 frame_dig -1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0 +240 int 3 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0xA0, 3 +242 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0 +243 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0, 0x00 +244 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0, 0x00, 0 +245 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00, 0, 0 +247 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00 +248 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0x00, 0 +249 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 0 +250 ! 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0, 1 +251 assert 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +252 retsub 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0 +141 dup 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0xA0 +142 log 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0 +143 int 17 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 17 +145 pop 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0 +146 byte 0x 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0x +147 dig 3 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0x, 0x000000083CFBF217000000230384B842 +149 concat 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0xA0, 0x000000083CFBF217000000230384B842 +150 swap 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842, 0xA0 +151 concat 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +152 callsub nested_decode 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +253 proto 1 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +256 frame_dig -1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0 +258 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 0 +259 int 16 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 0, 16 +260 extract3 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842 +261 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842, 0 +262 int 8 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842, 0, 8 +263 extract3 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217 +264 btoi 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 35382882839 +265 int 35382882839 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 35382882839, 35382882839 +272 == 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1 +273 assert 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +274 frame_dig -1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0 +276 int 16 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 16 +277 int 1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 16, 1 +278 extract3 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0xA0 +279 int 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0xA0, 2 +281 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1 +282 byte 0x00 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1, 0x00 +283 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1, 0x00, 0 +284 uncover 2 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x00, 0, 1 +286 setbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x80 +287 int 0 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x80, 0 +288 getbit 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1 +289 assert 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +290 retsub 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084 +155 int 1 1, 2, 0x000000083CFBF217000000230384B842, 0x0000004607097084, 1 +156 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/structs.O1.log b/examples/arc4_types/out/structs.O1.log new file mode 100644 index 0000000000..7fb50552b0 --- /dev/null +++ b/examples/arc4_types/out/structs.O1.log @@ -0,0 +1,141 @@ +PC Teal Stack +1 +8 +31 byte "" 0x +33 byte 0x000000083cfbf217000000230384b842 0x, 0x000000083CFBF217000000230384B842 +34 byte 0x000000083cfbf217000000230384b842 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +35 callsub add 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +98 proto 2 1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +101 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +103 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0 +104 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0, 8 +105 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +106 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839 +107 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842 +109 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0 +110 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0, 8 +111 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217 +112 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 35382882839 +113 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 70765765678 +114 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +115 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842 +117 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8 +118 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8, 8 +119 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000230384B842 +120 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930 +121 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842 +123 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8 +124 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8, 8 +125 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000230384B842 +126 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 150382884930 +127 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 300765769860 +128 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +129 concat 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084 +130 retsub 0x, 0x0000001079F7E42E0000004607097084 +38 dup 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 +39 int 0 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0 +40 int 8 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0, 8 +41 extract3 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E +42 swap 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 +43 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8 +44 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8, 8 +45 extract3 0x, 0x0000001079F7E42E, 0x0000004607097084 +46 swap 0x, 0x0000004607097084, 0x0000001079F7E42E +47 int 0 0x, 0x0000004607097084, 0x0000001079F7E42E, 0 +48 swap 0x, 0x0000004607097084, 0, 0x0000001079F7E42E +49 b main_for_body@3 0x, 0x0000004607097084, 0, 0x0000001079F7E42E +58 log 0x, 0x0000004607097084, 0 +59 dup 0x, 0x0000004607097084, 0, 0 +60 dup 0x, 0x0000004607097084, 0, 0, 0 +61 int 1 0x, 0x0000004607097084, 0, 0, 0, 1 +62 + 0x, 0x0000004607097084, 0, 0, 1 +63 bury 4 1, 0x0000004607097084, 0, 0 +65 bz main_for_header_1@2 1, 0x0000004607097084, 0 +52 dig 1 1, 0x0000004607097084, 0, 0x0000004607097084 +54 dig 3 1, 0x0000004607097084, 0, 0x0000004607097084, 1 +56 bury 2 1, 0x0000004607097084, 1, 0x0000004607097084 +58 log 1, 0x0000004607097084, 1 +59 dup 1, 0x0000004607097084, 1, 1 +60 dup 1, 0x0000004607097084, 1, 1, 1 +61 int 1 1, 0x0000004607097084, 1, 1, 1, 1 +62 + 1, 0x0000004607097084, 1, 1, 2 +63 bury 4 2, 0x0000004607097084, 1, 1 +65 bz main_for_header_1@2 2, 0x0000004607097084, 1 +68 byte 0xa0 2, 0x0000004607097084, 1, 0xA0 +69 callsub check 2, 0x0000004607097084, 1, 0xA0 +131 proto 1 0 2, 0x0000004607097084, 1, 0xA0 +134 frame_dig -1 2, 0x0000004607097084, 1, 0xA0, 0xA0 +136 int 0 2, 0x0000004607097084, 1, 0xA0, 0xA0, 0 +137 getbit 2, 0x0000004607097084, 1, 0xA0, 1 +138 byte 0x00 2, 0x0000004607097084, 1, 0xA0, 1, 0x00 +139 int 0 2, 0x0000004607097084, 1, 0xA0, 1, 0x00, 0 +140 uncover 2 2, 0x0000004607097084, 1, 0xA0, 0x00, 0, 1 +142 setbit 2, 0x0000004607097084, 1, 0xA0, 0x80 +143 int 0 2, 0x0000004607097084, 1, 0xA0, 0x80, 0 +144 getbit 2, 0x0000004607097084, 1, 0xA0, 1 +145 assert 2, 0x0000004607097084, 1, 0xA0 +146 frame_dig -1 2, 0x0000004607097084, 1, 0xA0, 0xA0 +148 int 1 2, 0x0000004607097084, 1, 0xA0, 0xA0, 1 +149 getbit 2, 0x0000004607097084, 1, 0xA0, 0 +150 byte 0x00 2, 0x0000004607097084, 1, 0xA0, 0, 0x00 +151 int 0 2, 0x0000004607097084, 1, 0xA0, 0, 0x00, 0 +152 uncover 2 2, 0x0000004607097084, 1, 0xA0, 0x00, 0, 0 +154 setbit 2, 0x0000004607097084, 1, 0xA0, 0x00 +155 int 0 2, 0x0000004607097084, 1, 0xA0, 0x00, 0 +156 getbit 2, 0x0000004607097084, 1, 0xA0, 0 +157 ! 2, 0x0000004607097084, 1, 0xA0, 1 +158 assert 2, 0x0000004607097084, 1, 0xA0 +159 frame_dig -1 2, 0x0000004607097084, 1, 0xA0, 0xA0 +161 int 2 2, 0x0000004607097084, 1, 0xA0, 0xA0, 2 +162 getbit 2, 0x0000004607097084, 1, 0xA0, 1 +163 byte 0x00 2, 0x0000004607097084, 1, 0xA0, 1, 0x00 +164 int 0 2, 0x0000004607097084, 1, 0xA0, 1, 0x00, 0 +165 uncover 2 2, 0x0000004607097084, 1, 0xA0, 0x00, 0, 1 +167 setbit 2, 0x0000004607097084, 1, 0xA0, 0x80 +168 int 0 2, 0x0000004607097084, 1, 0xA0, 0x80, 0 +169 getbit 2, 0x0000004607097084, 1, 0xA0, 1 +170 assert 2, 0x0000004607097084, 1, 0xA0 +171 frame_dig -1 2, 0x0000004607097084, 1, 0xA0, 0xA0 +173 int 3 2, 0x0000004607097084, 1, 0xA0, 0xA0, 3 +175 getbit 2, 0x0000004607097084, 1, 0xA0, 0 +176 byte 0x00 2, 0x0000004607097084, 1, 0xA0, 0, 0x00 +177 int 0 2, 0x0000004607097084, 1, 0xA0, 0, 0x00, 0 +178 uncover 2 2, 0x0000004607097084, 1, 0xA0, 0x00, 0, 0 +180 setbit 2, 0x0000004607097084, 1, 0xA0, 0x00 +181 int 0 2, 0x0000004607097084, 1, 0xA0, 0x00, 0 +182 getbit 2, 0x0000004607097084, 1, 0xA0, 0 +183 ! 2, 0x0000004607097084, 1, 0xA0, 1 +184 assert 2, 0x0000004607097084, 1, 0xA0 +185 retsub 2, 0x0000004607097084, 1 +72 byte 0xa0 2, 0x0000004607097084, 1, 0xA0 +73 log 2, 0x0000004607097084, 1 +74 byte 0x000000083cfbf217000000230384b842a0 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0 +93 callsub nested_decode 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0 +186 proto 1 0 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0 +189 frame_dig -1 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0 +191 int 0 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 0 +192 int 16 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 0, 16 +194 extract3 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842 +195 int 0 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842, 0 +196 int 8 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842, 0, 8 +197 extract3 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217 +198 btoi 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 35382882839 +199 int 35382882839 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 35382882839, 35382882839 +206 == 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 1 +207 assert 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0 +208 frame_dig -1 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0 +210 int 16 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 16 +212 int 1 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 16, 1 +213 extract3 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0xA0 +214 int 2 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0xA0, 2 +215 getbit 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 1 +216 byte 0x00 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 1, 0x00 +217 int 0 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 1, 0x00, 0 +218 uncover 2 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x00, 0, 1 +220 setbit 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x80 +221 int 0 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 0x80, 0 +222 getbit 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0, 1 +223 assert 2, 0x0000004607097084, 1, 0x000000083CFBF217000000230384B842A0 +224 retsub 2, 0x0000004607097084, 1 +96 int 1 2, 0x0000004607097084, 1, 1 +97 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/structs.O2.log b/examples/arc4_types/out/structs.O2.log new file mode 100644 index 0000000000..947e5741b8 --- /dev/null +++ b/examples/arc4_types/out/structs.O2.log @@ -0,0 +1,139 @@ +PC Teal Stack +1 +8 +31 byte "" 0x +33 byte 0x000000083cfbf217000000230384b842 0x, 0x000000083CFBF217000000230384B842 +34 byte 0x000000083cfbf217000000230384b842 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +35 callsub add 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +96 proto 2 1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +99 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 +101 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0 +102 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0, 8 +103 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217 +104 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839 +105 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842 +107 int 0 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0 +108 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217000000230384B842, 0, 8 +109 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 0x000000083CFBF217 +110 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 35382882839, 35382882839 +111 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 70765765678 +112 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E +113 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842 +115 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8 +116 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000083CFBF217000000230384B842, 8, 8 +117 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x000000230384B842 +118 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930 +119 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842 +121 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8 +122 int 8 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000083CFBF217000000230384B842, 8, 8 +123 extract3 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 0x000000230384B842 +124 btoi 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 150382884930, 150382884930 +125 + 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 300765769860 +126 itob 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E, 0x0000004607097084 +127 concat 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084 +128 retsub 0x, 0x0000001079F7E42E0000004607097084 +38 dup 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 +39 int 0 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0 +40 int 8 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084, 0, 8 +41 extract3 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E +42 swap 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 +43 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8 +44 int 8 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084, 8, 8 +45 extract3 0x, 0x0000001079F7E42E, 0x0000004607097084 +46 int 0 0x, 0x0000001079F7E42E, 0x0000004607097084, 0 +47 b main_for_body@3 0x, 0x0000001079F7E42E, 0x0000004607097084, 0 +55 dig 2 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 0x0000001079F7E42E +57 log 0x, 0x0000001079F7E42E, 0x0000004607097084, 0 +58 dup 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 0 +59 int 1 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 0, 1 +60 + 0x, 0x0000001079F7E42E, 0x0000004607097084, 0, 1 +61 bury 4 1, 0x0000001079F7E42E, 0x0000004607097084, 0 +63 bz main_for_header_1@2 1, 0x0000001079F7E42E, 0x0000004607097084 +50 dup 1, 0x0000001079F7E42E, 0x0000004607097084, 0x0000004607097084 +51 bury 2 1, 0x0000004607097084, 0x0000004607097084 +53 dig 2 1, 0x0000004607097084, 0x0000004607097084, 1 +55 dig 2 1, 0x0000004607097084, 0x0000004607097084, 1, 0x0000004607097084 +57 log 1, 0x0000004607097084, 0x0000004607097084, 1 +58 dup 1, 0x0000004607097084, 0x0000004607097084, 1, 1 +59 int 1 1, 0x0000004607097084, 0x0000004607097084, 1, 1, 1 +60 + 1, 0x0000004607097084, 0x0000004607097084, 1, 2 +61 bury 4 2, 0x0000004607097084, 0x0000004607097084, 1 +63 bz main_for_header_1@2 2, 0x0000004607097084, 0x0000004607097084 +66 byte 0xa0 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +67 callsub check 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +129 proto 1 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +132 frame_dig -1 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0 +134 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0, 0 +135 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1 +136 byte 0x00 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1, 0x00 +137 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1, 0x00, 0 +138 uncover 2 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00, 0, 1 +140 setbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x80 +141 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x80, 0 +142 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1 +143 assert 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +144 frame_dig -1 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0 +146 int 1 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0, 1 +147 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0 +148 byte 0x00 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0, 0x00 +149 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0, 0x00, 0 +150 uncover 2 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00, 0, 0 +152 setbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00 +153 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00, 0 +154 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0 +155 ! 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1 +156 assert 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +157 frame_dig -1 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0 +159 int 2 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0, 2 +160 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1 +161 byte 0x00 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1, 0x00 +162 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1, 0x00, 0 +163 uncover 2 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00, 0, 1 +165 setbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x80 +166 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x80, 0 +167 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1 +168 assert 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +169 frame_dig -1 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0 +171 int 3 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0xA0, 3 +173 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0 +174 byte 0x00 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0, 0x00 +175 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0, 0x00, 0 +176 uncover 2 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00, 0, 0 +178 setbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00 +179 int 0 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0x00, 0 +180 getbit 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 0 +181 ! 2, 0x0000004607097084, 0x0000004607097084, 0xA0, 1 +182 assert 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +183 retsub 2, 0x0000004607097084, 0x0000004607097084 +70 byte 0xa0 2, 0x0000004607097084, 0x0000004607097084, 0xA0 +71 log 2, 0x0000004607097084, 0x0000004607097084 +72 byte 0x000000083cfbf217000000230384b842a0 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +91 callsub nested_decode 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +184 proto 1 0 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +187 frame_dig -1 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0 +189 int 0 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 0 +190 int 16 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 0, 16 +192 extract3 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842 +193 int 0 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842, 0 +194 int 8 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842, 0, 8 +195 extract3 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217 +196 btoi 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 35382882839 +197 int 35382882839 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 35382882839, 35382882839 +204 == 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1 +205 assert 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +206 frame_dig -1 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0 +208 int 16 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 16 +210 int 1 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x000000083CFBF217000000230384B842A0, 16, 1 +211 extract3 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0xA0 +212 int 2 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0xA0, 2 +213 getbit 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1 +214 byte 0x00 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1, 0x00 +215 int 0 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1, 0x00, 0 +216 uncover 2 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x00, 0, 1 +218 setbit 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x80 +219 int 0 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 0x80, 0 +220 getbit 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0, 1 +221 assert 2, 0x0000004607097084, 0x0000004607097084, 0x000000083CFBF217000000230384B842A0 +222 retsub 2, 0x0000004607097084, 0x0000004607097084 +94 int 1 2, 0x0000004607097084, 0x0000004607097084, 1 +95 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/structs.approval.debug.teal b/examples/arc4_types/out/structs.approval.debug.teal new file mode 100644 index 0000000000..bc05a02e37 --- /dev/null +++ b/examples/arc4_types/out/structs.approval.debug.teal @@ -0,0 +1,166 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: +main: + byte "" // allocate 1 to stack (𝕗) tuple_index%6#3 | + +main_block@0: + byte 0x000000083cfbf217000000230384b842 // (𝕗) tuple_index%6#3 | 0x000000083cfbf217000000230384b842 Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 27 + byte 0x000000083cfbf217000000230384b842 // (𝕗) tuple_index%6#3 | 0x000000083cfbf217000000230384b842,0x000000083cfbf217000000230384b842 Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 28 + callsub add // (𝕗) tuple_index%6#3 | {add} add(coord_1, coord_2) File "arc4_types/structs.py", line 29 + dup // load coord_3#0 from l-stack (copy) (𝕗) tuple_index%6#3 | coord_3#0,coord_3#0 coord_3 File "arc4_types/structs.py", line 29 + int 0 // (𝕗) tuple_index%6#3 | coord_3#0,coord_3#0,0 coord_3.x File "arc4_types/structs.py", line 30 + int 8 // (𝕗) tuple_index%6#3 | coord_3#0,coord_3#0,0,8 coord_3.x File "arc4_types/structs.py", line 30 + extract3 // (𝕗) tuple_index%6#3 | coord_3#0,{extract3} coord_3.x File "arc4_types/structs.py", line 30 + swap // store val#0 to x-stack (no copy) (𝕗) tuple_index%6#3 | (𝕏) val#0 | coord_3#0 val File "arc4_types/structs.py", line 30 + int 8 // (𝕗) tuple_index%6#3 | (𝕏) val#0 | coord_3#0,8 coord_3.y File "arc4_types/structs.py", line 30 + int 8 // (𝕗) tuple_index%6#3 | (𝕏) val#0 | coord_3#0,8,8 coord_3.y File "arc4_types/structs.py", line 30 + extract3 // (𝕗) tuple_index%6#3 | (𝕏) val#0 | {extract3} coord_3.y File "arc4_types/structs.py", line 30 + swap // store val#1 to f-stack (𝕗) tuple_index%6#3,val#1 | (𝕏) val#0 | val File "arc4_types/structs.py", line 30 + int 0 // (𝕗) tuple_index%6#3,val#1 | (𝕏) val#0 | 0 + swap // store tuple_index%6#0 to f-stack (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | (𝕏) val#0 | + b main_for_body@3 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | (𝕏) val#0 | val#0 + +main_for_header_1@2: + dig 1 // load val#1 from f-stack (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | val#1 val File "arc4_types/structs.py", line 30 + dig 3 // load tuple_index%6#3 from f-stack (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | (𝕏) val#0 | tuple_index%6#3 + bury 2 // store tuple_index%6#0 to f-stack (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | (𝕏) val#0 | + // Implicit fall through to main_for_body@3 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | (𝕏) val#0 | val#0 + +main_for_body@3: + log // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | val#0 log(val.bytes) File "arc4_types/structs.py", line 31 + dup // load tuple_index%6#0 from f-stack (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | tuple_index%6#0 + dup // store tuple_index%6#0 to l-stack (copy) (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | tuple_index%6#0,tuple_index%6#0 + int 1 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | tuple_index%6#0,tuple_index%6#0,1 + + // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | tuple_index%6#0,{+} + bury 4 // store tuple_index%6#3 to f-stack (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | tuple_index%6#0 + bz main_for_header_1@2 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | for val in (coord_3.x, coord_3.y): File "arc4_types/structs.py", line 30 + // Implicit fall through to main_after_for@5 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | for val in (coord_3.x, coord_3.y): File "arc4_types/structs.py", line 30 + +main_after_for@5: + byte 0xa0 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | 0xa0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + callsub check // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | check(flags) File "arc4_types/structs.py", line 34 + byte 0xa0 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | 0xa0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + log // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | log(flags.bytes) File "arc4_types/structs.py", line 35 + byte 0x000000083cfbf217000000230384b842a0 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | 0x000000083cfbf217000000230384b842a0 VectorFlags(coord_1, flags) File "arc4_types/structs.py", line 37 + callsub nested_decode // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | nested_decode(VectorFlags(coord_1, flags)) File "arc4_types/structs.py", line 37 + int 1 // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | 1 True File "arc4_types/structs.py", line 39 + return // (𝕗) tuple_index%6#3,val#1,tuple_index%6#0 | return True File "arc4_types/structs.py", line 39 + + +// examples.arc4_types.structs.add(v1#0: bytes, v2#0: bytes) -> bytes: +add: + proto 2 1 // (𝕡) v1#0,v2#0 | def add(v1: Vector, v2: Vector) -> Vector: File "arc4_types/structs.py", line 46 + +add_block@0: + frame_dig -2 // load v1#0 from parameters (𝕡) v1#0,v2#0 | v1#0 v1: Vector File "arc4_types/structs.py", line 46 + int 0 // (𝕡) v1#0,v2#0 | v1#0,0 v1.x File "arc4_types/structs.py", line 48 + int 8 // (𝕡) v1#0,v2#0 | v1#0,0,8 v1.x File "arc4_types/structs.py", line 48 + extract3 // (𝕡) v1#0,v2#0 | {extract3} v1.x File "arc4_types/structs.py", line 48 + btoi // (𝕡) v1#0,v2#0 | {btoi} v1.x.decode() File "arc4_types/structs.py", line 48 + frame_dig -1 // load v2#0 from parameters (𝕡) v1#0,v2#0 | tmp%1#0,v2#0 v2: Vector File "arc4_types/structs.py", line 46 + int 0 // (𝕡) v1#0,v2#0 | tmp%1#0,v2#0,0 v2.x File "arc4_types/structs.py", line 48 + int 8 // (𝕡) v1#0,v2#0 | tmp%1#0,v2#0,0,8 v2.x File "arc4_types/structs.py", line 48 + extract3 // (𝕡) v1#0,v2#0 | tmp%1#0,{extract3} v2.x File "arc4_types/structs.py", line 48 + btoi // (𝕡) v1#0,v2#0 | tmp%1#0,{btoi} v2.x.decode() File "arc4_types/structs.py", line 48 + + // (𝕡) v1#0,v2#0 | {+} v1.x.decode() + v2.x.decode() File "arc4_types/structs.py", line 48 + itob // (𝕡) v1#0,v2#0 | {itob} Decimal.encode(v1.x.decode() + v2.x.decode()) File "arc4_types/structs.py", line 48 + frame_dig -2 // load v1#0 from parameters (𝕡) v1#0,v2#0 | val_as_bytes%5#0,v1#0 v1: Vector File "arc4_types/structs.py", line 46 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,v1#0,8 v1.y File "arc4_types/structs.py", line 49 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,v1#0,8,8 v1.y File "arc4_types/structs.py", line 49 + extract3 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{extract3} v1.y File "arc4_types/structs.py", line 49 + btoi // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{btoi} v1.y.decode() File "arc4_types/structs.py", line 49 + frame_dig -1 // load v2#0 from parameters (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,v2#0 v2: Vector File "arc4_types/structs.py", line 46 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,v2#0,8 v2.y File "arc4_types/structs.py", line 49 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,v2#0,8,8 v2.y File "arc4_types/structs.py", line 49 + extract3 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,{extract3} v2.y File "arc4_types/structs.py", line 49 + btoi // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,{btoi} v2.y.decode() File "arc4_types/structs.py", line 49 + + // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{+} v1.y.decode() + v2.y.decode() File "arc4_types/structs.py", line 49 + itob // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{itob} Decimal.encode(v1.y.decode() + v2.y.decode()) File "arc4_types/structs.py", line 49 + concat // (𝕡) v1#0,v2#0 | {concat} Vector( File "arc4_types/structs.py", line 47 + retsub // encoded_tuple_buffer%13#2 return Vector( File "arc4_types/structs.py", line 47 + + +// examples.arc4_types.structs.check(flags#0: bytes) -> void: +check: + proto 1 0 // (𝕡) flags#0 | def check(flags: Flags) -> None: File "arc4_types/structs.py", line 54 + +check_block@0: + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 0 // (𝕡) flags#0 | flags#0,0 flags.a File "arc4_types/structs.py", line 55 + getbit // (𝕡) flags#0 | {getbit} flags.a File "arc4_types/structs.py", line 55 + byte 0x00 // (𝕡) flags#0 | is_true%0#0,0x00 flags.a File "arc4_types/structs.py", line 55 + int 0 // (𝕡) flags#0 | is_true%0#0,0x00,0 + uncover 2 // load is_true%0#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%0#0 flags.a File "arc4_types/structs.py", line 55 + setbit // (𝕡) flags#0 | {setbit} flags.a File "arc4_types/structs.py", line 55 + int 0 // (𝕡) flags#0 | tmp%1#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.a.decode() File "arc4_types/structs.py", line 55 + assert // (𝕡) flags#0 | assert flags.a.decode() File "arc4_types/structs.py", line 55 + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 1 // (𝕡) flags#0 | flags#0,1 flags.b File "arc4_types/structs.py", line 56 + getbit // (𝕡) flags#0 | {getbit} flags.b File "arc4_types/structs.py", line 56 + byte 0x00 // (𝕡) flags#0 | is_true%3#0,0x00 flags.b File "arc4_types/structs.py", line 56 + int 0 // (𝕡) flags#0 | is_true%3#0,0x00,0 + uncover 2 // load is_true%3#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%3#0 flags.b File "arc4_types/structs.py", line 56 + setbit // (𝕡) flags#0 | {setbit} flags.b File "arc4_types/structs.py", line 56 + int 0 // (𝕡) flags#0 | tmp%4#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.b.decode() File "arc4_types/structs.py", line 56 + ! // (𝕡) flags#0 | {!} not flags.b.decode() File "arc4_types/structs.py", line 56 + assert // (𝕡) flags#0 | assert not flags.b.decode() File "arc4_types/structs.py", line 56 + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 2 // (𝕡) flags#0 | flags#0,2 flags.c File "arc4_types/structs.py", line 57 + getbit // (𝕡) flags#0 | {getbit} flags.c File "arc4_types/structs.py", line 57 + byte 0x00 // (𝕡) flags#0 | is_true%7#0,0x00 flags.c File "arc4_types/structs.py", line 57 + int 0 // (𝕡) flags#0 | is_true%7#0,0x00,0 + uncover 2 // load is_true%7#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%7#0 flags.c File "arc4_types/structs.py", line 57 + setbit // (𝕡) flags#0 | {setbit} flags.c File "arc4_types/structs.py", line 57 + int 0 // (𝕡) flags#0 | tmp%8#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.c.decode() File "arc4_types/structs.py", line 57 + assert // (𝕡) flags#0 | assert flags.c.decode() File "arc4_types/structs.py", line 57 + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 3 // (𝕡) flags#0 | flags#0,3 flags.d File "arc4_types/structs.py", line 58 + getbit // (𝕡) flags#0 | {getbit} flags.d File "arc4_types/structs.py", line 58 + byte 0x00 // (𝕡) flags#0 | is_true%10#0,0x00 flags.d File "arc4_types/structs.py", line 58 + int 0 // (𝕡) flags#0 | is_true%10#0,0x00,0 + uncover 2 // load is_true%10#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%10#0 flags.d File "arc4_types/structs.py", line 58 + setbit // (𝕡) flags#0 | {setbit} flags.d File "arc4_types/structs.py", line 58 + int 0 // (𝕡) flags#0 | tmp%11#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.d.decode() File "arc4_types/structs.py", line 58 + ! // (𝕡) flags#0 | {!} not flags.d.decode() File "arc4_types/structs.py", line 58 + assert // (𝕡) flags#0 | assert not flags.d.decode() File "arc4_types/structs.py", line 58 + retsub // + + +// examples.arc4_types.structs.nested_decode(vector_flags#0: bytes) -> void: +nested_decode: + proto 1 0 // (𝕡) vector_flags#0 | def nested_decode(vector_flags: VectorFlags) -> None: File "arc4_types/structs.py", line 62 + +nested_decode_block@0: + frame_dig -1 // load vector_flags#0 from parameters (𝕡) vector_flags#0 | vector_flags#0 vector_flags: VectorFlags File "arc4_types/structs.py", line 62 + int 0 // (𝕡) vector_flags#0 | vector_flags#0,0 vector_flags.vector File "arc4_types/structs.py", line 63 + int 16 // (𝕡) vector_flags#0 | vector_flags#0,0,16 vector_flags.vector File "arc4_types/structs.py", line 63 + extract3 // (𝕡) vector_flags#0 | {extract3} vector_flags.vector File "arc4_types/structs.py", line 63 + int 0 // (𝕡) vector_flags#0 | tmp%0#0,0 vector_flags.vector.x File "arc4_types/structs.py", line 63 + int 8 // (𝕡) vector_flags#0 | tmp%0#0,0,8 vector_flags.vector.x File "arc4_types/structs.py", line 63 + extract3 // (𝕡) vector_flags#0 | {extract3} vector_flags.vector.x File "arc4_types/structs.py", line 63 + btoi // (𝕡) vector_flags#0 | {btoi} vector_flags.vector.x.decode() File "arc4_types/structs.py", line 63 + int 35382882839 // (𝕡) vector_flags#0 | tmp%2#0,35382882839 35382882839 File "arc4_types/structs.py", line 63 + == // (𝕡) vector_flags#0 | {==} vector_flags.vector.x.decode() == 35382882839 File "arc4_types/structs.py", line 63 + assert // (𝕡) vector_flags#0 | assert vector_flags.vector.x.decode() == 35382882839 File "arc4_types/structs.py", line 63 + frame_dig -1 // load vector_flags#0 from parameters (𝕡) vector_flags#0 | vector_flags#0 vector_flags: VectorFlags File "arc4_types/structs.py", line 62 + int 16 // (𝕡) vector_flags#0 | vector_flags#0,16 vector_flags.flags File "arc4_types/structs.py", line 64 + int 1 // (𝕡) vector_flags#0 | vector_flags#0,16,1 vector_flags.flags File "arc4_types/structs.py", line 64 + extract3 // (𝕡) vector_flags#0 | {extract3} vector_flags.flags File "arc4_types/structs.py", line 64 + int 2 // (𝕡) vector_flags#0 | tmp%4#0,2 vector_flags.flags.c File "arc4_types/structs.py", line 64 + getbit // (𝕡) vector_flags#0 | {getbit} vector_flags.flags.c File "arc4_types/structs.py", line 64 + byte 0x00 // (𝕡) vector_flags#0 | is_true%5#0,0x00 vector_flags.flags.c File "arc4_types/structs.py", line 64 + int 0 // (𝕡) vector_flags#0 | is_true%5#0,0x00,0 + uncover 2 // load is_true%5#0 from l-stack (no copy) (𝕡) vector_flags#0 | 0x00,0,is_true%5#0 vector_flags.flags.c File "arc4_types/structs.py", line 64 + setbit // (𝕡) vector_flags#0 | {setbit} vector_flags.flags.c File "arc4_types/structs.py", line 64 + int 0 // (𝕡) vector_flags#0 | tmp%6#0,0 + getbit // (𝕡) vector_flags#0 | {getbit} vector_flags.flags.c.decode() File "arc4_types/structs.py", line 64 + assert // (𝕡) vector_flags#0 | assert vector_flags.flags.c.decode() File "arc4_types/structs.py", line 64 + retsub // + diff --git a/examples/arc4_types/out/structs.approval.teal b/examples/arc4_types/out/structs.approval.teal new file mode 100644 index 0000000000..00c96b1afc --- /dev/null +++ b/examples/arc4_types/out/structs.approval.teal @@ -0,0 +1,162 @@ +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: +main: + byte "" + +main_block@0: + byte 0x000000083cfbf217000000230384b842 + byte 0x000000083cfbf217000000230384b842 + callsub add + dup + int 0 + int 8 + extract3 + swap + int 8 + int 8 + extract3 + swap + int 0 + swap + b main_for_body@3 + +main_for_header_1@2: + dig 1 + dig 3 + bury 2 + +main_for_body@3: + log + dup + dup + int 1 + + + bury 4 + bz main_for_header_1@2 + +main_after_for@5: + byte 0xa0 + callsub check + byte 0xa0 + log + byte 0x000000083cfbf217000000230384b842a0 + callsub nested_decode + int 1 + return + + +// examples.arc4_types.structs.add(v1#0: bytes, v2#0: bytes) -> bytes: +add: + proto 2 1 + +add_block@0: + frame_dig -2 + int 0 + int 8 + extract3 + btoi + frame_dig -1 + int 0 + int 8 + extract3 + btoi + + + itob + frame_dig -2 + int 8 + int 8 + extract3 + btoi + frame_dig -1 + int 8 + int 8 + extract3 + btoi + + + itob + concat + retsub + + +// examples.arc4_types.structs.check(flags#0: bytes) -> void: +check: + proto 1 0 + +check_block@0: + frame_dig -1 + int 0 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + assert + frame_dig -1 + int 1 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + ! + assert + frame_dig -1 + int 2 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + assert + frame_dig -1 + int 3 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + ! + assert + retsub + + +// examples.arc4_types.structs.nested_decode(vector_flags#0: bytes) -> void: +nested_decode: + proto 1 0 + +nested_decode_block@0: + frame_dig -1 + int 0 + int 16 + extract3 + int 0 + int 8 + extract3 + btoi + int 35382882839 + == + assert + frame_dig -1 + int 16 + int 1 + extract3 + int 2 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + assert + retsub + diff --git a/examples/arc4_types/out/structs.approval_unoptimized.debug.teal b/examples/arc4_types/out/structs.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..df094f32e4 --- /dev/null +++ b/examples/arc4_types/out/structs.approval_unoptimized.debug.teal @@ -0,0 +1,243 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: +main: + byte "" + dup // allocate 2 to stack (𝕗) tuple_index%6#0,tuple_index%6#3 | + +main_block@0: + int 16 // (𝕗) tuple_index%6#0,tuple_index%6#3 | 16 Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 27 + pop // (𝕗) tuple_index%6#0,tuple_index%6#3 | Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 27 + byte 0x // (𝕗) tuple_index%6#0,tuple_index%6#3 | 0x Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 27 + byte 0x000000083cfbf217 // (𝕗) tuple_index%6#0,tuple_index%6#3 | encoded_tuple_buffer%1#0,0x000000083cfbf217 "35.382882839" File "arc4_types/structs.py", line 27 + concat // (𝕗) tuple_index%6#0,tuple_index%6#3 | {concat} Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 27 + byte 0x000000230384b842 // (𝕗) tuple_index%6#0,tuple_index%6#3 | encoded_tuple_buffer%1#0,0x000000230384b842 "150.382884930" File "arc4_types/structs.py", line 27 + concat // (𝕗) tuple_index%6#0,tuple_index%6#3 | {concat} Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 27 + dup // store coord_1#0 to l-stack (copy) (𝕗) tuple_index%6#0,tuple_index%6#3 | coord_1#0,coord_1#0 coord_1 File "arc4_types/structs.py", line 27 + swap // store coord_1#0 to f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0 coord_1 File "arc4_types/structs.py", line 27 + int 16 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0,16 Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 28 + pop // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0 Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 28 + byte 0x // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0,0x Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 28 + byte 0x000000083cfbf217 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0,encoded_tuple_buffer%3#0,0x000000083cfbf217 "35.382882839" File "arc4_types/structs.py", line 28 + concat // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0,{concat} Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 28 + byte 0x000000230384b842 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0,encoded_tuple_buffer%3#0,0x000000230384b842 "150.382884930" File "arc4_types/structs.py", line 28 + concat // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_1#0,{concat} Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) File "arc4_types/structs.py", line 28 + callsub add // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | {add} add(coord_1, coord_2) File "arc4_types/structs.py", line 29 + dup // load coord_3#0 from l-stack (copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_3#0,coord_3#0 coord_3 File "arc4_types/structs.py", line 29 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_3#0,coord_3#0,0 coord_3.x File "arc4_types/structs.py", line 30 + int 8 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_3#0,coord_3#0,0,8 coord_3.x File "arc4_types/structs.py", line 30 + extract3 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | coord_3#0,{extract3} coord_3.x File "arc4_types/structs.py", line 30 + swap // store tmp%4#0 to x-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | (𝕏) tmp%4#0 | coord_3#0 coord_3.x File "arc4_types/structs.py", line 30 + int 8 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | (𝕏) tmp%4#0 | coord_3#0,8 coord_3.y File "arc4_types/structs.py", line 30 + int 8 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | (𝕏) tmp%4#0 | coord_3#0,8,8 coord_3.y File "arc4_types/structs.py", line 30 + extract3 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0 | (𝕏) tmp%4#0 | {extract3} coord_3.y File "arc4_types/structs.py", line 30 + swap // store tmp%5#0 to f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) tmp%4#0 | coord_3.y File "arc4_types/structs.py", line 30 + // Implicit fall through to main_for_header_0@1 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) tmp%4#0 | tmp%4#0 + +main_for_header_0@1: + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) tmp%4#0 | 0 tmp%4#0 + bury 5 // store tuple_index%6#0 to f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) tmp%4#0 | + b main_for_body@3 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) val#0 | val#0 + +main_for_header_1@2: + dup // load tmp%5#0 from f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%5#0 coord_3.y File "arc4_types/structs.py", line 30 + dig 3 // load tuple_index%6#3 from f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) val#0 | tuple_index%6#3 + bury 5 // store tuple_index%6#0 to f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) val#0 | + // Implicit fall through to main_for_body@3 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | (𝕏) val#0 | val#0 + +main_for_body@3: + log // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | val#0 log(val.bytes) File "arc4_types/structs.py", line 31 + // Implicit fall through to main_for_footer@4 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | + +main_for_footer@4: + dig 3 // load tuple_index%6#0 from f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tuple_index%6#0 + dup // store tuple_index%6#0 to l-stack (copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tuple_index%6#0,tuple_index%6#0 + int 1 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tuple_index%6#0,tuple_index%6#0,1 + + // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tuple_index%6#0,{+} + bury 4 // store tuple_index%6#3 to f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tuple_index%6#0 + switch main_for_header_1@2 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | for val in (coord_3.x, coord_3.y): File "arc4_types/structs.py", line 30 + // Implicit fall through to main_after_for@5 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | for val in (coord_3.x, coord_3.y): File "arc4_types/structs.py", line 30 + +main_after_for@5: + byte 0x00 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | 0x00 arc4.Bool(True) File "arc4_types/structs.py", line 33 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | 0x00,0 + int 1 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | 0x00,0,1 True File "arc4_types/structs.py", line 33 + setbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | {setbit} arc4.Bool(True) File "arc4_types/structs.py", line 33 + byte 0x00 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,0x00 arc4.Bool(False) File "arc4_types/structs.py", line 33 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,0x00,0 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,0x00,0,0 False File "arc4_types/structs.py", line 33 + setbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,{setbit} arc4.Bool(False) File "arc4_types/structs.py", line 33 + byte 0x00 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,tmp%8#0,0x00 arc4.Bool(True) File "arc4_types/structs.py", line 33 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,tmp%8#0,0x00,0 + int 1 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,tmp%8#0,0x00,0,1 True File "arc4_types/structs.py", line 33 + setbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%7#0,tmp%8#0,{setbit} arc4.Bool(True) File "arc4_types/structs.py", line 33 + cover 2 // store tmp%9#0 to l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%9#0,tmp%7#0,tmp%8#0 arc4.Bool(True) File "arc4_types/structs.py", line 33 + byte 0x00 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%9#0,tmp%7#0,tmp%8#0,0x00 arc4.Bool(False) File "arc4_types/structs.py", line 33 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%9#0,tmp%7#0,tmp%8#0,0x00,0 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%9#0,tmp%7#0,tmp%8#0,0x00,0,0 False File "arc4_types/structs.py", line 33 + setbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%9#0,tmp%7#0,tmp%8#0,{setbit} arc4.Bool(False) File "arc4_types/structs.py", line 33 + cover 3 // store tmp%10#0 to l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,tmp%7#0,tmp%8#0 arc4.Bool(False) File "arc4_types/structs.py", line 33 + int 1 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,tmp%7#0,tmp%8#0,1 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + pop // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,tmp%7#0,tmp%8#0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + byte 0x // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,tmp%7#0,tmp%8#0,0x Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + uncover 2 // load tmp%7#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,tmp%8#0,encoded_tuple_buffer%12#0,tmp%7#0 arc4.Bool(True) File "arc4_types/structs.py", line 33 + concat // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,tmp%8#0,{concat} Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + swap // load tmp%8#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,encoded_tuple_buffer%12#0,tmp%8#0 arc4.Bool(False) File "arc4_types/structs.py", line 33 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,encoded_tuple_buffer%12#0,tmp%8#0,0 + getbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,encoded_tuple_buffer%12#0,{getbit} Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + swap // load encoded_tuple_buffer%12#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,is_true%13#0,encoded_tuple_buffer%12#0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + int 1 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,is_true%13#0,encoded_tuple_buffer%12#0,1 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + uncover 2 // load is_true%13#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,encoded_tuple_buffer%12#0,1,is_true%13#0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + setbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,tmp%9#0,{setbit} Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + swap // load tmp%9#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,encoded_tuple_buffer%12#0,tmp%9#0 arc4.Bool(True) File "arc4_types/structs.py", line 33 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,encoded_tuple_buffer%12#0,tmp%9#0,0 + getbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,encoded_tuple_buffer%12#0,{getbit} Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + swap // load encoded_tuple_buffer%12#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,is_true%14#0,encoded_tuple_buffer%12#0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + int 2 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,is_true%14#0,encoded_tuple_buffer%12#0,2 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + uncover 2 // load is_true%14#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,encoded_tuple_buffer%12#0,2,is_true%14#0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + setbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | tmp%10#0,{setbit} Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + swap // load tmp%10#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | encoded_tuple_buffer%12#0,tmp%10#0 arc4.Bool(False) File "arc4_types/structs.py", line 33 + int 0 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | encoded_tuple_buffer%12#0,tmp%10#0,0 + getbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | encoded_tuple_buffer%12#0,{getbit} Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + swap // load encoded_tuple_buffer%12#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | is_true%15#0,encoded_tuple_buffer%12#0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + int 3 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | is_true%15#0,encoded_tuple_buffer%12#0,3 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + uncover 2 // load is_true%15#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | encoded_tuple_buffer%12#0,3,is_true%15#0 Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + setbit // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | {setbit} Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) File "arc4_types/structs.py", line 33 + dup // load flags#0 from l-stack (copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0,flags#0 flags File "arc4_types/structs.py", line 33 + callsub check // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0 check(flags) File "arc4_types/structs.py", line 34 + dup // load flags#0 from l-stack (copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0,flags#0 flags File "arc4_types/structs.py", line 33 + log // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0 log(flags.bytes) File "arc4_types/structs.py", line 35 + int 17 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0,17 VectorFlags(coord_1, flags) File "arc4_types/structs.py", line 37 + pop // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0 VectorFlags(coord_1, flags) File "arc4_types/structs.py", line 37 + byte 0x // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0,0x VectorFlags(coord_1, flags) File "arc4_types/structs.py", line 37 + dig 3 // load coord_1#0 from f-stack (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0,encoded_tuple_buffer%17#0,coord_1#0 coord_1 File "arc4_types/structs.py", line 27 + concat // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | flags#0,{concat} VectorFlags(coord_1, flags) File "arc4_types/structs.py", line 37 + swap // load flags#0 from l-stack (no copy) (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | encoded_tuple_buffer%17#0,flags#0 flags File "arc4_types/structs.py", line 33 + concat // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | {concat} VectorFlags(coord_1, flags) File "arc4_types/structs.py", line 37 + callsub nested_decode // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | nested_decode(VectorFlags(coord_1, flags)) File "arc4_types/structs.py", line 37 + int 1 // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | 1 True File "arc4_types/structs.py", line 39 + return // (𝕗) tuple_index%6#0,tuple_index%6#3,coord_1#0,tmp%5#0 | return True File "arc4_types/structs.py", line 39 + + +// examples.arc4_types.structs.add(v1#0: bytes, v2#0: bytes) -> bytes: +add: + proto 2 1 // (𝕡) v1#0,v2#0 | def add(v1: Vector, v2: Vector) -> Vector: File "arc4_types/structs.py", line 46 + +add_block@0: + frame_dig -2 // load v1#0 from parameters (𝕡) v1#0,v2#0 | v1#0 v1: Vector File "arc4_types/structs.py", line 46 + int 0 // (𝕡) v1#0,v2#0 | v1#0,0 v1.x File "arc4_types/structs.py", line 48 + int 8 // (𝕡) v1#0,v2#0 | v1#0,0,8 v1.x File "arc4_types/structs.py", line 48 + extract3 // (𝕡) v1#0,v2#0 | {extract3} v1.x File "arc4_types/structs.py", line 48 + btoi // (𝕡) v1#0,v2#0 | {btoi} v1.x.decode() File "arc4_types/structs.py", line 48 + frame_dig -1 // load v2#0 from parameters (𝕡) v1#0,v2#0 | tmp%1#0,v2#0 v2: Vector File "arc4_types/structs.py", line 46 + int 0 // (𝕡) v1#0,v2#0 | tmp%1#0,v2#0,0 v2.x File "arc4_types/structs.py", line 48 + int 8 // (𝕡) v1#0,v2#0 | tmp%1#0,v2#0,0,8 v2.x File "arc4_types/structs.py", line 48 + extract3 // (𝕡) v1#0,v2#0 | tmp%1#0,{extract3} v2.x File "arc4_types/structs.py", line 48 + btoi // (𝕡) v1#0,v2#0 | tmp%1#0,{btoi} v2.x.decode() File "arc4_types/structs.py", line 48 + + // (𝕡) v1#0,v2#0 | {+} v1.x.decode() + v2.x.decode() File "arc4_types/structs.py", line 48 + itob // (𝕡) v1#0,v2#0 | {itob} Decimal.encode(v1.x.decode() + v2.x.decode()) File "arc4_types/structs.py", line 48 + frame_dig -2 // load v1#0 from parameters (𝕡) v1#0,v2#0 | val_as_bytes%5#0,v1#0 v1: Vector File "arc4_types/structs.py", line 46 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,v1#0,8 v1.y File "arc4_types/structs.py", line 49 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,v1#0,8,8 v1.y File "arc4_types/structs.py", line 49 + extract3 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{extract3} v1.y File "arc4_types/structs.py", line 49 + btoi // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{btoi} v1.y.decode() File "arc4_types/structs.py", line 49 + frame_dig -1 // load v2#0 from parameters (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,v2#0 v2: Vector File "arc4_types/structs.py", line 46 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,v2#0,8 v2.y File "arc4_types/structs.py", line 49 + int 8 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,v2#0,8,8 v2.y File "arc4_types/structs.py", line 49 + extract3 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,{extract3} v2.y File "arc4_types/structs.py", line 49 + btoi // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,tmp%7#0,{btoi} v2.y.decode() File "arc4_types/structs.py", line 49 + + // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{+} v1.y.decode() + v2.y.decode() File "arc4_types/structs.py", line 49 + itob // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,{itob} Decimal.encode(v1.y.decode() + v2.y.decode()) File "arc4_types/structs.py", line 49 + int 16 // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,val_as_bytes%11#0,16 Vector( File "arc4_types/structs.py", line 47 + pop // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,val_as_bytes%11#0 Vector( File "arc4_types/structs.py", line 47 + byte 0x // (𝕡) v1#0,v2#0 | val_as_bytes%5#0,val_as_bytes%11#0,0x Vector( File "arc4_types/structs.py", line 47 + uncover 2 // load val_as_bytes%5#0 from l-stack (no copy) (𝕡) v1#0,v2#0 | val_as_bytes%11#0,encoded_tuple_buffer%13#0,val_as_bytes%5#0 Decimal.encode(v1.x.decode() + v2.x.decode()) File "arc4_types/structs.py", line 48 + concat // (𝕡) v1#0,v2#0 | val_as_bytes%11#0,{concat} Vector( File "arc4_types/structs.py", line 47 + swap // load val_as_bytes%11#0 from l-stack (no copy) (𝕡) v1#0,v2#0 | encoded_tuple_buffer%13#0,val_as_bytes%11#0 Decimal.encode(v1.y.decode() + v2.y.decode()) File "arc4_types/structs.py", line 49 + concat // (𝕡) v1#0,v2#0 | {concat} Vector( File "arc4_types/structs.py", line 47 + retsub // encoded_tuple_buffer%13#0 return Vector( File "arc4_types/structs.py", line 47 + + +// examples.arc4_types.structs.check(flags#0: bytes) -> void: +check: + proto 1 0 // (𝕡) flags#0 | def check(flags: Flags) -> None: File "arc4_types/structs.py", line 54 + +check_block@0: + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 0 // (𝕡) flags#0 | flags#0,0 flags.a File "arc4_types/structs.py", line 55 + getbit // (𝕡) flags#0 | {getbit} flags.a File "arc4_types/structs.py", line 55 + byte 0x00 // (𝕡) flags#0 | is_true%0#0,0x00 flags.a File "arc4_types/structs.py", line 55 + int 0 // (𝕡) flags#0 | is_true%0#0,0x00,0 + uncover 2 // load is_true%0#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%0#0 flags.a File "arc4_types/structs.py", line 55 + setbit // (𝕡) flags#0 | {setbit} flags.a File "arc4_types/structs.py", line 55 + int 0 // (𝕡) flags#0 | tmp%1#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.a.decode() File "arc4_types/structs.py", line 55 + assert // (𝕡) flags#0 | assert flags.a.decode() File "arc4_types/structs.py", line 55 + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 1 // (𝕡) flags#0 | flags#0,1 flags.b File "arc4_types/structs.py", line 56 + getbit // (𝕡) flags#0 | {getbit} flags.b File "arc4_types/structs.py", line 56 + byte 0x00 // (𝕡) flags#0 | is_true%3#0,0x00 flags.b File "arc4_types/structs.py", line 56 + int 0 // (𝕡) flags#0 | is_true%3#0,0x00,0 + uncover 2 // load is_true%3#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%3#0 flags.b File "arc4_types/structs.py", line 56 + setbit // (𝕡) flags#0 | {setbit} flags.b File "arc4_types/structs.py", line 56 + int 0 // (𝕡) flags#0 | tmp%4#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.b.decode() File "arc4_types/structs.py", line 56 + ! // (𝕡) flags#0 | {!} not flags.b.decode() File "arc4_types/structs.py", line 56 + assert // (𝕡) flags#0 | assert not flags.b.decode() File "arc4_types/structs.py", line 56 + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 2 // (𝕡) flags#0 | flags#0,2 flags.c File "arc4_types/structs.py", line 57 + getbit // (𝕡) flags#0 | {getbit} flags.c File "arc4_types/structs.py", line 57 + byte 0x00 // (𝕡) flags#0 | is_true%7#0,0x00 flags.c File "arc4_types/structs.py", line 57 + int 0 // (𝕡) flags#0 | is_true%7#0,0x00,0 + uncover 2 // load is_true%7#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%7#0 flags.c File "arc4_types/structs.py", line 57 + setbit // (𝕡) flags#0 | {setbit} flags.c File "arc4_types/structs.py", line 57 + int 0 // (𝕡) flags#0 | tmp%8#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.c.decode() File "arc4_types/structs.py", line 57 + assert // (𝕡) flags#0 | assert flags.c.decode() File "arc4_types/structs.py", line 57 + frame_dig -1 // load flags#0 from parameters (𝕡) flags#0 | flags#0 flags: Flags File "arc4_types/structs.py", line 54 + int 3 // (𝕡) flags#0 | flags#0,3 flags.d File "arc4_types/structs.py", line 58 + getbit // (𝕡) flags#0 | {getbit} flags.d File "arc4_types/structs.py", line 58 + byte 0x00 // (𝕡) flags#0 | is_true%10#0,0x00 flags.d File "arc4_types/structs.py", line 58 + int 0 // (𝕡) flags#0 | is_true%10#0,0x00,0 + uncover 2 // load is_true%10#0 from l-stack (no copy) (𝕡) flags#0 | 0x00,0,is_true%10#0 flags.d File "arc4_types/structs.py", line 58 + setbit // (𝕡) flags#0 | {setbit} flags.d File "arc4_types/structs.py", line 58 + int 0 // (𝕡) flags#0 | tmp%11#0,0 + getbit // (𝕡) flags#0 | {getbit} flags.d.decode() File "arc4_types/structs.py", line 58 + ! // (𝕡) flags#0 | {!} not flags.d.decode() File "arc4_types/structs.py", line 58 + assert // (𝕡) flags#0 | assert not flags.d.decode() File "arc4_types/structs.py", line 58 + retsub // + + +// examples.arc4_types.structs.nested_decode(vector_flags#0: bytes) -> void: +nested_decode: + proto 1 0 // (𝕡) vector_flags#0 | def nested_decode(vector_flags: VectorFlags) -> None: File "arc4_types/structs.py", line 62 + +nested_decode_block@0: + frame_dig -1 // load vector_flags#0 from parameters (𝕡) vector_flags#0 | vector_flags#0 vector_flags: VectorFlags File "arc4_types/structs.py", line 62 + int 0 // (𝕡) vector_flags#0 | vector_flags#0,0 vector_flags.vector File "arc4_types/structs.py", line 63 + int 16 // (𝕡) vector_flags#0 | vector_flags#0,0,16 vector_flags.vector File "arc4_types/structs.py", line 63 + extract3 // (𝕡) vector_flags#0 | {extract3} vector_flags.vector File "arc4_types/structs.py", line 63 + int 0 // (𝕡) vector_flags#0 | tmp%0#0,0 vector_flags.vector.x File "arc4_types/structs.py", line 63 + int 8 // (𝕡) vector_flags#0 | tmp%0#0,0,8 vector_flags.vector.x File "arc4_types/structs.py", line 63 + extract3 // (𝕡) vector_flags#0 | {extract3} vector_flags.vector.x File "arc4_types/structs.py", line 63 + btoi // (𝕡) vector_flags#0 | {btoi} vector_flags.vector.x.decode() File "arc4_types/structs.py", line 63 + int 35382882839 // (𝕡) vector_flags#0 | tmp%2#0,35382882839 35382882839 File "arc4_types/structs.py", line 63 + == // (𝕡) vector_flags#0 | {==} vector_flags.vector.x.decode() == 35382882839 File "arc4_types/structs.py", line 63 + assert // (𝕡) vector_flags#0 | assert vector_flags.vector.x.decode() == 35382882839 File "arc4_types/structs.py", line 63 + frame_dig -1 // load vector_flags#0 from parameters (𝕡) vector_flags#0 | vector_flags#0 vector_flags: VectorFlags File "arc4_types/structs.py", line 62 + int 16 // (𝕡) vector_flags#0 | vector_flags#0,16 vector_flags.flags File "arc4_types/structs.py", line 64 + int 1 // (𝕡) vector_flags#0 | vector_flags#0,16,1 vector_flags.flags File "arc4_types/structs.py", line 64 + extract3 // (𝕡) vector_flags#0 | {extract3} vector_flags.flags File "arc4_types/structs.py", line 64 + int 2 // (𝕡) vector_flags#0 | tmp%4#0,2 vector_flags.flags.c File "arc4_types/structs.py", line 64 + getbit // (𝕡) vector_flags#0 | {getbit} vector_flags.flags.c File "arc4_types/structs.py", line 64 + byte 0x00 // (𝕡) vector_flags#0 | is_true%5#0,0x00 vector_flags.flags.c File "arc4_types/structs.py", line 64 + int 0 // (𝕡) vector_flags#0 | is_true%5#0,0x00,0 + uncover 2 // load is_true%5#0 from l-stack (no copy) (𝕡) vector_flags#0 | 0x00,0,is_true%5#0 vector_flags.flags.c File "arc4_types/structs.py", line 64 + setbit // (𝕡) vector_flags#0 | {setbit} vector_flags.flags.c File "arc4_types/structs.py", line 64 + int 0 // (𝕡) vector_flags#0 | tmp%6#0,0 + getbit // (𝕡) vector_flags#0 | {getbit} vector_flags.flags.c.decode() File "arc4_types/structs.py", line 64 + assert // (𝕡) vector_flags#0 | assert vector_flags.flags.c.decode() File "arc4_types/structs.py", line 64 + retsub // + diff --git a/examples/arc4_types/out/structs.approval_unoptimized.teal b/examples/arc4_types/out/structs.approval_unoptimized.teal new file mode 100644 index 0000000000..04413709f6 --- /dev/null +++ b/examples/arc4_types/out/structs.approval_unoptimized.teal @@ -0,0 +1,237 @@ +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: +main: + byte "" + dup + +main_block@0: + int 16 + pop + byte 0x + byte 0x000000083cfbf217 + concat + byte 0x000000230384b842 + concat + dup + swap + int 16 + pop + byte 0x + byte 0x000000083cfbf217 + concat + byte 0x000000230384b842 + concat + callsub add + dup + int 0 + int 8 + extract3 + swap + int 8 + int 8 + extract3 + swap + +main_for_header_0@1: + int 0 + bury 5 + b main_for_body@3 + +main_for_header_1@2: + dup + dig 3 + bury 5 + +main_for_body@3: + log + +main_for_footer@4: + dig 3 + dup + int 1 + + + bury 4 + switch main_for_header_1@2 + +main_after_for@5: + byte 0x00 + int 0 + int 1 + setbit + byte 0x00 + int 0 + int 0 + setbit + byte 0x00 + int 0 + int 1 + setbit + cover 2 + byte 0x00 + int 0 + int 0 + setbit + cover 3 + int 1 + pop + byte 0x + uncover 2 + concat + swap + int 0 + getbit + swap + int 1 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 2 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 3 + uncover 2 + setbit + dup + callsub check + dup + log + int 17 + pop + byte 0x + dig 3 + concat + swap + concat + callsub nested_decode + int 1 + return + + +// examples.arc4_types.structs.add(v1#0: bytes, v2#0: bytes) -> bytes: +add: + proto 2 1 + +add_block@0: + frame_dig -2 + int 0 + int 8 + extract3 + btoi + frame_dig -1 + int 0 + int 8 + extract3 + btoi + + + itob + frame_dig -2 + int 8 + int 8 + extract3 + btoi + frame_dig -1 + int 8 + int 8 + extract3 + btoi + + + itob + int 16 + pop + byte 0x + uncover 2 + concat + swap + concat + retsub + + +// examples.arc4_types.structs.check(flags#0: bytes) -> void: +check: + proto 1 0 + +check_block@0: + frame_dig -1 + int 0 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + assert + frame_dig -1 + int 1 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + ! + assert + frame_dig -1 + int 2 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + assert + frame_dig -1 + int 3 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + ! + assert + retsub + + +// examples.arc4_types.structs.nested_decode(vector_flags#0: bytes) -> void: +nested_decode: + proto 1 0 + +nested_decode_block@0: + frame_dig -1 + int 0 + int 16 + extract3 + int 0 + int 8 + extract3 + btoi + int 35382882839 + == + assert + frame_dig -1 + int 16 + int 1 + extract3 + int 2 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + int 0 + getbit + assert + retsub + diff --git a/examples/arc4_types/out/structs.awst b/examples/arc4_types/out/structs.awst new file mode 100644 index 0000000000..5b04b44205 --- /dev/null +++ b/examples/arc4_types/out/structs.awst @@ -0,0 +1,58 @@ +struct Vector { + x: algopy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[9]] + y: algopy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[9]] +} + +struct Flags { + a: algopy.arc4.Bool + b: algopy.arc4.Bool + c: algopy.arc4.Bool + d: algopy.arc4.Bool +} + +struct VectorFlags { + vector: examples.arc4_types.structs.Vector + flags: examples.arc4_types.structs.Flags +} + +contract Arc4StructsTypeContract +{ + approval_program(): bool + { + coord_1: examples.arc4_types.structs.Vector = arc4_encode((35.382882839arc4u64x9, 150.382884930arc4u64x9), examples.arc4_types.structs.Vector) + coord_2: examples.arc4_types.structs.Vector = arc4_encode((35.382882839arc4u64x9, 150.382884930arc4u64x9), examples.arc4_types.structs.Vector) + coord_3: examples.arc4_types.structs.Vector = examples.arc4_types.structs::add(coord_1, coord_2) + for val in (coord_3[0u], coord_3[1u]) { + log(reinterpret_cast(val)) + } + flags: examples.arc4_types.structs.Flags = arc4_encode((arc4_encode(true, algopy.arc4.Bool), arc4_encode(false, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(false, algopy.arc4.Bool)), examples.arc4_types.structs.Flags) + examples.arc4_types.structs::check(flags) + log(reinterpret_cast(flags)) + examples.arc4_types.structs::nested_decode(arc4_encode((coord_1, flags), examples.arc4_types.structs.VectorFlags)) + return true + } + + clear_state_program(): bool + { + return true + } +} + +subroutine add(v1: examples.arc4_types.structs.Vector, v2: examples.arc4_types.structs.Vector): examples.arc4_types.structs.Vector +{ + return arc4_encode((arc4_encode(arc4_decode(v1[0u], algopy.UInt64) + arc4_decode(v2[0u], algopy.UInt64), algopy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[9]]), arc4_encode(arc4_decode(v1[1u], algopy.UInt64) + arc4_decode(v2[1u], algopy.UInt64), algopy.arc4.UFixedNxM[typing.Literal[64], typing.Literal[9]])), examples.arc4_types.structs.Vector) +} + +subroutine check(flags: examples.arc4_types.structs.Flags): None +{ + assert(arc4_decode(flags[0u], bool)) + assert(!(arc4_decode(flags[1u], bool))) + assert(arc4_decode(flags[2u], bool)) + assert(!(arc4_decode(flags[3u], bool))) +} + +subroutine nested_decode(vector_flags: examples.arc4_types.structs.VectorFlags): None +{ + assert(arc4_decode(vector_flags[0u][0u], algopy.UInt64) == 35382882839u) + assert(arc4_decode(vector_flags[1u][2u], bool)) +} \ No newline at end of file diff --git a/examples/arc4_types/out/structs.clear.debug.teal b/examples/arc4_types/out/structs.clear.debug.teal new file mode 100644 index 0000000000..19beff8344 --- /dev/null +++ b/examples/arc4_types/out/structs.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/structs.py", line 42 + return // return True File "arc4_types/structs.py", line 42 + diff --git a/examples/arc4_types/out/structs.clear.teal b/examples/arc4_types/out/structs.clear.teal new file mode 100644 index 0000000000..7281be0732 --- /dev/null +++ b/examples/arc4_types/out/structs.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/structs.clear_unoptimized.debug.teal b/examples/arc4_types/out/structs.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..19beff8344 --- /dev/null +++ b/examples/arc4_types/out/structs.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/structs.py", line 42 + return // return True File "arc4_types/structs.py", line 42 + diff --git a/examples/arc4_types/out/structs.clear_unoptimized.teal b/examples/arc4_types/out/structs.clear_unoptimized.teal new file mode 100644 index 0000000000..7281be0732 --- /dev/null +++ b/examples/arc4_types/out/structs.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.cssa.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.cssa.ir new file mode 100644 index 0000000000..43aaef6d24 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.cssa.ir @@ -0,0 +1,83 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + let (tuple_index%6#4: uint64, val#3: bytes) = (tuple_index%6#0, val#0) + goto block@3 + block@2: // for_header_1_L30 + let (tuple_index%6#5: uint64, val#4: bytes) = (tuple_index%6#3, val#1) + goto block@3 + block@3: // for_body_L30 + let val#5: bytes = φ(val#3 <- block@0, val#4 <- block@2) + let tuple_index%6#6: uint64 = φ(tuple_index%6#4 <- block@0, tuple_index%6#5 <- block@2) + let (tuple_index%6#1: uint64, val#2: bytes) = (tuple_index%6#6, val#5) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + examples.arc4_types.structs.check(0xa0) + (log 0xa0) + examples.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.final.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.final.ir new file mode 100644 index 0000000000..fb82884db4 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.final.ir @@ -0,0 +1,80 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + goto block@3 + block@2: // for_header_1_L30 + let val#0: bytes = val#1 + let tuple_index%6#0: uint64 = tuple_index%6#3 + goto block@3 + block@3: // for_body_L30 + (log val#0) + let tuple_index%6#3: uint64 = (+ tuple_index%6#0 1u) + goto tuple_index%6#0 ? block@5 : block@2 + block@5: // after_for_L30 + examples.arc4_types.structs.check(0xa0) + (log 0xa0) + examples.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.final_unoptimized.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.final_unoptimized.ir new file mode 100644 index 0000000000..abddcfdf44 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.final_unoptimized.ir @@ -0,0 +1,116 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let current_tail_offset%0#0: uint64 = 16u + let encoded_tuple_buffer%1#0: bytes = 0x + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 0x000000083cfbf217) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 0x000000230384b842) + let coord_1#0: bytes = encoded_tuple_buffer%1#0 + let current_tail_offset%2#0: uint64 = 16u + let encoded_tuple_buffer%3#0: bytes = 0x + let encoded_tuple_buffer%3#0: bytes = (concat encoded_tuple_buffer%3#0 0x000000083cfbf217) + let encoded_tuple_buffer%3#0: bytes = (concat encoded_tuple_buffer%3#0 0x000000230384b842) + let coord_2#0: bytes = encoded_tuple_buffer%3#0 + let coord_3#0: bytes = examples.arc4_types.structs.add(coord_1#0, coord_2#0) + let tmp%4#0: bytes = (extract3 coord_3#0 0u 8u) + let tmp%5#0: bytes = (extract3 coord_3#0 8u 8u) + goto block@1 + block@1: // for_header_0_L30 + let tuple_index%6#0: uint64 = 0u + let val#0: bytes = tmp%4#0 + goto block@3 + block@2: // for_header_1_L30 + let val#0: bytes = tmp%5#0 + let tuple_index%6#0: uint64 = tuple_index%6#3 + goto block@3 + block@3: // for_body_L30 + (log val#0) + goto block@4 + block@4: // for_footer_L30 + let tuple_index%6#3: uint64 = (+ tuple_index%6#0 1u) + goto [block@2, ...block@5][tuple_index%6#0] + block@5: // after_for_L30 + let tmp%7#0: any = (setbit 0x00 0u 1u) + let tmp%8#0: any = (setbit 0x00 0u 0u) + let tmp%9#0: any = (setbit 0x00 0u 1u) + let tmp%10#0: any = (setbit 0x00 0u 0u) + let current_tail_offset%11#0: uint64 = 1u + let encoded_tuple_buffer%12#0: bytes = 0x + let encoded_tuple_buffer%12#0: bytes = (concat encoded_tuple_buffer%12#0 tmp%7#0) + let is_true%13#0: uint64 = (getbit tmp%8#0 0u) + let encoded_tuple_buffer%12#0: bytes = (setbit encoded_tuple_buffer%12#0 1u is_true%13#0) + let is_true%14#0: uint64 = (getbit tmp%9#0 0u) + let encoded_tuple_buffer%12#0: bytes = (setbit encoded_tuple_buffer%12#0 2u is_true%14#0) + let is_true%15#0: uint64 = (getbit tmp%10#0 0u) + let encoded_tuple_buffer%12#0: bytes = (setbit encoded_tuple_buffer%12#0 3u is_true%15#0) + let flags#0: any = encoded_tuple_buffer%12#0 + examples.arc4_types.structs.check(flags#0) + (log flags#0) + let current_tail_offset%16#0: uint64 = 17u + let encoded_tuple_buffer%17#0: bytes = 0x + let encoded_tuple_buffer%17#0: bytes = (concat encoded_tuple_buffer%17#0 coord_1#0) + let encoded_tuple_buffer%17#0: bytes = (concat encoded_tuple_buffer%17#0 flags#0) + examples.arc4_types.structs.nested_decode(encoded_tuple_buffer%17#0) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let current_tail_offset%12#0: uint64 = 16u + let encoded_tuple_buffer%13#0: bytes = 0x + let encoded_tuple_buffer%13#0: bytes = (concat encoded_tuple_buffer%13#0 val_as_bytes%5#0) + let encoded_tuple_buffer%13#0: bytes = (concat encoded_tuple_buffer%13#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#0 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.parallel_copies.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.parallel_copies.ir new file mode 100644 index 0000000000..d86f456c49 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.parallel_copies.ir @@ -0,0 +1,84 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + let val#5: bytes = val#0 + let tuple_index%6#6: uint64 = tuple_index%6#0 + goto block@3 + block@2: // for_header_1_L30 + let val#5: bytes = val#1 + let tuple_index%6#6: uint64 = tuple_index%6#3 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = val#5 + let tuple_index%6#1: uint64 = tuple_index%6#6 + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + examples.arc4_types.structs.check(0xa0) + (log 0xa0) + examples.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.post_ssa.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.post_ssa.ir new file mode 100644 index 0000000000..6997124d3f --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.post_ssa.ir @@ -0,0 +1,81 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + let (tuple_index%6#6: uint64, val#5: bytes) = (tuple_index%6#0, val#0) + goto block@3 + block@2: // for_header_1_L30 + let (tuple_index%6#6: uint64, val#5: bytes) = (tuple_index%6#3, val#1) + goto block@3 + block@3: // for_body_L30 + let (tuple_index%6#1: uint64, val#2: bytes) = (tuple_index%6#6, val#5) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + examples.arc4_types.structs.check(0xa0) + (log 0xa0) + examples.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.ir new file mode 100644 index 0000000000..28d3643cb6 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.ir @@ -0,0 +1,117 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let current_tail_offset%0#0: uint64 = 16u + let encoded_tuple_buffer%1#0: bytes = 0x + let encoded_tuple_buffer%1#1: bytes = (concat encoded_tuple_buffer%1#0 0x000000083cfbf217) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#1 0x000000230384b842) + let coord_1#0: bytes = encoded_tuple_buffer%1#2 + let current_tail_offset%2#0: uint64 = 16u + let encoded_tuple_buffer%3#0: bytes = 0x + let encoded_tuple_buffer%3#1: bytes = (concat encoded_tuple_buffer%3#0 0x000000083cfbf217) + let encoded_tuple_buffer%3#2: bytes = (concat encoded_tuple_buffer%3#1 0x000000230384b842) + let coord_2#0: bytes = encoded_tuple_buffer%3#2 + let coord_3#0: bytes = examples.arc4_types.structs.add(coord_1#0, coord_2#0) + let tmp%4#0: bytes = (extract3 coord_3#0 0u 8u) + let tmp%5#0: bytes = (extract3 coord_3#0 8u 8u) + goto block@1 + block@1: // for_header_0_L30 + let tuple_index%6#0: uint64 = 0u + let val#0: bytes = tmp%4#0 + goto block@3 + block@2: // for_header_1_L30 + let val#1: bytes = tmp%5#0 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = φ(val#0 <- block@1, val#1 <- block@2) + let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@1, tuple_index%6#3 <- block@2) + (log val#2) + goto block@4 + block@4: // for_footer_L30 + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto [block@2, ...block@5][tuple_index%6#1] + block@5: // after_for_L30 + let tmp%7#0: any = (setbit 0x00 0u 1u) + let tmp%8#0: any = (setbit 0x00 0u 0u) + let tmp%9#0: any = (setbit 0x00 0u 1u) + let tmp%10#0: any = (setbit 0x00 0u 0u) + let current_tail_offset%11#0: uint64 = 1u + let encoded_tuple_buffer%12#0: bytes = 0x + let encoded_tuple_buffer%12#1: bytes = (concat encoded_tuple_buffer%12#0 tmp%7#0) + let is_true%13#0: uint64 = (getbit tmp%8#0 0u) + let encoded_tuple_buffer%12#2: any = (setbit encoded_tuple_buffer%12#1 1u is_true%13#0) + let is_true%14#0: uint64 = (getbit tmp%9#0 0u) + let encoded_tuple_buffer%12#3: any = (setbit encoded_tuple_buffer%12#2 2u is_true%14#0) + let is_true%15#0: uint64 = (getbit tmp%10#0 0u) + let encoded_tuple_buffer%12#4: any = (setbit encoded_tuple_buffer%12#3 3u is_true%15#0) + let flags#0: any = encoded_tuple_buffer%12#4 + examples.arc4_types.structs.check(flags#0) + (log flags#0) + let current_tail_offset%16#0: uint64 = 17u + let encoded_tuple_buffer%17#0: bytes = 0x + let encoded_tuple_buffer%17#1: bytes = (concat encoded_tuple_buffer%17#0 coord_1#0) + let encoded_tuple_buffer%17#2: bytes = (concat encoded_tuple_buffer%17#1 flags#0) + examples.arc4_types.structs.nested_decode(encoded_tuple_buffer%17#2) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let current_tail_offset%12#0: uint64 = 16u + let encoded_tuple_buffer%13#0: bytes = 0x + let encoded_tuple_buffer%13#1: bytes = (concat encoded_tuple_buffer%13#0 val_as_bytes%5#0) + let encoded_tuple_buffer%13#2: bytes = (concat encoded_tuple_buffer%13#1 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_1.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..32b5c85210 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_1.ir @@ -0,0 +1,94 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let encoded_tuple_buffer%1#1: bytes = (concat 0x 0x000000083cfbf217) + let coord_1#0: bytes = (concat encoded_tuple_buffer%1#1 0x000000230384b842) + let encoded_tuple_buffer%3#1: bytes = (concat 0x 0x000000083cfbf217) + let coord_2#0: bytes = (concat encoded_tuple_buffer%3#1 0x000000230384b842) + let coord_3#0: bytes = examples.arc4_types.structs.add(coord_1#0, coord_2#0) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + goto block@3 + block@2: // for_header_1_L30 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = φ(val#0 <- block@0, val#1 <- block@2) + let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@0, tuple_index%6#3 <- block@2) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + let encoded_tuple_buffer%12#1: bytes = (concat 0x 0x80) + let is_true%13#0: uint64 = (getbit 0x00 0u) + let encoded_tuple_buffer%12#2: any = (setbit encoded_tuple_buffer%12#1 1u is_true%13#0) + let is_true%14#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%12#3: any = (setbit encoded_tuple_buffer%12#2 2u is_true%14#0) + let is_true%15#0: uint64 = (getbit 0x00 0u) + let flags#0: any = (setbit encoded_tuple_buffer%12#3 3u is_true%15#0) + examples.arc4_types.structs.check(flags#0) + (log flags#0) + let encoded_tuple_buffer%17#1: bytes = (concat 0x coord_1#0) + let encoded_tuple_buffer%17#2: bytes = (concat encoded_tuple_buffer%17#1 flags#0) + examples.arc4_types.structs.nested_decode(encoded_tuple_buffer%17#2) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#1: bytes = (concat 0x val_as_bytes%5#0) + let encoded_tuple_buffer%13#2: bytes = (concat encoded_tuple_buffer%13#1 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_2.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..9c6193371b --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_2.ir @@ -0,0 +1,86 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_1#0: bytes = (concat 0x000000083cfbf217 0x000000230384b842) + let coord_2#0: bytes = (concat 0x000000083cfbf217 0x000000230384b842) + let coord_3#0: bytes = examples.arc4_types.structs.add(coord_1#0, coord_2#0) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + goto block@3 + block@2: // for_header_1_L30 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = φ(val#0 <- block@0, val#1 <- block@2) + let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@0, tuple_index%6#3 <- block@2) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + let encoded_tuple_buffer%12#2: any = (setbit 0x80 1u 0u) + let encoded_tuple_buffer%12#3: any = (setbit encoded_tuple_buffer%12#2 2u 1u) + let flags#0: any = (setbit encoded_tuple_buffer%12#3 3u 0u) + examples.arc4_types.structs.check(flags#0) + (log flags#0) + let encoded_tuple_buffer%17#2: bytes = (concat coord_1#0 flags#0) + examples.arc4_types.structs.nested_decode(encoded_tuple_buffer%17#2) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_3.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..0a8226ec16 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_3.ir @@ -0,0 +1,83 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + goto block@3 + block@2: // for_header_1_L30 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = φ(val#0 <- block@0, val#1 <- block@2) + let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@0, tuple_index%6#3 <- block@2) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + let encoded_tuple_buffer%12#3: any = (setbit 0x80 2u 1u) + let flags#0: any = (setbit encoded_tuple_buffer%12#3 3u 0u) + examples.arc4_types.structs.check(flags#0) + (log flags#0) + let encoded_tuple_buffer%17#2: bytes = (concat 0x000000083cfbf217000000230384b842 flags#0) + examples.arc4_types.structs.nested_decode(encoded_tuple_buffer%17#2) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_4.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..825cc5fdae --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_4.ir @@ -0,0 +1,82 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + goto block@3 + block@2: // for_header_1_L30 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = φ(val#0 <- block@0, val#1 <- block@2) + let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@0, tuple_index%6#3 <- block@2) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + let flags#0: any = (setbit 0xa0 3u 0u) + examples.arc4_types.structs.check(flags#0) + (log flags#0) + let encoded_tuple_buffer%17#2: bytes = (concat 0x000000083cfbf217000000230384b842 flags#0) + examples.arc4_types.structs.nested_decode(encoded_tuple_buffer%17#2) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_5.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..a8be8482da --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_5.ir @@ -0,0 +1,81 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + goto block@3 + block@2: // for_header_1_L30 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = φ(val#0 <- block@0, val#1 <- block@2) + let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@0, tuple_index%6#3 <- block@2) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + examples.arc4_types.structs.check(0xa0) + (log 0xa0) + let encoded_tuple_buffer%17#2: bytes = (concat 0x000000083cfbf217000000230384b842 0xa0) + examples.arc4_types.structs.nested_decode(encoded_tuple_buffer%17#2) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_6.ir b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..cc9e12ea10 --- /dev/null +++ b/examples/arc4_types/out/structs_Arc4StructsTypeContract.ssa.opt_pass_6.ir @@ -0,0 +1,80 @@ +contract examples.arc4_types.structs.Arc4StructsTypeContract: + program approval: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: + block@0: // L26 + let coord_3#0: bytes = examples.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let val#0: bytes = (extract3 coord_3#0 0u 8u) + let val#1: bytes = (extract3 coord_3#0 8u 8u) + let tuple_index%6#0: uint64 = 0u + goto block@3 + block@2: // for_header_1_L30 + goto block@3 + block@3: // for_body_L30 + let val#2: bytes = φ(val#0 <- block@0, val#1 <- block@2) + let tuple_index%6#1: uint64 = φ(tuple_index%6#0 <- block@0, tuple_index%6#3 <- block@2) + (log val#2) + let tuple_index%6#3: uint64 = (+ tuple_index%6#1 1u) + goto tuple_index%6#1 ? block@5 : block@2 + block@5: // after_for_L30 + examples.arc4_types.structs.check(0xa0) + (log 0xa0) + examples.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + return 1u + + subroutine examples.arc4_types.structs.add(v1: bytes, v2: bytes) -> bytes: + block@0: // L46 + let tmp%0#0: bytes = (extract3 v1#0 0u 8u) + let tmp%1#0: uint64 = (btoi tmp%0#0) + let tmp%2#0: bytes = (extract3 v2#0 0u 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + let tmp%4#0: uint64 = (+ tmp%1#0 tmp%3#0) + let val_as_bytes%5#0: bytes = (itob tmp%4#0) + let tmp%6#0: bytes = (extract3 v1#0 8u 8u) + let tmp%7#0: uint64 = (btoi tmp%6#0) + let tmp%8#0: bytes = (extract3 v2#0 8u 8u) + let tmp%9#0: uint64 = (btoi tmp%8#0) + let tmp%10#0: uint64 = (+ tmp%7#0 tmp%9#0) + let val_as_bytes%11#0: bytes = (itob tmp%10#0) + let encoded_tuple_buffer%13#2: bytes = (concat val_as_bytes%5#0 val_as_bytes%11#0) + return encoded_tuple_buffer%13#2 + + subroutine examples.arc4_types.structs.check(flags: bytes) -> void: + block@0: // L54 + let is_true%0#0: uint64 = (getbit flags#0 0u) + let tmp%1#0: any = (setbit 0x00 0u is_true%0#0) + let tmp%2#0: uint64 = (getbit tmp%1#0 0u) + (assert tmp%2#0) + let is_true%3#0: uint64 = (getbit flags#0 1u) + let tmp%4#0: any = (setbit 0x00 0u is_true%3#0) + let tmp%5#0: uint64 = (getbit tmp%4#0 0u) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) + let is_true%7#0: uint64 = (getbit flags#0 2u) + let tmp%8#0: any = (setbit 0x00 0u is_true%7#0) + let tmp%9#0: uint64 = (getbit tmp%8#0 0u) + (assert tmp%9#0) + let is_true%10#0: uint64 = (getbit flags#0 3u) + let tmp%11#0: any = (setbit 0x00 0u is_true%10#0) + let tmp%12#0: uint64 = (getbit tmp%11#0 0u) + let tmp%13#0: uint64 = (! tmp%12#0) + (assert tmp%13#0) + return + + subroutine examples.arc4_types.structs.nested_decode(vector_flags: bytes) -> void: + block@0: // L62 + let tmp%0#0: bytes = (extract3 vector_flags#0 0u 16u) + let tmp%1#0: bytes = (extract3 tmp%0#0 0u 8u) + let tmp%2#0: uint64 = (btoi tmp%1#0) + let tmp%3#0: uint64 = (== tmp%2#0 35382882839u) + (assert tmp%3#0) + let tmp%4#0: bytes = (extract3 vector_flags#0 16u 1u) + let is_true%5#0: uint64 = (getbit tmp%4#0 2u) + let tmp%6#0: any = (setbit 0x00 0u is_true%5#0) + let tmp%7#0: uint64 = (getbit tmp%6#0 0u) + (assert tmp%7#0) + return + + program clear-state: + subroutine examples.arc4_types.structs.Arc4StructsTypeContract.clear_state_program() -> uint64: + block@0: // L41 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples.O0.log b/examples/arc4_types/out/tuples.O0.log new file mode 100644 index 0000000000..367eb4933a --- /dev/null +++ b/examples/arc4_types/out/tuples.O0.log @@ -0,0 +1,512 @@ +PC Teal Stack +1 +17 +38 int 7 7 +40 byte 0x 7, 0x +41 byte 0x01 7, 0x, 0x01 +44 concat 7, 0x01 +45 byte 0x02 7, 0x01, 0x02 +48 concat 7, 0x0102 +49 dig 1 7, 0x0102, 7 +51 itob 7, 0x0102, 0x0000000000000007 +52 extract 6 2 7, 0x0102, 0x0007 +55 concat 7, 0x01020007 +56 swap 0x01020007, 7 +57 byte "\x00\x05hello" 0x01020007, 7, 0x000568656C6C6F +58 len 0x01020007, 7, 7 +59 + 0x01020007, 14 +60 dup 0x01020007, 14, 14 +61 itob 0x01020007, 14, 0x000000000000000E +62 extract 6 2 0x01020007, 14, 0x000E +65 uncover 2 14, 0x000E, 0x01020007 +67 swap 14, 0x01020007, 0x000E +68 concat 14, 0x01020007000E +69 byte "\x00\x05world" 14, 0x01020007000E, 0x0005776F726C64 +70 len 14, 0x01020007000E, 7 +71 uncover 2 0x01020007000E, 7, 14 +73 + 0x01020007000E, 21 +74 pop 0x01020007000E +75 byte 0xff 0x01020007000E, 0xFF +78 concat 0x01020007000EFF +79 byte "\x00\x05hello" 0x01020007000EFF, 0x000568656C6C6F +80 concat 0x01020007000EFF000568656C6C6F +81 byte "\x00\x05world" 0x01020007000EFF000568656C6C6F, 0x0005776F726C64 +82 concat 0x01020007000EFF000568656C6C6F0005776F726C64 +83 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +84 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +85 byte 0x01020007000eff000568656c6c6f0005776f726c64 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +108 == 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +109 assert 0x01020007000EFF000568656C6C6F0005776F726C64 +110 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00 +111 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00, 0 +112 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00, 0, 1 +113 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80 +114 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00 +115 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0 +116 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0, 0 +117 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00 +118 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x00 +119 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x00, 0 +120 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x00, 0, 1 +121 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x80 +122 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00 +124 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x00 +125 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x00, 0 +126 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x00, 0, 1 +127 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80 +128 cover 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x00 +130 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x00, 0x00 +131 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x00, 0x00, 0 +132 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x00, 0x00, 0, 1 +133 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x00, 0x80 +134 cover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x00 +136 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 +137 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0 +138 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0, 1 +139 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80 +140 cover 5 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +142 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 +143 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0 +144 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0, 0 +145 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 +146 cover 6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +148 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 +149 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0 +150 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0, 1 +151 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80 +152 cover 7 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +154 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00 +155 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0 +156 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0, 1 +157 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80 +158 cover 8 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +160 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 4 +161 pop 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00 +162 byte 0x 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x +163 byte 0x04 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x, 0x04 +166 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04 +167 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04, 0x80 +169 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x0480 +170 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x0480, 0x00 +171 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x0480, 0x00, 0 +172 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x0480, 0 +173 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0, 0x0480 +174 int 9 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0, 0x0480, 9 +175 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x0480, 9, 0 +177 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x0480 +178 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x0480, 0x80 +179 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x0480, 0x80, 0 +180 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x0480, 1 +181 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 1, 0x0480 +182 int 10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 1, 0x0480, 10 +184 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x0480, 10, 1 +186 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04A0 +187 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04A0, 0x80 +188 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04A0, 0x80, 0 +189 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04A0, 1 +190 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 1, 0x04A0 +191 int 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 1, 0x04A0, 11 +193 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04A0, 11, 1 +195 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04B0 +196 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x04B0, 0x80 +197 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x04B0, 0x80, 0 +198 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x04B0, 1 +199 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 1, 0x04B0 +200 int 12 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 1, 0x04B0, 12 +202 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x04B0, 12, 1 +204 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x80, 0x04B8 +205 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x04B8, 0x80 +206 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x04B8, 0x80, 0 +207 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x04B8, 1 +208 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 1, 0x04B8 +209 int 13 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 1, 0x04B8, 13 +211 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x04B8, 13, 1 +213 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x00, 0x04BC +214 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x04BC, 0x00 +215 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x04BC, 0x00, 0 +216 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x04BC, 0 +217 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0, 0x04BC +218 int 14 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0, 0x04BC, 14 +220 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x04BC, 14, 0 +222 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x80, 0x04BC +223 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x04BC, 0x80 +224 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x04BC, 0x80, 0 +225 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x04BC, 1 +226 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 1, 0x04BC +227 int 15 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 1, 0x04BC, 15 +229 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x04BC, 15, 1 +231 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x80, 0x04BD +232 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD, 0x80 +233 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD80 +234 byte 0x10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD80, 0x10 +237 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010 +238 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010 +239 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010 +240 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010, 0x04BD8010 +241 byte 0x04bd8010 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010, 0x04BD8010, 0x04BD8010 +247 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010, 1 +248 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010 +249 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010, 0x04BD8010 +250 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010, 0x04BD8010, 0 +251 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010, 0x04BD8010, 0, 1 +252 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04BD8010, 0x04 +253 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010 +254 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010, 0x04BD8010 +255 int 8 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010, 0x04BD8010, 8 +257 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010, 1 +258 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010, 1, 0x00 +259 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010, 1, 0x00, 0 +260 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010, 0x00, 0, 1 +262 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x04BD8010, 0x80 +263 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010 +264 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010, 0x04BD8010 +265 int 9 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010, 0x04BD8010, 9 +266 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010, 0 +267 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010, 0, 0x00 +268 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010, 0, 0x00, 0 +269 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010, 0x00, 0, 0 +271 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x04BD8010, 0x00 +272 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010 +273 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +274 int 10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 10 +276 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010, 1 +277 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010, 1, 0x00 +278 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +279 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +281 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x04BD8010, 0x80 +282 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010 +283 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010, 0x04BD8010 +284 int 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010, 0x04BD8010, 11 +286 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010, 1 +287 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010, 1, 0x00 +288 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010, 1, 0x00, 0 +289 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010, 0x00, 0, 1 +291 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x04BD8010, 0x80 +292 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010 +293 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x04BD8010 +294 int 12 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x04BD8010, 12 +296 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 1 +297 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 1, 0x00 +298 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 1, 0x00, 0 +299 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x00, 0, 1 +301 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x80 +302 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010 +303 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x04BD8010 +304 int 13 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x04BD8010, 13 +306 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 1 +307 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 1, 0x00 +308 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 1, 0x00, 0 +309 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x00, 0, 1 +311 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x80 +312 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010 +313 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x04BD8010 +314 int 14 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x04BD8010, 14 +316 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0 +317 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0, 0x00 +318 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0, 0x00, 0 +319 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x00, 0, 0 +321 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x00 +322 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +323 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +324 int 15 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 15 +326 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1 +327 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00 +328 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +329 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +331 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x80 +332 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010 +333 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010, 0x04BD8010 +334 int 16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010, 0x04BD8010, 16 +336 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010, 1 +337 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010, 1, 0x00 +338 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010, 1, 0x00, 0 +339 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010, 0x00, 0, 1 +341 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04BD8010, 0x80 +342 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04BD8010 +343 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x04BD8010 +344 int 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x04BD8010, 3 +346 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x04BD8010, 3, 1 +347 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x10 +348 uncover 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04BD8010, 0x10, 0x04 +350 cover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04, 0x80, 0x80, 0x04BD8010, 0x10 +352 uncover 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04, 0x80, 0x80, 0x04BD8010, 0x10, 0x80 +354 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04, 0x80, 0x80, 0x04BD8010, 0x10, 0x80, 0x80 +355 cover 7 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04, 0x80, 0x80, 0x04BD8010, 0x10, 0x80 +357 cover 12 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04, 0x80, 0x80, 0x04BD8010, 0x10 +359 uncover 5 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x04, 0x80, 0x80, 0x04BD8010, 0x10, 0x00 +361 cover 6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04, 0x80, 0x80, 0x04BD8010, 0x10 +363 uncover 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x04, 0x80, 0x04BD8010, 0x10, 0x80 +365 cover 5 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04, 0x80, 0x04BD8010, 0x10 +367 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x04, 0x04BD8010, 0x10, 0x80 +369 cover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04, 0x04BD8010, 0x10 +371 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x04, 0x04BD8010, 0x10, 0x10 +372 cover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x04, 0x04BD8010, 0x10 +374 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x04, 0x10, 0x04BD8010 +375 int 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x04, 0x10, 0x04BD8010, 3 +377 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x04, 0x10, 0x04BD8010, 3, 1 +378 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x04, 0x10, 0x10 +379 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x04, 1 +380 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x04 +381 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 4 +382 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 4, 4 +383 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 1 +384 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80 +385 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x00 +386 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0 +387 bz main_ternary_false@2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +395 dig 7 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80 +397 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x00 +398 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0 +399 bz main_ternary_false@4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +407 dig 6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80 +409 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x00 +410 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0 +411 bz main_ternary_false@6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +419 dig 5 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80 +421 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x00 +422 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0 +423 bz main_ternary_false@8 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +431 dig 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80 +433 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x00 +434 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0 +435 bz main_ternary_false@10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +443 dig 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80 +445 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x00 +446 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0 +447 bz main_ternary_false@12 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +455 dig 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80 +457 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x00 +458 != 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 1 +459 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +460 dig 8 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x00 +462 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x00, 0x00 +463 != 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0 +464 bz main_ternary_false@20 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +472 dig 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x00 +474 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x00, 0x00 +475 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 1 +476 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +477 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x10 +478 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 16 +479 int 16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 16, 16 +481 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 1 +482 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +483 dig 10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04BD8010 +485 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BD8010 +486 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BD8010, 0 +487 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BD8010, 0, 1 +488 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04BD8010, 0x04 +489 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010 +490 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010, 0x04BD8010 +491 int 8 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010, 0x04BD8010, 8 +493 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010, 1 +494 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010, 1, 0x00 +495 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010, 1, 0x00, 0 +496 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010, 0x00, 0, 1 +498 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x04BD8010, 0x80 +499 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010 +500 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010, 0x04BD8010 +501 int 9 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010, 0x04BD8010, 9 +502 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010, 0 +503 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010, 0, 0x00 +504 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010, 0, 0x00, 0 +505 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010, 0x00, 0, 0 +507 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x04BD8010, 0x00 +508 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010 +509 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +510 int 10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 10 +512 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010, 1 +513 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010, 1, 0x00 +514 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +515 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +517 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x04BD8010, 0x80 +518 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010 +520 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +521 int 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 11 +523 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010, 1 +524 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00 +525 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +526 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +528 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x04BD8010, 0x80 +529 cover 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +531 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +532 int 12 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 12 +534 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1 +535 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00 +536 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +537 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +539 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x80 +540 cover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +542 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +543 int 13 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 13 +545 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1 +546 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00 +547 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +548 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +550 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x80 +551 cover 5 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +553 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +554 int 14 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 14 +556 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0 +557 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0, 0x00 +558 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0, 0x00, 0 +559 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x00, 0, 0 +561 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x00 +562 cover 6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +564 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +565 int 15 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 15 +567 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1 +568 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00 +569 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +570 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +572 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x80 +573 cover 7 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +575 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +576 int 16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 16 +578 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1 +579 byte 0x00 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00 +580 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 1, 0x00, 0 +581 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x00, 0, 1 +583 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x80 +584 cover 8 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +586 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010 +587 int 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 3 +589 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04BD8010, 3, 1 +590 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x10 +591 cover 7 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +593 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 4 +594 pop 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010 +595 byte 0x 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04, 0x80, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x +596 uncover 12 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x, 0x04 +598 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04 +599 uncover 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x04, 0x80 +601 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x04BD8010, 0x0480 +602 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 0x00 +604 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 0x00, 0 +605 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 0 +606 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0, 0x0480 +607 int 9 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0, 0x0480, 9 +608 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 9, 0 +610 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480 +611 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 0x80 +613 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 0x80, 0 +614 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 1 +615 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 1, 0x0480 +616 int 10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 1, 0x0480, 10 +618 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x0480, 10, 1 +620 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x80, 0x04BD8010, 0x04A0 +621 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x04BD8010, 0x04A0, 0x80 +623 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x04BD8010, 0x04A0, 0x80, 0 +624 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x04BD8010, 0x04A0, 1 +625 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x04BD8010, 1, 0x04A0 +626 int 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x04BD8010, 1, 0x04A0, 11 +628 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x04BD8010, 0x04A0, 11, 1 +630 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x80, 0x04BD8010, 0x04B0 +631 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x04BD8010, 0x04B0, 0x80 +633 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x04BD8010, 0x04B0, 0x80, 0 +634 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x04BD8010, 0x04B0, 1 +635 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x04BD8010, 1, 0x04B0 +636 int 12 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x04BD8010, 1, 0x04B0, 12 +638 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x04BD8010, 0x04B0, 12, 1 +640 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x80, 0x04BD8010, 0x04B8 +641 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x04BD8010, 0x04B8, 0x80 +643 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x04BD8010, 0x04B8, 0x80, 0 +644 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x04BD8010, 0x04B8, 1 +645 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x04BD8010, 1, 0x04B8 +646 int 13 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x04BD8010, 1, 0x04B8, 13 +648 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x04BD8010, 0x04B8, 13, 1 +650 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x00, 0x04BD8010, 0x04BC +651 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BC, 0x00 +653 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BC, 0x00, 0 +654 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BC, 0 +655 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x04BD8010, 0, 0x04BC +656 int 14 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x04BD8010, 0, 0x04BC, 14 +658 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BC, 14, 0 +660 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BC +661 uncover 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x10, 0x04BD8010, 0x04BC, 0x80 +663 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x10, 0x04BD8010, 0x04BC, 0x80, 0 +664 getbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x10, 0x04BD8010, 0x04BC, 1 +665 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x10, 0x04BD8010, 1, 0x04BC +666 int 15 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x10, 0x04BD8010, 1, 0x04BC, 15 +668 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x10, 0x04BD8010, 0x04BC, 15, 1 +670 setbit 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x80, 0x10, 0x04BD8010, 0x04BD +671 uncover 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x10, 0x04BD8010, 0x04BD, 0x80 +673 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x10, 0x04BD8010, 0x04BD80 +674 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BD80, 0x10 +676 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x04BD8010, 0x04BD8010 +677 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 1 +678 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +679 dig 11 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64 +681 callsub test_stuff 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64 +709 proto 1 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64 +712 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +714 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0 +715 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0, 1 +716 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01 +717 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64 +719 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +720 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64, 1, 1 +721 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02 +722 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64 +724 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64, 2 +726 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7 +727 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +729 dig 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 0x01020007000EFF000568656C6C6F0005776F726C64, 7 +731 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 5 +732 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 5, 2 +734 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 7 +735 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +737 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64, 7, 7 +739 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F +740 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64 +742 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64, 4 +743 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14 +744 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 0x01020007000EFF000568656C6C6F0005776F726C64 +746 dig 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 0x01020007000EFF000568656C6C6F0005776F726C64, 14 +748 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 5 +749 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 5, 2 +751 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 7 +752 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +754 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64, 14, 7 +756 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64 +757 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +759 int 6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 6 +761 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 6, 1 +762 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF +763 uncover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 0x01 +765 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01, 0xFF +766 uncover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0x01, 0xFF, 0x02 +768 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0x02, 0x01, 0xFF +770 uncover 3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x02, 0x01, 0xFF, 0x0005776F726C64 +772 cover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 0x02, 0x01, 0xFF +774 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 0xFF, 0x02, 0x01 +776 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 0xFF, 0x02, 1 +777 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 0xFF, 1, 0x02 +778 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 0xFF, 1, 2 +779 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 0xFF, 3 +780 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 3, 0xFF +781 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 3, 255 +782 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 0x000568656C6C6F, 258 +783 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x0005776F726C64, 0x000568656C6C6F +785 extract 2 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x0005776F726C64, "hello" +788 byte " " 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x0005776F726C64, "hello", " " +791 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x0005776F726C64, "hello " +792 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello ", 0x0005776F726C64 +793 extract 2 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello ", "world" +796 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world" +797 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", "hello world" +798 len 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 11 +799 itob 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 0x000000000000000B +800 extract 6 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 0x000B +803 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x000B, "hello world" +804 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x000B68656C6C6F20776F726C64 +805 retsub 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 258, 0x000B68656C6C6F20776F726C64 +684 extract 2 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 258, "hello world" +687 byte "hello world" 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 258, "hello world", "hello world" +700 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 258, 1 +701 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 258 +702 int 258 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 258, 258 +705 == 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 1 +706 assert 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10 +707 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04BD8010, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x10, 1 +708 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/tuples.O1.log b/examples/arc4_types/out/tuples.O1.log new file mode 100644 index 0000000000..79b963ba5b --- /dev/null +++ b/examples/arc4_types/out/tuples.O1.log @@ -0,0 +1,99 @@ +PC Teal Stack +1 +6 int 7 7 +8 itob 0x0000000000000007 +9 extract 6 2 0x0007 +12 byte 0x0102 0x0007, 0x0102 +16 swap 0x0102, 0x0007 +17 concat 0x01020007 +18 int 14 0x01020007, 14 +20 itob 0x01020007, 0x000000000000000E +21 extract 6 2 0x01020007, 0x000E +24 concat 0x01020007000E +25 byte 0xff 0x01020007000E, 0xFF +28 concat 0x01020007000EFF +29 byte "\x00\x05hello" 0x01020007000EFF, 0x000568656C6C6F +38 concat 0x01020007000EFF000568656C6C6F +39 byte "\x00\x05world" 0x01020007000EFF000568656C6C6F, 0x0005776F726C64 +48 concat 0x01020007000EFF000568656C6C6F0005776F726C64 +49 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +50 byte 0x01020007000eff000568656c6c6f0005776f726c64 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +73 == 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +74 assert 0x01020007000EFF000568656C6C6F0005776F726C64 +75 byte 0x04 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04 +78 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 4 +79 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 4, 4 +80 == 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +81 assert 0x01020007000EFF000568656C6C6F0005776F726C64 +82 byte 0x10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x10 +85 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 16 +86 int 16 0x01020007000EFF000568656C6C6F0005776F726C64, 16, 16 +88 == 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +89 assert 0x01020007000EFF000568656C6C6F0005776F726C64 +90 callsub test_stuff 0x01020007000EFF000568656C6C6F0005776F726C64 +118 proto 1 2 0x01020007000EFF000568656C6C6F0005776F726C64 +121 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +123 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0 +125 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0, 1 +126 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01 +127 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64 +129 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +130 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64, 1, 1 +131 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02 +132 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64 +134 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64, 2 +135 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7 +136 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +138 dig 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 0x01020007000EFF000568656C6C6F0005776F726C64, 7 +140 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 5 +141 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 5, 2 +142 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 7 +143 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +145 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64, 7, 7 +147 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F +148 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64 +150 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64, 4 +151 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14 +152 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 0x01020007000EFF000568656C6C6F0005776F726C64 +154 dig 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 0x01020007000EFF000568656C6C6F0005776F726C64, 14 +156 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 5 +157 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 5, 2 +158 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 7 +159 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +161 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64, 14, 7 +163 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64 +164 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +166 int 6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 6 +168 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 6, 1 +169 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF +170 uncover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 0x01 +172 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 1 +173 uncover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 1, 0x02 +175 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 1, 2 +176 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 3 +177 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 3, 0xFF +178 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 3, 255 +179 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 258 +180 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, 0x000568656C6C6F +182 extract 2 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, "hello" +185 byte " " 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, "hello", " " +188 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, "hello " +189 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello ", 0x0005776F726C64 +191 extract 2 0 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello ", "world" +194 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world" +195 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", "hello world" +196 len 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 11 +197 itob 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 0x000000000000000B +198 extract 6 2 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 0x000B +201 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x000B, "hello world" +202 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x000B68656C6C6F20776F726C64 +203 retsub 258, 0x000B68656C6C6F20776F726C64 +93 extract 2 0 258, "hello world" +96 byte "hello world" 258, "hello world", "hello world" +109 == 258, 1 +110 assert 258 +111 int 258 258, 258 +114 == 1 +115 assert +116 int 1 1 +117 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/tuples.O2.log b/examples/arc4_types/out/tuples.O2.log new file mode 100644 index 0000000000..79b963ba5b --- /dev/null +++ b/examples/arc4_types/out/tuples.O2.log @@ -0,0 +1,99 @@ +PC Teal Stack +1 +6 int 7 7 +8 itob 0x0000000000000007 +9 extract 6 2 0x0007 +12 byte 0x0102 0x0007, 0x0102 +16 swap 0x0102, 0x0007 +17 concat 0x01020007 +18 int 14 0x01020007, 14 +20 itob 0x01020007, 0x000000000000000E +21 extract 6 2 0x01020007, 0x000E +24 concat 0x01020007000E +25 byte 0xff 0x01020007000E, 0xFF +28 concat 0x01020007000EFF +29 byte "\x00\x05hello" 0x01020007000EFF, 0x000568656C6C6F +38 concat 0x01020007000EFF000568656C6C6F +39 byte "\x00\x05world" 0x01020007000EFF000568656C6C6F, 0x0005776F726C64 +48 concat 0x01020007000EFF000568656C6C6F0005776F726C64 +49 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +50 byte 0x01020007000eff000568656c6c6f0005776f726c64 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +73 == 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +74 assert 0x01020007000EFF000568656C6C6F0005776F726C64 +75 byte 0x04 0x01020007000EFF000568656C6C6F0005776F726C64, 0x04 +78 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 4 +79 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 4, 4 +80 == 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +81 assert 0x01020007000EFF000568656C6C6F0005776F726C64 +82 byte 0x10 0x01020007000EFF000568656C6C6F0005776F726C64, 0x10 +85 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 16 +86 int 16 0x01020007000EFF000568656C6C6F0005776F726C64, 16, 16 +88 == 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +89 assert 0x01020007000EFF000568656C6C6F0005776F726C64 +90 callsub test_stuff 0x01020007000EFF000568656C6C6F0005776F726C64 +118 proto 1 2 0x01020007000EFF000568656C6C6F0005776F726C64 +121 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +123 int 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0 +125 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 0, 1 +126 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01 +127 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64 +129 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64, 1 +130 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x01020007000EFF000568656C6C6F0005776F726C64, 1, 1 +131 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02 +132 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64 +134 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64, 2 +135 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7 +136 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +138 dig 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 0x01020007000EFF000568656C6C6F0005776F726C64, 7 +140 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 5 +141 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 5, 2 +142 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 7 +143 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 7, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +145 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x01020007000EFF000568656C6C6F0005776F726C64, 7, 7 +147 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F +148 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64 +150 int 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64, 4 +151 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14 +152 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 0x01020007000EFF000568656C6C6F0005776F726C64 +154 dig 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 0x01020007000EFF000568656C6C6F0005776F726C64, 14 +156 extract_uint16 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 5 +157 int 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 5, 2 +158 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 7 +159 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 14, 7, 0x01020007000EFF000568656C6C6F0005776F726C64 +161 cover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x01020007000EFF000568656C6C6F0005776F726C64, 14, 7 +163 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64 +164 frame_dig -1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64 +166 int 6 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 6 +168 int 1 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0x01020007000EFF000568656C6C6F0005776F726C64, 6, 1 +169 extract3 0x01020007000EFF000568656C6C6F0005776F726C64, 0x01, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF +170 uncover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 0x01 +172 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x02, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 1 +173 uncover 4 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 1, 0x02 +175 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 1, 2 +176 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 0xFF, 3 +177 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 3, 0xFF +178 btoi 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 3, 255 +179 + 0x01020007000EFF000568656C6C6F0005776F726C64, 0x000568656C6C6F, 0x0005776F726C64, 258 +180 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, 0x000568656C6C6F +182 extract 2 0 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, "hello" +185 byte " " 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, "hello", " " +188 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 0x0005776F726C64, 258, "hello " +189 uncover 2 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello ", 0x0005776F726C64 +191 extract 2 0 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello ", "world" +194 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world" +195 dup 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", "hello world" +196 len 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 11 +197 itob 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 0x000000000000000B +198 extract 6 2 0x01020007000EFF000568656C6C6F0005776F726C64, 258, "hello world", 0x000B +201 swap 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x000B, "hello world" +202 concat 0x01020007000EFF000568656C6C6F0005776F726C64, 258, 0x000B68656C6C6F20776F726C64 +203 retsub 258, 0x000B68656C6C6F20776F726C64 +93 extract 2 0 258, "hello world" +96 byte "hello world" 258, "hello world", "hello world" +109 == 258, 1 +110 assert 258 +111 int 258 258, 258 +114 == 1 +115 assert +116 int 1 1 +117 return 1 \ No newline at end of file diff --git a/examples/arc4_types/out/tuples.approval.debug.teal b/examples/arc4_types/out/tuples.approval.debug.teal new file mode 100644 index 0000000000..7b1fb58432 --- /dev/null +++ b/examples/arc4_types/out/tuples.approval.debug.teal @@ -0,0 +1,110 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: +main_block@0: + int 7 // 7 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + itob // {itob} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + extract 6 2 // {extract} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte 0x0102 // value_as_uint16%3#0,0x0102 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + swap // load value_as_uint16%3#0 from l-stack (no copy) 0x0102,value_as_uint16%3#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + int 14 // encoded_tuple_buffer%1#3,14 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + itob // encoded_tuple_buffer%1#3,{itob} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + extract 6 2 // encoded_tuple_buffer%1#3,{extract} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte 0xff // encoded_tuple_buffer%1#3,0xff 255 File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte "\x00\x05hello" // encoded_tuple_buffer%1#3,"\x00\x05hello" String("hello") File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte "\x00\x05world" // encoded_tuple_buffer%1#3,"\x00\x05world" String("world") File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + dup // load my_tuple#0 from l-stack (copy) my_tuple#0,my_tuple#0 my_tuple File "arc4_types/tuples.py", line 15 + byte 0x01020007000eff000568656c6c6f0005776f726c64 // my_tuple#0,my_tuple#0,0x01020007000eff000568656c6c6f0005776f726c64 Bytes.from_hex("01020007000EFF000568656C6C6F0005776F726C64") File "arc4_types/tuples.py", line 18 + == // my_tuple#0,{==} my_tuple == TestTuple.from_bytes( # type: ignore[comparison-overlap] File "arc4_types/tuples.py", line 17 + assert // my_tuple#0 assert my_tuple == TestTuple.from_bytes( # type: ignore[comparison-overlap] File "arc4_types/tuples.py", line 17 + byte 0x04 // my_tuple#0,0x04 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + btoi // my_tuple#0,{btoi} a.decode() File "arc4_types/tuples.py", line 38 + int 4 // my_tuple#0,tmp%50#0,4 4 File "arc4_types/tuples.py", line 38 + == // my_tuple#0,{==} a.decode() == 4, "a is 4" File "arc4_types/tuples.py", line 38 + assert // a is 4 // my_tuple#0 assert a.decode() == 4, "a is 4" File "arc4_types/tuples.py", line 38 + byte 0x10 // my_tuple#0,0x10 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + btoi // my_tuple#0,{btoi} k.decode() File "arc4_types/tuples.py", line 41 + int 16 // my_tuple#0,tmp%68#0,16 16 File "arc4_types/tuples.py", line 41 + == // my_tuple#0,{==} k.decode() == 16, "k is 16" File "arc4_types/tuples.py", line 41 + assert // k is 16 // my_tuple#0 assert k.decode() == 16, "k is 16" File "arc4_types/tuples.py", line 41 + callsub test_stuff // {test_stuff}.0,{test_stuff}.1 self.test_stuff(my_tuple) File "arc4_types/tuples.py", line 45 + extract 2 0 // total#0,{extract} concat.decode() File "arc4_types/tuples.py", line 46 + byte "hello world" // total#0,tmp%102#0,"hello world" b"hello world" File "arc4_types/tuples.py", line 46 + == // total#0,{==} concat.decode() == b"hello world" File "arc4_types/tuples.py", line 46 + assert // total#0 assert concat.decode() == b"hello world" File "arc4_types/tuples.py", line 46 + int 258 // total#0,258 258 File "arc4_types/tuples.py", line 47 + == // {==} total == 258 File "arc4_types/tuples.py", line 47 + assert // assert total == 258 File "arc4_types/tuples.py", line 47 + int 1 // 1 True File "arc4_types/tuples.py", line 49 + return // return True File "arc4_types/tuples.py", line 49 + + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple#0: bytes) -> uint64, bytes: +test_stuff: + proto 1 2 // (𝕡) test_tuple#0 | def test_stuff(self, test_tuple: TestTuple) -> tuple[UInt64, String]: File "arc4_types/tuples.py", line 55 + +test_stuff_block@0: + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 0 // (𝕡) test_tuple#0 | test_tuple#0,0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 1 // (𝕡) test_tuple#0 | test_tuple#0,0,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | {extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 1 // (𝕡) test_tuple#0 | a#0,test_tuple#0,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 1 // (𝕡) test_tuple#0 | a#0,test_tuple#0,1,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | a#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,b#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 2 // (𝕡) test_tuple#0 | a#0,b#0,test_tuple#0,2 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | a#0,b#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,b#0,item_index%2#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + dig 1 // load item_index%2#0 from l-stack (copy) (𝕡) test_tuple#0 | a#0,b#0,item_index%2#0,test_tuple#0,item_index%2#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | a#0,b#0,item_index%2#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 2 // (𝕡) test_tuple#0 | a#0,b#0,item_index%2#0,item_length%3#0,2 test_tuple.decode() File "arc4_types/tuples.py", line 56 + + // (𝕡) test_tuple#0 | a#0,b#0,item_index%2#0,{+} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,b#0,item_index%2#0,item_length_plus_2%4#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + cover 2 // virtual: 2 ops (𝕡) test_tuple#0 | a#0,b#0,test_tuple#0,item_index%2#0,item_length_plus_2%4#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | a#0,b#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,b#0,c#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 4 // (𝕡) test_tuple#0 | a#0,b#0,c#0,test_tuple#0,4 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | a#0,b#0,c#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,b#0,c#0,item_index%6#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + dig 1 // load item_index%6#0 from l-stack (copy) (𝕡) test_tuple#0 | a#0,b#0,c#0,item_index%6#0,test_tuple#0,item_index%6#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | a#0,b#0,c#0,item_index%6#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 2 // (𝕡) test_tuple#0 | a#0,b#0,c#0,item_index%6#0,item_length%7#0,2 test_tuple.decode() File "arc4_types/tuples.py", line 56 + + // (𝕡) test_tuple#0 | a#0,b#0,c#0,item_index%6#0,{+} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,b#0,c#0,item_index%6#0,item_length_plus_2%8#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + cover 2 // virtual: 2 ops (𝕡) test_tuple#0 | a#0,b#0,c#0,test_tuple#0,item_index%6#0,item_length_plus_2%8#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | a#0,b#0,c#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | a#0,b#0,c#0,d#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 6 // (𝕡) test_tuple#0 | a#0,b#0,c#0,d#0,test_tuple#0,6 test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 1 // (𝕡) test_tuple#0 | a#0,b#0,c#0,d#0,test_tuple#0,6,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | a#0,b#0,c#0,d#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + uncover 4 // load a#0 from l-stack (no copy) (𝕡) test_tuple#0 | b#0,c#0,d#0,e#0,a#0 a File "arc4_types/tuples.py", line 56 + btoi // (𝕡) test_tuple#0 | b#0,c#0,d#0,e#0,{btoi} a.decode() File "arc4_types/tuples.py", line 58 + uncover 4 // load b#0 from l-stack (no copy) (𝕡) test_tuple#0 | c#0,d#0,e#0,tmp%11#0,b#0 b File "arc4_types/tuples.py", line 56 + btoi // (𝕡) test_tuple#0 | c#0,d#0,e#0,tmp%11#0,{btoi} b.decode() File "arc4_types/tuples.py", line 58 + + // (𝕡) test_tuple#0 | c#0,d#0,e#0,{+} a.decode() + b.decode() File "arc4_types/tuples.py", line 58 + swap // load e#0 from l-stack (no copy) (𝕡) test_tuple#0 | c#0,d#0,tmp%13#0,e#0 e File "arc4_types/tuples.py", line 56 + btoi // (𝕡) test_tuple#0 | c#0,d#0,tmp%13#0,{btoi} e.decode() File "arc4_types/tuples.py", line 58 + + // (𝕡) test_tuple#0 | c#0,d#0,{+} a.decode() + b.decode() + e.decode() File "arc4_types/tuples.py", line 58 + uncover 2 // load c#0 from l-stack (no copy) (𝕡) test_tuple#0 | d#0,total#0,c#0 c File "arc4_types/tuples.py", line 56 + extract 2 0 // (𝕡) test_tuple#0 | d#0,total#0,{extract} c.decode() File "arc4_types/tuples.py", line 59 + byte " " // (𝕡) test_tuple#0 | d#0,total#0,tmp%15#0," " b" " File "arc4_types/tuples.py", line 59 + concat // (𝕡) test_tuple#0 | d#0,total#0,{concat} c.decode() + b" " File "arc4_types/tuples.py", line 59 + uncover 2 // load d#0 from l-stack (no copy) (𝕡) test_tuple#0 | total#0,tmp%16#0,d#0 d File "arc4_types/tuples.py", line 56 + extract 2 0 // (𝕡) test_tuple#0 | total#0,tmp%16#0,{extract} d.decode() File "arc4_types/tuples.py", line 59 + concat // (𝕡) test_tuple#0 | total#0,{concat} c.decode() + b" " + d.decode() File "arc4_types/tuples.py", line 59 + dup // load text#0 from l-stack (copy) (𝕡) test_tuple#0 | total#0,text#0,text#0 text File "arc4_types/tuples.py", line 59 + len // (𝕡) test_tuple#0 | total#0,text#0,{len} String.encode(text) File "arc4_types/tuples.py", line 61 + itob // (𝕡) test_tuple#0 | total#0,text#0,{itob} String.encode(text) File "arc4_types/tuples.py", line 61 + extract 6 2 // (𝕡) test_tuple#0 | total#0,text#0,{extract} String.encode(text) File "arc4_types/tuples.py", line 61 + swap // load text#0 from l-stack (no copy) (𝕡) test_tuple#0 | total#0,value_as_uint16%20#0,text#0 text File "arc4_types/tuples.py", line 59 + concat // (𝕡) test_tuple#0 | total#0,{concat} String.encode(text) File "arc4_types/tuples.py", line 61 + retsub // total#0,tmp%21#0 return total, String.encode(text) File "arc4_types/tuples.py", line 61 + diff --git a/examples/arc4_types/out/tuples.approval.teal b/examples/arc4_types/out/tuples.approval.teal new file mode 100644 index 0000000000..db0f0e1568 --- /dev/null +++ b/examples/arc4_types/out/tuples.approval.teal @@ -0,0 +1,108 @@ +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: +main_block@0: + int 7 + itob + extract 6 2 + byte 0x0102 + swap + concat + int 14 + itob + extract 6 2 + concat + byte 0xff + concat + byte "\x00\x05hello" + concat + byte "\x00\x05world" + concat + dup + byte 0x01020007000eff000568656c6c6f0005776f726c64 + == + assert + byte 0x04 + btoi + int 4 + == + assert // a is 4 + byte 0x10 + btoi + int 16 + == + assert // k is 16 + callsub test_stuff + extract 2 0 + byte "hello world" + == + assert + int 258 + == + assert + int 1 + return + + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple#0: bytes) -> uint64, bytes: +test_stuff: + proto 1 2 + +test_stuff_block@0: + frame_dig -1 + int 0 + int 1 + extract3 + frame_dig -1 + int 1 + int 1 + extract3 + frame_dig -1 + int 2 + extract_uint16 + frame_dig -1 + dig 1 + extract_uint16 + int 2 + + + frame_dig -1 + cover 2 + extract3 + frame_dig -1 + int 4 + extract_uint16 + frame_dig -1 + dig 1 + extract_uint16 + int 2 + + + frame_dig -1 + cover 2 + extract3 + frame_dig -1 + int 6 + int 1 + extract3 + uncover 4 + btoi + uncover 4 + btoi + + + swap + btoi + + + uncover 2 + extract 2 0 + byte " " + concat + uncover 2 + extract 2 0 + concat + dup + len + itob + extract 6 2 + swap + concat + retsub + diff --git a/examples/arc4_types/out/tuples.approval_unoptimized.debug.teal b/examples/arc4_types/out/tuples.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..764dcbe815 --- /dev/null +++ b/examples/arc4_types/out/tuples.approval_unoptimized.debug.teal @@ -0,0 +1,592 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: +main_block@0: + int 7 // 7 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte 0x // current_tail_offset%0#0,0x Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte 0x01 // current_tail_offset%0#0,encoded_tuple_buffer%1#0,0x01 1 File "arc4_types/tuples.py", line 15 + concat // current_tail_offset%0#0,{concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte 0x02 // current_tail_offset%0#0,encoded_tuple_buffer%1#0,0x02 2 File "arc4_types/tuples.py", line 15 + concat // current_tail_offset%0#0,{concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + dig 1 // load current_tail_offset%0#0 from l-stack (copy) current_tail_offset%0#0,encoded_tuple_buffer%1#0,current_tail_offset%0#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + itob // current_tail_offset%0#0,encoded_tuple_buffer%1#0,{itob} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + extract 6 2 // current_tail_offset%0#0,encoded_tuple_buffer%1#0,{extract} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + concat // current_tail_offset%0#0,{concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + swap // store encoded_tuple_buffer%1#0 to l-stack (no copy) encoded_tuple_buffer%1#0,current_tail_offset%0#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte "\x00\x05hello" // encoded_tuple_buffer%1#0,current_tail_offset%0#0,"\x00\x05hello" String("hello") File "arc4_types/tuples.py", line 15 + len // encoded_tuple_buffer%1#0,current_tail_offset%0#0,{len} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + + // encoded_tuple_buffer%1#0,{+} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + dup // load current_tail_offset%0#0 from l-stack (copy) encoded_tuple_buffer%1#0,current_tail_offset%0#0,current_tail_offset%0#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + itob // encoded_tuple_buffer%1#0,current_tail_offset%0#0,{itob} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + extract 6 2 // encoded_tuple_buffer%1#0,current_tail_offset%0#0,{extract} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + uncover 2 // load encoded_tuple_buffer%1#0 from l-stack (no copy) current_tail_offset%0#0,value_as_uint16%6#0,encoded_tuple_buffer%1#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + swap // load value_as_uint16%6#0 from l-stack (no copy) current_tail_offset%0#0,encoded_tuple_buffer%1#0,value_as_uint16%6#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + concat // current_tail_offset%0#0,{concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte "\x00\x05world" // current_tail_offset%0#0,encoded_tuple_buffer%1#0,"\x00\x05world" String("world") File "arc4_types/tuples.py", line 15 + len // current_tail_offset%0#0,encoded_tuple_buffer%1#0,{len} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + uncover 2 // load current_tail_offset%0#0 from l-stack (no copy) encoded_tuple_buffer%1#0,data_length%7#0,current_tail_offset%0#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + + // encoded_tuple_buffer%1#0,{+} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + pop // encoded_tuple_buffer%1#0 Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte 0xff // encoded_tuple_buffer%1#0,0xff 255 File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte "\x00\x05hello" // encoded_tuple_buffer%1#0,"\x00\x05hello" String("hello") File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + byte "\x00\x05world" // encoded_tuple_buffer%1#0,"\x00\x05world" String("world") File "arc4_types/tuples.py", line 15 + concat // {concat} Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) File "arc4_types/tuples.py", line 15 + dup // store my_tuple#0 to l-stack (copy) my_tuple#0,my_tuple#0 my_tuple File "arc4_types/tuples.py", line 15 + swap // store my_tuple#0 to f-stack (𝕗) my_tuple#0 | my_tuple#0 my_tuple File "arc4_types/tuples.py", line 15 + byte 0x01020007000eff000568656c6c6f0005776f726c64 // (𝕗) my_tuple#0 | my_tuple#0,0x01020007000eff000568656c6c6f0005776f726c64 Bytes.from_hex("01020007000EFF000568656C6C6F0005776F726C64") File "arc4_types/tuples.py", line 18 + == // (𝕗) my_tuple#0 | {==} my_tuple == TestTuple.from_bytes( # type: ignore[comparison-overlap] File "arc4_types/tuples.py", line 17 + assert // (𝕗) my_tuple#0 | assert my_tuple == TestTuple.from_bytes( # type: ignore[comparison-overlap] File "arc4_types/tuples.py", line 17 + byte 0x00 // (𝕗) my_tuple#0 | 0x00 Bool(True) File "arc4_types/tuples.py", line 23 + int 0 // (𝕗) my_tuple#0 | 0x00,0 + int 1 // (𝕗) my_tuple#0 | 0x00,0,1 True File "arc4_types/tuples.py", line 23 + setbit // (𝕗) my_tuple#0 | {setbit} Bool(True) File "arc4_types/tuples.py", line 23 + byte 0x00 // (𝕗) my_tuple#0 | tmp%9#0,0x00 Bool(False) File "arc4_types/tuples.py", line 24 + int 0 // (𝕗) my_tuple#0 | tmp%9#0,0x00,0 + int 0 // (𝕗) my_tuple#0 | tmp%9#0,0x00,0,0 False File "arc4_types/tuples.py", line 24 + setbit // (𝕗) my_tuple#0 | tmp%9#0,{setbit} Bool(False) File "arc4_types/tuples.py", line 24 + byte 0x00 // (𝕗) my_tuple#0 | tmp%9#0,tmp%10#0,0x00 Bool(True) File "arc4_types/tuples.py", line 25 + int 0 // (𝕗) my_tuple#0 | tmp%9#0,tmp%10#0,0x00,0 + int 1 // (𝕗) my_tuple#0 | tmp%9#0,tmp%10#0,0x00,0,1 True File "arc4_types/tuples.py", line 25 + setbit // (𝕗) my_tuple#0 | tmp%9#0,tmp%10#0,{setbit} Bool(True) File "arc4_types/tuples.py", line 25 + cover 2 // store tmp%11#0 to l-stack (no copy) (𝕗) my_tuple#0 | tmp%11#0,tmp%9#0,tmp%10#0 Bool(True) File "arc4_types/tuples.py", line 25 + byte 0x00 // (𝕗) my_tuple#0 | tmp%11#0,tmp%9#0,tmp%10#0,0x00 Bool(True) File "arc4_types/tuples.py", line 26 + int 0 // (𝕗) my_tuple#0 | tmp%11#0,tmp%9#0,tmp%10#0,0x00,0 + int 1 // (𝕗) my_tuple#0 | tmp%11#0,tmp%9#0,tmp%10#0,0x00,0,1 True File "arc4_types/tuples.py", line 26 + setbit // (𝕗) my_tuple#0 | tmp%11#0,tmp%9#0,tmp%10#0,{setbit} Bool(True) File "arc4_types/tuples.py", line 26 + cover 3 // store tmp%12#0 to l-stack (no copy) (𝕗) my_tuple#0 | tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0 Bool(True) File "arc4_types/tuples.py", line 26 + byte 0x00 // (𝕗) my_tuple#0 | tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00 Bool(True) File "arc4_types/tuples.py", line 27 + int 0 // (𝕗) my_tuple#0 | tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0 + int 1 // (𝕗) my_tuple#0 | tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0,1 True File "arc4_types/tuples.py", line 27 + setbit // (𝕗) my_tuple#0 | tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,{setbit} Bool(True) File "arc4_types/tuples.py", line 27 + cover 4 // store tmp%13#0 to l-stack (no copy) (𝕗) my_tuple#0 | tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0 Bool(True) File "arc4_types/tuples.py", line 27 + byte 0x00 // (𝕗) my_tuple#0 | tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00 Bool(True) File "arc4_types/tuples.py", line 28 + int 0 // (𝕗) my_tuple#0 | tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0 + int 1 // (𝕗) my_tuple#0 | tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0,1 True File "arc4_types/tuples.py", line 28 + setbit // (𝕗) my_tuple#0 | tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,{setbit} Bool(True) File "arc4_types/tuples.py", line 28 + cover 5 // store tmp%14#0 to l-stack (no copy) (𝕗) my_tuple#0 | tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0 Bool(True) File "arc4_types/tuples.py", line 28 + byte 0x00 // (𝕗) my_tuple#0 | tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00 Bool(False) File "arc4_types/tuples.py", line 29 + int 0 // (𝕗) my_tuple#0 | tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0 + int 0 // (𝕗) my_tuple#0 | tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0,0 False File "arc4_types/tuples.py", line 29 + setbit // (𝕗) my_tuple#0 | tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,{setbit} Bool(False) File "arc4_types/tuples.py", line 29 + cover 6 // store tmp%15#0 to l-stack (no copy) (𝕗) my_tuple#0 | tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0 Bool(False) File "arc4_types/tuples.py", line 29 + byte 0x00 // (𝕗) my_tuple#0 | tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00 Bool(True) File "arc4_types/tuples.py", line 30 + int 0 // (𝕗) my_tuple#0 | tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0 + int 1 // (𝕗) my_tuple#0 | tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0,1 True File "arc4_types/tuples.py", line 30 + setbit // (𝕗) my_tuple#0 | tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,{setbit} Bool(True) File "arc4_types/tuples.py", line 30 + cover 7 // store tmp%16#0 to l-stack (no copy) (𝕗) my_tuple#0 | tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0 Bool(True) File "arc4_types/tuples.py", line 30 + byte 0x00 // (𝕗) my_tuple#0 | tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00 Bool(True) File "arc4_types/tuples.py", line 31 + int 0 // (𝕗) my_tuple#0 | tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0 + int 1 // (𝕗) my_tuple#0 | tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x00,0,1 True File "arc4_types/tuples.py", line 31 + setbit // (𝕗) my_tuple#0 | tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,{setbit} Bool(True) File "arc4_types/tuples.py", line 31 + cover 8 // store tmp%17#0 to l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0 Bool(True) File "arc4_types/tuples.py", line 31 + int 4 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,4 Tuple( File "arc4_types/tuples.py", line 20 + pop // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0 Tuple( File "arc4_types/tuples.py", line 20 + byte 0x // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,0x Tuple( File "arc4_types/tuples.py", line 20 + byte 0x04 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,encoded_tuple_buffer%19#0,0x04 4 File "arc4_types/tuples.py", line 22 + concat // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%9#0,tmp%10#0,{concat} Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load tmp%9#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%10#0,encoded_tuple_buffer%19#0,tmp%9#0 Bool(True) File "arc4_types/tuples.py", line 23 + concat // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,tmp%10#0,{concat} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%10#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,encoded_tuple_buffer%19#0,tmp%10#0 Bool(False) File "arc4_types/tuples.py", line 24 + int 0 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,encoded_tuple_buffer%19#0,tmp%10#0,0 + getbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,encoded_tuple_buffer%19#0,{getbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load encoded_tuple_buffer%19#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,is_true%20#0,encoded_tuple_buffer%19#0 Tuple( File "arc4_types/tuples.py", line 20 + int 9 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,is_true%20#0,encoded_tuple_buffer%19#0,9 Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load is_true%20#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,encoded_tuple_buffer%19#0,9,is_true%20#0 Tuple( File "arc4_types/tuples.py", line 20 + setbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,tmp%11#0,{setbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%11#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,encoded_tuple_buffer%19#0,tmp%11#0 Bool(True) File "arc4_types/tuples.py", line 25 + int 0 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,encoded_tuple_buffer%19#0,tmp%11#0,0 + getbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,encoded_tuple_buffer%19#0,{getbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load encoded_tuple_buffer%19#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,is_true%21#0,encoded_tuple_buffer%19#0 Tuple( File "arc4_types/tuples.py", line 20 + int 10 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,is_true%21#0,encoded_tuple_buffer%19#0,10 Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load is_true%21#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,encoded_tuple_buffer%19#0,10,is_true%21#0 Tuple( File "arc4_types/tuples.py", line 20 + setbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,tmp%12#0,{setbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%12#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,encoded_tuple_buffer%19#0,tmp%12#0 Bool(True) File "arc4_types/tuples.py", line 26 + int 0 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,encoded_tuple_buffer%19#0,tmp%12#0,0 + getbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,encoded_tuple_buffer%19#0,{getbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load encoded_tuple_buffer%19#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,is_true%22#0,encoded_tuple_buffer%19#0 Tuple( File "arc4_types/tuples.py", line 20 + int 11 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,is_true%22#0,encoded_tuple_buffer%19#0,11 Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load is_true%22#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,encoded_tuple_buffer%19#0,11,is_true%22#0 Tuple( File "arc4_types/tuples.py", line 20 + setbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,tmp%13#0,{setbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%13#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,encoded_tuple_buffer%19#0,tmp%13#0 Bool(True) File "arc4_types/tuples.py", line 27 + int 0 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,encoded_tuple_buffer%19#0,tmp%13#0,0 + getbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,encoded_tuple_buffer%19#0,{getbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load encoded_tuple_buffer%19#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,is_true%23#0,encoded_tuple_buffer%19#0 Tuple( File "arc4_types/tuples.py", line 20 + int 12 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,is_true%23#0,encoded_tuple_buffer%19#0,12 Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load is_true%23#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,encoded_tuple_buffer%19#0,12,is_true%23#0 Tuple( File "arc4_types/tuples.py", line 20 + setbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,tmp%14#0,{setbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%14#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,encoded_tuple_buffer%19#0,tmp%14#0 Bool(True) File "arc4_types/tuples.py", line 28 + int 0 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,encoded_tuple_buffer%19#0,tmp%14#0,0 + getbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,encoded_tuple_buffer%19#0,{getbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load encoded_tuple_buffer%19#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,is_true%24#0,encoded_tuple_buffer%19#0 Tuple( File "arc4_types/tuples.py", line 20 + int 13 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,is_true%24#0,encoded_tuple_buffer%19#0,13 Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load is_true%24#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,encoded_tuple_buffer%19#0,13,is_true%24#0 Tuple( File "arc4_types/tuples.py", line 20 + setbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,tmp%15#0,{setbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%15#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,encoded_tuple_buffer%19#0,tmp%15#0 Bool(False) File "arc4_types/tuples.py", line 29 + int 0 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,encoded_tuple_buffer%19#0,tmp%15#0,0 + getbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,encoded_tuple_buffer%19#0,{getbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load encoded_tuple_buffer%19#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,is_true%25#0,encoded_tuple_buffer%19#0 Tuple( File "arc4_types/tuples.py", line 20 + int 14 // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,is_true%25#0,encoded_tuple_buffer%19#0,14 Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load is_true%25#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,encoded_tuple_buffer%19#0,14,is_true%25#0 Tuple( File "arc4_types/tuples.py", line 20 + setbit // (𝕗) my_tuple#0 | tmp%17#0,tmp%16#0,{setbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%16#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,encoded_tuple_buffer%19#0,tmp%16#0 Bool(True) File "arc4_types/tuples.py", line 30 + int 0 // (𝕗) my_tuple#0 | tmp%17#0,encoded_tuple_buffer%19#0,tmp%16#0,0 + getbit // (𝕗) my_tuple#0 | tmp%17#0,encoded_tuple_buffer%19#0,{getbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load encoded_tuple_buffer%19#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,is_true%26#0,encoded_tuple_buffer%19#0 Tuple( File "arc4_types/tuples.py", line 20 + int 15 // (𝕗) my_tuple#0 | tmp%17#0,is_true%26#0,encoded_tuple_buffer%19#0,15 Tuple( File "arc4_types/tuples.py", line 20 + uncover 2 // load is_true%26#0 from l-stack (no copy) (𝕗) my_tuple#0 | tmp%17#0,encoded_tuple_buffer%19#0,15,is_true%26#0 Tuple( File "arc4_types/tuples.py", line 20 + setbit // (𝕗) my_tuple#0 | tmp%17#0,{setbit} Tuple( File "arc4_types/tuples.py", line 20 + swap // load tmp%17#0 from l-stack (no copy) (𝕗) my_tuple#0 | encoded_tuple_buffer%19#0,tmp%17#0 Bool(True) File "arc4_types/tuples.py", line 31 + concat // (𝕗) my_tuple#0 | {concat} Tuple( File "arc4_types/tuples.py", line 20 + byte 0x10 // (𝕗) my_tuple#0 | encoded_tuple_buffer%19#0,0x10 16 File "arc4_types/tuples.py", line 32 + concat // (𝕗) my_tuple#0 | {concat} Tuple( File "arc4_types/tuples.py", line 20 + dup // store boolean_packing#0 to l-stack (copy) (𝕗) my_tuple#0 | boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + swap // store boolean_packing#0 to f-stack (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + byte 0x04bd8010 // (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0,boolean_packing#0,0x04bd8010 Bytes.from_hex("04BD8010") File "arc4_types/tuples.py", line 35 + == // (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0,{==} boolean_packing.bytes == Bytes.from_hex("04BD8010") File "arc4_types/tuples.py", line 35 + assert // (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0 assert boolean_packing.bytes == Bytes.from_hex("04BD8010") File "arc4_types/tuples.py", line 35 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0,boolean_packing#0,0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 1 // (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0,boolean_packing#0,0,1 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + extract3 // (𝕗) my_tuple#0,boolean_packing#0 | boolean_packing#0,{extract3} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item0%28#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 8 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0,boolean_packing#0,8 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0,is_true%29#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0,is_true%29#0,0x00,0 + uncover 2 // load is_true%29#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0,0x00,0,is_true%29#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item1%30#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 9 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0,boolean_packing#0,9 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0,is_true%31#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0,is_true%31#0,0x00,0 + uncover 2 // load is_true%31#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0,0x00,0,is_true%31#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item2%32#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 10 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0,boolean_packing#0,10 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0,is_true%33#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0,is_true%33#0,0x00,0 + uncover 2 // load is_true%33#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0,0x00,0,is_true%33#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item3%34#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 11 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0,boolean_packing#0,11 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0,is_true%35#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0,is_true%35#0,0x00,0 + uncover 2 // load is_true%35#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0,0x00,0,is_true%35#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item4%36#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 12 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0,boolean_packing#0,12 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0,is_true%37#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0,is_true%37#0,0x00,0 + uncover 2 // load is_true%37#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0,0x00,0,is_true%37#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item5%38#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 13 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0,boolean_packing#0,13 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0,is_true%39#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0,is_true%39#0,0x00,0 + uncover 2 // load is_true%39#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0,0x00,0,is_true%39#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item6%40#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 14 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0,boolean_packing#0,14 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0,is_true%41#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0,is_true%41#0,0x00,0 + uncover 2 // load is_true%41#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0,0x00,0,is_true%41#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item7%42#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 15 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0,boolean_packing#0,15 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0,is_true%43#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0,is_true%43#0,0x00,0 + uncover 2 // load is_true%43#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0,0x00,0,is_true%43#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item8%44#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 16 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0,boolean_packing#0,16 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + getbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0,is_true%45#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 0 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0,is_true%45#0,0x00,0 + uncover 2 // load is_true%45#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0,0x00,0,is_true%45#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + setbit // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + swap // store item9%46#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,item9%46#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,item9%46#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 3 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,item9%46#0,boolean_packing#0,boolean_packing#0,3 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + int 1 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,item9%46#0,boolean_packing#0,boolean_packing#0,3,1 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + extract3 // (𝕗) my_tuple#0,boolean_packing#0 | item0%28#0,item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,item9%46#0,boolean_packing#0,{extract3} boolean_packing.decode() File "arc4_types/tuples.py", line 36 + uncover 11 // load item0%28#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,item8%44#0,item9%46#0,boolean_packing#0,item10%47#0,item0%28#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + cover 4 // store a#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item1%30#0,item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,a#0,item8%44#0,item9%46#0,boolean_packing#0,item10%47#0 a File "arc4_types/tuples.py", line 36 + uncover 11 // load item1%30#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0 | item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,item7%42#0,a#0,item8%44#0,item9%46#0,boolean_packing#0,item10%47#0,item1%30#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + dup + cover 7 // store b#0 to l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0 | item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,b#0,item7%42#0,a#0,item8%44#0,item9%46#0,boolean_packing#0,item10%47#0,b#0 b File "arc4_types/tuples.py", line 36 + cover 12 // store b#0 to f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0 | item2%32#0,item3%34#0,item4%36#0,item5%38#0,item6%40#0,b#0,item7%42#0,a#0,item8%44#0,item9%46#0,boolean_packing#0,item10%47#0 b File "arc4_types/tuples.py", line 36 + uncover 5 // load item7%42#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0 | b#0,a#0,item8%44#0,item9%46#0,boolean_packing#0,item10%47#0,item7%42#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + cover 6 // store h#0 to f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0 | b#0,a#0,item8%44#0,item9%46#0,boolean_packing#0,item10%47#0 h File "arc4_types/tuples.py", line 36 + uncover 3 // load item8%44#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0 | b#0,a#0,item9%46#0,boolean_packing#0,item10%47#0,item8%44#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + cover 5 // store i#0 to f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0 | b#0,a#0,item9%46#0,boolean_packing#0,item10%47#0 i File "arc4_types/tuples.py", line 36 + uncover 2 // load item9%46#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0 | b#0,a#0,boolean_packing#0,item10%47#0,item9%46#0 boolean_packing.decode() File "arc4_types/tuples.py", line 36 + cover 4 // store j#0 to f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0 | b#0,a#0,boolean_packing#0,item10%47#0 j File "arc4_types/tuples.py", line 36 + dup // store k#0 to l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0 | b#0,a#0,boolean_packing#0,k#0,k#0 k File "arc4_types/tuples.py", line 36 + cover 4 // store k#0 to f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,a#0,boolean_packing#0,k#0 k File "arc4_types/tuples.py", line 36 + swap // load boolean_packing#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,a#0,k#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 3 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,a#0,k#0,boolean_packing#0,3 boolean_packing[10] File "arc4_types/tuples.py", line 37 + int 1 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,a#0,k#0,boolean_packing#0,3,1 boolean_packing[10] File "arc4_types/tuples.py", line 37 + extract3 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,a#0,k#0,{extract3} boolean_packing[10] File "arc4_types/tuples.py", line 37 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,a#0,{==} boolean_packing[10] == k File "arc4_types/tuples.py", line 37 + assert // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,a#0 assert boolean_packing[10] == k File "arc4_types/tuples.py", line 37 + btoi // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,{btoi} a.decode() File "arc4_types/tuples.py", line 38 + int 4 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,tmp%50#0,4 4 File "arc4_types/tuples.py", line 38 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,{==} a.decode() == 4, "a is 4" File "arc4_types/tuples.py", line 38 + assert // a is 4 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0 assert a.decode() == 4, "a is 4" File "arc4_types/tuples.py", line 38 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0,0x00 b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + bz main_ternary_false@2 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + // Implicit fall through to main_ternary_true@1 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + +main_ternary_true@1: + dig 9 // load b#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b#0 b File "arc4_types/tuples.py", line 36 + b main_ternary_merge@18 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%53#0 | ternary_result%53#0 + +main_ternary_false@2: + dig 7 // load d#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | d#0 d File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | d#0,0x00 b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + bz main_ternary_false@4 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + // Implicit fall through to main_ternary_true@3 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + +main_ternary_true@3: + dig 7 // load d#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | d#0 d File "arc4_types/tuples.py", line 36 + b main_ternary_merge@17 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%55#0 | ternary_result%55#0 + +main_ternary_false@4: + dig 6 // load e#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | e#0 e File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | e#0,0x00 b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + bz main_ternary_false@6 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + // Implicit fall through to main_ternary_true@5 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + +main_ternary_true@5: + dig 6 // load e#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | e#0 e File "arc4_types/tuples.py", line 36 + b main_ternary_merge@16 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%57#0 | ternary_result%57#0 + +main_ternary_false@6: + dig 5 // load f#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | f#0 f File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | f#0,0x00 b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + bz main_ternary_false@8 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + // Implicit fall through to main_ternary_true@7 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + +main_ternary_true@7: + dig 5 // load f#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | f#0 f File "arc4_types/tuples.py", line 36 + b main_ternary_merge@15 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%59#0 | ternary_result%59#0 + +main_ternary_false@8: + dig 4 // load g#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | g#0 g File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | g#0,0x00 b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + bz main_ternary_false@10 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + // Implicit fall through to main_ternary_true@9 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + +main_ternary_true@9: + dig 4 // load g#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | g#0 g File "arc4_types/tuples.py", line 36 + b main_ternary_merge@14 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%61#0 | ternary_result%61#0 + +main_ternary_false@10: + dig 2 // load i#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | i#0 i File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | i#0,0x00 b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + bz main_ternary_false@12 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + // Implicit fall through to main_ternary_true@11 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + +main_ternary_true@11: + dig 2 // load i#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | i#0 i File "arc4_types/tuples.py", line 36 + b main_ternary_merge@13 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%63#0 | ternary_result%63#0 + +main_ternary_false@12: + dig 1 // load j#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | j#0 j File "arc4_types/tuples.py", line 36 + // Implicit fall through to main_ternary_merge@13 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%63#0 | ternary_result%63#0 + +main_ternary_merge@13: + // Implicit fall through to main_ternary_merge@14 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%61#0 | ternary_result%63#0 + +main_ternary_merge@14: + // Implicit fall through to main_ternary_merge@15 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%59#0 | ternary_result%61#0 + +main_ternary_merge@15: + // Implicit fall through to main_ternary_merge@16 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%57#0 | ternary_result%59#0 + +main_ternary_merge@16: + // Implicit fall through to main_ternary_merge@17 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%55#0 | ternary_result%57#0 + +main_ternary_merge@17: + // Implicit fall through to main_ternary_merge@18 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%53#0 | ternary_result%55#0 + +main_ternary_merge@18: + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | ternary_result%53#0,0x00 ternary_result%53#0 b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + != // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {!=} b and d and e and f and g and i and j File "arc4_types/tuples.py", line 39 + assert // b,d,e,f,g,i,j are true // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | assert b and d and e and f and g and i and j, "b,d,e,f,g,i,j are true" File "arc4_types/tuples.py", line 39 + dig 8 // load c#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | c#0 c File "arc4_types/tuples.py", line 36 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | c#0,0x00 c or h File "arc4_types/tuples.py", line 40 + != // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {!=} c or h File "arc4_types/tuples.py", line 40 + bz main_ternary_false@20 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | c or h File "arc4_types/tuples.py", line 40 + // Implicit fall through to main_ternary_true@19 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | c or h File "arc4_types/tuples.py", line 40 + +main_ternary_true@19: + dig 8 // load c#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | c#0 c File "arc4_types/tuples.py", line 36 + b main_ternary_merge@21 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%66#0 | ternary_result%66#0 + +main_ternary_false@20: + dig 3 // load h#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | h#0 h File "arc4_types/tuples.py", line 36 + // Implicit fall through to main_ternary_merge@21 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | (𝕏) ternary_result%66#0 | ternary_result%66#0 + +main_ternary_merge@21: + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | ternary_result%66#0,0x00 ternary_result%66#0 not (c or h) File "arc4_types/tuples.py", line 40 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} not (c or h) File "arc4_types/tuples.py", line 40 + assert // c and h are false // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | assert not (c or h), "c and h are false" File "arc4_types/tuples.py", line 40 + dup // load k#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | k#0 k File "arc4_types/tuples.py", line 36 + btoi // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {btoi} k.decode() File "arc4_types/tuples.py", line 41 + int 16 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | tmp%68#0,16 16 File "arc4_types/tuples.py", line 41 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} k.decode() == 16, "k is 16" File "arc4_types/tuples.py", line 41 + assert // k is 16 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | assert k.decode() == 16, "k is 16" File "arc4_types/tuples.py", line 41 + dig 10 // load boolean_packing#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + dup // store boolean_packing#0 to l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | boolean_packing#0,boolean_packing#0,0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 1 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | boolean_packing#0,boolean_packing#0,0,1 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + extract3 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | boolean_packing#0,{extract3} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + swap // store item0%70#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 8 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0,boolean_packing#0,8 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0,is_true%71#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0,is_true%71#0,0x00,0 + uncover 2 // load is_true%71#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0,0x00,0,is_true%71#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + swap // store item1%72#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 9 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0,boolean_packing#0,9 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0,is_true%73#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0,is_true%73#0,0x00,0 + uncover 2 // load is_true%73#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0,0x00,0,is_true%73#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + swap // store item2%74#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 10 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0,boolean_packing#0,10 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0,is_true%75#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0,is_true%75#0,0x00,0 + uncover 2 // load is_true%75#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0,0x00,0,is_true%75#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item2%74#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 2 // store item3%76#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 11 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,11 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%77#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%77#0,0x00,0 + uncover 2 // load is_true%77#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0,0x00,0,is_true%77#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item3%76#0,item2%74#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 3 // store item4%78#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 12 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,12 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%79#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%79#0,0x00,0 + uncover 2 // load is_true%79#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,0x00,0,is_true%79#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 4 // store item5%80#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 13 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,13 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%81#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%81#0,0x00,0 + uncover 2 // load is_true%81#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,0x00,0,is_true%81#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 5 // store item6%82#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 14 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,14 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%83#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%83#0,0x00,0 + uncover 2 // load is_true%83#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,0x00,0,is_true%83#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 6 // store item7%84#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 15 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,15 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%85#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%85#0,0x00,0 + uncover 2 // load is_true%85#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,0x00,0,is_true%85#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 7 // store item8%86#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 16 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,16 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{getbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + byte 0x00 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%87#0,0x00 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,is_true%87#0,0x00,0 + uncover 2 // load is_true%87#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,0x00,0,is_true%87#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{setbit} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 8 // store item9%88#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + dup // load boolean_packing#0 from l-stack (copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0 boolean_packing File "arc4_types/tuples.py", line 20 + int 3 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,3 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 1 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,boolean_packing#0,3,1 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + extract3 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{extract3} boolean_packing.decode() File "arc4_types/tuples.py", line 43 + cover 7 // store item10%89#0 to l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 4 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,4 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + pop // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + byte 0x // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item0%70#0,item1%72#0,item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,0x TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 12 // load item0%70#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item1%72#0,item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,encoded_tuple_buffer%91#0,item0%70#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + concat // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item1%72#0,item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{concat} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 11 // load item1%72#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,encoded_tuple_buffer%91#0,item1%72#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + concat // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,item2%74#0,boolean_packing#0,{concat} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load item2%74#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,boolean_packing#0,encoded_tuple_buffer%91#0,item2%74#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,boolean_packing#0,encoded_tuple_buffer%91#0,item2%74#0,0 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,boolean_packing#0,encoded_tuple_buffer%91#0,{getbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + swap // load encoded_tuple_buffer%91#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,boolean_packing#0,is_true%92#0,encoded_tuple_buffer%91#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + int 9 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,boolean_packing#0,is_true%92#0,encoded_tuple_buffer%91#0,9 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load is_true%92#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,boolean_packing#0,encoded_tuple_buffer%91#0,9,is_true%92#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,item3%76#0,boolean_packing#0,{setbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load item3%76#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,boolean_packing#0,encoded_tuple_buffer%91#0,item3%76#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,boolean_packing#0,encoded_tuple_buffer%91#0,item3%76#0,0 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,boolean_packing#0,encoded_tuple_buffer%91#0,{getbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + swap // load encoded_tuple_buffer%91#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,boolean_packing#0,is_true%93#0,encoded_tuple_buffer%91#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + int 10 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,boolean_packing#0,is_true%93#0,encoded_tuple_buffer%91#0,10 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load is_true%93#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,boolean_packing#0,encoded_tuple_buffer%91#0,10,is_true%93#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,item4%78#0,boolean_packing#0,{setbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load item4%78#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,boolean_packing#0,encoded_tuple_buffer%91#0,item4%78#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,boolean_packing#0,encoded_tuple_buffer%91#0,item4%78#0,0 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,boolean_packing#0,encoded_tuple_buffer%91#0,{getbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + swap // load encoded_tuple_buffer%91#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,boolean_packing#0,is_true%94#0,encoded_tuple_buffer%91#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + int 11 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,boolean_packing#0,is_true%94#0,encoded_tuple_buffer%91#0,11 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load is_true%94#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,boolean_packing#0,encoded_tuple_buffer%91#0,11,is_true%94#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,item5%80#0,boolean_packing#0,{setbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load item5%80#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,boolean_packing#0,encoded_tuple_buffer%91#0,item5%80#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,boolean_packing#0,encoded_tuple_buffer%91#0,item5%80#0,0 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,boolean_packing#0,encoded_tuple_buffer%91#0,{getbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + swap // load encoded_tuple_buffer%91#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,boolean_packing#0,is_true%95#0,encoded_tuple_buffer%91#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + int 12 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,boolean_packing#0,is_true%95#0,encoded_tuple_buffer%91#0,12 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load is_true%95#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,boolean_packing#0,encoded_tuple_buffer%91#0,12,is_true%95#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,item6%82#0,boolean_packing#0,{setbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load item6%82#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,boolean_packing#0,encoded_tuple_buffer%91#0,item6%82#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,boolean_packing#0,encoded_tuple_buffer%91#0,item6%82#0,0 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,boolean_packing#0,encoded_tuple_buffer%91#0,{getbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + swap // load encoded_tuple_buffer%91#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,boolean_packing#0,is_true%96#0,encoded_tuple_buffer%91#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + int 13 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,boolean_packing#0,is_true%96#0,encoded_tuple_buffer%91#0,13 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load is_true%96#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,boolean_packing#0,encoded_tuple_buffer%91#0,13,is_true%96#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,item7%84#0,boolean_packing#0,{setbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load item7%84#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,item7%84#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,item7%84#0,0 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,{getbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + swap // load encoded_tuple_buffer%91#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,boolean_packing#0,is_true%97#0,encoded_tuple_buffer%91#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + int 14 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,boolean_packing#0,is_true%97#0,encoded_tuple_buffer%91#0,14 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load is_true%97#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,14,is_true%97#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item8%86#0,item10%89#0,boolean_packing#0,{setbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 3 // load item8%86#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,item8%86#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + int 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,item8%86#0,0 + getbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,{getbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + swap // load encoded_tuple_buffer%91#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item10%89#0,boolean_packing#0,is_true%98#0,encoded_tuple_buffer%91#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + int 15 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item10%89#0,boolean_packing#0,is_true%98#0,encoded_tuple_buffer%91#0,15 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load is_true%98#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,15,is_true%98#0 TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + setbit // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item9%88#0,item10%89#0,boolean_packing#0,{setbit} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 3 // load item9%88#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item10%89#0,boolean_packing#0,encoded_tuple_buffer%91#0,item9%88#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + concat // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | item10%89#0,boolean_packing#0,{concat} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + uncover 2 // load item10%89#0 from l-stack (no copy) (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | boolean_packing#0,encoded_tuple_buffer%91#0,item10%89#0 boolean_packing.decode() File "arc4_types/tuples.py", line 43 + concat // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | boolean_packing#0,{concat} TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} boolean_packing == TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + assert // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | assert boolean_packing == TestBooleanPacking.encode(boolean_packing.decode()) File "arc4_types/tuples.py", line 43 + dig 11 // load my_tuple#0 from f-stack (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | my_tuple#0 my_tuple File "arc4_types/tuples.py", line 15 + callsub test_stuff // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {test_stuff}.0,{test_stuff}.1 self.test_stuff(my_tuple) File "arc4_types/tuples.py", line 45 + extract 2 0 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | total#0,{extract} concat.decode() File "arc4_types/tuples.py", line 46 + byte "hello world" // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | total#0,tmp%102#0,"hello world" b"hello world" File "arc4_types/tuples.py", line 46 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | total#0,{==} concat.decode() == b"hello world" File "arc4_types/tuples.py", line 46 + assert // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | total#0 assert concat.decode() == b"hello world" File "arc4_types/tuples.py", line 46 + int 258 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | total#0,258 258 File "arc4_types/tuples.py", line 47 + == // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | {==} total == 258 File "arc4_types/tuples.py", line 47 + assert // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | assert total == 258 File "arc4_types/tuples.py", line 47 + int 1 // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | 1 True File "arc4_types/tuples.py", line 49 + return // (𝕗) my_tuple#0,boolean_packing#0,b#0,c#0,d#0,e#0,f#0,g#0,h#0,i#0,j#0,k#0 | return True File "arc4_types/tuples.py", line 49 + + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple#0: bytes) -> uint64, bytes: +test_stuff: + proto 1 2 // (𝕡) test_tuple#0 | def test_stuff(self, test_tuple: TestTuple) -> tuple[UInt64, String]: File "arc4_types/tuples.py", line 55 + +test_stuff_block@0: + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 0 // (𝕡) test_tuple#0 | test_tuple#0,0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 1 // (𝕡) test_tuple#0 | test_tuple#0,0,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | {extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 1 // (𝕡) test_tuple#0 | item0%0#0,test_tuple#0,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 1 // (𝕡) test_tuple#0 | item0%0#0,test_tuple#0,1,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | item0%0#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,item1%1#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 2 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,test_tuple#0,2 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item_index%2#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + dig 1 // load item_index%2#0 from l-stack (copy) (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item_index%2#0,test_tuple#0,item_index%2#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item_index%2#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 2 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item_index%2#0,item_length%3#0,2 test_tuple.decode() File "arc4_types/tuples.py", line 56 + + // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item_index%2#0,{+} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item_index%2#0,item_length_plus_2%4#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + cover 2 // virtual: 2 ops (𝕡) test_tuple#0 | item0%0#0,item1%1#0,test_tuple#0,item_index%2#0,item_length_plus_2%4#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 4 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,test_tuple#0,4 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item_index%6#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + dig 1 // load item_index%6#0 from l-stack (copy) (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item_index%6#0,test_tuple#0,item_index%6#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract_uint16 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item_index%6#0,{extract_uint16} test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 2 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item_index%6#0,item_length%7#0,2 test_tuple.decode() File "arc4_types/tuples.py", line 56 + + // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item_index%6#0,{+} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item_index%6#0,item_length_plus_2%8#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + cover 2 // virtual: 2 ops (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,test_tuple#0,item_index%6#0,item_length_plus_2%8#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + frame_dig -1 // load test_tuple#0 from parameters (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item3%9#0,test_tuple#0 test_tuple: TestTuple File "arc4_types/tuples.py", line 55 + int 6 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item3%9#0,test_tuple#0,6 test_tuple.decode() File "arc4_types/tuples.py", line 56 + int 1 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item3%9#0,test_tuple#0,6,1 test_tuple.decode() File "arc4_types/tuples.py", line 56 + extract3 // (𝕡) test_tuple#0 | item0%0#0,item1%1#0,item2%5#0,item3%9#0,{extract3} test_tuple.decode() File "arc4_types/tuples.py", line 56 + uncover 4 // load item0%0#0 from l-stack (no copy) (𝕡) test_tuple#0 | item1%1#0,item2%5#0,item3%9#0,item4%10#0,item0%0#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + swap // store a#0 to l-stack (no copy) (𝕡) test_tuple#0 | item1%1#0,item2%5#0,item3%9#0,a#0,item4%10#0 a File "arc4_types/tuples.py", line 56 + uncover 4 // load item1%1#0 from l-stack (no copy) (𝕡) test_tuple#0 | item2%5#0,item3%9#0,a#0,item4%10#0,item1%1#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + cover 2 // store b#0 to l-stack (no copy) (𝕡) test_tuple#0 | item2%5#0,item3%9#0,b#0,a#0,item4%10#0 b File "arc4_types/tuples.py", line 56 + uncover 3 // load item3%9#0 from l-stack (no copy) (𝕡) test_tuple#0 | c#0,b#0,a#0,item4%10#0,item3%9#0 test_tuple.decode() File "arc4_types/tuples.py", line 56 + cover 4 // store d#0 to l-stack (no copy) (𝕡) test_tuple#0 | d#0,c#0,b#0,a#0,item4%10#0 d File "arc4_types/tuples.py", line 56 + cover 2 // store e#0 to l-stack (no copy) (𝕡) test_tuple#0 | d#0,c#0,e#0,b#0,a#0 e File "arc4_types/tuples.py", line 56 + btoi // (𝕡) test_tuple#0 | d#0,c#0,e#0,b#0,{btoi} a.decode() File "arc4_types/tuples.py", line 58 + swap // load b#0 from l-stack (no copy) (𝕡) test_tuple#0 | d#0,c#0,e#0,tmp%11#0,b#0 b File "arc4_types/tuples.py", line 56 + btoi // (𝕡) test_tuple#0 | d#0,c#0,e#0,tmp%11#0,{btoi} b.decode() File "arc4_types/tuples.py", line 58 + + // (𝕡) test_tuple#0 | d#0,c#0,e#0,{+} a.decode() + b.decode() File "arc4_types/tuples.py", line 58 + swap // load e#0 from l-stack (no copy) (𝕡) test_tuple#0 | d#0,c#0,tmp%13#0,e#0 e File "arc4_types/tuples.py", line 56 + btoi // (𝕡) test_tuple#0 | d#0,c#0,tmp%13#0,{btoi} e.decode() File "arc4_types/tuples.py", line 58 + + // (𝕡) test_tuple#0 | d#0,c#0,{+} a.decode() + b.decode() + e.decode() File "arc4_types/tuples.py", line 58 + cover 2 // store total#0 to l-stack (no copy) (𝕡) test_tuple#0 | total#0,d#0,c#0 total File "arc4_types/tuples.py", line 58 + extract 2 0 // (𝕡) test_tuple#0 | total#0,d#0,{extract} c.decode() File "arc4_types/tuples.py", line 59 + byte " " // (𝕡) test_tuple#0 | total#0,d#0,tmp%15#0," " b" " File "arc4_types/tuples.py", line 59 + concat // (𝕡) test_tuple#0 | total#0,d#0,{concat} c.decode() + b" " File "arc4_types/tuples.py", line 59 + swap // load d#0 from l-stack (no copy) (𝕡) test_tuple#0 | total#0,tmp%16#0,d#0 d File "arc4_types/tuples.py", line 56 + extract 2 0 // (𝕡) test_tuple#0 | total#0,tmp%16#0,{extract} d.decode() File "arc4_types/tuples.py", line 59 + concat // (𝕡) test_tuple#0 | total#0,{concat} c.decode() + b" " + d.decode() File "arc4_types/tuples.py", line 59 + dup // load text#0 from l-stack (copy) (𝕡) test_tuple#0 | total#0,text#0,text#0 text File "arc4_types/tuples.py", line 59 + len // (𝕡) test_tuple#0 | total#0,text#0,{len} String.encode(text) File "arc4_types/tuples.py", line 61 + itob // (𝕡) test_tuple#0 | total#0,text#0,{itob} String.encode(text) File "arc4_types/tuples.py", line 61 + extract 6 2 // (𝕡) test_tuple#0 | total#0,text#0,{extract} String.encode(text) File "arc4_types/tuples.py", line 61 + swap // load text#0 from l-stack (no copy) (𝕡) test_tuple#0 | total#0,value_as_uint16%20#0,text#0 text File "arc4_types/tuples.py", line 59 + concat // (𝕡) test_tuple#0 | total#0,{concat} String.encode(text) File "arc4_types/tuples.py", line 61 + retsub // total#0,tmp%21#0 return total, String.encode(text) File "arc4_types/tuples.py", line 61 + diff --git a/examples/arc4_types/out/tuples.approval_unoptimized.teal b/examples/arc4_types/out/tuples.approval_unoptimized.teal new file mode 100644 index 0000000000..35dd1e047b --- /dev/null +++ b/examples/arc4_types/out/tuples.approval_unoptimized.teal @@ -0,0 +1,576 @@ +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: +main_block@0: + int 7 + byte 0x + byte 0x01 + concat + byte 0x02 + concat + dig 1 + itob + extract 6 2 + concat + swap + byte "\x00\x05hello" + len + + + dup + itob + extract 6 2 + uncover 2 + swap + concat + byte "\x00\x05world" + len + uncover 2 + + + pop + byte 0xff + concat + byte "\x00\x05hello" + concat + byte "\x00\x05world" + concat + dup + swap + byte 0x01020007000eff000568656c6c6f0005776f726c64 + == + assert + byte 0x00 + int 0 + int 1 + setbit + byte 0x00 + int 0 + int 0 + setbit + byte 0x00 + int 0 + int 1 + setbit + cover 2 + byte 0x00 + int 0 + int 1 + setbit + cover 3 + byte 0x00 + int 0 + int 1 + setbit + cover 4 + byte 0x00 + int 0 + int 1 + setbit + cover 5 + byte 0x00 + int 0 + int 0 + setbit + cover 6 + byte 0x00 + int 0 + int 1 + setbit + cover 7 + byte 0x00 + int 0 + int 1 + setbit + cover 8 + int 4 + pop + byte 0x + byte 0x04 + concat + uncover 2 + concat + swap + int 0 + getbit + swap + int 9 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 10 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 11 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 12 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 13 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 14 + uncover 2 + setbit + swap + int 0 + getbit + swap + int 15 + uncover 2 + setbit + swap + concat + byte 0x10 + concat + dup + swap + dup + byte 0x04bd8010 + == + assert + dup + int 0 + int 1 + extract3 + swap + dup + int 8 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 9 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 10 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 11 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 12 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 13 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 14 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 15 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 16 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 3 + int 1 + extract3 + uncover 11 + cover 4 + uncover 11 + dup + cover 7 + cover 12 + uncover 5 + cover 6 + uncover 3 + cover 5 + uncover 2 + cover 4 + dup + cover 4 + swap + int 3 + int 1 + extract3 + == + assert + btoi + int 4 + == + assert // a is 4 + byte 0x00 + == + bz main_ternary_false@2 + +main_ternary_true@1: + dig 9 + b main_ternary_merge@18 + +main_ternary_false@2: + dig 7 + byte 0x00 + == + bz main_ternary_false@4 + +main_ternary_true@3: + dig 7 + b main_ternary_merge@17 + +main_ternary_false@4: + dig 6 + byte 0x00 + == + bz main_ternary_false@6 + +main_ternary_true@5: + dig 6 + b main_ternary_merge@16 + +main_ternary_false@6: + dig 5 + byte 0x00 + == + bz main_ternary_false@8 + +main_ternary_true@7: + dig 5 + b main_ternary_merge@15 + +main_ternary_false@8: + dig 4 + byte 0x00 + == + bz main_ternary_false@10 + +main_ternary_true@9: + dig 4 + b main_ternary_merge@14 + +main_ternary_false@10: + dig 2 + byte 0x00 + == + bz main_ternary_false@12 + +main_ternary_true@11: + dig 2 + b main_ternary_merge@13 + +main_ternary_false@12: + dig 1 + +main_ternary_merge@13: + +main_ternary_merge@14: + +main_ternary_merge@15: + +main_ternary_merge@16: + +main_ternary_merge@17: + +main_ternary_merge@18: + byte 0x00 + != + assert // b,d,e,f,g,i,j are true + dig 8 + byte 0x00 + != + bz main_ternary_false@20 + +main_ternary_true@19: + dig 8 + b main_ternary_merge@21 + +main_ternary_false@20: + dig 3 + +main_ternary_merge@21: + byte 0x00 + == + assert // c and h are false + dup + btoi + int 16 + == + assert // k is 16 + dig 10 + dup + int 0 + int 1 + extract3 + swap + dup + int 8 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 9 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + swap + dup + int 10 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + cover 2 + dup + int 11 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + cover 3 + dup + int 12 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + cover 4 + dup + int 13 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + cover 5 + dup + int 14 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + cover 6 + dup + int 15 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + cover 7 + dup + int 16 + getbit + byte 0x00 + int 0 + uncover 2 + setbit + cover 8 + dup + int 3 + int 1 + extract3 + cover 7 + int 4 + pop + byte 0x + uncover 12 + concat + uncover 11 + concat + uncover 2 + int 0 + getbit + swap + int 9 + uncover 2 + setbit + uncover 2 + int 0 + getbit + swap + int 10 + uncover 2 + setbit + uncover 2 + int 0 + getbit + swap + int 11 + uncover 2 + setbit + uncover 2 + int 0 + getbit + swap + int 12 + uncover 2 + setbit + uncover 2 + int 0 + getbit + swap + int 13 + uncover 2 + setbit + uncover 2 + int 0 + getbit + swap + int 14 + uncover 2 + setbit + uncover 3 + int 0 + getbit + swap + int 15 + uncover 2 + setbit + uncover 3 + concat + uncover 2 + concat + == + assert + dig 11 + callsub test_stuff + extract 2 0 + byte "hello world" + == + assert + int 258 + == + assert + int 1 + return + + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple#0: bytes) -> uint64, bytes: +test_stuff: + proto 1 2 + +test_stuff_block@0: + frame_dig -1 + int 0 + int 1 + extract3 + frame_dig -1 + int 1 + int 1 + extract3 + frame_dig -1 + int 2 + extract_uint16 + frame_dig -1 + dig 1 + extract_uint16 + int 2 + + + frame_dig -1 + cover 2 + extract3 + frame_dig -1 + int 4 + extract_uint16 + frame_dig -1 + dig 1 + extract_uint16 + int 2 + + + frame_dig -1 + cover 2 + extract3 + frame_dig -1 + int 6 + int 1 + extract3 + uncover 4 + swap + uncover 4 + cover 2 + uncover 3 + cover 4 + cover 2 + btoi + swap + btoi + + + swap + btoi + + + cover 2 + extract 2 0 + byte " " + concat + swap + extract 2 0 + concat + dup + len + itob + extract 6 2 + swap + concat + retsub + diff --git a/examples/arc4_types/out/tuples.awst b/examples/arc4_types/out/tuples.awst new file mode 100644 index 0000000000..0ad64e86ba --- /dev/null +++ b/examples/arc4_types/out/tuples.awst @@ -0,0 +1,34 @@ +contract Arc4TuplesTypeContract +{ + approval_program(): bool + { + my_tuple: algopy.arc4.Tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.String, algopy.arc4.String, algopy.arc4.UIntN[typing.Literal[8]]] = arc4_encode((1arc4u8, 2arc4u8, arc4_encode('hello', algopy.arc4.String), arc4_encode('world', algopy.arc4.String), 255arc4u8), algopy.arc4.Tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.String, algopy.arc4.String, algopy.arc4.UIntN[typing.Literal[8]]]) + assert(reinterpret_cast(my_tuple) == reinterpret_cast(reinterpret_cast(hex<"01020007000EFF000568656C6C6F0005776F726C64">))) + boolean_packing: algopy.arc4.Tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.UIntN[typing.Literal[8]]] = arc4_encode((4arc4u8, arc4_encode(true, algopy.arc4.Bool), arc4_encode(false, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(false, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), arc4_encode(true, algopy.arc4.Bool), 16arc4u8), algopy.arc4.Tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.UIntN[typing.Literal[8]]]) + assert(reinterpret_cast(boolean_packing) == hex<"04BD8010">) + (a, b, c, d, e, f, g, h, i, j, k): tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.UIntN[typing.Literal[8]]] = arc4_decode(boolean_packing, tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.UIntN[typing.Literal[8]]]) + assert(reinterpret_cast(boolean_packing[10u]) == reinterpret_cast(k)) + assert(arc4_decode(a, algopy.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, algopy.UInt64) == 16u, comment="k is 16") + assert(reinterpret_cast(boolean_packing) == reinterpret_cast(arc4_encode(arc4_decode(boolean_packing, tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.UIntN[typing.Literal[8]]]), algopy.arc4.Tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.Bool, algopy.arc4.UIntN[typing.Literal[8]]]))) + (total, concat): tuple[algopy.UInt64, algopy.arc4.String] = this::test_stuff(my_tuple) + assert(arc4_decode(concat, algopy.Bytes) == 'hello world') + assert(total == 258u) + return true + } + + clear_state_program(): bool + { + return true + } + + subroutine test_stuff(test_tuple: algopy.arc4.Tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.String, algopy.arc4.String, algopy.arc4.UIntN[typing.Literal[8]]]): tuple[algopy.UInt64, algopy.arc4.String] + { + (a, b, c, d, e): tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.String, algopy.arc4.String, algopy.arc4.UIntN[typing.Literal[8]]] = arc4_decode(test_tuple, tuple[algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.UIntN[typing.Literal[8]], algopy.arc4.String, algopy.arc4.String, algopy.arc4.UIntN[typing.Literal[8]]]) + total: algopy.UInt64 = arc4_decode(a, algopy.UInt64) + arc4_decode(b, algopy.UInt64) + arc4_decode(e, algopy.UInt64) + text: algopy.Bytes = arc4_decode(c, algopy.Bytes) + ' ' + arc4_decode(d, algopy.Bytes) + return (total, arc4_encode(text, algopy.arc4.String)) + } +} \ No newline at end of file diff --git a/examples/arc4_types/out/tuples.clear.debug.teal b/examples/arc4_types/out/tuples.clear.debug.teal new file mode 100644 index 0000000000..63028a3aae --- /dev/null +++ b/examples/arc4_types/out/tuples.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/tuples.py", line 52 + return // return True File "arc4_types/tuples.py", line 52 + diff --git a/examples/arc4_types/out/tuples.clear.teal b/examples/arc4_types/out/tuples.clear.teal new file mode 100644 index 0000000000..79bfe32a59 --- /dev/null +++ b/examples/arc4_types/out/tuples.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/tuples.clear_unoptimized.debug.teal b/examples/arc4_types/out/tuples.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..63028a3aae --- /dev/null +++ b/examples/arc4_types/out/tuples.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "arc4_types/tuples.py", line 52 + return // return True File "arc4_types/tuples.py", line 52 + diff --git a/examples/arc4_types/out/tuples.clear_unoptimized.teal b/examples/arc4_types/out/tuples.clear_unoptimized.teal new file mode 100644 index 0000000000..79bfe32a59 --- /dev/null +++ b/examples/arc4_types/out/tuples.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.cssa.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.cssa.ir new file mode 100644 index 0000000000..682545cab7 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.cssa.ir @@ -0,0 +1,61 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final.ir new file mode 100644 index 0000000000..383c0de82b --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final.ir @@ -0,0 +1,61 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#3 0xff) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#3 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#3 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final_unoptimized.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final_unoptimized.ir new file mode 100644 index 0000000000..b77f72892f --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.final_unoptimized.ir @@ -0,0 +1,252 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let current_tail_offset%0#0: uint64 = 7u + let encoded_tuple_buffer%1#0: bytes = 0x + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 0x01) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 0x02) + let value_as_bytes%2#0: bytes = (itob current_tail_offset%0#0) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 value_as_uint16%3#0) + let data_length%4#0: uint64 = (len "\x00\x05hello") + let current_tail_offset%0#0: uint64 = (+ current_tail_offset%0#0 data_length%4#0) + let value_as_bytes%5#0: bytes = (itob current_tail_offset%0#0) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 value_as_uint16%6#0) + let data_length%7#0: uint64 = (len "\x00\x05world") + let current_tail_offset%0#0: uint64 = (+ current_tail_offset%0#0 data_length%7#0) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 0xff) + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 "\x00\x05hello") + let encoded_tuple_buffer%1#0: bytes = (concat encoded_tuple_buffer%1#0 "\x00\x05world") + let my_tuple#0: bytes = encoded_tuple_buffer%1#0 + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%9#0: any = (setbit 0x00 0u 1u) + let tmp%10#0: any = (setbit 0x00 0u 0u) + let tmp%11#0: any = (setbit 0x00 0u 1u) + let tmp%12#0: any = (setbit 0x00 0u 1u) + let tmp%13#0: any = (setbit 0x00 0u 1u) + let tmp%14#0: any = (setbit 0x00 0u 1u) + let tmp%15#0: any = (setbit 0x00 0u 0u) + let tmp%16#0: any = (setbit 0x00 0u 1u) + let tmp%17#0: any = (setbit 0x00 0u 1u) + let current_tail_offset%18#0: uint64 = 4u + let encoded_tuple_buffer%19#0: bytes = 0x + let encoded_tuple_buffer%19#0: bytes = (concat encoded_tuple_buffer%19#0 0x04) + let encoded_tuple_buffer%19#0: bytes = (concat encoded_tuple_buffer%19#0 tmp%9#0) + let is_true%20#0: uint64 = (getbit tmp%10#0 0u) + let encoded_tuple_buffer%19#0: bytes = (setbit encoded_tuple_buffer%19#0 9u is_true%20#0) + let is_true%21#0: uint64 = (getbit tmp%11#0 0u) + let encoded_tuple_buffer%19#0: bytes = (setbit encoded_tuple_buffer%19#0 10u is_true%21#0) + let is_true%22#0: uint64 = (getbit tmp%12#0 0u) + let encoded_tuple_buffer%19#0: bytes = (setbit encoded_tuple_buffer%19#0 11u is_true%22#0) + let is_true%23#0: uint64 = (getbit tmp%13#0 0u) + let encoded_tuple_buffer%19#0: bytes = (setbit encoded_tuple_buffer%19#0 12u is_true%23#0) + let is_true%24#0: uint64 = (getbit tmp%14#0 0u) + let encoded_tuple_buffer%19#0: bytes = (setbit encoded_tuple_buffer%19#0 13u is_true%24#0) + let is_true%25#0: uint64 = (getbit tmp%15#0 0u) + let encoded_tuple_buffer%19#0: bytes = (setbit encoded_tuple_buffer%19#0 14u is_true%25#0) + let is_true%26#0: uint64 = (getbit tmp%16#0 0u) + let encoded_tuple_buffer%19#0: bytes = (setbit encoded_tuple_buffer%19#0 15u is_true%26#0) + let encoded_tuple_buffer%19#0: bytes = (concat encoded_tuple_buffer%19#0 tmp%17#0) + let encoded_tuple_buffer%19#0: bytes = (concat encoded_tuple_buffer%19#0 0x10) + let boolean_packing#0: bytes = encoded_tuple_buffer%19#0 + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let item0%28#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let item1%30#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let item2%32#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let item3%34#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let item4%36#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let item5%38#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let item6%40#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let item7%42#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let item8%44#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let item9%46#0: any = (setbit 0x00 0u is_true%45#0) + let item10%47#0: bytes = (extract3 boolean_packing#0 3u 1u) + let a#0: bytes = item0%28#0 + let b#0: any = item1%30#0 + let c#0: any = item2%32#0 + let d#0: any = item3%34#0 + let e#0: any = item4%36#0 + let f#0: any = item5%38#0 + let g#0: any = item6%40#0 + let h#0: any = item7%42#0 + let i#0: any = item8%44#0 + let j#0: any = item9%46#0 + let k#0: bytes = item10%47#0 + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + let ternary_result%53#0: any = b#0 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + let ternary_result%55#0: any = d#0 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + let ternary_result%57#0: any = e#0 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + let ternary_result%59#0: any = f#0 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + let ternary_result%61#0: any = g#0 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + let ternary_result%63#0: any = i#0 + goto block@13 + block@12: // ternary_false_L39 + let ternary_result%63#0: any = j#0 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%61#0: any = ternary_result%63#0 + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%59#0: any = ternary_result%61#0 + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%57#0: any = ternary_result%59#0 + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%55#0: any = ternary_result%57#0 + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%53#0: any = ternary_result%55#0 + goto block@18 + block@18: // ternary_merge_L39 + let tmp%64#0: uint64 = (!= ternary_result%53#0 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + let ternary_result%66#0: any = c#0 + goto block@21 + block@20: // ternary_false_L40 + let ternary_result%66#0: any = h#0 + goto block@21 + block@21: // ternary_merge_L40 + let tmp%67#0: uint64 = (== ternary_result%66#0 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let current_tail_offset%90#0: uint64 = 4u + let encoded_tuple_buffer%91#0: bytes = 0x + let encoded_tuple_buffer%91#0: bytes = (concat encoded_tuple_buffer%91#0 item0%70#0) + let encoded_tuple_buffer%91#0: bytes = (concat encoded_tuple_buffer%91#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#0: bytes = (setbit encoded_tuple_buffer%91#0 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#0: bytes = (setbit encoded_tuple_buffer%91#0 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#0: bytes = (setbit encoded_tuple_buffer%91#0 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#0: bytes = (setbit encoded_tuple_buffer%91#0 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#0: bytes = (setbit encoded_tuple_buffer%91#0 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#0: bytes = (setbit encoded_tuple_buffer%91#0 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#0: bytes = (setbit encoded_tuple_buffer%91#0 15u is_true%98#0) + let encoded_tuple_buffer%91#0: bytes = (concat encoded_tuple_buffer%91#0 item9%88#0) + let encoded_tuple_buffer%91#0: bytes = (concat encoded_tuple_buffer%91#0 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#0) + (assert tmp%99#0) + let (tuple_assignment%100#0: uint64, tuple_assignment%101#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let total#0: uint64 = tuple_assignment%100#0 + let concat#0: bytes = tuple_assignment%101#0 + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let item0%0#0: bytes = (extract3 test_tuple#0 0u 1u) + let item1%1#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let item2%5#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let item3%9#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let item4%10#0: bytes = (extract3 test_tuple#0 6u 1u) + let a#0: bytes = item0%0#0 + let b#0: bytes = item1%1#0 + let c#0: bytes = item2%5#0 + let d#0: bytes = item3%9#0 + let e#0: bytes = item4%10#0 + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.parallel_copies.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.parallel_copies.ir new file mode 100644 index 0000000000..682545cab7 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.parallel_copies.ir @@ -0,0 +1,61 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.post_ssa.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.post_ssa.ir new file mode 100644 index 0000000000..682545cab7 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.post_ssa.ir @@ -0,0 +1,61 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.ir new file mode 100644 index 0000000000..a6b36e09e4 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.ir @@ -0,0 +1,259 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let current_tail_offset%0#0: uint64 = 7u + let encoded_tuple_buffer%1#0: bytes = 0x + let encoded_tuple_buffer%1#1: bytes = (concat encoded_tuple_buffer%1#0 0x01) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#1 0x02) + let value_as_bytes%2#0: bytes = (itob current_tail_offset%0#0) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#2 value_as_uint16%3#0) + let data_length%4#0: uint64 = (len "\x00\x05hello") + let current_tail_offset%0#1: uint64 = (+ current_tail_offset%0#0 data_length%4#0) + let value_as_bytes%5#0: bytes = (itob current_tail_offset%0#1) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let data_length%7#0: uint64 = (len "\x00\x05world") + let current_tail_offset%0#2: uint64 = (+ current_tail_offset%0#1 data_length%7#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let encoded_tuple_buffer%1#7: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let my_tuple#0: bytes = encoded_tuple_buffer%1#7 + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%9#0: any = (setbit 0x00 0u 1u) + let tmp%10#0: any = (setbit 0x00 0u 0u) + let tmp%11#0: any = (setbit 0x00 0u 1u) + let tmp%12#0: any = (setbit 0x00 0u 1u) + let tmp%13#0: any = (setbit 0x00 0u 1u) + let tmp%14#0: any = (setbit 0x00 0u 1u) + let tmp%15#0: any = (setbit 0x00 0u 0u) + let tmp%16#0: any = (setbit 0x00 0u 1u) + let tmp%17#0: any = (setbit 0x00 0u 1u) + let current_tail_offset%18#0: uint64 = 4u + let encoded_tuple_buffer%19#0: bytes = 0x + let encoded_tuple_buffer%19#1: bytes = (concat encoded_tuple_buffer%19#0 0x04) + let encoded_tuple_buffer%19#2: bytes = (concat encoded_tuple_buffer%19#1 tmp%9#0) + let is_true%20#0: uint64 = (getbit tmp%10#0 0u) + let encoded_tuple_buffer%19#3: any = (setbit encoded_tuple_buffer%19#2 9u is_true%20#0) + let is_true%21#0: uint64 = (getbit tmp%11#0 0u) + let encoded_tuple_buffer%19#4: any = (setbit encoded_tuple_buffer%19#3 10u is_true%21#0) + let is_true%22#0: uint64 = (getbit tmp%12#0 0u) + let encoded_tuple_buffer%19#5: any = (setbit encoded_tuple_buffer%19#4 11u is_true%22#0) + let is_true%23#0: uint64 = (getbit tmp%13#0 0u) + let encoded_tuple_buffer%19#6: any = (setbit encoded_tuple_buffer%19#5 12u is_true%23#0) + let is_true%24#0: uint64 = (getbit tmp%14#0 0u) + let encoded_tuple_buffer%19#7: any = (setbit encoded_tuple_buffer%19#6 13u is_true%24#0) + let is_true%25#0: uint64 = (getbit tmp%15#0 0u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u is_true%25#0) + let is_true%26#0: uint64 = (getbit tmp%16#0 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u is_true%26#0) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 tmp%17#0) + let encoded_tuple_buffer%19#11: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let boolean_packing#0: bytes = encoded_tuple_buffer%19#11 + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let item0%28#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let item1%30#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let item2%32#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let item3%34#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let item4%36#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let item5%38#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let item6%40#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let item7%42#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let item8%44#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let item9%46#0: any = (setbit 0x00 0u is_true%45#0) + let item10%47#0: bytes = (extract3 boolean_packing#0 3u 1u) + let a#0: bytes = item0%28#0 + let b#0: any = item1%30#0 + let c#0: any = item2%32#0 + let d#0: any = item3%34#0 + let e#0: any = item4%36#0 + let f#0: any = item5%38#0 + let g#0: any = item6%40#0 + let h#0: any = item7%42#0 + let i#0: any = item8%44#0 + let j#0: any = item9%46#0 + let k#0: bytes = item10%47#0 + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + let ternary_result%53#0: any = b#0 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + let ternary_result%55#0: any = d#0 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + let ternary_result%57#0: any = e#0 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + let ternary_result%59#0: any = f#0 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + let ternary_result%61#0: any = g#0 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + let ternary_result%63#0: any = i#0 + goto block@13 + block@12: // ternary_false_L39 + let ternary_result%63#1: any = j#0 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(ternary_result%63#0 <- block@11, ternary_result%63#1 <- block@12) + let ternary_result%61#1: bytes = ternary_result%63#2 + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(ternary_result%61#0 <- block@9, ternary_result%61#1 <- block@13) + let ternary_result%59#1: bytes = ternary_result%61#2 + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(ternary_result%59#0 <- block@7, ternary_result%59#1 <- block@14) + let ternary_result%57#1: bytes = ternary_result%59#2 + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@5, ternary_result%57#1 <- block@15) + let ternary_result%55#1: bytes = ternary_result%57#2 + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(ternary_result%55#0 <- block@3, ternary_result%55#1 <- block@16) + let ternary_result%53#1: bytes = ternary_result%55#2 + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(ternary_result%53#0 <- block@1, ternary_result%53#1 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + let ternary_result%66#0: any = c#0 + goto block@21 + block@20: // ternary_false_L40 + let ternary_result%66#1: any = h#0 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(ternary_result%66#0 <- block@19, ternary_result%66#1 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let current_tail_offset%90#0: uint64 = 4u + let encoded_tuple_buffer%91#0: bytes = 0x + let encoded_tuple_buffer%91#1: bytes = (concat encoded_tuple_buffer%91#0 item0%70#0) + let encoded_tuple_buffer%91#2: bytes = (concat encoded_tuple_buffer%91#1 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (tuple_assignment%100#0: uint64, tuple_assignment%101#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let total#0: uint64 = tuple_assignment%100#0 + let concat#0: bytes = tuple_assignment%101#0 + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let item0%0#0: bytes = (extract3 test_tuple#0 0u 1u) + let item1%1#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let item2%5#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let item3%9#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let item4%10#0: bytes = (extract3 test_tuple#0 6u 1u) + let a#0: bytes = item0%0#0 + let b#0: bytes = item1%1#0 + let c#0: bytes = item2%5#0 + let d#0: bytes = item3%9#0 + let e#0: bytes = item4%10#0 + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_1.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..b85cb9e977 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_1.ir @@ -0,0 +1,208 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let encoded_tuple_buffer%1#1: bytes = (concat 0x 0x01) + let encoded_tuple_buffer%1#2: bytes = (concat encoded_tuple_buffer%1#1 0x02) + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#2 value_as_uint16%3#0) + let current_tail_offset%0#1: uint64 = (+ 7u 7u) + let value_as_bytes%5#0: bytes = (itob current_tail_offset%0#1) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let current_tail_offset%0#2: uint64 = (+ current_tail_offset%0#1 7u) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#1: bytes = (concat 0x 0x04) + let encoded_tuple_buffer%19#2: bytes = (concat encoded_tuple_buffer%19#1 0x80) + let is_true%20#0: uint64 = (getbit 0x00 0u) + let encoded_tuple_buffer%19#3: any = (setbit encoded_tuple_buffer%19#2 9u is_true%20#0) + let is_true%21#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%19#4: any = (setbit encoded_tuple_buffer%19#3 10u is_true%21#0) + let is_true%22#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%19#5: any = (setbit encoded_tuple_buffer%19#4 11u is_true%22#0) + let is_true%23#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%19#6: any = (setbit encoded_tuple_buffer%19#5 12u is_true%23#0) + let is_true%24#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%19#7: any = (setbit encoded_tuple_buffer%19#6 13u is_true%24#0) + let is_true%25#0: uint64 = (getbit 0x00 0u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u is_true%25#0) + let is_true%26#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u is_true%26#0) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#1: bytes = (concat 0x item0%70#0) + let encoded_tuple_buffer%91#2: bytes = (concat encoded_tuple_buffer%91#1 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_10.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_10.ir new file mode 100644 index 0000000000..dc0c7bca45 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_10.ir @@ -0,0 +1,187 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#10: bytes = (concat 0x04bd 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_11.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_11.ir new file mode 100644 index 0000000000..61186e6448 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_11.ir @@ -0,0 +1,186 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let boolean_packing#0: bytes = (concat 0x04bd80 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_12.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_12.ir new file mode 100644 index 0000000000..74c2743263 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_12.ir @@ -0,0 +1,185 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%27#0: uint64 = (== 0x04bd8010 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 0x04bd8010 0u 1u) + let is_true%29#0: uint64 = (getbit 0x04bd8010 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit 0x04bd8010 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit 0x04bd8010 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit 0x04bd8010 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit 0x04bd8010 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit 0x04bd8010 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit 0x04bd8010 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit 0x04bd8010 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit 0x04bd8010 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 0x04bd8010 3u 1u) + let tmp%48#0: bytes = (extract3 0x04bd8010 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 0x04bd8010 0u 1u) + let is_true%71#0: uint64 = (getbit 0x04bd8010 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit 0x04bd8010 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit 0x04bd8010 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit 0x04bd8010 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit 0x04bd8010 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit 0x04bd8010 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit 0x04bd8010 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit 0x04bd8010 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit 0x04bd8010 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 0x04bd8010 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_13.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_13.ir new file mode 100644 index 0000000000..6d68d47abe --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_13.ir @@ -0,0 +1,160 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let b#0: any = (setbit 0x00 0u 1u) + let c#0: any = (setbit 0x00 0u 0u) + let d#0: any = (setbit 0x00 0u 1u) + let e#0: any = (setbit 0x00 0u 1u) + let f#0: any = (setbit 0x00 0u 1u) + let g#0: any = (setbit 0x00 0u 1u) + let h#0: any = (setbit 0x00 0u 0u) + let i#0: any = (setbit 0x00 0u 1u) + let j#0: any = (setbit 0x00 0u 1u) + let tmp%49#0: uint64 = (== 0x10 0x10) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item1%72#0: any = (setbit 0x00 0u 1u) + let item2%74#0: any = (setbit 0x00 0u 0u) + let item3%76#0: any = (setbit 0x00 0u 1u) + let item4%78#0: any = (setbit 0x00 0u 1u) + let item5%80#0: any = (setbit 0x00 0u 1u) + let item6%82#0: any = (setbit 0x00 0u 1u) + let item7%84#0: any = (setbit 0x00 0u 0u) + let item8%86#0: any = (setbit 0x00 0u 1u) + let item9%88#0: any = (setbit 0x00 0u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat 0x04 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_14.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_14.ir new file mode 100644 index 0000000000..7ea1dc00d0 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_14.ir @@ -0,0 +1,149 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let b#0: any = 0x80 + let c#0: any = 0x00 + let d#0: any = 0x80 + let e#0: any = 0x80 + let f#0: any = 0x80 + let g#0: any = 0x80 + let h#0: any = 0x00 + let i#0: any = 0x80 + let j#0: any = 0x80 + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== 0x80 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== 0x80 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== 0x80 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== 0x80 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== 0x80 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== 0x80 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= 0x00 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#2: bytes = (concat 0x04 0x80) + let is_true%92#0: uint64 = (getbit 0x00 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit 0x00 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit 0x80 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_15.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_15.ir new file mode 100644 index 0000000000..3ed0eec77d --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_15.ir @@ -0,0 +1,99 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let b#0: any = 0x80 + let c#0: any = 0x00 + let d#0: any = 0x80 + let e#0: any = 0x80 + let f#0: any = 0x80 + let g#0: any = 0x80 + let h#0: any = 0x00 + let i#0: any = 0x80 + let j#0: any = 0x80 + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + goto block@13 + block@13: // ternary_merge_L39 + goto block@14 + block@14: // ternary_merge_L39 + goto block@15 + block@15: // ternary_merge_L39 + goto block@16 + block@16: // ternary_merge_L39 + goto block@17 + block@17: // ternary_merge_L39 + goto block@18 + block@18: // ternary_merge_L39 + let tmp%64#0: uint64 = (!= j#0 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + goto block@21 + block@21: // ternary_merge_L40 + let tmp%67#0: uint64 = (== h#0 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#3: any = (setbit 0x0480 9u 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u 1u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u 1u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u 1u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u 1u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u 1u) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_16.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_16.ir new file mode 100644 index 0000000000..4728280b48 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_16.ir @@ -0,0 +1,75 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%64#0: uint64 = (!= 0x80 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%67#0: uint64 = (== 0x00 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#4: any = (setbit 0x0480 10u 1u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u 1u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u 1u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u 1u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u 1u) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_17.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_17.ir new file mode 100644 index 0000000000..090140ca5d --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_17.ir @@ -0,0 +1,70 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#5: any = (setbit 0x04a0 11u 1u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u 1u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u 1u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u 1u) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_18.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_18.ir new file mode 100644 index 0000000000..7c425230d2 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_18.ir @@ -0,0 +1,69 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#6: any = (setbit 0x04b0 12u 1u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u 1u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u 1u) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_19.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_19.ir new file mode 100644 index 0000000000..c43a02845c --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_19.ir @@ -0,0 +1,68 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#7: any = (setbit 0x04b8 13u 1u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u 1u) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_2.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..e21bb05db2 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_2.ir @@ -0,0 +1,197 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let encoded_tuple_buffer%1#2: bytes = (concat 0x01 0x02) + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat encoded_tuple_buffer%1#2 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let current_tail_offset%0#2: uint64 = (+ 14u 7u) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#2: bytes = (concat 0x04 0x80) + let encoded_tuple_buffer%19#3: any = (setbit encoded_tuple_buffer%19#2 9u 0u) + let encoded_tuple_buffer%19#4: any = (setbit encoded_tuple_buffer%19#3 10u 1u) + let encoded_tuple_buffer%19#5: any = (setbit encoded_tuple_buffer%19#4 11u 1u) + let encoded_tuple_buffer%19#6: any = (setbit encoded_tuple_buffer%19#5 12u 1u) + let encoded_tuple_buffer%19#7: any = (setbit encoded_tuple_buffer%19#6 13u 1u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_20.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_20.ir new file mode 100644 index 0000000000..2e3f220d71 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_20.ir @@ -0,0 +1,67 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#8: any = (setbit 0x04bc 14u 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u 1u) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_21.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_21.ir new file mode 100644 index 0000000000..2e96878f5f --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_21.ir @@ -0,0 +1,66 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#9: any = (setbit 0x04bc 15u 1u) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_22.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_22.ir new file mode 100644 index 0000000000..b00c885a1c --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_22.ir @@ -0,0 +1,65 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#10: bytes = (concat 0x04bd 0x80) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_23.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_23.ir new file mode 100644 index 0000000000..e28fa68903 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_23.ir @@ -0,0 +1,64 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let encoded_tuple_buffer%91#11: bytes = (concat 0x04bd80 0x10) + let tmp%99#0: uint64 = (== 0x04bd8010 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_24.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_24.ir new file mode 100644 index 0000000000..28afe935bd --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_24.ir @@ -0,0 +1,63 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let tmp%99#0: uint64 = (== 0x04bd8010 0x04bd8010) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_25.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_25.ir new file mode 100644 index 0000000000..682545cab7 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_25.ir @@ -0,0 +1,61 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let tmp%50#0: uint64 = (btoi 0x04) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%68#0: uint64 = (btoi 0x10) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_3.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_3.ir new file mode 100644 index 0000000000..22c6ab0a9d --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_3.ir @@ -0,0 +1,194 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#3: any = (setbit 0x0480 9u 0u) + let encoded_tuple_buffer%19#4: any = (setbit encoded_tuple_buffer%19#3 10u 1u) + let encoded_tuple_buffer%19#5: any = (setbit encoded_tuple_buffer%19#4 11u 1u) + let encoded_tuple_buffer%19#6: any = (setbit encoded_tuple_buffer%19#5 12u 1u) + let encoded_tuple_buffer%19#7: any = (setbit encoded_tuple_buffer%19#6 13u 1u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_4.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..57b75e4e59 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_4.ir @@ -0,0 +1,193 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#4: any = (setbit 0x0480 10u 1u) + let encoded_tuple_buffer%19#5: any = (setbit encoded_tuple_buffer%19#4 11u 1u) + let encoded_tuple_buffer%19#6: any = (setbit encoded_tuple_buffer%19#5 12u 1u) + let encoded_tuple_buffer%19#7: any = (setbit encoded_tuple_buffer%19#6 13u 1u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_5.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..4e1f94ea63 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_5.ir @@ -0,0 +1,192 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#5: any = (setbit 0x04a0 11u 1u) + let encoded_tuple_buffer%19#6: any = (setbit encoded_tuple_buffer%19#5 12u 1u) + let encoded_tuple_buffer%19#7: any = (setbit encoded_tuple_buffer%19#6 13u 1u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_6.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..d3856162de --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_6.ir @@ -0,0 +1,191 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#6: any = (setbit 0x04b0 12u 1u) + let encoded_tuple_buffer%19#7: any = (setbit encoded_tuple_buffer%19#6 13u 1u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_7.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_7.ir new file mode 100644 index 0000000000..6b4ec69f8f --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_7.ir @@ -0,0 +1,190 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#7: any = (setbit 0x04b8 13u 1u) + let encoded_tuple_buffer%19#8: any = (setbit encoded_tuple_buffer%19#7 14u 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_8.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_8.ir new file mode 100644 index 0000000000..50b3f9a9a1 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_8.ir @@ -0,0 +1,189 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#8: any = (setbit 0x04bc 14u 0u) + let encoded_tuple_buffer%19#9: any = (setbit encoded_tuple_buffer%19#8 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_9.ir b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_9.ir new file mode 100644 index 0000000000..214e88c280 --- /dev/null +++ b/examples/arc4_types/out/tuples_Arc4TuplesTypeContract.ssa.opt_pass_9.ir @@ -0,0 +1,188 @@ +contract examples.arc4_types.tuples.Arc4TuplesTypeContract: + program approval: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.approval_program() -> uint64: + block@0: // L14 + let value_as_bytes%2#0: bytes = (itob 7u) + let value_as_uint16%3#0: bytes = ((extract 6 2) value_as_bytes%2#0) + let encoded_tuple_buffer%1#3: bytes = (concat 0x0102 value_as_uint16%3#0) + let value_as_bytes%5#0: bytes = (itob 14u) + let value_as_uint16%6#0: bytes = ((extract 6 2) value_as_bytes%5#0) + let encoded_tuple_buffer%1#4: bytes = (concat encoded_tuple_buffer%1#3 value_as_uint16%6#0) + let encoded_tuple_buffer%1#5: bytes = (concat encoded_tuple_buffer%1#4 0xff) + let encoded_tuple_buffer%1#6: bytes = (concat encoded_tuple_buffer%1#5 "\x00\x05hello") + let my_tuple#0: bytes = (concat encoded_tuple_buffer%1#6 "\x00\x05world") + let tmp%8#0: uint64 = (== my_tuple#0 0x01020007000eff000568656c6c6f0005776f726c64) + (assert tmp%8#0) + let encoded_tuple_buffer%19#9: any = (setbit 0x04bc 15u 1u) + let encoded_tuple_buffer%19#10: bytes = (concat encoded_tuple_buffer%19#9 0x80) + let boolean_packing#0: bytes = (concat encoded_tuple_buffer%19#10 0x10) + let tmp%27#0: uint64 = (== boolean_packing#0 0x04bd8010) + (assert tmp%27#0) + let a#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%29#0: uint64 = (getbit boolean_packing#0 8u) + let b#0: any = (setbit 0x00 0u is_true%29#0) + let is_true%31#0: uint64 = (getbit boolean_packing#0 9u) + let c#0: any = (setbit 0x00 0u is_true%31#0) + let is_true%33#0: uint64 = (getbit boolean_packing#0 10u) + let d#0: any = (setbit 0x00 0u is_true%33#0) + let is_true%35#0: uint64 = (getbit boolean_packing#0 11u) + let e#0: any = (setbit 0x00 0u is_true%35#0) + let is_true%37#0: uint64 = (getbit boolean_packing#0 12u) + let f#0: any = (setbit 0x00 0u is_true%37#0) + let is_true%39#0: uint64 = (getbit boolean_packing#0 13u) + let g#0: any = (setbit 0x00 0u is_true%39#0) + let is_true%41#0: uint64 = (getbit boolean_packing#0 14u) + let h#0: any = (setbit 0x00 0u is_true%41#0) + let is_true%43#0: uint64 = (getbit boolean_packing#0 15u) + let i#0: any = (setbit 0x00 0u is_true%43#0) + let is_true%45#0: uint64 = (getbit boolean_packing#0 16u) + let j#0: any = (setbit 0x00 0u is_true%45#0) + let k#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%48#0: bytes = (extract3 boolean_packing#0 3u 1u) + let tmp%49#0: uint64 = (== tmp%48#0 k#0) + (assert tmp%49#0) + let tmp%50#0: uint64 = (btoi a#0) + let tmp%51#0: uint64 = (== tmp%50#0 4u) + (assert tmp%51#0) // a is 4 + let tmp%52#0: uint64 = (== b#0 0x00) + goto tmp%52#0 ? block@1 : block@2 + block@1: // ternary_true_L39 + goto block@18 + block@2: // ternary_false_L39 + let tmp%54#0: uint64 = (== d#0 0x00) + goto tmp%54#0 ? block@3 : block@4 + block@3: // ternary_true_L39 + goto block@17 + block@4: // ternary_false_L39 + let tmp%56#0: uint64 = (== e#0 0x00) + goto tmp%56#0 ? block@5 : block@6 + block@5: // ternary_true_L39 + goto block@16 + block@6: // ternary_false_L39 + let tmp%58#0: uint64 = (== f#0 0x00) + goto tmp%58#0 ? block@7 : block@8 + block@7: // ternary_true_L39 + goto block@15 + block@8: // ternary_false_L39 + let tmp%60#0: uint64 = (== g#0 0x00) + goto tmp%60#0 ? block@9 : block@10 + block@9: // ternary_true_L39 + goto block@14 + block@10: // ternary_false_L39 + let tmp%62#0: uint64 = (== i#0 0x00) + goto tmp%62#0 ? block@11 : block@12 + block@11: // ternary_true_L39 + goto block@13 + block@12: // ternary_false_L39 + goto block@13 + block@13: // ternary_merge_L39 + let ternary_result%63#2: bytes = φ(i#0 <- block@11, j#0 <- block@12) + goto block@14 + block@14: // ternary_merge_L39 + let ternary_result%61#2: bytes = φ(g#0 <- block@9, ternary_result%63#2 <- block@13) + goto block@15 + block@15: // ternary_merge_L39 + let ternary_result%59#2: bytes = φ(f#0 <- block@7, ternary_result%61#2 <- block@14) + goto block@16 + block@16: // ternary_merge_L39 + let ternary_result%57#2: bytes = φ(e#0 <- block@5, ternary_result%59#2 <- block@15) + goto block@17 + block@17: // ternary_merge_L39 + let ternary_result%55#2: bytes = φ(d#0 <- block@3, ternary_result%57#2 <- block@16) + goto block@18 + block@18: // ternary_merge_L39 + let ternary_result%53#2: bytes = φ(b#0 <- block@1, ternary_result%55#2 <- block@17) + let tmp%64#0: uint64 = (!= ternary_result%53#2 0x00) + (assert tmp%64#0) // b,d,e,f,g,i,j are true + let tmp%65#0: uint64 = (!= c#0 0x00) + goto tmp%65#0 ? block@19 : block@20 + block@19: // ternary_true_L40 + goto block@21 + block@20: // ternary_false_L40 + goto block@21 + block@21: // ternary_merge_L40 + let ternary_result%66#2: bytes = φ(c#0 <- block@19, h#0 <- block@20) + let tmp%67#0: uint64 = (== ternary_result%66#2 0x00) + (assert tmp%67#0) // c and h are false + let tmp%68#0: uint64 = (btoi k#0) + let tmp%69#0: uint64 = (== tmp%68#0 16u) + (assert tmp%69#0) // k is 16 + let item0%70#0: bytes = (extract3 boolean_packing#0 0u 1u) + let is_true%71#0: uint64 = (getbit boolean_packing#0 8u) + let item1%72#0: any = (setbit 0x00 0u is_true%71#0) + let is_true%73#0: uint64 = (getbit boolean_packing#0 9u) + let item2%74#0: any = (setbit 0x00 0u is_true%73#0) + let is_true%75#0: uint64 = (getbit boolean_packing#0 10u) + let item3%76#0: any = (setbit 0x00 0u is_true%75#0) + let is_true%77#0: uint64 = (getbit boolean_packing#0 11u) + let item4%78#0: any = (setbit 0x00 0u is_true%77#0) + let is_true%79#0: uint64 = (getbit boolean_packing#0 12u) + let item5%80#0: any = (setbit 0x00 0u is_true%79#0) + let is_true%81#0: uint64 = (getbit boolean_packing#0 13u) + let item6%82#0: any = (setbit 0x00 0u is_true%81#0) + let is_true%83#0: uint64 = (getbit boolean_packing#0 14u) + let item7%84#0: any = (setbit 0x00 0u is_true%83#0) + let is_true%85#0: uint64 = (getbit boolean_packing#0 15u) + let item8%86#0: any = (setbit 0x00 0u is_true%85#0) + let is_true%87#0: uint64 = (getbit boolean_packing#0 16u) + let item9%88#0: any = (setbit 0x00 0u is_true%87#0) + let item10%89#0: bytes = (extract3 boolean_packing#0 3u 1u) + let encoded_tuple_buffer%91#2: bytes = (concat item0%70#0 item1%72#0) + let is_true%92#0: uint64 = (getbit item2%74#0 0u) + let encoded_tuple_buffer%91#3: any = (setbit encoded_tuple_buffer%91#2 9u is_true%92#0) + let is_true%93#0: uint64 = (getbit item3%76#0 0u) + let encoded_tuple_buffer%91#4: any = (setbit encoded_tuple_buffer%91#3 10u is_true%93#0) + let is_true%94#0: uint64 = (getbit item4%78#0 0u) + let encoded_tuple_buffer%91#5: any = (setbit encoded_tuple_buffer%91#4 11u is_true%94#0) + let is_true%95#0: uint64 = (getbit item5%80#0 0u) + let encoded_tuple_buffer%91#6: any = (setbit encoded_tuple_buffer%91#5 12u is_true%95#0) + let is_true%96#0: uint64 = (getbit item6%82#0 0u) + let encoded_tuple_buffer%91#7: any = (setbit encoded_tuple_buffer%91#6 13u is_true%96#0) + let is_true%97#0: uint64 = (getbit item7%84#0 0u) + let encoded_tuple_buffer%91#8: any = (setbit encoded_tuple_buffer%91#7 14u is_true%97#0) + let is_true%98#0: uint64 = (getbit item8%86#0 0u) + let encoded_tuple_buffer%91#9: any = (setbit encoded_tuple_buffer%91#8 15u is_true%98#0) + let encoded_tuple_buffer%91#10: bytes = (concat encoded_tuple_buffer%91#9 item9%88#0) + let encoded_tuple_buffer%91#11: bytes = (concat encoded_tuple_buffer%91#10 item10%89#0) + let tmp%99#0: uint64 = (== boolean_packing#0 encoded_tuple_buffer%91#11) + (assert tmp%99#0) + let (total#0: uint64, concat#0: bytes) = examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(my_tuple#0) + let tmp%102#0: bytes = ((extract 2 0) concat#0) + let tmp%103#0: uint64 = (== tmp%102#0 "hello world") + (assert tmp%103#0) + let tmp%104#0: uint64 = (== total#0 258u) + (assert tmp%104#0) + return 1u + + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.test_stuff(test_tuple: bytes) -> : + block@0: // L55 + let a#0: bytes = (extract3 test_tuple#0 0u 1u) + let b#0: bytes = (extract3 test_tuple#0 1u 1u) + let item_index%2#0: uint64 = (extract_uint16 test_tuple#0 2u) + let item_length%3#0: uint64 = (extract_uint16 test_tuple#0 item_index%2#0) + let item_length_plus_2%4#0: uint64 = (+ item_length%3#0 2u) + let c#0: bytes = (extract3 test_tuple#0 item_index%2#0 item_length_plus_2%4#0) + let item_index%6#0: uint64 = (extract_uint16 test_tuple#0 4u) + let item_length%7#0: uint64 = (extract_uint16 test_tuple#0 item_index%6#0) + let item_length_plus_2%8#0: uint64 = (+ item_length%7#0 2u) + let d#0: bytes = (extract3 test_tuple#0 item_index%6#0 item_length_plus_2%8#0) + let e#0: bytes = (extract3 test_tuple#0 6u 1u) + let tmp%11#0: uint64 = (btoi a#0) + let tmp%12#0: uint64 = (btoi b#0) + let tmp%13#0: uint64 = (+ tmp%11#0 tmp%12#0) + let tmp%14#0: uint64 = (btoi e#0) + let total#0: uint64 = (+ tmp%13#0 tmp%14#0) + let tmp%15#0: bytes = ((extract 2 0) c#0) + let tmp%16#0: bytes = (concat tmp%15#0 " ") + let tmp%17#0: bytes = ((extract 2 0) d#0) + let text#0: bytes = (concat tmp%16#0 tmp%17#0) + let length%18#0: uint64 = (len text#0) + let value_as_bytes%19#0: bytes = (itob length%18#0) + let value_as_uint16%20#0: bytes = ((extract 6 2) value_as_bytes%19#0) + let tmp%21#0: bytes = (concat value_as_uint16%20#0 text#0) + return total#0 tmp%21#0 + + program clear-state: + subroutine examples.arc4_types.tuples.Arc4TuplesTypeContract.clear_state_program() -> uint64: + block@0: // L51 + return 1u \ No newline at end of file diff --git a/examples/arc4_types/string.py b/examples/arc4_types/string.py new file mode 100644 index 0000000000..2223c4dc8d --- /dev/null +++ b/examples/arc4_types/string.py @@ -0,0 +1,28 @@ +from algopy import Bytes, Contract +from algopy.arc4 import ( + String, +) + + +class Arc4StringTypesContract(Contract): + def approval_program(self) -> bool: + some_bytes = Bytes(b"Hello World!") + + some_bytes_as_string = String.encode(some_bytes) + + some_bytes_as_bytes_again = some_bytes_as_string.decode() + + assert ( + some_bytes != some_bytes_as_string.bytes + ), "Original bytes should not match encoded bytes" + + assert ( + some_bytes == some_bytes_as_string.bytes[2:] + ), "Original bytes should match encoded if we strip the length header" + + assert some_bytes == some_bytes_as_bytes_again + + return True + + def clear_state_program(self) -> bool: + return True diff --git a/examples/arc4_types/structs.py b/examples/arc4_types/structs.py new file mode 100644 index 0000000000..2c95ab776b --- /dev/null +++ b/examples/arc4_types/structs.py @@ -0,0 +1,64 @@ +import typing + +from algopy import Contract, arc4, log, subroutine + +Decimal: typing.TypeAlias = arc4.UFixedNxM[typing.Literal[64], typing.Literal[9]] + + +class Vector(arc4.Struct): + x: Decimal + y: Decimal + + +class Flags(arc4.Struct): + a: arc4.Bool + b: arc4.Bool + c: arc4.Bool + d: arc4.Bool + + +class VectorFlags(arc4.Struct): + vector: Vector + flags: Flags + + +class Arc4StructsTypeContract(Contract): + def approval_program(self) -> bool: + coord_1 = Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) + coord_2 = Vector(x=Decimal("35.382882839"), y=Decimal("150.382884930")) + coord_3 = add(coord_1, coord_2) + for val in (coord_3.x, coord_3.y): + log(val.bytes) + + flags = Flags(a=arc4.Bool(True), b=arc4.Bool(False), c=arc4.Bool(True), d=arc4.Bool(False)) + check(flags) + log(flags.bytes) + + nested_decode(VectorFlags(coord_1, flags)) + + return True + + def clear_state_program(self) -> bool: + return True + + +@subroutine +def add(v1: Vector, v2: Vector) -> Vector: + return Vector( + x=Decimal.encode(v1.x.decode() + v2.x.decode()), + y=Decimal.encode(v1.y.decode() + v2.y.decode()), + ) + + +@subroutine +def check(flags: Flags) -> None: + assert flags.a.decode() + assert not flags.b.decode() + assert flags.c.decode() + assert not flags.d.decode() + + +@subroutine +def nested_decode(vector_flags: VectorFlags) -> None: + assert vector_flags.vector.x.decode() == 35382882839 + assert vector_flags.flags.c.decode() diff --git a/examples/arc4_types/tuples.py b/examples/arc4_types/tuples.py new file mode 100644 index 0000000000..13adf0b178 --- /dev/null +++ b/examples/arc4_types/tuples.py @@ -0,0 +1,61 @@ +import typing + +from algopy import Bytes, Contract, UInt64, subroutine +from algopy.arc4 import Bool, String, Tuple, UInt8 + +TestTuple: typing.TypeAlias = Tuple[UInt8, UInt8, String, String, UInt8] + +TestBooleanPacking: typing.TypeAlias = Tuple[ + UInt8, Bool, Bool, Bool, Bool, Bool, Bool, Bool, Bool, Bool, UInt8 +] + + +class Arc4TuplesTypeContract(Contract): + def approval_program(self) -> bool: + my_tuple = Tuple((UInt8(1), UInt8(2), String("hello"), String("world"), UInt8(255))) + + assert my_tuple == TestTuple.from_bytes( # type: ignore[comparison-overlap] + Bytes.from_hex("01020007000EFF000568656C6C6F0005776F726C64") + ) + boolean_packing = Tuple( + ( + UInt8(4), + Bool(True), + Bool(False), + Bool(True), + Bool(True), + Bool(True), + Bool(True), + Bool(False), + Bool(True), + Bool(True), + UInt8(16), + ) + ) + assert boolean_packing.bytes == Bytes.from_hex("04BD8010") + (a, b, c, d, e, f, g, h, i, j, k) = boolean_packing.decode() + assert boolean_packing[10] == k + assert a.decode() == 4, "a is 4" + assert b and d and e and f and g and i and j, "b,d,e,f,g,i,j are true" + assert not (c or h), "c and h are false" + assert k.decode() == 16, "k is 16" + + assert boolean_packing == TestBooleanPacking.encode(boolean_packing.decode()) + + total, concat = self.test_stuff(my_tuple) + assert concat.decode() == b"hello world" + assert total == 258 + + return True + + def clear_state_program(self) -> bool: + return True + + @subroutine + def test_stuff(self, test_tuple: TestTuple) -> tuple[UInt64, String]: + a, b, c, d, e = test_tuple.decode() + + total = a.decode() + b.decode() + e.decode() + text = c.decode() + b" " + d.decode() + + return total, String.encode(text) diff --git a/examples/asset/algopy.log b/examples/asset/algopy.log index 8044e4601b..96375c52e8 100644 --- a/examples/asset/algopy.log +++ b/examples/asset/algopy.log @@ -1,38 +1,39 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 asset -info: Building AWST for __init__.py -info: Building AWST for asset -info: Building AWST for asset/contract.py -debug: Sealing block@0: // L33 -debug: Terminated block@0: // L33 -debug: Sealing block@0: // L50 -debug: Terminated block@0: // L50 -debug: Sealing block@0: // L14 -debug: Terminated block@0: // L14 +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug asset +debug: Building AWST for __init__.py +debug: Building AWST for asset +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for asset/contract.py +debug: Sealing block@0: // L36 +debug: Terminated block@0: // L36 +debug: Sealing block@0: // L53 +debug: Terminated block@0: // L53 debug: Sealing block@0: // L17 debug: Terminated block@0: // L17 -debug: Sealing block@None: // on_create_L14 -debug: Terminated block@1: // on_create_L14 -debug: Sealing block@2: // entrypoint_L14 -debug: Terminated block@2: // entrypoint_L14 -debug: Sealing block@None: // if_body_L18 -debug: Sealing block@None: // else_body_L18 -debug: Terminated block@3: // if_body_L18 -debug: Sealing block@None: // if_body_L19 -debug: Sealing block@None: // else_body_L19 -debug: Terminated block@4: // if_body_L19 -debug: Terminated block@5: // else_body_L19 +debug: Sealing block@0: // L20 +debug: Terminated block@0: // L20 +debug: Sealing block@None: // on_create_L17 +debug: Terminated block@1: // on_create_L17 +debug: Sealing block@2: // entrypoint_L17 +debug: Terminated block@2: // entrypoint_L17 +debug: Sealing block@None: // if_body_L21 +debug: Sealing block@None: // else_body_L21 +debug: Terminated block@3: // if_body_L21 debug: Sealing block@None: // if_body_L22 debug: Sealing block@None: // else_body_L22 -debug: Terminated block@6: // if_body_L22 -debug: Terminated block@7: // else_body_L22 -debug: Sealing block@8: // after_if_else_L22 -debug: Terminated block@8: // after_if_else_L22 -debug: Sealing block@9: // after_if_else_L19 -debug: Terminated block@9: // after_if_else_L19 -debug: Sealing block@10: // after_if_else_L18 -debug: Terminated block@10: // after_if_else_L18 -debug: Sealing block@0: // L29 -debug: Terminated block@0: // L29 +debug: Terminated block@4: // if_body_L22 +debug: Terminated block@5: // else_body_L22 +debug: Sealing block@None: // if_body_L25 +debug: Sealing block@None: // else_body_L25 +debug: Terminated block@6: // if_body_L25 +debug: Terminated block@7: // else_body_L25 +debug: Sealing block@8: // after_if_else_L25 +debug: Terminated block@8: // after_if_else_L25 +debug: Sealing block@9: // after_if_else_L22 +debug: Terminated block@9: // after_if_else_L22 +debug: Sealing block@10: // after_if_else_L21 +debug: Terminated block@10: // after_if_else_L21 +debug: Sealing block@0: // L32 +debug: Terminated block@0: // L32 debug: Output IR to /examples/asset/out/contract_Reference.ssa.ir info: Optimizing examples.asset.contract.Reference at level 1 debug: Begin optimization pass 1/100 @@ -41,19 +42,21 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump -debug: Replaced predecessor block@8: // after_if_else_L22 with block@6: // if_body_L22 in block@9: // after_if_else_L19 -debug: Merged linear block@8: // after_if_else_L22 into block@6: // if_body_L22 +debug: Replaced predecessor block@8: // after_if_else_L25 with block@6: // if_body_L25 in block@9: // after_if_else_L22 +debug: Merged linear block@8: // after_if_else_L25 into block@6: // if_body_L25 debug: Optimizer: Remove Empty Blocks -debug: Removed empty block: block@9: // after_if_else_L19 +debug: Removed empty block: block@9: // after_if_else_L22 debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.asset.contract.Reference.opt_into_asset debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -64,6 +67,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -74,6 +78,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -84,6 +89,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -95,6 +101,7 @@ debug: Optimizing subroutine examples.asset.contract.Reference.approval_program debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -104,6 +111,7 @@ debug: Optimizing subroutine examples.asset.contract.Reference.opt_into_asset debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -113,6 +121,7 @@ debug: Optimizing subroutine examples.asset.contract.Reference.is_opted_asset debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -122,6 +131,7 @@ debug: Optimizing subroutine examples.asset.contract.Reference.__init__ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -131,6 +141,7 @@ debug: Optimizing subroutine examples.asset.contract.Reference.clear_state_progr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -163,46 +174,130 @@ debug: Coalescing local variables in examples.asset.contract.Reference.clear_sta debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/asset/out/contract_Reference.final.ir debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[6]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[8]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[8]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_if_body@3.ops[1]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_if_body@3.ops[3]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_if_body@3.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_if_body@3.ops[6]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_if_body@3.ops[8]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_if_body@3.ops[8]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_if_body@4.ops[1]: 'store asset#0 to l-stack (copy)' -debug: Replaced main_if_body@4.ops[3]: 'load asset#0 from scratch' with 'load asset#0 from l-stack (no copy)' +debug: Replaced main_if_body@4.ops[3]: 'load asset#0' with 'load asset#0 from l-stack (no copy)' debug: Inserted main_else_body@5.ops[1]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_else_body@5.ops[3]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_else_body@5.ops[3]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_else_body@5.ops[6]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_else_body@5.ops[8]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_else_body@5.ops[8]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[1]: 'store asset#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[3]: 'load asset#0 from scratch' with 'load asset#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[3]: 'load asset#0' with 'load asset#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.asset.contract.Reference.approval_program debug: Inserted opt_into_asset_block@0.ops[7]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced opt_into_asset_block@0.ops[9]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced opt_into_asset_block@0.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted opt_into_asset_block@0.ops[20]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced opt_into_asset_block@0.ops[22]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced opt_into_asset_block@0.ops[22]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted opt_into_asset_block@0.ops[33]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced opt_into_asset_block@0.ops[35]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced opt_into_asset_block@0.ops[35]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted opt_into_asset_block@0.ops[3]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted opt_into_asset_block@0.ops[15]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' -debug: Replaced opt_into_asset_block@0.ops[18]: 'load app_global_get_ex_did_exist%4#0 from scratch' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Replaced opt_into_asset_block@0.ops[18]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' debug: Inserted opt_into_asset_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced opt_into_asset_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted opt_into_asset_block@0.ops[18]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' -debug: Replaced opt_into_asset_block@0.ops[22]: 'load app_global_get_ex_value%3#0 from scratch' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Replaced opt_into_asset_block@0.ops[22]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' debug: Inserted is_opted_asset_block@0.ops[10]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced is_opted_asset_block@0.ops[12]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced is_opted_asset_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[23]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[25]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[35]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[37]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[47]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[49]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[60]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[62]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[73]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[75]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[86]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[88]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[102]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[104]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[117]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[119]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[132]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[134]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[147]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[149]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[162]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[164]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[177]: 'store tmp%44#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[179]: 'load tmp%44#0' with 'load tmp%44#0 from l-stack (no copy)' debug: Inserted is_opted_asset_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' -debug: Replaced is_opted_asset_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0 from scratch' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Replaced is_opted_asset_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[17]: 'store maybe_value_did_exist%4#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[20]: 'load maybe_value_did_exist%4#0' with 'load maybe_value_did_exist%4#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[31]: 'store maybe_value_did_exist%7#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[34]: 'load maybe_value_did_exist%7#0' with 'load maybe_value_did_exist%7#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[44]: 'store maybe_value_did_exist%10#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[47]: 'load maybe_value_did_exist%10#0' with 'load maybe_value_did_exist%10#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[57]: 'store maybe_value_did_exist%13#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[60]: 'load maybe_value_did_exist%13#0' with 'load maybe_value_did_exist%13#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[71]: 'store maybe_value_did_exist%16#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[74]: 'load maybe_value_did_exist%16#0' with 'load maybe_value_did_exist%16#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[85]: 'store maybe_value_did_exist%19#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[88]: 'load maybe_value_did_exist%19#0' with 'load maybe_value_did_exist%19#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[99]: 'store maybe_value_did_exist%22#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[102]: 'load maybe_value_did_exist%22#0' with 'load maybe_value_did_exist%22#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[106]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[109]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[117]: 'store maybe_value_did_exist%26#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[120]: 'load maybe_value_did_exist%26#0' with 'load maybe_value_did_exist%26#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[123]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[126]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[134]: 'store maybe_value_did_exist%30#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[137]: 'load maybe_value_did_exist%30#0' with 'load maybe_value_did_exist%30#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[140]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[143]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[151]: 'store maybe_value_did_exist%34#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[154]: 'load maybe_value_did_exist%34#0' with 'load maybe_value_did_exist%34#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[157]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[160]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[168]: 'store maybe_value_did_exist%38#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[171]: 'load maybe_value_did_exist%38#0' with 'load maybe_value_did_exist%38#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[174]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[177]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[185]: 'store maybe_value_did_exist%42#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[188]: 'load maybe_value_did_exist%42#0' with 'load maybe_value_did_exist%42#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[191]: 'store tmp%43#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[194]: 'load tmp%43#0' with 'load tmp%43#0 from l-stack (no copy)' debug: Inserted is_opted_asset_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' -debug: Replaced is_opted_asset_block@0.ops[9]: 'load app_global_get_ex_value%0#0 from scratch' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' -info: Writing /examples/asset/out/contract.approval.teal -info: Writing /examples/asset/out/contract.approval.debug.teal -info: Writing /examples/asset/out/contract.clear.teal -info: Writing /examples/asset/out/contract.clear.debug.teal +debug: Replaced is_opted_asset_block@0.ops[9]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[20]: 'store maybe_value%3#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[24]: 'load maybe_value%3#0' with 'load maybe_value%3#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[35]: 'store maybe_value%6#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[39]: 'load maybe_value%6#0' with 'load maybe_value%6#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[49]: 'store maybe_value%9#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[53]: 'load maybe_value%9#0' with 'load maybe_value%9#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[63]: 'store maybe_value%12#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[67]: 'load maybe_value%12#0' with 'load maybe_value%12#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[78]: 'store maybe_value%15#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[82]: 'load maybe_value%15#0' with 'load maybe_value%15#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[93]: 'store maybe_value%18#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[97]: 'load maybe_value%18#0' with 'load maybe_value%18#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[126]: 'store maybe_value%25#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[133]: 'load maybe_value%25#0' with 'load maybe_value%25#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[144]: 'store maybe_value%29#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[151]: 'load maybe_value%29#0' with 'load maybe_value%29#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[162]: 'store maybe_value%33#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[169]: 'load maybe_value%33#0' with 'load maybe_value%33#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[180]: 'store maybe_value%37#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[187]: 'load maybe_value%37#0' with 'load maybe_value%37#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[198]: 'store maybe_value%41#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[205]: 'load maybe_value%41#0' with 'load maybe_value%41#0 from l-stack (no copy)' +debug: Inserted is_opted_asset_block@0.ops[108]: 'store maybe_value%21#0 to l-stack (copy)' +debug: Replaced is_opted_asset_block@0.ops[116]: 'load maybe_value%21#0' with 'load maybe_value%21#0 from l-stack (no copy)' +info: Writing asset/out/contract.approval.teal +info: Writing asset/out/contract.approval.debug.teal +info: Writing asset/out/contract.clear.teal +info: Writing asset/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/asset/contract.py b/examples/asset/contract.py index 9671f4c195..0f7ca430b3 100644 --- a/examples/asset/contract.py +++ b/examples/asset/contract.py @@ -1,5 +1,5 @@ from algopy import ( - Asset, + Bytes, Contract, CreateInnerTransaction, Global, @@ -7,7 +7,10 @@ TransactionType, UInt64, subroutine, + log, + bzero, ) +from algopy._reference import Asset class Reference(Contract): @@ -49,3 +52,15 @@ def opt_into_asset(self, asset: Asset) -> None: @subroutine def is_opted_asset(self, asset: Asset) -> None: assert self.asa == asset, "asset self.asa == asset" + assert asset.total == 10000000, "total" + assert asset.decimals == 0, "decimals" + assert not asset.default_frozen, "default frozen" + assert asset.unit_name == b"a", "unit_name" + assert asset.name == b"asset a", "name" + assert asset.url == b"", "URL" + assert asset.metadata_hash == bzero(32), "hash" + assert asset.manager == Global.zero_address(), "manager" + assert asset.reserve == Global.zero_address(), "reserve" + assert asset.freeze == Global.zero_address(), "freeze" + assert asset.clawback == Global.zero_address(), "clawback" + assert asset.creator == Global.creator_address(), "creator" diff --git a/examples/asset/out/contract.approval.debug.teal b/examples/asset/out/contract.approval.debug.teal index f7c4dbd7cd..2aaef1ce3d 100644 --- a/examples/asset/out/contract.approval.debug.teal +++ b/examples/asset/out/contract.approval.debug.teal @@ -13,97 +13,168 @@ main_on_create@1: // Implicit fall through to main_entrypoint@2 // main_entrypoint@2: - txn NumAppArgs // {txn} Transaction.num_app_args() File "asset/contract.py", line 18 - int 1 // tmp%1#0,1 1 File "asset/contract.py", line 18 - == // {==} Transaction.num_app_args() == 1: File "asset/contract.py", line 18 - bz main_after_if_else@10 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 18 - // Implicit fall through to main_if_body@3 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 18 + txn NumAppArgs // {txn} Transaction.num_app_args() File "asset/contract.py", line 21 + int 1 // tmp%1#0,1 1 File "asset/contract.py", line 21 + == // {==} Transaction.num_app_args() == 1: File "asset/contract.py", line 21 + bz main_after_if_else@10 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 21 + // Implicit fall through to main_if_body@3 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 21 main_if_body@3: - txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 19 - byte "opt_in" // tmp%3#0,"opt_in" b"opt_in" File "asset/contract.py", line 19 - == // {==} Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 19 - bz main_else_body@5 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 19 - // Implicit fall through to main_if_body@4 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 19 + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 22 + byte "opt_in" // tmp%3#0,"opt_in" b"opt_in" File "asset/contract.py", line 22 + == // {==} Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 22 + bz main_else_body@5 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 22 + // Implicit fall through to main_if_body@4 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 22 main_if_body@4: - txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 20 - callsub opt_into_asset // self.opt_into_asset(asset) File "asset/contract.py", line 21 + txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 23 + callsub opt_into_asset // self.opt_into_asset(asset) File "asset/contract.py", line 24 b main_after_if_else@10 // main_else_body@5: - txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 22 - byte "is_opted_in" // tmp%5#0,"is_opted_in" b"is_opted_in" File "asset/contract.py", line 22 - == // {==} Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 22 - bz main_else_body@7 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 22 - // Implicit fall through to main_if_body@6 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 22 + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 25 + byte "is_opted_in" // tmp%5#0,"is_opted_in" b"is_opted_in" File "asset/contract.py", line 25 + == // {==} Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 25 + bz main_else_body@7 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 25 + // Implicit fall through to main_if_body@6 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 25 main_if_body@6: - txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 23 - callsub is_opted_asset // self.is_opted_asset(asset) File "asset/contract.py", line 24 + txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 26 + callsub is_opted_asset // self.is_opted_asset(asset) File "asset/contract.py", line 27 b main_after_if_else@10 // main_else_body@7: - err // Expected opt_in or is_opted_in // assert False, "Expected opt_in or is_opted_in" File "asset/contract.py", line 26 + err // Expected opt_in or is_opted_in // assert False, "Expected opt_in or is_opted_in" File "asset/contract.py", line 29 main_after_if_else@10: - int 1 // 1 True File "asset/contract.py", line 27 - return // return True File "asset/contract.py", line 27 + int 1 // 1 True File "asset/contract.py", line 30 + return // return True File "asset/contract.py", line 30 -// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> void: opt_into_asset: - proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "asset/contract.py", line 33 + proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "asset/contract.py", line 36 opt_into_asset_block@0: - txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "asset/contract.py", line 35 - global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "asset/contract.py", line 35 - == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 35 - assert // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 35 - int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 37 - byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 37 - app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 37 - assert // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "asset/contract.py", line 37 - ! // (𝕡) asset#0 | {!} not self.asa File "asset/contract.py", line 37 - assert // (𝕡) asset#0 | assert not self.asa, "ASA already opted in" File "asset/contract.py", line 37 - byte "asa" // (𝕡) asset#0 | "asa" self.asa File "asset/contract.py", line 39 - frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "asset/contract.py", line 33 - app_global_put // (𝕡) asset#0 | self.asa = asset File "asset/contract.py", line 39 - itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "asset/contract.py", line 42 - int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "asset/contract.py", line 43 - itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "asset/contract.py", line 43 - int 0 // (𝕡) asset#0 | 0 0 File "asset/contract.py", line 44 - itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "asset/contract.py", line 44 - global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "asset/contract.py", line 45 - itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "asset/contract.py", line 45 - frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 33 - itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "asset/contract.py", line 46 - itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "asset/contract.py", line 47 + txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "asset/contract.py", line 38 + global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "asset/contract.py", line 38 + == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 38 + assert // Only creator can opt in to ASA // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 38 + int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 40 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 40 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 40 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "asset/contract.py", line 40 + ! // (𝕡) asset#0 | {!} not self.asa File "asset/contract.py", line 40 + assert // ASA already opted in // (𝕡) asset#0 | assert not self.asa, "ASA already opted in" File "asset/contract.py", line 40 + byte "asa" // (𝕡) asset#0 | "asa" self.asa File "asset/contract.py", line 42 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "asset/contract.py", line 36 + app_global_put // (𝕡) asset#0 | self.asa = asset File "asset/contract.py", line 42 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "asset/contract.py", line 45 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "asset/contract.py", line 46 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "asset/contract.py", line 46 + int 0 // (𝕡) asset#0 | 0 0 File "asset/contract.py", line 47 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "asset/contract.py", line 47 + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "asset/contract.py", line 48 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "asset/contract.py", line 48 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 36 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "asset/contract.py", line 49 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "asset/contract.py", line 50 retsub // -// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> void: is_opted_asset: - proto 1 0 // (𝕡) asset#0 | def is_opted_asset(self, asset: Asset) -> None: File "asset/contract.py", line 50 + proto 1 0 // (𝕡) asset#0 | def is_opted_asset(self, asset: Asset) -> None: File "asset/contract.py", line 53 is_opted_asset_block@0: - int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 51 - byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 51 - app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 51 - assert // (𝕡) asset#0 | app_global_get_ex_value%0#0 self.asa File "asset/contract.py", line 51 - frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | app_global_get_ex_value%0#0,asset#0 asset: Asset File "asset/contract.py", line 50 - == // (𝕡) asset#0 | {==} self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 51 - assert // (𝕡) asset#0 | assert self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 51 + int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 54 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 54 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 54 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%0#0 self.asa File "asset/contract.py", line 54 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | app_global_get_ex_value%0#0,asset#0 asset: Asset File "asset/contract.py", line 53 + == // (𝕡) asset#0 | {==} self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 54 + assert // asset self.asa == asset // (𝕡) asset#0 | assert self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 54 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetTotal // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.total File "asset/contract.py", line 55 + assert // asset exists // (𝕡) asset#0 | maybe_value%3#0 asset.total File "asset/contract.py", line 55 + int 10000000 // (𝕡) asset#0 | maybe_value%3#0,10000000 10000000 File "asset/contract.py", line 55 + == // (𝕡) asset#0 | {==} asset.total == 10000000, "total" File "asset/contract.py", line 55 + assert // total // (𝕡) asset#0 | assert asset.total == 10000000, "total" File "asset/contract.py", line 55 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetDecimals // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.decimals File "asset/contract.py", line 56 + assert // asset exists // (𝕡) asset#0 | maybe_value%6#0 asset.decimals File "asset/contract.py", line 56 + ! // (𝕡) asset#0 | {!} asset.decimals == 0, "decimals" File "asset/contract.py", line 56 + assert // decimals // (𝕡) asset#0 | assert asset.decimals == 0, "decimals" File "asset/contract.py", line 56 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetDefaultFrozen // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.default_frozen File "asset/contract.py", line 57 + assert // asset exists // (𝕡) asset#0 | maybe_value%9#0 asset.default_frozen File "asset/contract.py", line 57 + ! // (𝕡) asset#0 | {!} not asset.default_frozen File "asset/contract.py", line 57 + assert // default frozen // (𝕡) asset#0 | assert not asset.default_frozen, "default frozen" File "asset/contract.py", line 57 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetUnitName // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.unit_name File "asset/contract.py", line 58 + assert // asset exists // (𝕡) asset#0 | maybe_value%12#0 asset.unit_name File "asset/contract.py", line 58 + byte "a" // (𝕡) asset#0 | maybe_value%12#0,"a" b"a" File "asset/contract.py", line 58 + == // (𝕡) asset#0 | {==} asset.unit_name == b"a", "unit_name" File "asset/contract.py", line 58 + assert // unit_name // (𝕡) asset#0 | assert asset.unit_name == b"a", "unit_name" File "asset/contract.py", line 58 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetName // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.name File "asset/contract.py", line 59 + assert // asset exists // (𝕡) asset#0 | maybe_value%15#0 asset.name File "asset/contract.py", line 59 + byte "asset a" // (𝕡) asset#0 | maybe_value%15#0,"asset a" b"asset a" File "asset/contract.py", line 59 + == // (𝕡) asset#0 | {==} asset.name == b"asset a", "name" File "asset/contract.py", line 59 + assert // name // (𝕡) asset#0 | assert asset.name == b"asset a", "name" File "asset/contract.py", line 59 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetURL // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.url File "asset/contract.py", line 60 + assert // asset exists // (𝕡) asset#0 | maybe_value%18#0 asset.url File "asset/contract.py", line 60 + byte "" // (𝕡) asset#0 | maybe_value%18#0,"" b"" File "asset/contract.py", line 60 + == // (𝕡) asset#0 | {==} asset.url == b"", "URL" File "asset/contract.py", line 60 + assert // URL // (𝕡) asset#0 | assert asset.url == b"", "URL" File "asset/contract.py", line 60 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetMetadataHash // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.metadata_hash File "asset/contract.py", line 61 + assert // asset exists // (𝕡) asset#0 | maybe_value%21#0 asset.metadata_hash File "asset/contract.py", line 61 + int 32 // (𝕡) asset#0 | maybe_value%21#0,32 32 File "asset/contract.py", line 61 + bzero // (𝕡) asset#0 | maybe_value%21#0,{bzero} bzero(32) File "asset/contract.py", line 61 + == // (𝕡) asset#0 | {==} asset.metadata_hash == bzero(32), "hash" File "asset/contract.py", line 61 + assert // hash // (𝕡) asset#0 | assert asset.metadata_hash == bzero(32), "hash" File "asset/contract.py", line 61 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetManager // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.manager File "asset/contract.py", line 62 + assert // asset exists // (𝕡) asset#0 | maybe_value%25#0 asset.manager File "asset/contract.py", line 62 + global ZeroAddress // (𝕡) asset#0 | maybe_value%25#0,{global} Global.zero_address() File "asset/contract.py", line 62 + == // (𝕡) asset#0 | {==} asset.manager == Global.zero_address(), "manager" File "asset/contract.py", line 62 + assert // manager // (𝕡) asset#0 | assert asset.manager == Global.zero_address(), "manager" File "asset/contract.py", line 62 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetReserve // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.reserve File "asset/contract.py", line 63 + assert // asset exists // (𝕡) asset#0 | maybe_value%29#0 asset.reserve File "asset/contract.py", line 63 + global ZeroAddress // (𝕡) asset#0 | maybe_value%29#0,{global} Global.zero_address() File "asset/contract.py", line 63 + == // (𝕡) asset#0 | {==} asset.reserve == Global.zero_address(), "reserve" File "asset/contract.py", line 63 + assert // reserve // (𝕡) asset#0 | assert asset.reserve == Global.zero_address(), "reserve" File "asset/contract.py", line 63 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetFreeze // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.freeze File "asset/contract.py", line 64 + assert // asset exists // (𝕡) asset#0 | maybe_value%33#0 asset.freeze File "asset/contract.py", line 64 + global ZeroAddress // (𝕡) asset#0 | maybe_value%33#0,{global} Global.zero_address() File "asset/contract.py", line 64 + == // (𝕡) asset#0 | {==} asset.freeze == Global.zero_address(), "freeze" File "asset/contract.py", line 64 + assert // freeze // (𝕡) asset#0 | assert asset.freeze == Global.zero_address(), "freeze" File "asset/contract.py", line 64 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetClawback // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.clawback File "asset/contract.py", line 65 + assert // asset exists // (𝕡) asset#0 | maybe_value%37#0 asset.clawback File "asset/contract.py", line 65 + global ZeroAddress // (𝕡) asset#0 | maybe_value%37#0,{global} Global.zero_address() File "asset/contract.py", line 65 + == // (𝕡) asset#0 | {==} asset.clawback == Global.zero_address(), "clawback" File "asset/contract.py", line 65 + assert // clawback // (𝕡) asset#0 | assert asset.clawback == Global.zero_address(), "clawback" File "asset/contract.py", line 65 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetCreator // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.creator File "asset/contract.py", line 66 + assert // asset exists // (𝕡) asset#0 | maybe_value%41#0 asset.creator File "asset/contract.py", line 66 + global CreatorAddress // (𝕡) asset#0 | maybe_value%41#0,{global} Global.creator_address() File "asset/contract.py", line 66 + == // (𝕡) asset#0 | {==} asset.creator == Global.creator_address(), "creator" File "asset/contract.py", line 66 + assert // creator // (𝕡) asset#0 | assert asset.creator == Global.creator_address(), "creator" File "asset/contract.py", line 66 retsub // -// examples.asset.contract.Reference.__init__() -> : +// examples.asset.contract.Reference.__init__() -> void: __init__: - proto 0 0 // def __init__(self) -> None: File "asset/contract.py", line 14 + proto 0 0 // def __init__(self) -> None: File "asset/contract.py", line 17 __init___block@0: - byte "asa" // "asa" self.asa File "asset/contract.py", line 15 - int 0 // "asa",0 0 File "asset/contract.py", line 15 - app_global_put // self.asa = Asset(0) File "asset/contract.py", line 15 + byte "asa" // "asa" self.asa File "asset/contract.py", line 18 + int 0 // "asa",0 0 File "asset/contract.py", line 18 + app_global_put // self.asa = Asset(0) File "asset/contract.py", line 18 retsub // diff --git a/examples/asset/out/contract.approval.teal b/examples/asset/out/contract.approval.teal index 771ecafbca..347507ffc5 100644 --- a/examples/asset/out/contract.approval.teal +++ b/examples/asset/out/contract.approval.teal @@ -44,7 +44,7 @@ main_after_if_else@10: return -// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> void: opt_into_asset: proto 1 0 @@ -52,13 +52,13 @@ opt_into_asset_block@0: txn Sender global CreatorAddress == - assert + assert // Only creator can opt in to ASA int 0 byte "asa" app_global_get_ex - assert + assert // check value exists ! - assert + assert // ASA already opted in byte "asa" frame_dig -1 app_global_put @@ -75,7 +75,7 @@ opt_into_asset_block@0: retsub -// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> void: is_opted_asset: proto 1 0 @@ -83,14 +83,85 @@ is_opted_asset_block@0: int 0 byte "asa" app_global_get_ex - assert + assert // check value exists frame_dig -1 == - assert + assert // asset self.asa == asset + frame_dig -1 + asset_params_get AssetTotal + assert // asset exists + int 10000000 + == + assert // total + frame_dig -1 + asset_params_get AssetDecimals + assert // asset exists + ! + assert // decimals + frame_dig -1 + asset_params_get AssetDefaultFrozen + assert // asset exists + ! + assert // default frozen + frame_dig -1 + asset_params_get AssetUnitName + assert // asset exists + byte "a" + == + assert // unit_name + frame_dig -1 + asset_params_get AssetName + assert // asset exists + byte "asset a" + == + assert // name + frame_dig -1 + asset_params_get AssetURL + assert // asset exists + byte "" + == + assert // URL + frame_dig -1 + asset_params_get AssetMetadataHash + assert // asset exists + int 32 + bzero + == + assert // hash + frame_dig -1 + asset_params_get AssetManager + assert // asset exists + global ZeroAddress + == + assert // manager + frame_dig -1 + asset_params_get AssetReserve + assert // asset exists + global ZeroAddress + == + assert // reserve + frame_dig -1 + asset_params_get AssetFreeze + assert // asset exists + global ZeroAddress + == + assert // freeze + frame_dig -1 + asset_params_get AssetClawback + assert // asset exists + global ZeroAddress + == + assert // clawback + frame_dig -1 + asset_params_get AssetCreator + assert // asset exists + global CreatorAddress + == + assert // creator retsub -// examples.asset.contract.Reference.__init__() -> : +// examples.asset.contract.Reference.__init__() -> void: __init__: proto 0 0 diff --git a/examples/asset/out/contract.approval_unoptimized.debug.teal b/examples/asset/out/contract.approval_unoptimized.debug.teal index 63a08659cd..34df71a062 100644 --- a/examples/asset/out/contract.approval_unoptimized.debug.teal +++ b/examples/asset/out/contract.approval_unoptimized.debug.teal @@ -13,38 +13,38 @@ main_on_create@1: // Implicit fall through to main_entrypoint@2 // main_entrypoint@2: - txn NumAppArgs // {txn} Transaction.num_app_args() File "asset/contract.py", line 18 - int 1 // tmp%1#0,1 1 File "asset/contract.py", line 18 - == // {==} Transaction.num_app_args() == 1: File "asset/contract.py", line 18 - bz main_after_if_else@10 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 18 - // Implicit fall through to main_if_body@3 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 18 + txn NumAppArgs // {txn} Transaction.num_app_args() File "asset/contract.py", line 21 + int 1 // tmp%1#0,1 1 File "asset/contract.py", line 21 + == // {==} Transaction.num_app_args() == 1: File "asset/contract.py", line 21 + bz main_after_if_else@10 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 21 + // Implicit fall through to main_if_body@3 // if Transaction.num_app_args() == 1: File "asset/contract.py", line 21 main_if_body@3: - txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 19 - byte "opt_in" // tmp%3#0,"opt_in" b"opt_in" File "asset/contract.py", line 19 - == // {==} Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 19 - bz main_else_body@5 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 19 - // Implicit fall through to main_if_body@4 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 19 + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 22 + byte "opt_in" // tmp%3#0,"opt_in" b"opt_in" File "asset/contract.py", line 22 + == // {==} Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 22 + bz main_else_body@5 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 22 + // Implicit fall through to main_if_body@4 // if Transaction.application_args(0) == b"opt_in": File "asset/contract.py", line 22 main_if_body@4: - txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 20 - callsub opt_into_asset // self.opt_into_asset(asset) File "asset/contract.py", line 21 + txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 23 + callsub opt_into_asset // self.opt_into_asset(asset) File "asset/contract.py", line 24 b main_after_if_else@9 // main_else_body@5: - txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 22 - byte "is_opted_in" // tmp%5#0,"is_opted_in" b"is_opted_in" File "asset/contract.py", line 22 - == // {==} Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 22 - bz main_else_body@7 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 22 - // Implicit fall through to main_if_body@6 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 22 + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "asset/contract.py", line 25 + byte "is_opted_in" // tmp%5#0,"is_opted_in" b"is_opted_in" File "asset/contract.py", line 25 + == // {==} Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 25 + bz main_else_body@7 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 25 + // Implicit fall through to main_if_body@6 // elif Transaction.application_args(0) == b"is_opted_in": File "asset/contract.py", line 25 main_if_body@6: - txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 23 - callsub is_opted_asset // self.is_opted_asset(asset) File "asset/contract.py", line 24 + txna Assets 0 // {txna} Transaction.assets(0) File "asset/contract.py", line 26 + callsub is_opted_asset // self.is_opted_asset(asset) File "asset/contract.py", line 27 b main_after_if_else@8 // main_else_body@7: - err // Expected opt_in or is_opted_in // assert False, "Expected opt_in or is_opted_in" File "asset/contract.py", line 26 + err // Expected opt_in or is_opted_in // assert False, "Expected opt_in or is_opted_in" File "asset/contract.py", line 29 main_after_if_else@8: // Implicit fall through to main_after_if_else@9 // @@ -53,63 +53,135 @@ main_after_if_else@9: // Implicit fall through to main_after_if_else@10 // main_after_if_else@10: - int 1 // 1 True File "asset/contract.py", line 27 - return // return True File "asset/contract.py", line 27 + int 1 // 1 True File "asset/contract.py", line 30 + return // return True File "asset/contract.py", line 30 -// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> void: opt_into_asset: - proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "asset/contract.py", line 33 + proto 1 0 // (𝕡) asset#0 | def opt_into_asset(self, asset: Asset) -> None: File "asset/contract.py", line 36 opt_into_asset_block@0: - txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "asset/contract.py", line 35 - global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "asset/contract.py", line 35 - == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 35 - assert // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 35 - int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 37 - byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 37 - app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 37 - assert // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "asset/contract.py", line 37 - ! // (𝕡) asset#0 | {!} not self.asa File "asset/contract.py", line 37 - assert // (𝕡) asset#0 | assert not self.asa, "ASA already opted in" File "asset/contract.py", line 37 - byte "asa" // (𝕡) asset#0 | "asa" self.asa File "asset/contract.py", line 39 - frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "asset/contract.py", line 33 - app_global_put // (𝕡) asset#0 | self.asa = asset File "asset/contract.py", line 39 - itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "asset/contract.py", line 42 - int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "asset/contract.py", line 43 - itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "asset/contract.py", line 43 - int 0 // (𝕡) asset#0 | 0 0 File "asset/contract.py", line 44 - itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "asset/contract.py", line 44 - global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "asset/contract.py", line 45 - itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "asset/contract.py", line 45 - frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 33 - itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "asset/contract.py", line 46 - itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "asset/contract.py", line 47 + txn Sender // (𝕡) asset#0 | {txn} Transaction.sender() File "asset/contract.py", line 38 + global CreatorAddress // (𝕡) asset#0 | tmp%0#0,{global} Global.creator_address() File "asset/contract.py", line 38 + == // (𝕡) asset#0 | {==} Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 38 + assert // Only creator can opt in to ASA // (𝕡) asset#0 | assert Transaction.sender() == Global.creator_address(), "Only creator can opt in to ASA" File "asset/contract.py", line 38 + int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 40 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 40 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 40 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%3#0 self.asa File "asset/contract.py", line 40 + ! // (𝕡) asset#0 | {!} not self.asa File "asset/contract.py", line 40 + assert // ASA already opted in // (𝕡) asset#0 | assert not self.asa, "ASA already opted in" File "asset/contract.py", line 40 + byte "asa" // (𝕡) asset#0 | "asa" self.asa File "asset/contract.py", line 42 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | "asa",asset#0 asset: Asset File "asset/contract.py", line 36 + app_global_put // (𝕡) asset#0 | self.asa = asset File "asset/contract.py", line 42 + itxn_begin // (𝕡) asset#0 | CreateInnerTransaction.begin() File "asset/contract.py", line 45 + int axfer // (𝕡) asset#0 | axfer TransactionType.AssetTransfer File "asset/contract.py", line 46 + itxn_field TypeEnum // (𝕡) asset#0 | CreateInnerTransaction.set_type_enum(TransactionType.AssetTransfer) File "asset/contract.py", line 46 + int 0 // (𝕡) asset#0 | 0 0 File "asset/contract.py", line 47 + itxn_field Fee // (𝕡) asset#0 | CreateInnerTransaction.set_fee(UInt64(0)) File "asset/contract.py", line 47 + global CurrentApplicationAddress // (𝕡) asset#0 | {global} Global.current_application_address() File "asset/contract.py", line 48 + itxn_field AssetReceiver // (𝕡) asset#0 | CreateInnerTransaction.set_asset_receiver(Global.current_application_address()) File "asset/contract.py", line 48 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 36 + itxn_field XferAsset // (𝕡) asset#0 | CreateInnerTransaction.set_xfer_asset(asset.asset_id) File "asset/contract.py", line 49 + itxn_submit // (𝕡) asset#0 | CreateInnerTransaction.submit() File "asset/contract.py", line 50 retsub // -// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> void: is_opted_asset: - proto 1 0 // (𝕡) asset#0 | def is_opted_asset(self, asset: Asset) -> None: File "asset/contract.py", line 50 + proto 1 0 // (𝕡) asset#0 | def is_opted_asset(self, asset: Asset) -> None: File "asset/contract.py", line 53 is_opted_asset_block@0: - int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 51 - byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 51 - app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 51 - assert // (𝕡) asset#0 | app_global_get_ex_value%0#0 self.asa File "asset/contract.py", line 51 - frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | app_global_get_ex_value%0#0,asset#0 asset: Asset File "asset/contract.py", line 50 - == // (𝕡) asset#0 | {==} self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 51 - assert // (𝕡) asset#0 | assert self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 51 + int 0 // (𝕡) asset#0 | 0 self.asa File "asset/contract.py", line 54 + byte "asa" // (𝕡) asset#0 | 0,"asa" self.asa File "asset/contract.py", line 54 + app_global_get_ex // (𝕡) asset#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.asa File "asset/contract.py", line 54 + assert // check value exists // (𝕡) asset#0 | app_global_get_ex_value%0#0 self.asa File "asset/contract.py", line 54 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | app_global_get_ex_value%0#0,asset#0 asset: Asset File "asset/contract.py", line 53 + == // (𝕡) asset#0 | {==} self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 54 + assert // asset self.asa == asset // (𝕡) asset#0 | assert self.asa == asset, "asset self.asa == asset" File "asset/contract.py", line 54 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetTotal // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.total File "asset/contract.py", line 55 + assert // asset exists // (𝕡) asset#0 | maybe_value%3#0 asset.total File "asset/contract.py", line 55 + int 10000000 // (𝕡) asset#0 | maybe_value%3#0,10000000 10000000 File "asset/contract.py", line 55 + == // (𝕡) asset#0 | {==} asset.total == 10000000, "total" File "asset/contract.py", line 55 + assert // total // (𝕡) asset#0 | assert asset.total == 10000000, "total" File "asset/contract.py", line 55 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetDecimals // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.decimals File "asset/contract.py", line 56 + assert // asset exists // (𝕡) asset#0 | maybe_value%6#0 asset.decimals File "asset/contract.py", line 56 + int 0 // (𝕡) asset#0 | maybe_value%6#0,0 0 File "asset/contract.py", line 56 + == // (𝕡) asset#0 | {==} asset.decimals == 0, "decimals" File "asset/contract.py", line 56 + assert // decimals // (𝕡) asset#0 | assert asset.decimals == 0, "decimals" File "asset/contract.py", line 56 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetDefaultFrozen // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.default_frozen File "asset/contract.py", line 57 + assert // asset exists // (𝕡) asset#0 | maybe_value%9#0 asset.default_frozen File "asset/contract.py", line 57 + ! // (𝕡) asset#0 | {!} not asset.default_frozen File "asset/contract.py", line 57 + assert // default frozen // (𝕡) asset#0 | assert not asset.default_frozen, "default frozen" File "asset/contract.py", line 57 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetUnitName // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.unit_name File "asset/contract.py", line 58 + assert // asset exists // (𝕡) asset#0 | maybe_value%12#0 asset.unit_name File "asset/contract.py", line 58 + byte "a" // (𝕡) asset#0 | maybe_value%12#0,"a" b"a" File "asset/contract.py", line 58 + == // (𝕡) asset#0 | {==} asset.unit_name == b"a", "unit_name" File "asset/contract.py", line 58 + assert // unit_name // (𝕡) asset#0 | assert asset.unit_name == b"a", "unit_name" File "asset/contract.py", line 58 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetName // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.name File "asset/contract.py", line 59 + assert // asset exists // (𝕡) asset#0 | maybe_value%15#0 asset.name File "asset/contract.py", line 59 + byte "asset a" // (𝕡) asset#0 | maybe_value%15#0,"asset a" b"asset a" File "asset/contract.py", line 59 + == // (𝕡) asset#0 | {==} asset.name == b"asset a", "name" File "asset/contract.py", line 59 + assert // name // (𝕡) asset#0 | assert asset.name == b"asset a", "name" File "asset/contract.py", line 59 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetURL // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.url File "asset/contract.py", line 60 + assert // asset exists // (𝕡) asset#0 | maybe_value%18#0 asset.url File "asset/contract.py", line 60 + byte "" // (𝕡) asset#0 | maybe_value%18#0,"" b"" File "asset/contract.py", line 60 + == // (𝕡) asset#0 | {==} asset.url == b"", "URL" File "asset/contract.py", line 60 + assert // URL // (𝕡) asset#0 | assert asset.url == b"", "URL" File "asset/contract.py", line 60 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetMetadataHash // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.metadata_hash File "asset/contract.py", line 61 + assert // asset exists // (𝕡) asset#0 | maybe_value%21#0 asset.metadata_hash File "asset/contract.py", line 61 + int 32 // (𝕡) asset#0 | maybe_value%21#0,32 32 File "asset/contract.py", line 61 + bzero // (𝕡) asset#0 | maybe_value%21#0,{bzero} bzero(32) File "asset/contract.py", line 61 + == // (𝕡) asset#0 | {==} asset.metadata_hash == bzero(32), "hash" File "asset/contract.py", line 61 + assert // hash // (𝕡) asset#0 | assert asset.metadata_hash == bzero(32), "hash" File "asset/contract.py", line 61 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetManager // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.manager File "asset/contract.py", line 62 + assert // asset exists // (𝕡) asset#0 | maybe_value%25#0 asset.manager File "asset/contract.py", line 62 + global ZeroAddress // (𝕡) asset#0 | maybe_value%25#0,{global} Global.zero_address() File "asset/contract.py", line 62 + == // (𝕡) asset#0 | {==} asset.manager == Global.zero_address(), "manager" File "asset/contract.py", line 62 + assert // manager // (𝕡) asset#0 | assert asset.manager == Global.zero_address(), "manager" File "asset/contract.py", line 62 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetReserve // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.reserve File "asset/contract.py", line 63 + assert // asset exists // (𝕡) asset#0 | maybe_value%29#0 asset.reserve File "asset/contract.py", line 63 + global ZeroAddress // (𝕡) asset#0 | maybe_value%29#0,{global} Global.zero_address() File "asset/contract.py", line 63 + == // (𝕡) asset#0 | {==} asset.reserve == Global.zero_address(), "reserve" File "asset/contract.py", line 63 + assert // reserve // (𝕡) asset#0 | assert asset.reserve == Global.zero_address(), "reserve" File "asset/contract.py", line 63 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetFreeze // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.freeze File "asset/contract.py", line 64 + assert // asset exists // (𝕡) asset#0 | maybe_value%33#0 asset.freeze File "asset/contract.py", line 64 + global ZeroAddress // (𝕡) asset#0 | maybe_value%33#0,{global} Global.zero_address() File "asset/contract.py", line 64 + == // (𝕡) asset#0 | {==} asset.freeze == Global.zero_address(), "freeze" File "asset/contract.py", line 64 + assert // freeze // (𝕡) asset#0 | assert asset.freeze == Global.zero_address(), "freeze" File "asset/contract.py", line 64 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetClawback // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.clawback File "asset/contract.py", line 65 + assert // asset exists // (𝕡) asset#0 | maybe_value%37#0 asset.clawback File "asset/contract.py", line 65 + global ZeroAddress // (𝕡) asset#0 | maybe_value%37#0,{global} Global.zero_address() File "asset/contract.py", line 65 + == // (𝕡) asset#0 | {==} asset.clawback == Global.zero_address(), "clawback" File "asset/contract.py", line 65 + assert // clawback // (𝕡) asset#0 | assert asset.clawback == Global.zero_address(), "clawback" File "asset/contract.py", line 65 + frame_dig -1 // load asset#0 from parameters (𝕡) asset#0 | asset#0 asset: Asset File "asset/contract.py", line 53 + asset_params_get AssetCreator // (𝕡) asset#0 | {asset_params_get}.0,{asset_params_get}.1 asset.creator File "asset/contract.py", line 66 + assert // asset exists // (𝕡) asset#0 | maybe_value%41#0 asset.creator File "asset/contract.py", line 66 + global CreatorAddress // (𝕡) asset#0 | maybe_value%41#0,{global} Global.creator_address() File "asset/contract.py", line 66 + == // (𝕡) asset#0 | {==} asset.creator == Global.creator_address(), "creator" File "asset/contract.py", line 66 + assert // creator // (𝕡) asset#0 | assert asset.creator == Global.creator_address(), "creator" File "asset/contract.py", line 66 retsub // -// examples.asset.contract.Reference.__init__() -> : +// examples.asset.contract.Reference.__init__() -> void: __init__: - proto 0 0 // def __init__(self) -> None: File "asset/contract.py", line 14 + proto 0 0 // def __init__(self) -> None: File "asset/contract.py", line 17 __init___block@0: - byte "asa" // "asa" self.asa File "asset/contract.py", line 15 - int 0 // "asa",0 0 File "asset/contract.py", line 15 - app_global_put // self.asa = Asset(0) File "asset/contract.py", line 15 + byte "asa" // "asa" self.asa File "asset/contract.py", line 18 + int 0 // "asa",0 0 File "asset/contract.py", line 18 + app_global_put // self.asa = Asset(0) File "asset/contract.py", line 18 retsub // diff --git a/examples/asset/out/contract.approval_unoptimized.teal b/examples/asset/out/contract.approval_unoptimized.teal index 8d79ff16ad..c4c97b5195 100644 --- a/examples/asset/out/contract.approval_unoptimized.teal +++ b/examples/asset/out/contract.approval_unoptimized.teal @@ -48,7 +48,7 @@ main_after_if_else@10: return -// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.opt_into_asset(asset#0: uint64) -> void: opt_into_asset: proto 1 0 @@ -56,13 +56,13 @@ opt_into_asset_block@0: txn Sender global CreatorAddress == - assert + assert // Only creator can opt in to ASA int 0 byte "asa" app_global_get_ex - assert + assert // check value exists ! - assert + assert // ASA already opted in byte "asa" frame_dig -1 app_global_put @@ -79,7 +79,7 @@ opt_into_asset_block@0: retsub -// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> : +// examples.asset.contract.Reference.is_opted_asset(asset#0: uint64) -> void: is_opted_asset: proto 1 0 @@ -87,14 +87,86 @@ is_opted_asset_block@0: int 0 byte "asa" app_global_get_ex - assert + assert // check value exists frame_dig -1 == - assert + assert // asset self.asa == asset + frame_dig -1 + asset_params_get AssetTotal + assert // asset exists + int 10000000 + == + assert // total + frame_dig -1 + asset_params_get AssetDecimals + assert // asset exists + int 0 + == + assert // decimals + frame_dig -1 + asset_params_get AssetDefaultFrozen + assert // asset exists + ! + assert // default frozen + frame_dig -1 + asset_params_get AssetUnitName + assert // asset exists + byte "a" + == + assert // unit_name + frame_dig -1 + asset_params_get AssetName + assert // asset exists + byte "asset a" + == + assert // name + frame_dig -1 + asset_params_get AssetURL + assert // asset exists + byte "" + == + assert // URL + frame_dig -1 + asset_params_get AssetMetadataHash + assert // asset exists + int 32 + bzero + == + assert // hash + frame_dig -1 + asset_params_get AssetManager + assert // asset exists + global ZeroAddress + == + assert // manager + frame_dig -1 + asset_params_get AssetReserve + assert // asset exists + global ZeroAddress + == + assert // reserve + frame_dig -1 + asset_params_get AssetFreeze + assert // asset exists + global ZeroAddress + == + assert // freeze + frame_dig -1 + asset_params_get AssetClawback + assert // asset exists + global ZeroAddress + == + assert // clawback + frame_dig -1 + asset_params_get AssetCreator + assert // asset exists + global CreatorAddress + == + assert // creator retsub -// examples.asset.contract.Reference.__init__() -> : +// examples.asset.contract.Reference.__init__() -> void: __init__: proto 0 0 diff --git a/examples/asset/out/contract.awst b/examples/asset/out/contract.awst index 913d65c83d..752df2219c 100644 --- a/examples/asset/out/contract.awst +++ b/examples/asset/out/contract.awst @@ -1,23 +1,23 @@ contract Reference { globals { - ['asa']: algopy._primitives.Asset + ['asa']: algopy.Asset } constructor() { - this.globals['asa']: algopy._primitives.Asset = reinterpret_cast(0u) + this.globals['asa']: algopy.Asset = reinterpret_cast(0u) } approval_program(): bool { if (txn() == 1u) { if (txna() == 'opt_in') { - asset: algopy._primitives.Asset = reinterpret_cast(txna()) + asset: algopy.Asset = reinterpret_cast(txna()) this::opt_into_asset(asset) } else { if (txna() == 'is_opted_in') { - asset: algopy._primitives.Asset = reinterpret_cast(txna()) + asset: algopy.Asset = reinterpret_cast(txna()) this::is_opted_asset(asset) } else { assert(false, comment="Expected opt_in or is_opted_in") @@ -32,11 +32,11 @@ contract Reference return true } - subroutine opt_into_asset(asset: algopy._primitives.Asset): None + subroutine opt_into_asset(asset: algopy.Asset): None { assert(txn() == global(), comment="Only creator can opt in to ASA") assert(!(reinterpret_cast(this.globals['asa'])), comment="ASA already opted in") - this.globals['asa']: algopy._primitives.Asset = asset + this.globals['asa']: algopy.Asset = asset itxn_begin() itxn_field(axfer) itxn_field(0u) @@ -45,8 +45,20 @@ contract Reference itxn_submit() } - subroutine is_opted_asset(asset: algopy._primitives.Asset): None + subroutine is_opted_asset(asset: algopy.Asset): None { - assert(reinterpret_cast(this.globals['asa']) == reinterpret_cast(asset), comment="asset self.asa == asset") + assert(this.globals['asa'] == asset, comment="asset self.asa == asset") + assert(checked_maybe(asset_params_get(asset)) == 10000000u, comment="total") + assert(checked_maybe(asset_params_get(asset)) == 0u, comment="decimals") + assert(!(checked_maybe(asset_params_get(asset))), comment="default frozen") + assert(checked_maybe(asset_params_get(asset)) == 'a', comment="unit_name") + assert(checked_maybe(asset_params_get(asset)) == 'asset a', comment="name") + assert(checked_maybe(asset_params_get(asset)) == '', comment="URL") + assert(checked_maybe(asset_params_get(asset)) == bzero(32u), comment="hash") + assert(checked_maybe(asset_params_get(asset)) == global(), comment="manager") + assert(checked_maybe(asset_params_get(asset)) == global(), comment="reserve") + assert(checked_maybe(asset_params_get(asset)) == global(), comment="freeze") + assert(checked_maybe(asset_params_get(asset)) == global(), comment="clawback") + assert(checked_maybe(asset_params_get(asset)) == global(), comment="creator") } } \ No newline at end of file diff --git a/examples/asset/out/contract.clear.debug.teal b/examples/asset/out/contract.clear.debug.teal index d8ff07931c..de9a2d2566 100644 --- a/examples/asset/out/contract.clear.debug.teal +++ b/examples/asset/out/contract.clear.debug.teal @@ -4,6 +4,6 @@ // examples.asset.contract.Reference.clear_state_program() -> uint64: main_block@0: - int 1 // 1 True File "asset/contract.py", line 30 - return // return True File "asset/contract.py", line 30 + int 1 // 1 True File "asset/contract.py", line 33 + return // return True File "asset/contract.py", line 33 diff --git a/examples/asset/out/contract.clear_unoptimized.debug.teal b/examples/asset/out/contract.clear_unoptimized.debug.teal index d8ff07931c..de9a2d2566 100644 --- a/examples/asset/out/contract.clear_unoptimized.debug.teal +++ b/examples/asset/out/contract.clear_unoptimized.debug.teal @@ -4,6 +4,6 @@ // examples.asset.contract.Reference.clear_state_program() -> uint64: main_block@0: - int 1 // 1 True File "asset/contract.py", line 30 - return // return True File "asset/contract.py", line 30 + int 1 // 1 True File "asset/contract.py", line 33 + return // return True File "asset/contract.py", line 33 diff --git a/examples/asset/out/contract_Reference.cssa.ir b/examples/asset/out/contract_Reference.cssa.ir index c8ade7cf9d..957b28bd42 100644 --- a/examples/asset/out/contract_Reference.cssa.ir +++ b/examples/asset/out/contract_Reference.cssa.ir @@ -1,39 +1,39 @@ contract examples.asset.contract.Reference: program approval: subroutine examples.asset.contract.Reference.approval_program() -> uint64: - block@0: // L17 + block@0: // L20 let app_id%0#0: uint64 = (txn ApplicationID) goto app_id%0#0 ? block@2 : block@1 - block@1: // on_create_L14 + block@1: // on_create_L17 examples.asset.contract.Reference.__init__() goto block@2 - block@2: // entrypoint_L14 + block@2: // entrypoint_L17 let tmp%1#0: uint64 = (txn NumAppArgs) let tmp%2#0: uint64 = (== tmp%1#0 1u) goto tmp%2#0 ? block@3 : block@10 - block@3: // if_body_L18 + block@3: // if_body_L21 let tmp%3#0: bytes = (txna ApplicationArgs 0) let tmp%4#0: uint64 = (== tmp%3#0 "opt_in") goto tmp%4#0 ? block@4 : block@5 - block@4: // if_body_L19 + block@4: // if_body_L22 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.opt_into_asset(asset#0) goto block@10 - block@5: // else_body_L19 + block@5: // else_body_L22 let tmp%5#0: bytes = (txna ApplicationArgs 0) let tmp%6#0: uint64 = (== tmp%5#0 "is_opted_in") goto tmp%6#0 ? block@6 : block@7 - block@6: // if_body_L22 + block@6: // if_body_L25 let asset#1: uint64 = (txna Assets 0) examples.asset.contract.Reference.is_opted_asset(asset#1) goto block@10 - block@7: // else_body_L22 + block@7: // else_body_L25 fail // Expected opt_in or is_opted_in - block@10: // after_if_else_L18 + block@10: // after_if_else_L21 return 1u subroutine examples.asset.contract.Reference.opt_into_asset(asset: uint64) -> void: - block@0: // L33 + block@0: // L36 let tmp%0#0: bytes = (txn Sender) let tmp%1#0: bytes = (global CreatorAddress) let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) @@ -53,19 +53,73 @@ contract examples.asset.contract.Reference: return subroutine examples.asset.contract.Reference.is_opted_asset(asset: uint64) -> void: - block@0: // L50 + block@0: // L53 let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") (assert app_global_get_ex_did_exist%1#0) // check value exists let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) (assert tmp%2#0) // asset self.asa == asset + let (maybe_value%3#0: uint64, maybe_value_did_exist%4#0: uint64) = ((asset_params_get AssetTotal) asset#0) + (assert maybe_value_did_exist%4#0) // asset exists + let tmp%5#0: uint64 = (== maybe_value%3#0 10000000u) + (assert tmp%5#0) // total + let (maybe_value%6#0: uint64, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetDecimals) asset#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%8#0: uint64 = (! maybe_value%6#0) + (assert tmp%8#0) // decimals + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = ((asset_params_get AssetDefaultFrozen) asset#0) + (assert maybe_value_did_exist%10#0) // asset exists + let tmp%11#0: uint64 = (! maybe_value%9#0) + (assert tmp%11#0) // default frozen + let (maybe_value%12#0: bytes, maybe_value_did_exist%13#0: uint64) = ((asset_params_get AssetUnitName) asset#0) + (assert maybe_value_did_exist%13#0) // asset exists + let tmp%14#0: uint64 = (== maybe_value%12#0 "a") + (assert tmp%14#0) // unit_name + let (maybe_value%15#0: bytes, maybe_value_did_exist%16#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert maybe_value_did_exist%16#0) // asset exists + let tmp%17#0: uint64 = (== maybe_value%15#0 "asset a") + (assert tmp%17#0) // name + let (maybe_value%18#0: bytes, maybe_value_did_exist%19#0: uint64) = ((asset_params_get AssetURL) asset#0) + (assert maybe_value_did_exist%19#0) // asset exists + let tmp%20#0: uint64 = (== maybe_value%18#0 "") + (assert tmp%20#0) // URL + let (maybe_value%21#0: bytes, maybe_value_did_exist%22#0: uint64) = ((asset_params_get AssetMetadataHash) asset#0) + (assert maybe_value_did_exist%22#0) // asset exists + let tmp%23#0: bytes = (bzero 32u) + let tmp%24#0: uint64 = (== maybe_value%21#0 tmp%23#0) + (assert tmp%24#0) // hash + let (maybe_value%25#0: bytes, maybe_value_did_exist%26#0: uint64) = ((asset_params_get AssetManager) asset#0) + (assert maybe_value_did_exist%26#0) // asset exists + let tmp%27#0: bytes = (global ZeroAddress) + let tmp%28#0: uint64 = (== maybe_value%25#0 tmp%27#0) + (assert tmp%28#0) // manager + let (maybe_value%29#0: bytes, maybe_value_did_exist%30#0: uint64) = ((asset_params_get AssetReserve) asset#0) + (assert maybe_value_did_exist%30#0) // asset exists + let tmp%31#0: bytes = (global ZeroAddress) + let tmp%32#0: uint64 = (== maybe_value%29#0 tmp%31#0) + (assert tmp%32#0) // reserve + let (maybe_value%33#0: bytes, maybe_value_did_exist%34#0: uint64) = ((asset_params_get AssetFreeze) asset#0) + (assert maybe_value_did_exist%34#0) // asset exists + let tmp%35#0: bytes = (global ZeroAddress) + let tmp%36#0: uint64 = (== maybe_value%33#0 tmp%35#0) + (assert tmp%36#0) // freeze + let (maybe_value%37#0: bytes, maybe_value_did_exist%38#0: uint64) = ((asset_params_get AssetClawback) asset#0) + (assert maybe_value_did_exist%38#0) // asset exists + let tmp%39#0: bytes = (global ZeroAddress) + let tmp%40#0: uint64 = (== maybe_value%37#0 tmp%39#0) + (assert tmp%40#0) // clawback + let (maybe_value%41#0: bytes, maybe_value_did_exist%42#0: uint64) = ((asset_params_get AssetCreator) asset#0) + (assert maybe_value_did_exist%42#0) // asset exists + let tmp%43#0: bytes = (global CreatorAddress) + let tmp%44#0: uint64 = (== maybe_value%41#0 tmp%43#0) + (assert tmp%44#0) // creator return subroutine examples.asset.contract.Reference.__init__() -> void: - block@0: // L14 + block@0: // L17 (app_global_put "asa" 0u) return program clear-state: subroutine examples.asset.contract.Reference.clear_state_program() -> uint64: - block@0: // L29 + block@0: // L32 return 1u \ No newline at end of file diff --git a/examples/asset/out/contract_Reference.final.ir b/examples/asset/out/contract_Reference.final.ir index 844cff2113..2c73c31197 100644 --- a/examples/asset/out/contract_Reference.final.ir +++ b/examples/asset/out/contract_Reference.final.ir @@ -1,39 +1,39 @@ contract examples.asset.contract.Reference: program approval: subroutine examples.asset.contract.Reference.approval_program() -> uint64: - block@0: // L17 + block@0: // L20 let app_id%0#0: uint64 = (txn ApplicationID) goto app_id%0#0 ? block@2 : block@1 - block@1: // on_create_L14 + block@1: // on_create_L17 examples.asset.contract.Reference.__init__() goto block@2 - block@2: // entrypoint_L14 + block@2: // entrypoint_L17 let tmp%1#0: uint64 = (txn NumAppArgs) let tmp%2#0: uint64 = (== tmp%1#0 1u) goto tmp%2#0 ? block@3 : block@10 - block@3: // if_body_L18 + block@3: // if_body_L21 let tmp%3#0: bytes = (txna ApplicationArgs 0) let tmp%4#0: uint64 = (== tmp%3#0 "opt_in") goto tmp%4#0 ? block@4 : block@5 - block@4: // if_body_L19 + block@4: // if_body_L22 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.opt_into_asset(asset#0) goto block@10 - block@5: // else_body_L19 + block@5: // else_body_L22 let tmp%5#0: bytes = (txna ApplicationArgs 0) let tmp%6#0: uint64 = (== tmp%5#0 "is_opted_in") goto tmp%6#0 ? block@6 : block@7 - block@6: // if_body_L22 + block@6: // if_body_L25 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.is_opted_asset(asset#0) goto block@10 - block@7: // else_body_L22 + block@7: // else_body_L25 fail // Expected opt_in or is_opted_in - block@10: // after_if_else_L18 + block@10: // after_if_else_L21 return 1u subroutine examples.asset.contract.Reference.opt_into_asset(asset: uint64) -> void: - block@0: // L33 + block@0: // L36 let tmp%0#0: bytes = (txn Sender) let tmp%1#0: bytes = (global CreatorAddress) let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) @@ -53,19 +53,73 @@ contract examples.asset.contract.Reference: return subroutine examples.asset.contract.Reference.is_opted_asset(asset: uint64) -> void: - block@0: // L50 + block@0: // L53 let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") (assert app_global_get_ex_did_exist%1#0) // check value exists let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) (assert tmp%2#0) // asset self.asa == asset + let (maybe_value%3#0: uint64, maybe_value_did_exist%4#0: uint64) = ((asset_params_get AssetTotal) asset#0) + (assert maybe_value_did_exist%4#0) // asset exists + let tmp%5#0: uint64 = (== maybe_value%3#0 10000000u) + (assert tmp%5#0) // total + let (maybe_value%6#0: uint64, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetDecimals) asset#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%8#0: uint64 = (! maybe_value%6#0) + (assert tmp%8#0) // decimals + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = ((asset_params_get AssetDefaultFrozen) asset#0) + (assert maybe_value_did_exist%10#0) // asset exists + let tmp%11#0: uint64 = (! maybe_value%9#0) + (assert tmp%11#0) // default frozen + let (maybe_value%12#0: bytes, maybe_value_did_exist%13#0: uint64) = ((asset_params_get AssetUnitName) asset#0) + (assert maybe_value_did_exist%13#0) // asset exists + let tmp%14#0: uint64 = (== maybe_value%12#0 "a") + (assert tmp%14#0) // unit_name + let (maybe_value%15#0: bytes, maybe_value_did_exist%16#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert maybe_value_did_exist%16#0) // asset exists + let tmp%17#0: uint64 = (== maybe_value%15#0 "asset a") + (assert tmp%17#0) // name + let (maybe_value%18#0: bytes, maybe_value_did_exist%19#0: uint64) = ((asset_params_get AssetURL) asset#0) + (assert maybe_value_did_exist%19#0) // asset exists + let tmp%20#0: uint64 = (== maybe_value%18#0 "") + (assert tmp%20#0) // URL + let (maybe_value%21#0: bytes, maybe_value_did_exist%22#0: uint64) = ((asset_params_get AssetMetadataHash) asset#0) + (assert maybe_value_did_exist%22#0) // asset exists + let tmp%23#0: bytes = (bzero 32u) + let tmp%24#0: uint64 = (== maybe_value%21#0 tmp%23#0) + (assert tmp%24#0) // hash + let (maybe_value%25#0: bytes, maybe_value_did_exist%26#0: uint64) = ((asset_params_get AssetManager) asset#0) + (assert maybe_value_did_exist%26#0) // asset exists + let tmp%27#0: bytes = (global ZeroAddress) + let tmp%28#0: uint64 = (== maybe_value%25#0 tmp%27#0) + (assert tmp%28#0) // manager + let (maybe_value%29#0: bytes, maybe_value_did_exist%30#0: uint64) = ((asset_params_get AssetReserve) asset#0) + (assert maybe_value_did_exist%30#0) // asset exists + let tmp%31#0: bytes = (global ZeroAddress) + let tmp%32#0: uint64 = (== maybe_value%29#0 tmp%31#0) + (assert tmp%32#0) // reserve + let (maybe_value%33#0: bytes, maybe_value_did_exist%34#0: uint64) = ((asset_params_get AssetFreeze) asset#0) + (assert maybe_value_did_exist%34#0) // asset exists + let tmp%35#0: bytes = (global ZeroAddress) + let tmp%36#0: uint64 = (== maybe_value%33#0 tmp%35#0) + (assert tmp%36#0) // freeze + let (maybe_value%37#0: bytes, maybe_value_did_exist%38#0: uint64) = ((asset_params_get AssetClawback) asset#0) + (assert maybe_value_did_exist%38#0) // asset exists + let tmp%39#0: bytes = (global ZeroAddress) + let tmp%40#0: uint64 = (== maybe_value%37#0 tmp%39#0) + (assert tmp%40#0) // clawback + let (maybe_value%41#0: bytes, maybe_value_did_exist%42#0: uint64) = ((asset_params_get AssetCreator) asset#0) + (assert maybe_value_did_exist%42#0) // asset exists + let tmp%43#0: bytes = (global CreatorAddress) + let tmp%44#0: uint64 = (== maybe_value%41#0 tmp%43#0) + (assert tmp%44#0) // creator return subroutine examples.asset.contract.Reference.__init__() -> void: - block@0: // L14 + block@0: // L17 (app_global_put "asa" 0u) return program clear-state: subroutine examples.asset.contract.Reference.clear_state_program() -> uint64: - block@0: // L29 + block@0: // L32 return 1u \ No newline at end of file diff --git a/examples/asset/out/contract_Reference.final_unoptimized.ir b/examples/asset/out/contract_Reference.final_unoptimized.ir index 2f7bf3dbc6..8028ca9e46 100644 --- a/examples/asset/out/contract_Reference.final_unoptimized.ir +++ b/examples/asset/out/contract_Reference.final_unoptimized.ir @@ -1,43 +1,43 @@ contract examples.asset.contract.Reference: program approval: subroutine examples.asset.contract.Reference.approval_program() -> uint64: - block@0: // L17 + block@0: // L20 let app_id%0#0: uint64 = (txn ApplicationID) goto app_id%0#0 ? block@2 : block@1 - block@1: // on_create_L14 + block@1: // on_create_L17 examples.asset.contract.Reference.__init__() goto block@2 - block@2: // entrypoint_L14 + block@2: // entrypoint_L17 let tmp%1#0: uint64 = (txn NumAppArgs) let tmp%2#0: uint64 = (== tmp%1#0 1u) goto tmp%2#0 ? block@3 : block@10 - block@3: // if_body_L18 + block@3: // if_body_L21 let tmp%3#0: bytes = (txna ApplicationArgs 0) let tmp%4#0: uint64 = (== tmp%3#0 "opt_in") goto tmp%4#0 ? block@4 : block@5 - block@4: // if_body_L19 + block@4: // if_body_L22 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.opt_into_asset(asset#0) goto block@9 - block@5: // else_body_L19 + block@5: // else_body_L22 let tmp%5#0: bytes = (txna ApplicationArgs 0) let tmp%6#0: uint64 = (== tmp%5#0 "is_opted_in") goto tmp%6#0 ? block@6 : block@7 - block@6: // if_body_L22 + block@6: // if_body_L25 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.is_opted_asset(asset#0) goto block@8 - block@7: // else_body_L22 + block@7: // else_body_L25 fail // Expected opt_in or is_opted_in - block@8: // after_if_else_L22 + block@8: // after_if_else_L25 goto block@9 - block@9: // after_if_else_L19 + block@9: // after_if_else_L22 goto block@10 - block@10: // after_if_else_L18 + block@10: // after_if_else_L21 return 1u subroutine examples.asset.contract.Reference.opt_into_asset(asset: uint64) -> void: - block@0: // L33 + block@0: // L36 let tmp%0#0: bytes = (txn Sender) let tmp%1#0: bytes = (global CreatorAddress) let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) @@ -57,19 +57,73 @@ contract examples.asset.contract.Reference: return subroutine examples.asset.contract.Reference.is_opted_asset(asset: uint64) -> void: - block@0: // L50 + block@0: // L53 let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") (assert app_global_get_ex_did_exist%1#0) // check value exists let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) (assert tmp%2#0) // asset self.asa == asset + let (maybe_value%3#0: uint64, maybe_value_did_exist%4#0: uint64) = ((asset_params_get AssetTotal) asset#0) + (assert maybe_value_did_exist%4#0) // asset exists + let tmp%5#0: uint64 = (== maybe_value%3#0 10000000u) + (assert tmp%5#0) // total + let (maybe_value%6#0: uint64, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetDecimals) asset#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%8#0: uint64 = (== maybe_value%6#0 0u) + (assert tmp%8#0) // decimals + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = ((asset_params_get AssetDefaultFrozen) asset#0) + (assert maybe_value_did_exist%10#0) // asset exists + let tmp%11#0: uint64 = (! maybe_value%9#0) + (assert tmp%11#0) // default frozen + let (maybe_value%12#0: bytes, maybe_value_did_exist%13#0: uint64) = ((asset_params_get AssetUnitName) asset#0) + (assert maybe_value_did_exist%13#0) // asset exists + let tmp%14#0: uint64 = (== maybe_value%12#0 "a") + (assert tmp%14#0) // unit_name + let (maybe_value%15#0: bytes, maybe_value_did_exist%16#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert maybe_value_did_exist%16#0) // asset exists + let tmp%17#0: uint64 = (== maybe_value%15#0 "asset a") + (assert tmp%17#0) // name + let (maybe_value%18#0: bytes, maybe_value_did_exist%19#0: uint64) = ((asset_params_get AssetURL) asset#0) + (assert maybe_value_did_exist%19#0) // asset exists + let tmp%20#0: uint64 = (== maybe_value%18#0 "") + (assert tmp%20#0) // URL + let (maybe_value%21#0: bytes, maybe_value_did_exist%22#0: uint64) = ((asset_params_get AssetMetadataHash) asset#0) + (assert maybe_value_did_exist%22#0) // asset exists + let tmp%23#0: bytes = (bzero 32u) + let tmp%24#0: uint64 = (== maybe_value%21#0 tmp%23#0) + (assert tmp%24#0) // hash + let (maybe_value%25#0: bytes, maybe_value_did_exist%26#0: uint64) = ((asset_params_get AssetManager) asset#0) + (assert maybe_value_did_exist%26#0) // asset exists + let tmp%27#0: bytes = (global ZeroAddress) + let tmp%28#0: uint64 = (== maybe_value%25#0 tmp%27#0) + (assert tmp%28#0) // manager + let (maybe_value%29#0: bytes, maybe_value_did_exist%30#0: uint64) = ((asset_params_get AssetReserve) asset#0) + (assert maybe_value_did_exist%30#0) // asset exists + let tmp%31#0: bytes = (global ZeroAddress) + let tmp%32#0: uint64 = (== maybe_value%29#0 tmp%31#0) + (assert tmp%32#0) // reserve + let (maybe_value%33#0: bytes, maybe_value_did_exist%34#0: uint64) = ((asset_params_get AssetFreeze) asset#0) + (assert maybe_value_did_exist%34#0) // asset exists + let tmp%35#0: bytes = (global ZeroAddress) + let tmp%36#0: uint64 = (== maybe_value%33#0 tmp%35#0) + (assert tmp%36#0) // freeze + let (maybe_value%37#0: bytes, maybe_value_did_exist%38#0: uint64) = ((asset_params_get AssetClawback) asset#0) + (assert maybe_value_did_exist%38#0) // asset exists + let tmp%39#0: bytes = (global ZeroAddress) + let tmp%40#0: uint64 = (== maybe_value%37#0 tmp%39#0) + (assert tmp%40#0) // clawback + let (maybe_value%41#0: bytes, maybe_value_did_exist%42#0: uint64) = ((asset_params_get AssetCreator) asset#0) + (assert maybe_value_did_exist%42#0) // asset exists + let tmp%43#0: bytes = (global CreatorAddress) + let tmp%44#0: uint64 = (== maybe_value%41#0 tmp%43#0) + (assert tmp%44#0) // creator return subroutine examples.asset.contract.Reference.__init__() -> void: - block@0: // L14 + block@0: // L17 (app_global_put "asa" 0u) return program clear-state: subroutine examples.asset.contract.Reference.clear_state_program() -> uint64: - block@0: // L29 + block@0: // L32 return 1u \ No newline at end of file diff --git a/examples/asset/out/contract_Reference.parallel_copies.ir b/examples/asset/out/contract_Reference.parallel_copies.ir index c8ade7cf9d..957b28bd42 100644 --- a/examples/asset/out/contract_Reference.parallel_copies.ir +++ b/examples/asset/out/contract_Reference.parallel_copies.ir @@ -1,39 +1,39 @@ contract examples.asset.contract.Reference: program approval: subroutine examples.asset.contract.Reference.approval_program() -> uint64: - block@0: // L17 + block@0: // L20 let app_id%0#0: uint64 = (txn ApplicationID) goto app_id%0#0 ? block@2 : block@1 - block@1: // on_create_L14 + block@1: // on_create_L17 examples.asset.contract.Reference.__init__() goto block@2 - block@2: // entrypoint_L14 + block@2: // entrypoint_L17 let tmp%1#0: uint64 = (txn NumAppArgs) let tmp%2#0: uint64 = (== tmp%1#0 1u) goto tmp%2#0 ? block@3 : block@10 - block@3: // if_body_L18 + block@3: // if_body_L21 let tmp%3#0: bytes = (txna ApplicationArgs 0) let tmp%4#0: uint64 = (== tmp%3#0 "opt_in") goto tmp%4#0 ? block@4 : block@5 - block@4: // if_body_L19 + block@4: // if_body_L22 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.opt_into_asset(asset#0) goto block@10 - block@5: // else_body_L19 + block@5: // else_body_L22 let tmp%5#0: bytes = (txna ApplicationArgs 0) let tmp%6#0: uint64 = (== tmp%5#0 "is_opted_in") goto tmp%6#0 ? block@6 : block@7 - block@6: // if_body_L22 + block@6: // if_body_L25 let asset#1: uint64 = (txna Assets 0) examples.asset.contract.Reference.is_opted_asset(asset#1) goto block@10 - block@7: // else_body_L22 + block@7: // else_body_L25 fail // Expected opt_in or is_opted_in - block@10: // after_if_else_L18 + block@10: // after_if_else_L21 return 1u subroutine examples.asset.contract.Reference.opt_into_asset(asset: uint64) -> void: - block@0: // L33 + block@0: // L36 let tmp%0#0: bytes = (txn Sender) let tmp%1#0: bytes = (global CreatorAddress) let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) @@ -53,19 +53,73 @@ contract examples.asset.contract.Reference: return subroutine examples.asset.contract.Reference.is_opted_asset(asset: uint64) -> void: - block@0: // L50 + block@0: // L53 let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") (assert app_global_get_ex_did_exist%1#0) // check value exists let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) (assert tmp%2#0) // asset self.asa == asset + let (maybe_value%3#0: uint64, maybe_value_did_exist%4#0: uint64) = ((asset_params_get AssetTotal) asset#0) + (assert maybe_value_did_exist%4#0) // asset exists + let tmp%5#0: uint64 = (== maybe_value%3#0 10000000u) + (assert tmp%5#0) // total + let (maybe_value%6#0: uint64, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetDecimals) asset#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%8#0: uint64 = (! maybe_value%6#0) + (assert tmp%8#0) // decimals + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = ((asset_params_get AssetDefaultFrozen) asset#0) + (assert maybe_value_did_exist%10#0) // asset exists + let tmp%11#0: uint64 = (! maybe_value%9#0) + (assert tmp%11#0) // default frozen + let (maybe_value%12#0: bytes, maybe_value_did_exist%13#0: uint64) = ((asset_params_get AssetUnitName) asset#0) + (assert maybe_value_did_exist%13#0) // asset exists + let tmp%14#0: uint64 = (== maybe_value%12#0 "a") + (assert tmp%14#0) // unit_name + let (maybe_value%15#0: bytes, maybe_value_did_exist%16#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert maybe_value_did_exist%16#0) // asset exists + let tmp%17#0: uint64 = (== maybe_value%15#0 "asset a") + (assert tmp%17#0) // name + let (maybe_value%18#0: bytes, maybe_value_did_exist%19#0: uint64) = ((asset_params_get AssetURL) asset#0) + (assert maybe_value_did_exist%19#0) // asset exists + let tmp%20#0: uint64 = (== maybe_value%18#0 "") + (assert tmp%20#0) // URL + let (maybe_value%21#0: bytes, maybe_value_did_exist%22#0: uint64) = ((asset_params_get AssetMetadataHash) asset#0) + (assert maybe_value_did_exist%22#0) // asset exists + let tmp%23#0: bytes = (bzero 32u) + let tmp%24#0: uint64 = (== maybe_value%21#0 tmp%23#0) + (assert tmp%24#0) // hash + let (maybe_value%25#0: bytes, maybe_value_did_exist%26#0: uint64) = ((asset_params_get AssetManager) asset#0) + (assert maybe_value_did_exist%26#0) // asset exists + let tmp%27#0: bytes = (global ZeroAddress) + let tmp%28#0: uint64 = (== maybe_value%25#0 tmp%27#0) + (assert tmp%28#0) // manager + let (maybe_value%29#0: bytes, maybe_value_did_exist%30#0: uint64) = ((asset_params_get AssetReserve) asset#0) + (assert maybe_value_did_exist%30#0) // asset exists + let tmp%31#0: bytes = (global ZeroAddress) + let tmp%32#0: uint64 = (== maybe_value%29#0 tmp%31#0) + (assert tmp%32#0) // reserve + let (maybe_value%33#0: bytes, maybe_value_did_exist%34#0: uint64) = ((asset_params_get AssetFreeze) asset#0) + (assert maybe_value_did_exist%34#0) // asset exists + let tmp%35#0: bytes = (global ZeroAddress) + let tmp%36#0: uint64 = (== maybe_value%33#0 tmp%35#0) + (assert tmp%36#0) // freeze + let (maybe_value%37#0: bytes, maybe_value_did_exist%38#0: uint64) = ((asset_params_get AssetClawback) asset#0) + (assert maybe_value_did_exist%38#0) // asset exists + let tmp%39#0: bytes = (global ZeroAddress) + let tmp%40#0: uint64 = (== maybe_value%37#0 tmp%39#0) + (assert tmp%40#0) // clawback + let (maybe_value%41#0: bytes, maybe_value_did_exist%42#0: uint64) = ((asset_params_get AssetCreator) asset#0) + (assert maybe_value_did_exist%42#0) // asset exists + let tmp%43#0: bytes = (global CreatorAddress) + let tmp%44#0: uint64 = (== maybe_value%41#0 tmp%43#0) + (assert tmp%44#0) // creator return subroutine examples.asset.contract.Reference.__init__() -> void: - block@0: // L14 + block@0: // L17 (app_global_put "asa" 0u) return program clear-state: subroutine examples.asset.contract.Reference.clear_state_program() -> uint64: - block@0: // L29 + block@0: // L32 return 1u \ No newline at end of file diff --git a/examples/asset/out/contract_Reference.post_ssa.ir b/examples/asset/out/contract_Reference.post_ssa.ir index c8ade7cf9d..957b28bd42 100644 --- a/examples/asset/out/contract_Reference.post_ssa.ir +++ b/examples/asset/out/contract_Reference.post_ssa.ir @@ -1,39 +1,39 @@ contract examples.asset.contract.Reference: program approval: subroutine examples.asset.contract.Reference.approval_program() -> uint64: - block@0: // L17 + block@0: // L20 let app_id%0#0: uint64 = (txn ApplicationID) goto app_id%0#0 ? block@2 : block@1 - block@1: // on_create_L14 + block@1: // on_create_L17 examples.asset.contract.Reference.__init__() goto block@2 - block@2: // entrypoint_L14 + block@2: // entrypoint_L17 let tmp%1#0: uint64 = (txn NumAppArgs) let tmp%2#0: uint64 = (== tmp%1#0 1u) goto tmp%2#0 ? block@3 : block@10 - block@3: // if_body_L18 + block@3: // if_body_L21 let tmp%3#0: bytes = (txna ApplicationArgs 0) let tmp%4#0: uint64 = (== tmp%3#0 "opt_in") goto tmp%4#0 ? block@4 : block@5 - block@4: // if_body_L19 + block@4: // if_body_L22 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.opt_into_asset(asset#0) goto block@10 - block@5: // else_body_L19 + block@5: // else_body_L22 let tmp%5#0: bytes = (txna ApplicationArgs 0) let tmp%6#0: uint64 = (== tmp%5#0 "is_opted_in") goto tmp%6#0 ? block@6 : block@7 - block@6: // if_body_L22 + block@6: // if_body_L25 let asset#1: uint64 = (txna Assets 0) examples.asset.contract.Reference.is_opted_asset(asset#1) goto block@10 - block@7: // else_body_L22 + block@7: // else_body_L25 fail // Expected opt_in or is_opted_in - block@10: // after_if_else_L18 + block@10: // after_if_else_L21 return 1u subroutine examples.asset.contract.Reference.opt_into_asset(asset: uint64) -> void: - block@0: // L33 + block@0: // L36 let tmp%0#0: bytes = (txn Sender) let tmp%1#0: bytes = (global CreatorAddress) let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) @@ -53,19 +53,73 @@ contract examples.asset.contract.Reference: return subroutine examples.asset.contract.Reference.is_opted_asset(asset: uint64) -> void: - block@0: // L50 + block@0: // L53 let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") (assert app_global_get_ex_did_exist%1#0) // check value exists let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) (assert tmp%2#0) // asset self.asa == asset + let (maybe_value%3#0: uint64, maybe_value_did_exist%4#0: uint64) = ((asset_params_get AssetTotal) asset#0) + (assert maybe_value_did_exist%4#0) // asset exists + let tmp%5#0: uint64 = (== maybe_value%3#0 10000000u) + (assert tmp%5#0) // total + let (maybe_value%6#0: uint64, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetDecimals) asset#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%8#0: uint64 = (! maybe_value%6#0) + (assert tmp%8#0) // decimals + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = ((asset_params_get AssetDefaultFrozen) asset#0) + (assert maybe_value_did_exist%10#0) // asset exists + let tmp%11#0: uint64 = (! maybe_value%9#0) + (assert tmp%11#0) // default frozen + let (maybe_value%12#0: bytes, maybe_value_did_exist%13#0: uint64) = ((asset_params_get AssetUnitName) asset#0) + (assert maybe_value_did_exist%13#0) // asset exists + let tmp%14#0: uint64 = (== maybe_value%12#0 "a") + (assert tmp%14#0) // unit_name + let (maybe_value%15#0: bytes, maybe_value_did_exist%16#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert maybe_value_did_exist%16#0) // asset exists + let tmp%17#0: uint64 = (== maybe_value%15#0 "asset a") + (assert tmp%17#0) // name + let (maybe_value%18#0: bytes, maybe_value_did_exist%19#0: uint64) = ((asset_params_get AssetURL) asset#0) + (assert maybe_value_did_exist%19#0) // asset exists + let tmp%20#0: uint64 = (== maybe_value%18#0 "") + (assert tmp%20#0) // URL + let (maybe_value%21#0: bytes, maybe_value_did_exist%22#0: uint64) = ((asset_params_get AssetMetadataHash) asset#0) + (assert maybe_value_did_exist%22#0) // asset exists + let tmp%23#0: bytes = (bzero 32u) + let tmp%24#0: uint64 = (== maybe_value%21#0 tmp%23#0) + (assert tmp%24#0) // hash + let (maybe_value%25#0: bytes, maybe_value_did_exist%26#0: uint64) = ((asset_params_get AssetManager) asset#0) + (assert maybe_value_did_exist%26#0) // asset exists + let tmp%27#0: bytes = (global ZeroAddress) + let tmp%28#0: uint64 = (== maybe_value%25#0 tmp%27#0) + (assert tmp%28#0) // manager + let (maybe_value%29#0: bytes, maybe_value_did_exist%30#0: uint64) = ((asset_params_get AssetReserve) asset#0) + (assert maybe_value_did_exist%30#0) // asset exists + let tmp%31#0: bytes = (global ZeroAddress) + let tmp%32#0: uint64 = (== maybe_value%29#0 tmp%31#0) + (assert tmp%32#0) // reserve + let (maybe_value%33#0: bytes, maybe_value_did_exist%34#0: uint64) = ((asset_params_get AssetFreeze) asset#0) + (assert maybe_value_did_exist%34#0) // asset exists + let tmp%35#0: bytes = (global ZeroAddress) + let tmp%36#0: uint64 = (== maybe_value%33#0 tmp%35#0) + (assert tmp%36#0) // freeze + let (maybe_value%37#0: bytes, maybe_value_did_exist%38#0: uint64) = ((asset_params_get AssetClawback) asset#0) + (assert maybe_value_did_exist%38#0) // asset exists + let tmp%39#0: bytes = (global ZeroAddress) + let tmp%40#0: uint64 = (== maybe_value%37#0 tmp%39#0) + (assert tmp%40#0) // clawback + let (maybe_value%41#0: bytes, maybe_value_did_exist%42#0: uint64) = ((asset_params_get AssetCreator) asset#0) + (assert maybe_value_did_exist%42#0) // asset exists + let tmp%43#0: bytes = (global CreatorAddress) + let tmp%44#0: uint64 = (== maybe_value%41#0 tmp%43#0) + (assert tmp%44#0) // creator return subroutine examples.asset.contract.Reference.__init__() -> void: - block@0: // L14 + block@0: // L17 (app_global_put "asa" 0u) return program clear-state: subroutine examples.asset.contract.Reference.clear_state_program() -> uint64: - block@0: // L29 + block@0: // L32 return 1u \ No newline at end of file diff --git a/examples/asset/out/contract_Reference.ssa.ir b/examples/asset/out/contract_Reference.ssa.ir index ea5b4e3f63..b508b10121 100644 --- a/examples/asset/out/contract_Reference.ssa.ir +++ b/examples/asset/out/contract_Reference.ssa.ir @@ -1,43 +1,43 @@ contract examples.asset.contract.Reference: program approval: subroutine examples.asset.contract.Reference.approval_program() -> uint64: - block@0: // L17 + block@0: // L20 let app_id%0#0: uint64 = (txn ApplicationID) goto app_id%0#0 ? block@2 : block@1 - block@1: // on_create_L14 + block@1: // on_create_L17 examples.asset.contract.Reference.__init__() goto block@2 - block@2: // entrypoint_L14 + block@2: // entrypoint_L17 let tmp%1#0: uint64 = (txn NumAppArgs) let tmp%2#0: uint64 = (== tmp%1#0 1u) goto tmp%2#0 ? block@3 : block@10 - block@3: // if_body_L18 + block@3: // if_body_L21 let tmp%3#0: bytes = (txna ApplicationArgs 0) let tmp%4#0: uint64 = (== tmp%3#0 "opt_in") goto tmp%4#0 ? block@4 : block@5 - block@4: // if_body_L19 + block@4: // if_body_L22 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.opt_into_asset(asset#0) goto block@9 - block@5: // else_body_L19 + block@5: // else_body_L22 let tmp%5#0: bytes = (txna ApplicationArgs 0) let tmp%6#0: uint64 = (== tmp%5#0 "is_opted_in") goto tmp%6#0 ? block@6 : block@7 - block@6: // if_body_L22 + block@6: // if_body_L25 let asset#1: uint64 = (txna Assets 0) examples.asset.contract.Reference.is_opted_asset(asset#1) goto block@8 - block@7: // else_body_L22 + block@7: // else_body_L25 fail // Expected opt_in or is_opted_in - block@8: // after_if_else_L22 + block@8: // after_if_else_L25 goto block@9 - block@9: // after_if_else_L19 + block@9: // after_if_else_L22 goto block@10 - block@10: // after_if_else_L18 + block@10: // after_if_else_L21 return 1u subroutine examples.asset.contract.Reference.opt_into_asset(asset: uint64) -> void: - block@0: // L33 + block@0: // L36 let tmp%0#0: bytes = (txn Sender) let tmp%1#0: bytes = (global CreatorAddress) let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) @@ -57,19 +57,73 @@ contract examples.asset.contract.Reference: return subroutine examples.asset.contract.Reference.is_opted_asset(asset: uint64) -> void: - block@0: // L50 + block@0: // L53 let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") (assert app_global_get_ex_did_exist%1#0) // check value exists let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) (assert tmp%2#0) // asset self.asa == asset + let (maybe_value%3#0: uint64, maybe_value_did_exist%4#0: uint64) = ((asset_params_get AssetTotal) asset#0) + (assert maybe_value_did_exist%4#0) // asset exists + let tmp%5#0: uint64 = (== maybe_value%3#0 10000000u) + (assert tmp%5#0) // total + let (maybe_value%6#0: uint64, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetDecimals) asset#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%8#0: uint64 = (== maybe_value%6#0 0u) + (assert tmp%8#0) // decimals + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = ((asset_params_get AssetDefaultFrozen) asset#0) + (assert maybe_value_did_exist%10#0) // asset exists + let tmp%11#0: uint64 = (! maybe_value%9#0) + (assert tmp%11#0) // default frozen + let (maybe_value%12#0: bytes, maybe_value_did_exist%13#0: uint64) = ((asset_params_get AssetUnitName) asset#0) + (assert maybe_value_did_exist%13#0) // asset exists + let tmp%14#0: uint64 = (== maybe_value%12#0 "a") + (assert tmp%14#0) // unit_name + let (maybe_value%15#0: bytes, maybe_value_did_exist%16#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert maybe_value_did_exist%16#0) // asset exists + let tmp%17#0: uint64 = (== maybe_value%15#0 "asset a") + (assert tmp%17#0) // name + let (maybe_value%18#0: bytes, maybe_value_did_exist%19#0: uint64) = ((asset_params_get AssetURL) asset#0) + (assert maybe_value_did_exist%19#0) // asset exists + let tmp%20#0: uint64 = (== maybe_value%18#0 "") + (assert tmp%20#0) // URL + let (maybe_value%21#0: bytes, maybe_value_did_exist%22#0: uint64) = ((asset_params_get AssetMetadataHash) asset#0) + (assert maybe_value_did_exist%22#0) // asset exists + let tmp%23#0: bytes = (bzero 32u) + let tmp%24#0: uint64 = (== maybe_value%21#0 tmp%23#0) + (assert tmp%24#0) // hash + let (maybe_value%25#0: bytes, maybe_value_did_exist%26#0: uint64) = ((asset_params_get AssetManager) asset#0) + (assert maybe_value_did_exist%26#0) // asset exists + let tmp%27#0: bytes = (global ZeroAddress) + let tmp%28#0: uint64 = (== maybe_value%25#0 tmp%27#0) + (assert tmp%28#0) // manager + let (maybe_value%29#0: bytes, maybe_value_did_exist%30#0: uint64) = ((asset_params_get AssetReserve) asset#0) + (assert maybe_value_did_exist%30#0) // asset exists + let tmp%31#0: bytes = (global ZeroAddress) + let tmp%32#0: uint64 = (== maybe_value%29#0 tmp%31#0) + (assert tmp%32#0) // reserve + let (maybe_value%33#0: bytes, maybe_value_did_exist%34#0: uint64) = ((asset_params_get AssetFreeze) asset#0) + (assert maybe_value_did_exist%34#0) // asset exists + let tmp%35#0: bytes = (global ZeroAddress) + let tmp%36#0: uint64 = (== maybe_value%33#0 tmp%35#0) + (assert tmp%36#0) // freeze + let (maybe_value%37#0: bytes, maybe_value_did_exist%38#0: uint64) = ((asset_params_get AssetClawback) asset#0) + (assert maybe_value_did_exist%38#0) // asset exists + let tmp%39#0: bytes = (global ZeroAddress) + let tmp%40#0: uint64 = (== maybe_value%37#0 tmp%39#0) + (assert tmp%40#0) // clawback + let (maybe_value%41#0: bytes, maybe_value_did_exist%42#0: uint64) = ((asset_params_get AssetCreator) asset#0) + (assert maybe_value_did_exist%42#0) // asset exists + let tmp%43#0: bytes = (global CreatorAddress) + let tmp%44#0: uint64 = (== maybe_value%41#0 tmp%43#0) + (assert tmp%44#0) // creator return subroutine examples.asset.contract.Reference.__init__() -> void: - block@0: // L14 + block@0: // L17 (app_global_put "asa" 0u) return program clear-state: subroutine examples.asset.contract.Reference.clear_state_program() -> uint64: - block@0: // L29 + block@0: // L32 return 1u \ No newline at end of file diff --git a/examples/asset/out/contract_Reference.ssa.opt_pass_1.ir b/examples/asset/out/contract_Reference.ssa.opt_pass_1.ir index c8ade7cf9d..957b28bd42 100644 --- a/examples/asset/out/contract_Reference.ssa.opt_pass_1.ir +++ b/examples/asset/out/contract_Reference.ssa.opt_pass_1.ir @@ -1,39 +1,39 @@ contract examples.asset.contract.Reference: program approval: subroutine examples.asset.contract.Reference.approval_program() -> uint64: - block@0: // L17 + block@0: // L20 let app_id%0#0: uint64 = (txn ApplicationID) goto app_id%0#0 ? block@2 : block@1 - block@1: // on_create_L14 + block@1: // on_create_L17 examples.asset.contract.Reference.__init__() goto block@2 - block@2: // entrypoint_L14 + block@2: // entrypoint_L17 let tmp%1#0: uint64 = (txn NumAppArgs) let tmp%2#0: uint64 = (== tmp%1#0 1u) goto tmp%2#0 ? block@3 : block@10 - block@3: // if_body_L18 + block@3: // if_body_L21 let tmp%3#0: bytes = (txna ApplicationArgs 0) let tmp%4#0: uint64 = (== tmp%3#0 "opt_in") goto tmp%4#0 ? block@4 : block@5 - block@4: // if_body_L19 + block@4: // if_body_L22 let asset#0: uint64 = (txna Assets 0) examples.asset.contract.Reference.opt_into_asset(asset#0) goto block@10 - block@5: // else_body_L19 + block@5: // else_body_L22 let tmp%5#0: bytes = (txna ApplicationArgs 0) let tmp%6#0: uint64 = (== tmp%5#0 "is_opted_in") goto tmp%6#0 ? block@6 : block@7 - block@6: // if_body_L22 + block@6: // if_body_L25 let asset#1: uint64 = (txna Assets 0) examples.asset.contract.Reference.is_opted_asset(asset#1) goto block@10 - block@7: // else_body_L22 + block@7: // else_body_L25 fail // Expected opt_in or is_opted_in - block@10: // after_if_else_L18 + block@10: // after_if_else_L21 return 1u subroutine examples.asset.contract.Reference.opt_into_asset(asset: uint64) -> void: - block@0: // L33 + block@0: // L36 let tmp%0#0: bytes = (txn Sender) let tmp%1#0: bytes = (global CreatorAddress) let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) @@ -53,19 +53,73 @@ contract examples.asset.contract.Reference: return subroutine examples.asset.contract.Reference.is_opted_asset(asset: uint64) -> void: - block@0: // L50 + block@0: // L53 let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "asa") (assert app_global_get_ex_did_exist%1#0) // check value exists let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 asset#0) (assert tmp%2#0) // asset self.asa == asset + let (maybe_value%3#0: uint64, maybe_value_did_exist%4#0: uint64) = ((asset_params_get AssetTotal) asset#0) + (assert maybe_value_did_exist%4#0) // asset exists + let tmp%5#0: uint64 = (== maybe_value%3#0 10000000u) + (assert tmp%5#0) // total + let (maybe_value%6#0: uint64, maybe_value_did_exist%7#0: uint64) = ((asset_params_get AssetDecimals) asset#0) + (assert maybe_value_did_exist%7#0) // asset exists + let tmp%8#0: uint64 = (! maybe_value%6#0) + (assert tmp%8#0) // decimals + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = ((asset_params_get AssetDefaultFrozen) asset#0) + (assert maybe_value_did_exist%10#0) // asset exists + let tmp%11#0: uint64 = (! maybe_value%9#0) + (assert tmp%11#0) // default frozen + let (maybe_value%12#0: bytes, maybe_value_did_exist%13#0: uint64) = ((asset_params_get AssetUnitName) asset#0) + (assert maybe_value_did_exist%13#0) // asset exists + let tmp%14#0: uint64 = (== maybe_value%12#0 "a") + (assert tmp%14#0) // unit_name + let (maybe_value%15#0: bytes, maybe_value_did_exist%16#0: uint64) = ((asset_params_get AssetName) asset#0) + (assert maybe_value_did_exist%16#0) // asset exists + let tmp%17#0: uint64 = (== maybe_value%15#0 "asset a") + (assert tmp%17#0) // name + let (maybe_value%18#0: bytes, maybe_value_did_exist%19#0: uint64) = ((asset_params_get AssetURL) asset#0) + (assert maybe_value_did_exist%19#0) // asset exists + let tmp%20#0: uint64 = (== maybe_value%18#0 "") + (assert tmp%20#0) // URL + let (maybe_value%21#0: bytes, maybe_value_did_exist%22#0: uint64) = ((asset_params_get AssetMetadataHash) asset#0) + (assert maybe_value_did_exist%22#0) // asset exists + let tmp%23#0: bytes = (bzero 32u) + let tmp%24#0: uint64 = (== maybe_value%21#0 tmp%23#0) + (assert tmp%24#0) // hash + let (maybe_value%25#0: bytes, maybe_value_did_exist%26#0: uint64) = ((asset_params_get AssetManager) asset#0) + (assert maybe_value_did_exist%26#0) // asset exists + let tmp%27#0: bytes = (global ZeroAddress) + let tmp%28#0: uint64 = (== maybe_value%25#0 tmp%27#0) + (assert tmp%28#0) // manager + let (maybe_value%29#0: bytes, maybe_value_did_exist%30#0: uint64) = ((asset_params_get AssetReserve) asset#0) + (assert maybe_value_did_exist%30#0) // asset exists + let tmp%31#0: bytes = (global ZeroAddress) + let tmp%32#0: uint64 = (== maybe_value%29#0 tmp%31#0) + (assert tmp%32#0) // reserve + let (maybe_value%33#0: bytes, maybe_value_did_exist%34#0: uint64) = ((asset_params_get AssetFreeze) asset#0) + (assert maybe_value_did_exist%34#0) // asset exists + let tmp%35#0: bytes = (global ZeroAddress) + let tmp%36#0: uint64 = (== maybe_value%33#0 tmp%35#0) + (assert tmp%36#0) // freeze + let (maybe_value%37#0: bytes, maybe_value_did_exist%38#0: uint64) = ((asset_params_get AssetClawback) asset#0) + (assert maybe_value_did_exist%38#0) // asset exists + let tmp%39#0: bytes = (global ZeroAddress) + let tmp%40#0: uint64 = (== maybe_value%37#0 tmp%39#0) + (assert tmp%40#0) // clawback + let (maybe_value%41#0: bytes, maybe_value_did_exist%42#0: uint64) = ((asset_params_get AssetCreator) asset#0) + (assert maybe_value_did_exist%42#0) // asset exists + let tmp%43#0: bytes = (global CreatorAddress) + let tmp%44#0: uint64 = (== maybe_value%41#0 tmp%43#0) + (assert tmp%44#0) // creator return subroutine examples.asset.contract.Reference.__init__() -> void: - block@0: // L14 + block@0: // L17 (app_global_put "asa" 0u) return program clear-state: subroutine examples.asset.contract.Reference.clear_state_program() -> uint64: - block@0: // L29 + block@0: // L32 return 1u \ No newline at end of file diff --git a/examples/aug_ass_wit_side_efex/algopy.log b/examples/aug_ass_wit_side_efex/algopy.log index cfe80d3481..1f1624477d 100644 --- a/examples/aug_ass_wit_side_efex/algopy.log +++ b/examples/aug_ass_wit_side_efex/algopy.log @@ -1,38 +1,39 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 aug_ass_wit_side_efex -info: Building AWST for __init__.py -info: Building AWST for aug_ass_wit_side_efex -info: Building AWST for aug_ass_wit_side_efex/lol.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug aug_ass_wit_side_efex +debug: Building AWST for __init__.py +debug: Building AWST for aug_ass_wit_side_efex +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for aug_ass_wit_side_efex/lol.py aug_ass_wit_side_efex/lol.py:8 error: UNEXPECTED Traceback (most recent call last): File "", line 1, in - File "/src/wyvern/__main__.py", line 91, in main + File "/src/wyvern/__main__.py", line 97, in main compile_to_teal(options) - File "/src/wyvern/compile.py", line 143, in compile_to_teal + File "/src/wyvern/compile.py", line 166, in compile_to_teal compiled_contracts_by_source_path = awst_to_teal(context, awst) - File "/src/wyvern/compile.py", line 75, in awst_to_teal + File "/src/wyvern/compile.py", line 76, in awst_to_teal build_ir(context, node, module_asts) - File "/src/wyvern/ir/main.py", line 42, in build_ir + File "/src/wyvern/ir/main.py", line 47, in build_ir return _build_ir(ctx, contract) ^^^^^^^^^^^^^^^^^^^^^^^^ - File "/src/wyvern/ir/main.py", line 61, in _build_ir + File "/src/wyvern/ir/main.py", line 60, in _build_ir approval_subs_srefs = SubroutineCollector.collect(ctx, start=folded.approval_program.body) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/src/wyvern/ir/main.py", line 219, in collect + File "/src/wyvern/ir/main.py", line 266, in collect start.accept(collector) - File "/src/wyvern/awst/nodes.py", line 136, in accept + File "/src/wyvern/awst/nodes.py", line 204, in accept return visitor.visit_block(self) ^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/src/wyvern/awst/function_traverser.py", line 147, in visit_block + File "/src/wyvern/awst/function_traverser.py", line 143, in visit_block stmt.accept(self) - File "/src/wyvern/awst/nodes.py", line 545, in accept + File "/src/wyvern/awst/nodes.py", line 688, in accept return visitor.visit_assignment_statement(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/src/wyvern/awst/function_traverser.py", line 15, in visit_assignment_statement + File "/src/wyvern/awst/function_traverser.py", line 11, in visit_assignment_statement statement.value.accept(self) - File "/src/wyvern/awst/nodes.py", line 945, in accept + File "/src/wyvern/awst/nodes.py", line 1088, in accept return visitor.visit_new_struct(self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/src/wyvern/awst/visitors.py", line 202, in visit_new_struct + File "/src/wyvern/awst/visitors.py", line 206, in visit_new_struct raise NotImplementedError /examples/aug_ass_wit_side_efex/lol.py:8: NotImplementedError: >> exit code = 2 \ No newline at end of file diff --git a/examples/aug_ass_wit_side_efex/lol.py b/examples/aug_ass_wit_side_efex/lol.py index 6115c26012..ccf2aa6d6d 100644 --- a/examples/aug_ass_wit_side_efex/lol.py +++ b/examples/aug_ass_wit_side_efex/lol.py @@ -1,4 +1,4 @@ -from algopy import Contract, subroutine, log, Transaction, Address, Bytes, Struct, UInt64, itob +from algopy import Contract, Struct, UInt64, itob, log, subroutine class MyData(Struct): diff --git a/examples/augmented_assignment/algopy.log b/examples/augmented_assignment/algopy.log index 21c2a101fe..997235c5c1 100644 --- a/examples/augmented_assignment/algopy.log +++ b/examples/augmented_assignment/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 augmented_assignment -info: Building AWST for __init__.py -info: Building AWST for augmented_assignment -info: Building AWST for augmented_assignment/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug augmented_assignment +debug: Building AWST for __init__.py +debug: Building AWST for augmented_assignment +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for augmented_assignment/contract.py debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L11 @@ -36,6 +37,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -46,6 +48,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -56,6 +59,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -79,62 +83,62 @@ debug: Coalescing local variables in examples.augmented_assignment.contract.Augm debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/augmented_assignment/out/contract_Augmented.final.ir debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[3]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[5]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[8]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[10]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[10]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_if_body@3.ops[1]: 'store me#0 to l-stack (copy)' -debug: Replaced main_if_body@3.ops[5]: 'load me#0 from scratch' with 'load me#0 from l-stack (no copy)' +debug: Replaced main_if_body@3.ops[5]: 'load me#0' with 'load me#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[3]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[6]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[8]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[8]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[1]: 'store n#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[3]: 'load n#0 from scratch' with 'load n#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[3]: 'load n#0' with 'load n#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[10]: 'store app_local_get_ex_did_exist%6#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[13]: 'load app_local_get_ex_did_exist%6#0 from scratch' with 'load app_local_get_ex_did_exist%6#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[13]: 'load app_local_get_ex_did_exist%6#0' with 'load app_local_get_ex_did_exist%6#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[27]: 'store app_local_get_ex_did_exist%9#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[30]: 'load app_local_get_ex_did_exist%9#0 from scratch' with 'load app_local_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[30]: 'load app_local_get_ex_did_exist%9#0' with 'load app_local_get_ex_did_exist%9#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[43]: 'store app_global_get_ex_did_exist%12#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[46]: 'load app_global_get_ex_did_exist%12#0 from scratch' with 'load app_global_get_ex_did_exist%12#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[46]: 'load app_global_get_ex_did_exist%12#0' with 'load app_global_get_ex_did_exist%12#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[51]: 'store new_state_value%13#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[54]: 'load new_state_value%13#0 from scratch' with 'load new_state_value%13#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[54]: 'load new_state_value%13#0' with 'load new_state_value%13#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[59]: 'store app_global_get_ex_did_exist%15#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[62]: 'load app_global_get_ex_did_exist%15#0 from scratch' with 'load app_global_get_ex_did_exist%15#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[62]: 'load app_global_get_ex_did_exist%15#0' with 'load app_global_get_ex_did_exist%15#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[67]: 'store new_state_value%16#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[70]: 'load new_state_value%16#0 from scratch' with 'load new_state_value%16#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[70]: 'load new_state_value%16#0' with 'load new_state_value%16#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[12]: 'store app_local_get_ex_value%5#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[16]: 'load app_local_get_ex_value%5#0 from scratch' with 'load app_local_get_ex_value%5#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[16]: 'load app_local_get_ex_value%5#0' with 'load app_local_get_ex_value%5#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[19]: 'store new_state_value%7#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[23]: 'load new_state_value%7#0 from scratch' with 'load new_state_value%7#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[23]: 'load new_state_value%7#0' with 'load new_state_value%7#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[31]: 'store app_local_get_ex_value%8#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[35]: 'load app_local_get_ex_value%8#0 from scratch' with 'load app_local_get_ex_value%8#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[35]: 'load app_local_get_ex_value%8#0' with 'load app_local_get_ex_value%8#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[38]: 'store new_state_value%10#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[42]: 'load new_state_value%10#0 from scratch' with 'load new_state_value%10#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[42]: 'load new_state_value%10#0' with 'load new_state_value%10#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[49]: 'store app_global_get_ex_value%11#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[53]: 'load app_global_get_ex_value%11#0 from scratch' with 'load app_global_get_ex_value%11#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[53]: 'load app_global_get_ex_value%11#0' with 'load app_global_get_ex_value%11#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[66]: 'store app_global_get_ex_value%14#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[70]: 'load app_global_get_ex_value%14#0 from scratch' with 'load app_global_get_ex_value%14#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[70]: 'load app_global_get_ex_value%14#0' with 'load app_global_get_ex_value%14#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[22]: 'store me#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[26]: 'load me#0 from scratch' with 'load me#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[26]: 'load me#0' with 'load me#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[4]: 'store n#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[18]: 'load n#0 from scratch' with 'load n#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[18]: 'load n#0' with 'load n#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[8]: 'store me#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[23]: 'load me#0 from scratch' with 'load me#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[23]: 'load me#0' with 'load me#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[29]: 'store me#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[44]: 'load me#0 from scratch' with 'load me#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[44]: 'load me#0' with 'load me#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[6]: 'store bytes_to_add#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[41]: 'load bytes_to_add#0 from scratch' with 'load bytes_to_add#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[41]: 'load bytes_to_add#0' with 'load bytes_to_add#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[42]: 'store bytes_to_add#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[77]: 'load bytes_to_add#0 from scratch' with 'load bytes_to_add#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[77]: 'load bytes_to_add#0' with 'load bytes_to_add#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[21]: 'store n#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[61]: 'load n#0 from scratch' with 'load n#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[61]: 'load n#0' with 'load n#0 from l-stack (no copy)' debug: Found 3 edge set/s for examples.augmented_assignment.contract.Augmented.approval_program debug: examples.augmented_assignment.contract.Augmented.approval_program f-stack entry: ['me#0'] debug: examples.augmented_assignment.contract.Augmented.approval_program f-stack on first store: [] -info: Writing /examples/augmented_assignment/out/contract.approval.teal -info: Writing /examples/augmented_assignment/out/contract.approval.debug.teal -info: Writing /examples/augmented_assignment/out/contract.clear.teal -info: Writing /examples/augmented_assignment/out/contract.clear.debug.teal +info: Writing augmented_assignment/out/contract.approval.teal +info: Writing augmented_assignment/out/contract.approval.debug.teal +info: Writing augmented_assignment/out/contract.clear.teal +info: Writing augmented_assignment/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/augmented_assignment/out/contract.approval.debug.teal b/examples/augmented_assignment/out/contract.approval.debug.teal index 58d2637d3e..0db3068269 100644 --- a/examples/augmented_assignment/out/contract.approval.debug.teal +++ b/examples/augmented_assignment/out/contract.approval.debug.teal @@ -46,14 +46,14 @@ main_if_body@5: txn NumAppArgs // (𝕗) me#0 | {txn} Transaction.num_app_args() File "augmented_assignment/contract.py", line 19 dup // load n#0 from l-stack (copy) (𝕗) me#0 | n#0,n#0 n File "augmented_assignment/contract.py", line 19 itob // (𝕗) me#0 | n#0,{itob} BigUInt(n) File "augmented_assignment/contract.py", line 20 - cover 1 // store bytes_to_add#0 to l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,n#0 bytes_to_add File "augmented_assignment/contract.py", line 20 + swap // store bytes_to_add#0 to l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,n#0 bytes_to_add File "augmented_assignment/contract.py", line 20 dig 2 // load me#0 from f-stack (𝕗) me#0 | bytes_to_add#0,n#0,me#0 me File "augmented_assignment/contract.py", line 12 dup cover 2 // store me#0 to l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0 me File "augmented_assignment/contract.py", line 12 int 0 // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0 self.my_uint[me] File "augmented_assignment/contract.py", line 24 byte "my_uint" // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0,"my_uint" self.my_uint[me] File "augmented_assignment/contract.py", line 24 app_local_get_ex // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{app_local_get_ex}.0,{app_local_get_ex}.1 self.my_uint[me] File "augmented_assignment/contract.py", line 24 - assert // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%5#0 self.my_uint[me] File "augmented_assignment/contract.py", line 24 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%5#0 self.my_uint[me] File "augmented_assignment/contract.py", line 24 dig 1 // load n#0 from l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%5#0,n#0 n File "augmented_assignment/contract.py", line 19 + // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{+} self.my_uint[me] += n File "augmented_assignment/contract.py", line 24 dig 2 // load me#0 from l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,new_state_value%7#0,me#0 me File "augmented_assignment/contract.py", line 12 @@ -64,7 +64,7 @@ main_if_body@5: int 0 // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 byte "my_bytes" // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0,"my_bytes" self.my_bytes[me] File "augmented_assignment/contract.py", line 25 app_local_get_ex // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{app_local_get_ex}.0,{app_local_get_ex}.1 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 - assert // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%8#0 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%8#0 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 dig 3 // load bytes_to_add#0 from l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%8#0,bytes_to_add#0 bytes_to_add File "augmented_assignment/contract.py", line 20 concat // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{concat} self.my_bytes[me] += bytes_to_add File "augmented_assignment/contract.py", line 25 uncover 2 // load me#0 from l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,n#0,new_state_value%10#0,me#0 me File "augmented_assignment/contract.py", line 12 @@ -74,19 +74,19 @@ main_if_body@5: int 0 // (𝕗) me#0 | bytes_to_add#0,n#0,0 self.global_uint File "augmented_assignment/contract.py", line 28 byte "global_uint" // (𝕗) me#0 | bytes_to_add#0,n#0,0,"global_uint" self.global_uint File "augmented_assignment/contract.py", line 28 app_global_get_ex // (𝕗) me#0 | bytes_to_add#0,n#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.global_uint File "augmented_assignment/contract.py", line 28 - assert // (𝕗) me#0 | bytes_to_add#0,n#0,app_global_get_ex_value%11#0 self.global_uint File "augmented_assignment/contract.py", line 28 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,n#0,app_global_get_ex_value%11#0 self.global_uint File "augmented_assignment/contract.py", line 28 + // (𝕗) me#0 | bytes_to_add#0,{+} self.global_uint += n File "augmented_assignment/contract.py", line 28 byte "global_uint" // (𝕗) me#0 | bytes_to_add#0,new_state_value%13#0,"global_uint" self.global_uint File "augmented_assignment/contract.py", line 28 - uncover 1 // load new_state_value%13#0 from l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,"global_uint",new_state_value%13#0 self.global_uint += n File "augmented_assignment/contract.py", line 28 + swap // load new_state_value%13#0 from l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,"global_uint",new_state_value%13#0 self.global_uint += n File "augmented_assignment/contract.py", line 28 app_global_put // (𝕗) me#0 | bytes_to_add#0 self.global_uint += n File "augmented_assignment/contract.py", line 28 int 0 // (𝕗) me#0 | bytes_to_add#0,0 self.global_bytes File "augmented_assignment/contract.py", line 29 byte "global_bytes" // (𝕗) me#0 | bytes_to_add#0,0,"global_bytes" self.global_bytes File "augmented_assignment/contract.py", line 29 app_global_get_ex // (𝕗) me#0 | bytes_to_add#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.global_bytes File "augmented_assignment/contract.py", line 29 - assert // (𝕗) me#0 | bytes_to_add#0,app_global_get_ex_value%14#0 self.global_bytes File "augmented_assignment/contract.py", line 29 - uncover 1 // load bytes_to_add#0 from l-stack (no copy) (𝕗) me#0 | app_global_get_ex_value%14#0,bytes_to_add#0 bytes_to_add File "augmented_assignment/contract.py", line 20 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,app_global_get_ex_value%14#0 self.global_bytes File "augmented_assignment/contract.py", line 29 + swap // load bytes_to_add#0 from l-stack (no copy) (𝕗) me#0 | app_global_get_ex_value%14#0,bytes_to_add#0 bytes_to_add File "augmented_assignment/contract.py", line 20 concat // (𝕗) me#0 | {concat} self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 byte "global_bytes" // (𝕗) me#0 | new_state_value%16#0,"global_bytes" self.global_bytes File "augmented_assignment/contract.py", line 29 - uncover 1 // load new_state_value%16#0 from l-stack (no copy) (𝕗) me#0 | "global_bytes",new_state_value%16#0 self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 + swap // load new_state_value%16#0 from l-stack (no copy) (𝕗) me#0 | "global_bytes",new_state_value%16#0 self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 app_global_put // (𝕗) me#0 | self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 // Implicit fall through to main_after_if_else@6 // (𝕗) me#0 | @@ -95,7 +95,7 @@ main_after_if_else@6: return // (𝕗) me#0 | return True File "augmented_assignment/contract.py", line 30 -// examples.augmented_assignment.contract.Augmented.__init__() -> : +// examples.augmented_assignment.contract.Augmented.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "augmented_assignment/contract.py", line 5 diff --git a/examples/augmented_assignment/out/contract.approval.teal b/examples/augmented_assignment/out/contract.approval.teal index f87de6d5f3..d79c5be303 100644 --- a/examples/augmented_assignment/out/contract.approval.teal +++ b/examples/augmented_assignment/out/contract.approval.teal @@ -39,14 +39,14 @@ main_if_body@5: txn NumAppArgs dup itob - cover 1 + swap dig 2 dup cover 2 int 0 byte "my_uint" app_local_get_ex - assert + assert // check value exists dig 1 + dig 2 @@ -57,7 +57,7 @@ main_if_body@5: int 0 byte "my_bytes" app_local_get_ex - assert + assert // check value exists dig 3 concat uncover 2 @@ -67,19 +67,19 @@ main_if_body@5: int 0 byte "global_uint" app_global_get_ex - assert + assert // check value exists + byte "global_uint" - uncover 1 + swap app_global_put int 0 byte "global_bytes" app_global_get_ex - assert - uncover 1 + assert // check value exists + swap concat byte "global_bytes" - uncover 1 + swap app_global_put main_after_if_else@6: @@ -87,7 +87,7 @@ main_after_if_else@6: return -// examples.augmented_assignment.contract.Augmented.__init__() -> : +// examples.augmented_assignment.contract.Augmented.__init__() -> void: __init__: proto 0 0 diff --git a/examples/augmented_assignment/out/contract.approval_unoptimized.debug.teal b/examples/augmented_assignment/out/contract.approval_unoptimized.debug.teal index 58d2637d3e..0db3068269 100644 --- a/examples/augmented_assignment/out/contract.approval_unoptimized.debug.teal +++ b/examples/augmented_assignment/out/contract.approval_unoptimized.debug.teal @@ -46,14 +46,14 @@ main_if_body@5: txn NumAppArgs // (𝕗) me#0 | {txn} Transaction.num_app_args() File "augmented_assignment/contract.py", line 19 dup // load n#0 from l-stack (copy) (𝕗) me#0 | n#0,n#0 n File "augmented_assignment/contract.py", line 19 itob // (𝕗) me#0 | n#0,{itob} BigUInt(n) File "augmented_assignment/contract.py", line 20 - cover 1 // store bytes_to_add#0 to l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,n#0 bytes_to_add File "augmented_assignment/contract.py", line 20 + swap // store bytes_to_add#0 to l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,n#0 bytes_to_add File "augmented_assignment/contract.py", line 20 dig 2 // load me#0 from f-stack (𝕗) me#0 | bytes_to_add#0,n#0,me#0 me File "augmented_assignment/contract.py", line 12 dup cover 2 // store me#0 to l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0 me File "augmented_assignment/contract.py", line 12 int 0 // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0 self.my_uint[me] File "augmented_assignment/contract.py", line 24 byte "my_uint" // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0,"my_uint" self.my_uint[me] File "augmented_assignment/contract.py", line 24 app_local_get_ex // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{app_local_get_ex}.0,{app_local_get_ex}.1 self.my_uint[me] File "augmented_assignment/contract.py", line 24 - assert // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%5#0 self.my_uint[me] File "augmented_assignment/contract.py", line 24 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%5#0 self.my_uint[me] File "augmented_assignment/contract.py", line 24 dig 1 // load n#0 from l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%5#0,n#0 n File "augmented_assignment/contract.py", line 19 + // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{+} self.my_uint[me] += n File "augmented_assignment/contract.py", line 24 dig 2 // load me#0 from l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,new_state_value%7#0,me#0 me File "augmented_assignment/contract.py", line 12 @@ -64,7 +64,7 @@ main_if_body@5: int 0 // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 byte "my_bytes" // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,me#0,0,"my_bytes" self.my_bytes[me] File "augmented_assignment/contract.py", line 25 app_local_get_ex // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{app_local_get_ex}.0,{app_local_get_ex}.1 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 - assert // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%8#0 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%8#0 self.my_bytes[me] File "augmented_assignment/contract.py", line 25 dig 3 // load bytes_to_add#0 from l-stack (copy) (𝕗) me#0 | bytes_to_add#0,me#0,n#0,app_local_get_ex_value%8#0,bytes_to_add#0 bytes_to_add File "augmented_assignment/contract.py", line 20 concat // (𝕗) me#0 | bytes_to_add#0,me#0,n#0,{concat} self.my_bytes[me] += bytes_to_add File "augmented_assignment/contract.py", line 25 uncover 2 // load me#0 from l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,n#0,new_state_value%10#0,me#0 me File "augmented_assignment/contract.py", line 12 @@ -74,19 +74,19 @@ main_if_body@5: int 0 // (𝕗) me#0 | bytes_to_add#0,n#0,0 self.global_uint File "augmented_assignment/contract.py", line 28 byte "global_uint" // (𝕗) me#0 | bytes_to_add#0,n#0,0,"global_uint" self.global_uint File "augmented_assignment/contract.py", line 28 app_global_get_ex // (𝕗) me#0 | bytes_to_add#0,n#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.global_uint File "augmented_assignment/contract.py", line 28 - assert // (𝕗) me#0 | bytes_to_add#0,n#0,app_global_get_ex_value%11#0 self.global_uint File "augmented_assignment/contract.py", line 28 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,n#0,app_global_get_ex_value%11#0 self.global_uint File "augmented_assignment/contract.py", line 28 + // (𝕗) me#0 | bytes_to_add#0,{+} self.global_uint += n File "augmented_assignment/contract.py", line 28 byte "global_uint" // (𝕗) me#0 | bytes_to_add#0,new_state_value%13#0,"global_uint" self.global_uint File "augmented_assignment/contract.py", line 28 - uncover 1 // load new_state_value%13#0 from l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,"global_uint",new_state_value%13#0 self.global_uint += n File "augmented_assignment/contract.py", line 28 + swap // load new_state_value%13#0 from l-stack (no copy) (𝕗) me#0 | bytes_to_add#0,"global_uint",new_state_value%13#0 self.global_uint += n File "augmented_assignment/contract.py", line 28 app_global_put // (𝕗) me#0 | bytes_to_add#0 self.global_uint += n File "augmented_assignment/contract.py", line 28 int 0 // (𝕗) me#0 | bytes_to_add#0,0 self.global_bytes File "augmented_assignment/contract.py", line 29 byte "global_bytes" // (𝕗) me#0 | bytes_to_add#0,0,"global_bytes" self.global_bytes File "augmented_assignment/contract.py", line 29 app_global_get_ex // (𝕗) me#0 | bytes_to_add#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.global_bytes File "augmented_assignment/contract.py", line 29 - assert // (𝕗) me#0 | bytes_to_add#0,app_global_get_ex_value%14#0 self.global_bytes File "augmented_assignment/contract.py", line 29 - uncover 1 // load bytes_to_add#0 from l-stack (no copy) (𝕗) me#0 | app_global_get_ex_value%14#0,bytes_to_add#0 bytes_to_add File "augmented_assignment/contract.py", line 20 + assert // check value exists // (𝕗) me#0 | bytes_to_add#0,app_global_get_ex_value%14#0 self.global_bytes File "augmented_assignment/contract.py", line 29 + swap // load bytes_to_add#0 from l-stack (no copy) (𝕗) me#0 | app_global_get_ex_value%14#0,bytes_to_add#0 bytes_to_add File "augmented_assignment/contract.py", line 20 concat // (𝕗) me#0 | {concat} self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 byte "global_bytes" // (𝕗) me#0 | new_state_value%16#0,"global_bytes" self.global_bytes File "augmented_assignment/contract.py", line 29 - uncover 1 // load new_state_value%16#0 from l-stack (no copy) (𝕗) me#0 | "global_bytes",new_state_value%16#0 self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 + swap // load new_state_value%16#0 from l-stack (no copy) (𝕗) me#0 | "global_bytes",new_state_value%16#0 self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 app_global_put // (𝕗) me#0 | self.global_bytes += bytes_to_add File "augmented_assignment/contract.py", line 29 // Implicit fall through to main_after_if_else@6 // (𝕗) me#0 | @@ -95,7 +95,7 @@ main_after_if_else@6: return // (𝕗) me#0 | return True File "augmented_assignment/contract.py", line 30 -// examples.augmented_assignment.contract.Augmented.__init__() -> : +// examples.augmented_assignment.contract.Augmented.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "augmented_assignment/contract.py", line 5 diff --git a/examples/augmented_assignment/out/contract.approval_unoptimized.teal b/examples/augmented_assignment/out/contract.approval_unoptimized.teal index f87de6d5f3..d79c5be303 100644 --- a/examples/augmented_assignment/out/contract.approval_unoptimized.teal +++ b/examples/augmented_assignment/out/contract.approval_unoptimized.teal @@ -39,14 +39,14 @@ main_if_body@5: txn NumAppArgs dup itob - cover 1 + swap dig 2 dup cover 2 int 0 byte "my_uint" app_local_get_ex - assert + assert // check value exists dig 1 + dig 2 @@ -57,7 +57,7 @@ main_if_body@5: int 0 byte "my_bytes" app_local_get_ex - assert + assert // check value exists dig 3 concat uncover 2 @@ -67,19 +67,19 @@ main_if_body@5: int 0 byte "global_uint" app_global_get_ex - assert + assert // check value exists + byte "global_uint" - uncover 1 + swap app_global_put int 0 byte "global_bytes" app_global_get_ex - assert - uncover 1 + assert // check value exists + swap concat byte "global_bytes" - uncover 1 + swap app_global_put main_after_if_else@6: @@ -87,7 +87,7 @@ main_after_if_else@6: return -// examples.augmented_assignment.contract.Augmented.__init__() -> : +// examples.augmented_assignment.contract.Augmented.__init__() -> void: __init__: proto 0 0 diff --git a/examples/augmented_assignment/out/contract.awst b/examples/augmented_assignment/out/contract.awst index 32a21ef82a..400e2441a2 100644 --- a/examples/augmented_assignment/out/contract.awst +++ b/examples/augmented_assignment/out/contract.awst @@ -17,7 +17,7 @@ contract Augmented approval_program(): bool { - me: algopy.Address = txn() + me: algopy.Account = txn() if (txn() == OptIn) { this.locals['my_uint'].account[me]: algopy.UInt64 = 0u this.locals['my_bytes'].account[me]: algopy.Bytes = '' diff --git a/examples/biguint_binary_ops/algopy.log b/examples/biguint_binary_ops/algopy.log index 5c12f81925..c15fd82629 100644 --- a/examples/biguint_binary_ops/algopy.log +++ b/examples/biguint_binary_ops/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 biguint_binary_ops -info: Building AWST for __init__.py -info: Building AWST for biguint_binary_ops -info: Building AWST for biguint_binary_ops/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug biguint_binary_ops +debug: Building AWST for __init__.py +debug: Building AWST for biguint_binary_ops +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for biguint_binary_ops/contract.py debug: Sealing block@0: // L44 debug: Terminated block@0: // L44 debug: Sealing block@0: // L5 @@ -44,6 +45,7 @@ debug: Found equivalence set: tuple_assignment%12#0, b_and#0 debug: Replacing {tuple_assignment%12#0} with b_and#0 made 1 modifications debug: Found equivalence set: tuple_assignment%13#0, b_xor#0 debug: Replacing {tuple_assignment%13#0} with b_xor#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -54,6 +56,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -64,6 +67,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -75,6 +79,7 @@ debug: Optimizing subroutine examples.biguint_binary_ops.contract.BiguintBinaryO debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -84,6 +89,7 @@ debug: Optimizing subroutine examples.biguint_binary_ops.contract.do_some_ops debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -93,6 +99,7 @@ debug: Optimizing subroutine examples.biguint_binary_ops.contract.BiguintBinaryO debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -116,86 +123,86 @@ debug: Coalescing local variables in examples.biguint_binary_ops.contract.Biguin debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/biguint_binary_ops/out/contract_BiguintBinaryOps.final.ir debug: Inserted main_block@0.ops[16]: 'store add#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[18]: 'load add#0 from scratch' with 'load add#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[18]: 'load add#0' with 'load add#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[21]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[23]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[23]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[28]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[30]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[30]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[35]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[37]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[37]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[42]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[44]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[44]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[49]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[51]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[51]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[55]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[57]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[57]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[61]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[63]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[63]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[71]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[73]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[73]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[80]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[82]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[82]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[87]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[89]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[89]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[94]: 'store tmp%24#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[96]: 'load tmp%24#0 from scratch' with 'load tmp%24#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[96]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[15]: 'store subtract#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[26]: 'load subtract#0 from scratch' with 'load subtract#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[26]: 'load subtract#0' with 'load subtract#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[14]: 'store multiply#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[34]: 'load multiply#0 from scratch' with 'load multiply#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[34]: 'load multiply#0' with 'load multiply#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[13]: 'store divide#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[42]: 'load divide#0 from scratch' with 'load divide#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[42]: 'load divide#0' with 'load divide#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[12]: 'store mod#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[50]: 'load mod#0 from scratch' with 'load mod#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[50]: 'load mod#0' with 'load mod#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[11]: 'store lt#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[58]: 'load lt#0 from scratch' with 'load lt#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[58]: 'load lt#0' with 'load lt#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[10]: 'store lte#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[65]: 'load lte#0 from scratch' with 'load lte#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[65]: 'load lte#0' with 'load lte#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[9]: 'store gt#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[72]: 'load gt#0 from scratch' with 'load gt#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[72]: 'load gt#0' with 'load gt#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[8]: 'store gte#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[75]: 'load gte#0 from scratch' with 'load gte#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[75]: 'load gte#0' with 'load gte#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[7]: 'store eq#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[78]: 'load eq#0 from scratch' with 'load eq#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[78]: 'load eq#0' with 'load eq#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[6]: 'store neq#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[85]: 'load neq#0 from scratch' with 'load neq#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[85]: 'load neq#0' with 'load neq#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[5]: 'store b_or#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[88]: 'load b_or#0 from scratch' with 'load b_or#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[88]: 'load b_or#0' with 'load b_or#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[4]: 'store b_and#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[96]: 'load b_and#0 from scratch' with 'load b_and#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[96]: 'load b_and#0' with 'load b_and#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[3]: 'store b_xor#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[104]: 'load b_xor#0 from scratch' with 'load b_xor#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[104]: 'load b_xor#0' with 'load b_xor#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[55]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[51]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[47]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[43]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[39]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[35]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[31]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[27]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[23]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[19]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[15]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[7]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[70]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Simplified uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13; uncover 13 to -info: Writing /examples/biguint_binary_ops/out/contract.approval.teal -info: Writing /examples/biguint_binary_ops/out/contract.approval.debug.teal -info: Writing /examples/biguint_binary_ops/out/contract.clear.teal -info: Writing /examples/biguint_binary_ops/out/contract.clear.debug.teal +info: Writing biguint_binary_ops/out/contract.approval.teal +info: Writing biguint_binary_ops/out/contract.approval.debug.teal +info: Writing biguint_binary_ops/out/contract.clear.teal +info: Writing biguint_binary_ops/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/biguint_binary_ops/out/contract.approval.debug.teal b/examples/biguint_binary_ops/out/contract.approval.debug.teal index f4d77c9afc..be8eb1e979 100644 --- a/examples/biguint_binary_ops/out/contract.approval.debug.teal +++ b/examples/biguint_binary_ops/out/contract.approval.debug.teal @@ -19,7 +19,7 @@ main_block@0: cover 4 // store mod#0 to l-stack (no copy) b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,{do_some_ops}.0,{do_some_ops}.1,{do_some_ops}.2,{do_some_ops}.3 mod File "biguint_binary_ops/contract.py", line 11 cover 3 // store divide#0 to l-stack (no copy) b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,divide#0,{do_some_ops}.0,{do_some_ops}.1,{do_some_ops}.2 divide File "biguint_binary_ops/contract.py", line 10 cover 2 // store multiply#0 to l-stack (no copy) b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,divide#0,multiply#0,{do_some_ops}.0,{do_some_ops}.1 multiply File "biguint_binary_ops/contract.py", line 9 - cover 1 // store subtract#0 to l-stack (no copy) b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,divide#0,multiply#0,subtract#0,{do_some_ops}.0 subtract File "biguint_binary_ops/contract.py", line 8 + swap // store subtract#0 to l-stack (no copy) b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,divide#0,multiply#0,subtract#0,{do_some_ops}.0 subtract File "biguint_binary_ops/contract.py", line 8 byte 0x042b1c8c1227a00300 // b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,divide#0,multiply#0,subtract#0,add#0,0x042b1c8c1227a00300 76893488147419104000 File "biguint_binary_ops/contract.py", line 23 b== // b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,divide#0,multiply#0,subtract#0,{b==} add == BigUInt(76893488147419104000) File "biguint_binary_ops/contract.py", line 23 assert // b_xor#0,b_and#0,b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,divide#0,multiply#0,subtract#0 assert add == BigUInt(76893488147419104000) File "biguint_binary_ops/contract.py", line 23 diff --git a/examples/biguint_binary_ops/out/contract.approval.teal b/examples/biguint_binary_ops/out/contract.approval.teal index 0266265db9..257c0eec3c 100644 --- a/examples/biguint_binary_ops/out/contract.approval.teal +++ b/examples/biguint_binary_ops/out/contract.approval.teal @@ -17,7 +17,7 @@ main_block@0: cover 4 cover 3 cover 2 - cover 1 + swap byte 0x042b1c8c1227a00300 b== assert diff --git a/examples/biguint_binary_ops/out/contract.approval_unoptimized.debug.teal b/examples/biguint_binary_ops/out/contract.approval_unoptimized.debug.teal index 3550f5a959..c44bc2de4c 100644 --- a/examples/biguint_binary_ops/out/contract.approval_unoptimized.debug.teal +++ b/examples/biguint_binary_ops/out/contract.approval_unoptimized.debug.teal @@ -19,7 +19,7 @@ main_block@0: cover 4 // store tuple_assignment%4#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,tuple_assignment%11#0,tuple_assignment%10#0,tuple_assignment%9#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,{do_some_ops}.0,{do_some_ops}.1,{do_some_ops}.2,{do_some_ops}.3 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 cover 3 // store tuple_assignment%3#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,tuple_assignment%11#0,tuple_assignment%10#0,tuple_assignment%9#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,tuple_assignment%3#0,{do_some_ops}.0,{do_some_ops}.1,{do_some_ops}.2 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 cover 2 // store tuple_assignment%2#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,tuple_assignment%11#0,tuple_assignment%10#0,tuple_assignment%9#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,tuple_assignment%3#0,tuple_assignment%2#0,{do_some_ops}.0,{do_some_ops}.1 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 - cover 1 // store tuple_assignment%1#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,tuple_assignment%11#0,tuple_assignment%10#0,tuple_assignment%9#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,tuple_assignment%3#0,tuple_assignment%2#0,tuple_assignment%1#0,{do_some_ops}.0 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 + swap // store tuple_assignment%1#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,tuple_assignment%11#0,tuple_assignment%10#0,tuple_assignment%9#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,tuple_assignment%3#0,tuple_assignment%2#0,tuple_assignment%1#0,{do_some_ops}.0 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 cover 8 // store add#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,tuple_assignment%11#0,tuple_assignment%10#0,tuple_assignment%9#0,add#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,tuple_assignment%3#0,tuple_assignment%2#0,tuple_assignment%1#0 add File "biguint_binary_ops/contract.py", line 7 cover 10 // store subtract#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,tuple_assignment%9#0,add#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,tuple_assignment%3#0,tuple_assignment%2#0 subtract File "biguint_binary_ops/contract.py", line 8 cover 11 // store multiply#0 to l-stack (no copy) tuple_assignment%13#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,tuple_assignment%9#0,add#0,tuple_assignment%8#0,tuple_assignment%7#0,tuple_assignment%6#0,tuple_assignment%5#0,tuple_assignment%4#0,tuple_assignment%3#0 multiply File "biguint_binary_ops/contract.py", line 9 @@ -29,9 +29,9 @@ main_block@0: cover 13 // store lte#0 to l-stack (no copy) lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,tuple_assignment%9#0,add#0,tuple_assignment%8#0,tuple_assignment%7#0 lte File "biguint_binary_ops/contract.py", line 13 cover 13 // store gt#0 to l-stack (no copy) gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,tuple_assignment%9#0,add#0,tuple_assignment%8#0 gt File "biguint_binary_ops/contract.py", line 14 cover 13 // store gte#0 to l-stack (no copy) gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,tuple_assignment%9#0,add#0 gte File "biguint_binary_ops/contract.py", line 15 - uncover 1 // load tuple_assignment%9#0 from l-stack (no copy) gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,add#0,tuple_assignment%9#0 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 + swap // load tuple_assignment%9#0 from l-stack (no copy) gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,add#0,tuple_assignment%9#0 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 cover 13 // store eq#0 to l-stack (no copy) eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,tuple_assignment%10#0,add#0 eq File "biguint_binary_ops/contract.py", line 16 - uncover 1 // load tuple_assignment%10#0 from l-stack (no copy) eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,add#0,tuple_assignment%10#0 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 + swap // load tuple_assignment%10#0 from l-stack (no copy) eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,add#0,tuple_assignment%10#0 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 cover 13 // store neq#0 to l-stack (no copy) neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,tuple_assignment%11#0,subtract#0,add#0 neq File "biguint_binary_ops/contract.py", line 17 uncover 2 // load tuple_assignment%11#0 from l-stack (no copy) neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,subtract#0,add#0,tuple_assignment%11#0 do_some_ops(BigUInt(58446744073709552000), BigUInt(18446744073709552000)) File "biguint_binary_ops/contract.py", line 21 cover 13 // store b_or#0 to l-stack (no copy) b_or#0,neq#0,eq#0,gte#0,gt#0,lte#0,lt#0,mod#0,tuple_assignment%13#0,divide#0,tuple_assignment%12#0,multiply#0,subtract#0,add#0 b_or File "biguint_binary_ops/contract.py", line 18 diff --git a/examples/biguint_binary_ops/out/contract.approval_unoptimized.teal b/examples/biguint_binary_ops/out/contract.approval_unoptimized.teal index 4efac6a182..56a16e959c 100644 --- a/examples/biguint_binary_ops/out/contract.approval_unoptimized.teal +++ b/examples/biguint_binary_ops/out/contract.approval_unoptimized.teal @@ -17,7 +17,7 @@ main_block@0: cover 4 cover 3 cover 2 - cover 1 + swap cover 8 cover 10 cover 11 @@ -27,9 +27,9 @@ main_block@0: cover 13 cover 13 cover 13 - uncover 1 + swap cover 13 - uncover 1 + swap cover 13 uncover 2 cover 13 diff --git a/examples/boolean_binary_ops/algopy.log b/examples/boolean_binary_ops/algopy.log index bc9fe6b4ad..07b29cb290 100644 --- a/examples/boolean_binary_ops/algopy.log +++ b/examples/boolean_binary_ops/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 boolean_binary_ops -info: Building AWST for __init__.py -info: Building AWST for boolean_binary_ops -info: Building AWST for boolean_binary_ops/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug boolean_binary_ops +debug: Building AWST for __init__.py +debug: Building AWST for boolean_binary_ops +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for boolean_binary_ops/contract.py debug: Sealing block@0: // L15 debug: Terminated block@0: // L15 debug: Sealing block@0: // L33 @@ -211,6 +212,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -221,6 +223,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -235,8 +238,11 @@ debug: Found equivalence set: and_result%10#2, and_result#0 debug: Replacing {and_result%10#2} with and_result#0 made 1 modifications debug: Found equivalence set: or_result%21#2, or_result#0 debug: Replacing {or_result%21#2} with or_result#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches +debug: GotoNth goto [block@5, ...block@16][tuple_index%1#4] simplified to goto tuple_index%1#4 ? block@16 : block@5 +debug: GotoNth goto [block@2, ...block@18][tuple_index%0#5] simplified to goto tuple_index%0#5 ? block@18 : block@2 debug: Optimizer: Remove Linear Jump debug: Replaced predecessor block@1: // for_header_0_L34 with block@0: // L33 in block@3: // for_body_L34 debug: Merged linear block@1: // for_header_0_L34 into block@0: // L33 @@ -255,6 +261,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -265,6 +272,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -275,6 +283,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -286,6 +295,7 @@ debug: Optimizing subroutine examples.boolean_binary_ops.contract.BooleanBinaryO debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -295,6 +305,7 @@ debug: Optimizing subroutine examples.boolean_binary_ops.contract.test_boolean_b debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -304,6 +315,7 @@ debug: Optimizing subroutine examples.boolean_binary_ops.contract.test_boolean_s debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -313,6 +325,7 @@ debug: Optimizing subroutine examples.boolean_binary_ops.contract.bool_to_bytes debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -322,6 +335,7 @@ debug: Optimizing subroutine examples.boolean_binary_ops.contract.log_and_return debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -331,6 +345,7 @@ debug: Optimizing subroutine examples.boolean_binary_ops.contract.BooleanBinaryO debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -435,107 +450,107 @@ debug: Coalescing local variables in examples.boolean_binary_ops.contract.Boolea debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/boolean_binary_ops/out/contract_BooleanBinaryOps.final.ir debug: Inserted test_boolean_binary_ops_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[7]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[9]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[9]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[16]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[18]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[20]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[20]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[25]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[27]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[27]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[32]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[34]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[34]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[36]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[38]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[38]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[43]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[45]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[45]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[50]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[52]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[52]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[57]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[59]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[59]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[64]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[66]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[66]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted test_boolean_binary_ops_block@0.ops[68]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced test_boolean_binary_ops_block@0.ops[70]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced test_boolean_binary_ops_block@0.ops[70]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[6]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[8]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[8]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[26]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[28]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[28]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[2]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[5]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[15]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[18]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[18]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[20]: 'store and_msg#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[23]: 'load and_msg#0 from scratch' with 'load and_msg#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[23]: 'load and_msg#0' with 'load and_msg#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[25]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[28]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[28]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[12]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[18]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[18]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_for_body@6.ops[1]: 'store lhs#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[29]: 'load lhs#0 from scratch' with 'load lhs#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_for_body@6.ops[29]: 'load lhs#0' with 'load lhs#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_and_contd@7.ops[7]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_and_contd@7.ops[9]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_and_contd@7.ops[9]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_and_contd@7.ops[3]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_and_contd@7.ops[6]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_and_contd@7.ops[6]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_true@8.ops[1]: 'store and_result%10#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_true@8.ops[3]: 'load and_result%10#0 from scratch' with 'load and_result%10#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_true@8.ops[3]: 'load and_result%10#0' with 'load and_result%10#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_false@9.ops[1]: 'store and_result%10#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_false@9.ops[3]: 'load and_result%10#0 from scratch' with 'load and_result%10#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_false@9.ops[3]: 'load and_result%10#0' with 'load and_result%10#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[7]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[9]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[9]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[17]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[19]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[19]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[37]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[39]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[39]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[3]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[6]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[6]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[14]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[17]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[17]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[27]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[30]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[30]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[32]: 'store or_msg#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[35]: 'load or_msg#0 from scratch' with 'load or_msg#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[35]: 'load or_msg#0' with 'load or_msg#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[37]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[40]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[40]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[24]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[30]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[30]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[1]: 'store lhs#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[13]: 'load lhs#0 from scratch' with 'load lhs#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[13]: 'load lhs#0' with 'load lhs#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[3]: 'store rhs#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[28]: 'load rhs#0 from scratch' with 'load rhs#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[28]: 'load rhs#0' with 'load rhs#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[15]: 'store lhs#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[43]: 'load lhs#0 from scratch' with 'load lhs#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@10.ops[43]: 'load lhs#0' with 'load lhs#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_or_contd@11.ops[7]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_or_contd@11.ops[9]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_or_contd@11.ops[9]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_or_contd@11.ops[3]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_or_contd@11.ops[6]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_or_contd@11.ops[6]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_true@12.ops[1]: 'store or_result%21#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_true@12.ops[3]: 'load or_result%21#0 from scratch' with 'load or_result%21#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_true@12.ops[3]: 'load or_result%21#0' with 'load or_result%21#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_false@13.ops[1]: 'store or_result%21#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_false@13.ops[3]: 'load or_result%21#0 from scratch' with 'load or_result%21#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_false@13.ops[3]: 'load or_result%21#0' with 'load or_result%21#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[7]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[9]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[9]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[3]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[6]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[6]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[13]: 'store tuple_index%1#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[17]: 'load tuple_index%1#0 from scratch' with 'load tuple_index%1#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_bool_merge@14.ops[17]: 'load tuple_index%1#0' with 'load tuple_index%1#0 from l-stack (no copy)' debug: Inserted test_boolean_shortcircuit_binary_ops_after_for@16.ops[1]: 'store tuple_index%0#0 to l-stack (copy)' -debug: Replaced test_boolean_shortcircuit_binary_ops_after_for@16.ops[5]: 'load tuple_index%0#0 from scratch' with 'load tuple_index%0#0 from l-stack (no copy)' +debug: Replaced test_boolean_shortcircuit_binary_ops_after_for@16.ops[5]: 'load tuple_index%0#0' with 'load tuple_index%0#0 from l-stack (no copy)' debug: Found 8 edge set/s for examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops -debug: Eliminated scratch slots for 2 variable/s: and_result#0, or_result#0 -info: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_true@8 -> test_boolean_shortcircuit_binary_ops_bool_merge@10: and_result#0 -info: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_false@9 -> test_boolean_shortcircuit_binary_ops_bool_merge@10: and_result#0 -info: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_true@12 -> test_boolean_shortcircuit_binary_ops_bool_merge@14: or_result#0 -info: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_false@13 -> test_boolean_shortcircuit_binary_ops_bool_merge@14: or_result#0 +debug: Allocated 2 variable/s to x-stack: and_result#0, or_result#0 +debug: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_true@8 -> test_boolean_shortcircuit_binary_ops_bool_merge@10: and_result#0 +debug: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_false@9 -> test_boolean_shortcircuit_binary_ops_bool_merge@10: and_result#0 +debug: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_true@12 -> test_boolean_shortcircuit_binary_ops_bool_merge@14: or_result#0 +debug: shared x-stack for test_boolean_shortcircuit_binary_ops_bool_false@13 -> test_boolean_shortcircuit_binary_ops_bool_merge@14: or_result#0 debug: examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops f-stack entry: ['and_msg#0', 'or_msg#0', 'rhs#0', 'tuple_index%0#8', 'tuple_index%1#0', 'tuple_index%1#7'] debug: examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops f-stack on first store: ['tuple_index%0#0', 'lhs#0'] debug: Found 2 edge set/s for examples.boolean_binary_ops.contract.bool_to_bytes -debug: Eliminated scratch slots for 1 variable/s: ternary_result%0#0 -info: shared x-stack for bool_to_bytes_ternary_true@1 -> bool_to_bytes_ternary_merge@3: ternary_result%0#0 -info: shared x-stack for bool_to_bytes_ternary_false@2 -> bool_to_bytes_ternary_merge@3: ternary_result%0#0 -info: Writing /examples/boolean_binary_ops/out/contract.approval.teal -info: Writing /examples/boolean_binary_ops/out/contract.approval.debug.teal -info: Writing /examples/boolean_binary_ops/out/contract.clear.teal -info: Writing /examples/boolean_binary_ops/out/contract.clear.debug.teal +debug: Allocated 1 variable/s to x-stack: ternary_result%0#0 +debug: shared x-stack for bool_to_bytes_ternary_true@1 -> bool_to_bytes_ternary_merge@3: ternary_result%0#0 +debug: shared x-stack for bool_to_bytes_ternary_false@2 -> bool_to_bytes_ternary_merge@3: ternary_result%0#0 +info: Writing boolean_binary_ops/out/contract.approval.teal +info: Writing boolean_binary_ops/out/contract.approval.debug.teal +info: Writing boolean_binary_ops/out/contract.clear.teal +info: Writing boolean_binary_ops/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/boolean_binary_ops/out/contract.approval.debug.teal b/examples/boolean_binary_ops/out/contract.approval.debug.teal index 7e163f6bf4..a8189dfa2e 100644 --- a/examples/boolean_binary_ops/out/contract.approval.debug.teal +++ b/examples/boolean_binary_ops/out/contract.approval.debug.teal @@ -12,7 +12,7 @@ main_block@0: return // return True File "boolean_binary_ops/contract.py", line 8 -// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> : +// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> void: test_boolean_binary_ops: proto 2 0 // (𝕡) true#0,false#0 | def test_boolean_binary_ops(*, true: bool, false: bool) -> None: File "boolean_binary_ops/contract.py", line 15 @@ -56,7 +56,7 @@ test_boolean_binary_ops_block@0: retsub // -// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> : +// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> void: test_boolean_shortcircuit_binary_ops: proto 0 0 // def test_boolean_shortcircuit_binary_ops() -> None: File "boolean_binary_ops/contract.py", line 33 int 0 @@ -95,7 +95,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup // store lhs#0 to l-stack (copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,lhs#0 lhs File "boolean_binary_ops/contract.py", line 34 callsub bool_to_bytes // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,{bool_to_bytes} bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 byte "_" // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,tmp%2#0,"_" b"_" File "boolean_binary_ops/contract.py", line 36 - uncover 1 // load tmp%2#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,"_",tmp%2#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 + swap // load tmp%2#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,"_",tmp%2#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,{concat} b"_" + bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 byte "_and_" // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,tmp%3#0,"_and_" b"_and_" File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,{concat} b"_" + bool_to_bytes(lhs) + b"_and_" File "boolean_binary_ops/contract.py", line 36 @@ -105,7 +105,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup // store and_msg#0 to l-stack (copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,and_msg#0,and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 frame_bury 0 // store and_msg#0 to f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 byte "lhs" // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,and_msg#0,"lhs" b"lhs" File "boolean_binary_ops/contract.py", line 37 - uncover 1 // load and_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,"lhs",and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 + swap // load and_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,"lhs",and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,{concat} b"lhs" + and_msg File "boolean_binary_ops/contract.py", line 37 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | {log_and_return} log_and_return(lhs, b"lhs" + and_msg) File "boolean_binary_ops/contract.py", line 37 bz test_boolean_shortcircuit_binary_ops_bool_false@9 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | log_and_return(lhs, b"lhs" + and_msg) and log_and_return( File "boolean_binary_ops/contract.py", line 37 @@ -116,7 +116,7 @@ test_boolean_shortcircuit_binary_ops_and_contd@7: frame_dig 0 // load and_msg#0 from f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | "rhs",and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | {concat} b"rhs" + and_msg File "boolean_binary_ops/contract.py", line 38 frame_dig 2 // load rhs#0 from f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tmp%8#0,rhs#0 rhs File "boolean_binary_ops/contract.py", line 35 - uncover 1 // load tmp%8#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,tmp%8#0 b"rhs" + and_msg File "boolean_binary_ops/contract.py", line 38 + swap // load tmp%8#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,tmp%8#0 b"rhs" + and_msg File "boolean_binary_ops/contract.py", line 38 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | {log_and_return} log_and_return( File "boolean_binary_ops/contract.py", line 37 bz test_boolean_shortcircuit_binary_ops_bool_false@9 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | log_and_return(lhs, b"lhs" + and_msg) and log_and_return( File "boolean_binary_ops/contract.py", line 37 // Implicit fall through to test_boolean_shortcircuit_binary_ops_bool_true@8 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | log_and_return(lhs, b"lhs" + and_msg) and log_and_return( File "boolean_binary_ops/contract.py", line 37 @@ -142,7 +142,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup // load lhs#0 from l-stack (copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,lhs#0 lhs File "boolean_binary_ops/contract.py", line 34 callsub bool_to_bytes // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,{bool_to_bytes} bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 byte "_" // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,tmp%13#0,"_" b"_" File "boolean_binary_ops/contract.py", line 41 - uncover 1 // load tmp%13#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,"_",tmp%13#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 + swap // load tmp%13#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,"_",tmp%13#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,{concat} b"_" + bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 byte "_or_" // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,tmp%14#0,"_or_" b"_or_" File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,lhs#0,{concat} b"_" + bool_to_bytes(lhs) + b"_or_" File "boolean_binary_ops/contract.py", line 41 @@ -152,7 +152,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup // store or_msg#0 to l-stack (copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,or_msg#0,or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 frame_bury 1 // store or_msg#0 to f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 byte "lhs" // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,or_msg#0,"lhs" b"lhs" File "boolean_binary_ops/contract.py", line 42 - uncover 1 // load or_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,"lhs",or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 + swap // load or_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,"lhs",or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | lhs#0,{concat} b"lhs" + or_msg File "boolean_binary_ops/contract.py", line 42 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | {log_and_return} log_and_return(lhs, b"lhs" + or_msg) File "boolean_binary_ops/contract.py", line 42 bnz test_boolean_shortcircuit_binary_ops_bool_true@12 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | log_and_return(lhs, b"lhs" + or_msg) or log_and_return( File "boolean_binary_ops/contract.py", line 42 @@ -163,7 +163,7 @@ test_boolean_shortcircuit_binary_ops_or_contd@11: frame_dig 1 // load or_msg#0 from f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | "rhs",or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | {concat} b"rhs" + or_msg File "boolean_binary_ops/contract.py", line 43 frame_dig 2 // load rhs#0 from f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tmp%19#0,rhs#0 rhs File "boolean_binary_ops/contract.py", line 35 - uncover 1 // load tmp%19#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,tmp%19#0 b"rhs" + or_msg File "boolean_binary_ops/contract.py", line 43 + swap // load tmp%19#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | rhs#0,tmp%19#0 b"rhs" + or_msg File "boolean_binary_ops/contract.py", line 43 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | {log_and_return} log_and_return( File "boolean_binary_ops/contract.py", line 42 bz test_boolean_shortcircuit_binary_ops_bool_false@13 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | log_and_return(lhs, b"lhs" + or_msg) or log_and_return( File "boolean_binary_ops/contract.py", line 42 // Implicit fall through to test_boolean_shortcircuit_binary_ops_bool_true@12 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | log_and_return(lhs, b"lhs" + or_msg) or log_and_return( File "boolean_binary_ops/contract.py", line 42 @@ -187,7 +187,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@14: int 1 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tuple_index%1#0,tuple_index%1#0,1 + // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tuple_index%1#0,{+} frame_bury 5 // store tuple_index%1#7 to f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tuple_index%1#0 - switch test_boolean_shortcircuit_binary_ops_for_header_1@5 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | for rhs in (True, False): File "boolean_binary_ops/contract.py", line 35 + bz test_boolean_shortcircuit_binary_ops_for_header_1@5 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | for rhs in (True, False): File "boolean_binary_ops/contract.py", line 35 // Implicit fall through to test_boolean_shortcircuit_binary_ops_after_for@16 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | for rhs in (True, False): File "boolean_binary_ops/contract.py", line 35 test_boolean_shortcircuit_binary_ops_after_for@16: @@ -196,7 +196,7 @@ test_boolean_shortcircuit_binary_ops_after_for@16: int 1 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tuple_index%0#0,tuple_index%0#0,1 + // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tuple_index%0#0,{+} frame_bury 3 // store tuple_index%0#8 to f-stack (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | tuple_index%0#0 - switch test_boolean_shortcircuit_binary_ops_for_header_1@2 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | for lhs in (True, False): File "boolean_binary_ops/contract.py", line 34 + bz test_boolean_shortcircuit_binary_ops_for_header_1@2 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | for lhs in (True, False): File "boolean_binary_ops/contract.py", line 34 // Implicit fall through to test_boolean_shortcircuit_binary_ops_after_for@18 // (𝕗) and_msg#0,or_msg#0,rhs#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7,tuple_index%0#0,lhs#0 | for lhs in (True, False): File "boolean_binary_ops/contract.py", line 34 test_boolean_shortcircuit_binary_ops_after_for@18: diff --git a/examples/boolean_binary_ops/out/contract.approval.teal b/examples/boolean_binary_ops/out/contract.approval.teal index eb3ea1b2a0..d696476bf9 100644 --- a/examples/boolean_binary_ops/out/contract.approval.teal +++ b/examples/boolean_binary_ops/out/contract.approval.teal @@ -10,7 +10,7 @@ main_block@0: return -// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> : +// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> void: test_boolean_binary_ops: proto 2 0 @@ -54,7 +54,7 @@ test_boolean_binary_ops_block@0: retsub -// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> : +// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> void: test_boolean_shortcircuit_binary_ops: proto 0 0 int 0 @@ -91,7 +91,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup callsub bool_to_bytes byte "_" - uncover 1 + swap concat byte "_and_" concat @@ -101,7 +101,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup frame_bury 0 byte "lhs" - uncover 1 + swap concat callsub log_and_return bz test_boolean_shortcircuit_binary_ops_bool_false@9 @@ -111,7 +111,7 @@ test_boolean_shortcircuit_binary_ops_and_contd@7: frame_dig 0 concat frame_dig 2 - uncover 1 + swap callsub log_and_return bz test_boolean_shortcircuit_binary_ops_bool_false@9 @@ -135,7 +135,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup callsub bool_to_bytes byte "_" - uncover 1 + swap concat byte "_or_" concat @@ -145,7 +145,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup frame_bury 1 byte "lhs" - uncover 1 + swap concat callsub log_and_return bnz test_boolean_shortcircuit_binary_ops_bool_true@12 @@ -155,7 +155,7 @@ test_boolean_shortcircuit_binary_ops_or_contd@11: frame_dig 1 concat frame_dig 2 - uncover 1 + swap callsub log_and_return bz test_boolean_shortcircuit_binary_ops_bool_false@13 @@ -177,7 +177,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@14: int 1 + frame_bury 5 - switch test_boolean_shortcircuit_binary_ops_for_header_1@5 + bz test_boolean_shortcircuit_binary_ops_for_header_1@5 test_boolean_shortcircuit_binary_ops_after_for@16: frame_dig 6 @@ -185,7 +185,7 @@ test_boolean_shortcircuit_binary_ops_after_for@16: int 1 + frame_bury 3 - switch test_boolean_shortcircuit_binary_ops_for_header_1@2 + bz test_boolean_shortcircuit_binary_ops_for_header_1@2 test_boolean_shortcircuit_binary_ops_after_for@18: retsub diff --git a/examples/boolean_binary_ops/out/contract.approval_unoptimized.debug.teal b/examples/boolean_binary_ops/out/contract.approval_unoptimized.debug.teal index 808e285d2b..9b5cc83a78 100644 --- a/examples/boolean_binary_ops/out/contract.approval_unoptimized.debug.teal +++ b/examples/boolean_binary_ops/out/contract.approval_unoptimized.debug.teal @@ -12,7 +12,7 @@ main_block@0: return // return True File "boolean_binary_ops/contract.py", line 8 -// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> : +// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> void: test_boolean_binary_ops: proto 2 0 // (𝕡) true#0,false#0 | def test_boolean_binary_ops(*, true: bool, false: bool) -> None: File "boolean_binary_ops/contract.py", line 15 @@ -56,7 +56,7 @@ test_boolean_binary_ops_block@0: retsub // -// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> : +// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> void: test_boolean_shortcircuit_binary_ops: proto 0 0 // def test_boolean_shortcircuit_binary_ops() -> None: File "boolean_binary_ops/contract.py", line 33 int 0 @@ -103,7 +103,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup // store lhs#0 to l-stack (copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,lhs#0 lhs File "boolean_binary_ops/contract.py", line 34 callsub bool_to_bytes // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,{bool_to_bytes} bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 byte "_" // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,tmp%2#0,"_" b"_" File "boolean_binary_ops/contract.py", line 36 - uncover 1 // load tmp%2#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,"_",tmp%2#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 + swap // load tmp%2#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,"_",tmp%2#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,{concat} b"_" + bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 36 byte "_and_" // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,tmp%3#0,"_and_" b"_and_" File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,{concat} b"_" + bool_to_bytes(lhs) + b"_and_" File "boolean_binary_ops/contract.py", line 36 @@ -113,7 +113,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup // store and_msg#0 to l-stack (copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,and_msg#0,and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 frame_bury 0 // store and_msg#0 to f-stack (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 byte "lhs" // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,and_msg#0,"lhs" b"lhs" File "boolean_binary_ops/contract.py", line 37 - uncover 1 // load and_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,"lhs",and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 + swap // load and_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,"lhs",and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,{concat} b"lhs" + and_msg File "boolean_binary_ops/contract.py", line 37 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | {log_and_return} log_and_return(lhs, b"lhs" + and_msg) File "boolean_binary_ops/contract.py", line 37 bz test_boolean_shortcircuit_binary_ops_bool_false@9 // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | log_and_return(lhs, b"lhs" + and_msg) and log_and_return( File "boolean_binary_ops/contract.py", line 37 @@ -124,7 +124,7 @@ test_boolean_shortcircuit_binary_ops_and_contd@7: frame_dig 0 // load and_msg#0 from f-stack (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | "rhs",and_msg#0 and_msg File "boolean_binary_ops/contract.py", line 36 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | {concat} b"rhs" + and_msg File "boolean_binary_ops/contract.py", line 38 frame_dig 3 // load rhs#0 from f-stack (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | tmp%8#0,rhs#0 rhs File "boolean_binary_ops/contract.py", line 35 - uncover 1 // load tmp%8#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,tmp%8#0 b"rhs" + and_msg File "boolean_binary_ops/contract.py", line 38 + swap // load tmp%8#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,tmp%8#0 b"rhs" + and_msg File "boolean_binary_ops/contract.py", line 38 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | {log_and_return} log_and_return( File "boolean_binary_ops/contract.py", line 37 bz test_boolean_shortcircuit_binary_ops_bool_false@9 // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | log_and_return(lhs, b"lhs" + and_msg) and log_and_return( File "boolean_binary_ops/contract.py", line 37 // Implicit fall through to test_boolean_shortcircuit_binary_ops_bool_true@8 // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | log_and_return(lhs, b"lhs" + and_msg) and log_and_return( File "boolean_binary_ops/contract.py", line 37 @@ -150,7 +150,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup // load lhs#0 from l-stack (copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,lhs#0 lhs File "boolean_binary_ops/contract.py", line 34 callsub bool_to_bytes // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,{bool_to_bytes} bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 byte "_" // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,tmp%13#0,"_" b"_" File "boolean_binary_ops/contract.py", line 41 - uncover 1 // load tmp%13#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,"_",tmp%13#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 + swap // load tmp%13#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,"_",tmp%13#0 bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,{concat} b"_" + bool_to_bytes(lhs) File "boolean_binary_ops/contract.py", line 41 byte "_or_" // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,tmp%14#0,"_or_" b"_or_" File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,lhs#0,{concat} b"_" + bool_to_bytes(lhs) + b"_or_" File "boolean_binary_ops/contract.py", line 41 @@ -160,7 +160,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup // store or_msg#0 to l-stack (copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,or_msg#0,or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 frame_bury 1 // store or_msg#0 to f-stack (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 byte "lhs" // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,or_msg#0,"lhs" b"lhs" File "boolean_binary_ops/contract.py", line 42 - uncover 1 // load or_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,"lhs",or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 + swap // load or_msg#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,"lhs",or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | lhs#0,{concat} b"lhs" + or_msg File "boolean_binary_ops/contract.py", line 42 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | {log_and_return} log_and_return(lhs, b"lhs" + or_msg) File "boolean_binary_ops/contract.py", line 42 bnz test_boolean_shortcircuit_binary_ops_bool_true@12 // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | log_and_return(lhs, b"lhs" + or_msg) or log_and_return( File "boolean_binary_ops/contract.py", line 42 @@ -171,7 +171,7 @@ test_boolean_shortcircuit_binary_ops_or_contd@11: frame_dig 1 // load or_msg#0 from f-stack (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | "rhs",or_msg#0 or_msg File "boolean_binary_ops/contract.py", line 41 concat // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | {concat} b"rhs" + or_msg File "boolean_binary_ops/contract.py", line 43 frame_dig 3 // load rhs#0 from f-stack (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | tmp%19#0,rhs#0 rhs File "boolean_binary_ops/contract.py", line 35 - uncover 1 // load tmp%19#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,tmp%19#0 b"rhs" + or_msg File "boolean_binary_ops/contract.py", line 43 + swap // load tmp%19#0 from l-stack (no copy) (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | rhs#0,tmp%19#0 b"rhs" + or_msg File "boolean_binary_ops/contract.py", line 43 callsub log_and_return // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | {log_and_return} log_and_return( File "boolean_binary_ops/contract.py", line 42 bz test_boolean_shortcircuit_binary_ops_bool_false@13 // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | log_and_return(lhs, b"lhs" + or_msg) or log_and_return( File "boolean_binary_ops/contract.py", line 42 // Implicit fall through to test_boolean_shortcircuit_binary_ops_bool_true@12 // (𝕗) and_msg#0,or_msg#0,lhs#0,rhs#0,tuple_index%0#0,tuple_index%0#8,tuple_index%1#0,tuple_index%1#7 | log_and_return(lhs, b"lhs" + or_msg) or log_and_return( File "boolean_binary_ops/contract.py", line 42 diff --git a/examples/boolean_binary_ops/out/contract.approval_unoptimized.teal b/examples/boolean_binary_ops/out/contract.approval_unoptimized.teal index 96f81adce3..d983253dbc 100644 --- a/examples/boolean_binary_ops/out/contract.approval_unoptimized.teal +++ b/examples/boolean_binary_ops/out/contract.approval_unoptimized.teal @@ -10,7 +10,7 @@ main_block@0: return -// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> : +// examples.boolean_binary_ops.contract.test_boolean_binary_ops(true#0: uint64, false#0: uint64) -> void: test_boolean_binary_ops: proto 2 0 @@ -54,7 +54,7 @@ test_boolean_binary_ops_block@0: retsub -// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> : +// examples.boolean_binary_ops.contract.test_boolean_shortcircuit_binary_ops() -> void: test_boolean_shortcircuit_binary_ops: proto 0 0 int 0 @@ -97,7 +97,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup callsub bool_to_bytes byte "_" - uncover 1 + swap concat byte "_and_" concat @@ -107,7 +107,7 @@ test_boolean_shortcircuit_binary_ops_for_body@6: dup frame_bury 0 byte "lhs" - uncover 1 + swap concat callsub log_and_return bz test_boolean_shortcircuit_binary_ops_bool_false@9 @@ -117,7 +117,7 @@ test_boolean_shortcircuit_binary_ops_and_contd@7: frame_dig 0 concat frame_dig 3 - uncover 1 + swap callsub log_and_return bz test_boolean_shortcircuit_binary_ops_bool_false@9 @@ -141,7 +141,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup callsub bool_to_bytes byte "_" - uncover 1 + swap concat byte "_or_" concat @@ -151,7 +151,7 @@ test_boolean_shortcircuit_binary_ops_bool_merge@10: dup frame_bury 1 byte "lhs" - uncover 1 + swap concat callsub log_and_return bnz test_boolean_shortcircuit_binary_ops_bool_true@12 @@ -161,7 +161,7 @@ test_boolean_shortcircuit_binary_ops_or_contd@11: frame_dig 1 concat frame_dig 3 - uncover 1 + swap callsub log_and_return bz test_boolean_shortcircuit_binary_ops_bool_false@13 diff --git a/examples/boolean_binary_ops/out/contract.awst b/examples/boolean_binary_ops/out/contract.awst index 77177b25ce..0dee4f6599 100644 --- a/examples/boolean_binary_ops/out/contract.awst +++ b/examples/boolean_binary_ops/out/contract.awst @@ -27,7 +27,7 @@ subroutine test_boolean_binary_ops(true: bool, false: bool): None subroutine bool_to_bytes(x: bool): algopy.Bytes { - return x ? 'true' : 'false' + return (x) ? ('true') : ('false') } subroutine test_boolean_shortcircuit_binary_ops(): None diff --git a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.cssa.ir b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.cssa.ir index 697fb46524..b9682650d4 100644 --- a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.cssa.ir +++ b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.cssa.ir @@ -109,10 +109,10 @@ contract examples.boolean_binary_ops.contract.BooleanBinaryOps: let tmp%23#0: uint64 = (== or_result#0 tmp%22#0) (assert tmp%23#0) let tuple_index%1#7: uint64 = (+ tuple_index%1#4 1u) - goto [block@5, ...block@16][tuple_index%1#4] + goto tuple_index%1#4 ? block@16 : block@5 block@16: // after_for_L35 let tuple_index%0#8: uint64 = (+ tuple_index%0#5 1u) - goto [block@2, ...block@18][tuple_index%0#5] + goto tuple_index%0#5 ? block@18 : block@2 block@18: // after_for_L34 return diff --git a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.final.ir b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.final.ir index 86402bc721..752fb710e0 100644 --- a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.final.ir +++ b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.final.ir @@ -97,10 +97,10 @@ contract examples.boolean_binary_ops.contract.BooleanBinaryOps: let tmp%23#0: uint64 = (== or_result#0 tmp%22#0) (assert tmp%23#0) let tuple_index%1#7: uint64 = (+ tuple_index%1#0 1u) - goto [block@5, ...block@16][tuple_index%1#0] + goto tuple_index%1#0 ? block@16 : block@5 block@16: // after_for_L35 let tuple_index%0#8: uint64 = (+ tuple_index%0#0 1u) - goto [block@2, ...block@18][tuple_index%0#0] + goto tuple_index%0#0 ? block@18 : block@2 block@18: // after_for_L34 return diff --git a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.parallel_copies.ir b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.parallel_copies.ir index fe25cc7e94..03d7ea65ff 100644 --- a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.parallel_copies.ir +++ b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.parallel_copies.ir @@ -109,10 +109,10 @@ contract examples.boolean_binary_ops.contract.BooleanBinaryOps: let tmp%23#0: uint64 = (== or_result#0 tmp%22#0) (assert tmp%23#0) let tuple_index%1#7: uint64 = (+ tuple_index%1#4 1u) - goto [block@5, ...block@16][tuple_index%1#4] + goto tuple_index%1#4 ? block@16 : block@5 block@16: // after_for_L35 let tuple_index%0#8: uint64 = (+ tuple_index%0#5 1u) - goto [block@2, ...block@18][tuple_index%0#5] + goto tuple_index%0#5 ? block@18 : block@2 block@18: // after_for_L34 return diff --git a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.post_ssa.ir b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.post_ssa.ir index 4b66764e09..789613d536 100644 --- a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.post_ssa.ir +++ b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.post_ssa.ir @@ -103,10 +103,10 @@ contract examples.boolean_binary_ops.contract.BooleanBinaryOps: let tmp%23#0: uint64 = (== or_result#0 tmp%22#0) (assert tmp%23#0) let tuple_index%1#7: uint64 = (+ tuple_index%1#4 1u) - goto [block@5, ...block@16][tuple_index%1#4] + goto tuple_index%1#4 ? block@16 : block@5 block@16: // after_for_L35 let tuple_index%0#8: uint64 = (+ tuple_index%0#5 1u) - goto [block@2, ...block@18][tuple_index%0#5] + goto tuple_index%0#5 ? block@18 : block@2 block@18: // after_for_L34 return diff --git a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.ssa.opt_pass_1.ir b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.ssa.opt_pass_1.ir index 7736ef5bba..7a577329a2 100644 --- a/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.ssa.opt_pass_1.ir +++ b/examples/boolean_binary_ops/out/contract_BooleanBinaryOps.ssa.opt_pass_1.ir @@ -97,10 +97,10 @@ contract examples.boolean_binary_ops.contract.BooleanBinaryOps: let tmp%23#0: uint64 = (== or_result#0 tmp%22#0) (assert tmp%23#0) let tuple_index%1#7: uint64 = (+ tuple_index%1#4 1u) - goto [block@5, ...block@16][tuple_index%1#4] + goto tuple_index%1#4 ? block@16 : block@5 block@16: // after_for_L35 let tuple_index%0#8: uint64 = (+ tuple_index%0#5 1u) - goto [block@2, ...block@18][tuple_index%0#5] + goto tuple_index%0#5 ? block@18 : block@2 block@18: // after_for_L34 return diff --git a/examples/byte_constants.algopy.log b/examples/byte_constants.algopy.log index 9fc2e7b8a1..ed5e01b309 100644 --- a/examples/byte_constants.algopy.log +++ b/examples/byte_constants.algopy.log @@ -1,6 +1,7 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 byte_constants.py -info: Building AWST for __init__.py -info: Building AWST for byte_constants.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug byte_constants.py +debug: Building AWST for __init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for byte_constants.py debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L16 @@ -13,6 +14,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable base_64#0 debug: Removing unused variable base_32#0 @@ -27,6 +29,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -38,6 +41,7 @@ debug: Optimizing subroutine examples.byte_constants.ByteConstantsContract.appro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -47,6 +51,7 @@ debug: Optimizing subroutine examples.byte_constants.ByteConstantsContract.clear debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -66,25 +71,25 @@ debug: Coalescing local variables in examples.byte_constants.ByteConstantsContra debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/out/byte_constants_ByteConstantsContract.final.ir debug: Inserted main_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[13]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[15]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[15]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[18]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[20]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[20]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[23]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[25]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[25]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[28]: 'store result#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[30]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[30]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[34]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[36]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[36]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[38]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[40]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[40]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[31]: 'store result#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[33]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' -info: Writing /examples/out/byte_constants.approval.teal -info: Writing /examples/out/byte_constants.approval.debug.teal -info: Writing /examples/out/byte_constants.clear.teal -info: Writing /examples/out/byte_constants.clear.debug.teal +debug: Replaced main_block@0.ops[33]: 'load result#0' with 'load result#0 from l-stack (no copy)' +info: Writing out/byte_constants.approval.teal +info: Writing out/byte_constants.approval.debug.teal +info: Writing out/byte_constants.clear.teal +info: Writing out/byte_constants.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/bytes_ops/algopy.log b/examples/bytes_ops/algopy.log index ad240efe54..af7093e49a 100644 --- a/examples/bytes_ops/algopy.log +++ b/examples/bytes_ops/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 bytes_ops -info: Building AWST for __init__.py -info: Building AWST for bytes_ops -info: Building AWST for bytes_ops/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug bytes_ops +debug: Building AWST for __init__.py +debug: Building AWST for bytes_ops +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for bytes_ops/contract.py debug: Sealing block@0: // L22 debug: Terminated block@0: // L22 debug: Sealing block@0: // L42 @@ -18,6 +19,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -28,6 +30,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -38,6 +41,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable five#0 debug: Removing unused variable sixteen#0 @@ -50,6 +54,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -61,6 +66,7 @@ debug: Optimizing subroutine examples.bytes_ops.contract.BiguintBinaryOps.approv debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -70,6 +76,7 @@ debug: Optimizing subroutine examples.bytes_ops.contract.do_some_ops debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -79,6 +86,7 @@ debug: Optimizing subroutine examples.bytes_ops.contract.do_augmented_assignment debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -88,6 +96,7 @@ debug: Optimizing subroutine examples.bytes_ops.contract.BiguintBinaryOps.clear_ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -117,33 +126,33 @@ debug: Coalescing local variables in examples.bytes_ops.contract.BiguintBinaryOp debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/bytes_ops/out/contract_BiguintBinaryOps.final.ir debug: Inserted do_some_ops_block@0.ops[3]: 'store result#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[5]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[5]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[8]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[10]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[10]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[15]: 'store result#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[17]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[17]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[20]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[22]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[22]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[27]: 'store result#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[29]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[29]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[32]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[34]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[34]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[39]: 'store result#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[41]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[41]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted do_some_ops_block@0.ops[44]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced do_some_ops_block@0.ops[46]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced do_some_ops_block@0.ops[46]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted do_augmented_assignment_ops_block@0.ops[6]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced do_augmented_assignment_ops_block@0.ops[8]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced do_augmented_assignment_ops_block@0.ops[8]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted do_augmented_assignment_ops_block@0.ops[16]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced do_augmented_assignment_ops_block@0.ops[18]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced do_augmented_assignment_ops_block@0.ops[18]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted do_augmented_assignment_ops_block@0.ops[26]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced do_augmented_assignment_ops_block@0.ops[28]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced do_augmented_assignment_ops_block@0.ops[28]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted do_augmented_assignment_ops_block@0.ops[36]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced do_augmented_assignment_ops_block@0.ops[38]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced do_augmented_assignment_ops_block@0.ops[38]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted do_augmented_assignment_ops_block@0.ops[46]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced do_augmented_assignment_ops_block@0.ops[48]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' -info: Writing /examples/bytes_ops/out/contract.approval.teal -info: Writing /examples/bytes_ops/out/contract.approval.debug.teal -info: Writing /examples/bytes_ops/out/contract.clear.teal -info: Writing /examples/bytes_ops/out/contract.clear.debug.teal +debug: Replaced do_augmented_assignment_ops_block@0.ops[48]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +info: Writing bytes_ops/out/contract.approval.teal +info: Writing bytes_ops/out/contract.approval.debug.teal +info: Writing bytes_ops/out/contract.clear.teal +info: Writing bytes_ops/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/bytes_ops/out/contract.approval.debug.teal b/examples/bytes_ops/out/contract.approval.debug.teal index 522103cfd9..a4aa23c13a 100644 --- a/examples/bytes_ops/out/contract.approval.debug.teal +++ b/examples/bytes_ops/out/contract.approval.debug.teal @@ -17,7 +17,7 @@ main_block@0: return // return True File "bytes_ops/contract.py", line 15 -// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> : +// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> void: do_some_ops: proto 6 0 // (𝕡) left#0,right#0,concat#0,bitwise_or#0,bitwise_xor#0,bitwise_and#0 | def do_some_ops( File "bytes_ops/contract.py", line 22 @@ -49,7 +49,7 @@ do_some_ops_block@0: retsub // -// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> : +// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> void: do_augmented_assignment_ops: proto 1 0 // (𝕡) seed#0 | def do_augmented_assignment_ops(seed: Bytes) -> None: File "bytes_ops/contract.py", line 42 diff --git a/examples/bytes_ops/out/contract.approval.teal b/examples/bytes_ops/out/contract.approval.teal index 3daeed75ef..bcf4e4fb7a 100644 --- a/examples/bytes_ops/out/contract.approval.teal +++ b/examples/bytes_ops/out/contract.approval.teal @@ -15,7 +15,7 @@ main_block@0: return -// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> : +// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> void: do_some_ops: proto 6 0 @@ -47,7 +47,7 @@ do_some_ops_block@0: retsub -// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> : +// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> void: do_augmented_assignment_ops: proto 1 0 diff --git a/examples/bytes_ops/out/contract.approval_unoptimized.debug.teal b/examples/bytes_ops/out/contract.approval_unoptimized.debug.teal index ff59176bac..54bce90cd1 100644 --- a/examples/bytes_ops/out/contract.approval_unoptimized.debug.teal +++ b/examples/bytes_ops/out/contract.approval_unoptimized.debug.teal @@ -17,7 +17,7 @@ main_block@0: return // return True File "bytes_ops/contract.py", line 15 -// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> : +// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> void: do_some_ops: proto 6 0 // (𝕡) left#0,right#0,concat#0,bitwise_or#0,bitwise_xor#0,bitwise_and#0 | def do_some_ops( File "bytes_ops/contract.py", line 22 @@ -49,7 +49,7 @@ do_some_ops_block@0: retsub // -// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> : +// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> void: do_augmented_assignment_ops: proto 1 0 // (𝕡) seed#0 | def do_augmented_assignment_ops(seed: Bytes) -> None: File "bytes_ops/contract.py", line 42 @@ -88,7 +88,7 @@ do_augmented_assignment_ops_block@0: == // (𝕡) seed#0 | five#0,{==} seed == sixteen File "bytes_ops/contract.py", line 61 assert // (𝕡) seed#0 | five#0 assert seed == sixteen File "bytes_ops/contract.py", line 61 frame_dig -1 // load seed#0 from parameters (𝕡) seed#0 | five#0,seed#0 seed: Bytes File "bytes_ops/contract.py", line 42 - uncover 1 // load five#0 from l-stack (no copy) (𝕡) seed#0 | seed#0,five#0 five File "bytes_ops/contract.py", line 47 + swap // load five#0 from l-stack (no copy) (𝕡) seed#0 | seed#0,five#0 five File "bytes_ops/contract.py", line 47 concat // (𝕡) seed#0 | {concat} seed += five File "bytes_ops/contract.py", line 63 dup frame_bury -1 // store seed#0 to parameters (copy) (𝕡) seed#0 | seed#0 seed: Bytes File "bytes_ops/contract.py", line 42 diff --git a/examples/bytes_ops/out/contract.approval_unoptimized.teal b/examples/bytes_ops/out/contract.approval_unoptimized.teal index 7cb712ef2d..0b9675791d 100644 --- a/examples/bytes_ops/out/contract.approval_unoptimized.teal +++ b/examples/bytes_ops/out/contract.approval_unoptimized.teal @@ -15,7 +15,7 @@ main_block@0: return -// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> : +// examples.bytes_ops.contract.do_some_ops(left#0: bytes, right#0: bytes, concat#0: bytes, bitwise_or#0: bytes, bitwise_xor#0: bytes, bitwise_and#0: bytes) -> void: do_some_ops: proto 6 0 @@ -47,7 +47,7 @@ do_some_ops_block@0: retsub -// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> : +// examples.bytes_ops.contract.do_augmented_assignment_ops(seed#0: bytes) -> void: do_augmented_assignment_ops: proto 1 0 @@ -86,7 +86,7 @@ do_augmented_assignment_ops_block@0: == assert frame_dig -1 - uncover 1 + swap concat dup frame_bury -1 diff --git a/examples/bytes_ops/out/contract.awst b/examples/bytes_ops/out/contract.awst index 5fd88b62e6..6b4bdc1027 100644 --- a/examples/bytes_ops/out/contract.awst +++ b/examples/bytes_ops/out/contract.awst @@ -2,8 +2,8 @@ contract BiguintBinaryOps { approval_program(): bool { - examples.bytes_ops.contract::do_some_ops(left=Bytes.from_base16("FF"), right=Bytes.from_base16("0F"), concat=Bytes.from_base16("FF0F"), bitwise_or=Bytes.from_base16("FF"), bitwise_xor=Bytes.from_base16("F0"), bitwise_and=Bytes.from_base16("0F")) - examples.bytes_ops.contract::do_augmented_assignment_ops(Bytes.from_base16("FF")) + examples.bytes_ops.contract::do_some_ops(left=hex<"FF">, right=hex<"0F">, concat=hex<"FF0F">, bitwise_or=hex<"FF">, bitwise_xor=hex<"F0">, bitwise_and=hex<"0F">) + examples.bytes_ops.contract::do_augmented_assignment_ops(hex<"FF">) return true } @@ -27,16 +27,16 @@ subroutine do_some_ops(left: algopy.Bytes, right: algopy.Bytes, concat: algopy.B subroutine do_augmented_assignment_ops(seed: algopy.Bytes): None { - seed &= Bytes.from_base16("00") - assert(seed == Bytes.from_base16("00")) - five: algopy.Bytes = Bytes.from_base16("05") + seed &= hex<"00"> + assert(seed == hex<"00">) + five: algopy.Bytes = hex<"05"> seed |= five assert(seed == five) - sixteen: algopy.Bytes = Bytes.from_base16("10") + sixteen: algopy.Bytes = hex<"10"> seed ^= sixteen - assert(seed == Bytes.from_base16("15")) + assert(seed == hex<"15">) seed ^= five assert(seed == sixteen) seed += five - assert(seed == Bytes.from_base16("1005")) + assert(seed == hex<"1005">) } \ No newline at end of file diff --git a/examples/calculator/algopy.log b/examples/calculator/algopy.log index a64b162d8d..e928f82fac 100644 --- a/examples/calculator/algopy.log +++ b/examples/calculator/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 calculator -info: Building AWST for __init__.py -info: Building AWST for calculator -info: Building AWST for calculator/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug calculator +debug: Building AWST for __init__.py +debug: Building AWST for calculator +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for calculator/contract.py debug: Sealing block@0: // L57 debug: Terminated block@0: // L57 debug: Sealing block@None: // if_body_L58 @@ -88,6 +89,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -98,6 +100,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -108,6 +111,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -118,6 +122,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -128,6 +133,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -138,6 +144,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -148,6 +155,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable digits#0 debug: Optimizer: Simplify Conditional Branches @@ -159,6 +167,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -169,6 +178,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -180,6 +190,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.approval_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -189,6 +200,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.do_calc debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -198,6 +210,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.add debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -207,6 +220,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.sub debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -216,6 +230,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.mul debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -225,6 +240,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.div debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -235,6 +251,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded len("0123456789") to 10 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable radix#0 debug: Optimizer: Simplify Conditional Branches @@ -245,6 +262,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.op debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -254,6 +272,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.clear_state debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -265,6 +284,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.approval_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -274,6 +294,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.do_calc debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -283,6 +304,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.add debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -292,6 +314,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.sub debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -301,6 +324,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.mul debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -310,6 +334,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.div debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -319,6 +344,7 @@ debug: Optimizing subroutine examples.calculator.contract.itoa debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -328,6 +354,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.op debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -337,6 +364,7 @@ debug: Optimizing subroutine examples.calculator.contract.MyContract.clear_state debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -426,113 +454,113 @@ debug: Coalescing local variables in examples.calculator.contract.MyContract.cle debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/calculator/out/contract_MyContract.final.ir debug: Inserted main_block@0.ops[1]: 'store num_args#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load num_args#0 from scratch' with 'load num_args#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load num_args#0' with 'load num_args#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[5]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[7]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[7]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_if_body@1.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_if_body@1.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_if_body@1.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_if_body@1.ops[14]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_if_body@1.ops[16]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_if_body@1.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_else_body@2.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_else_body@2.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_else_body@2.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_else_body@2.ops[8]: 'store action_b#0 to l-stack (copy)' -debug: Replaced main_else_body@2.ops[10]: 'load action_b#0 from scratch' with 'load action_b#0 from l-stack (no copy)' +debug: Replaced main_else_body@2.ops[10]: 'load action_b#0' with 'load action_b#0 from l-stack (no copy)' debug: Inserted main_else_body@2.ops[14]: 'store a_bytes#0 to l-stack (copy)' -debug: Replaced main_else_body@2.ops[18]: 'load a_bytes#0 from scratch' with 'load a_bytes#0 from l-stack (no copy)' +debug: Replaced main_else_body@2.ops[18]: 'load a_bytes#0' with 'load a_bytes#0 from l-stack (no copy)' debug: Inserted main_else_body@2.ops[17]: 'store b_bytes#0 to l-stack (copy)' -debug: Replaced main_else_body@2.ops[21]: 'load b_bytes#0 from scratch' with 'load b_bytes#0 from l-stack (no copy)' +debug: Replaced main_else_body@2.ops[21]: 'load b_bytes#0' with 'load b_bytes#0 from l-stack (no copy)' debug: Inserted main_else_body@2.ops[20]: 'store a_bytes#0 to l-stack (copy)' -debug: Replaced main_else_body@2.ops[24]: 'load a_bytes#0 from scratch' with 'load a_bytes#0 from l-stack (no copy)' +debug: Replaced main_else_body@2.ops[24]: 'load a_bytes#0' with 'load a_bytes#0 from l-stack (no copy)' debug: Inserted main_else_body@2.ops[23]: 'store b_bytes#0 to l-stack (copy)' -debug: Replaced main_else_body@2.ops[28]: 'load b_bytes#0 from scratch' with 'load b_bytes#0 from l-stack (no copy)' +debug: Replaced main_else_body@2.ops[28]: 'load b_bytes#0' with 'load b_bytes#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[21]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[23]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[23]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[33]: 'store result_b#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[35]: 'load result_b#0 from scratch' with 'load result_b#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[35]: 'load result_b#0' with 'load result_b#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[10]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[13]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[13]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[18]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[21]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[21]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[31]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[34]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[34]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[2]: 'store a#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[6]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[6]: 'load a#0' with 'load a#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[8]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[14]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[14]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[17]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[23]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[23]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[31]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[37]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[37]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[1]: 'store action#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[11]: 'load action#0 from scratch' with 'load action#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[11]: 'load action#0' with 'load action#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[5]: 'store b#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[21]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[21]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted main_after_if_else@3.ops[7]: 'store result#0 to l-stack (copy)' -debug: Replaced main_after_if_else@3.ops[36]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@3.ops[36]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.calculator.contract.MyContract.approval_program -debug: Eliminated scratch slots for 1 variable/s: b#0 -info: shared x-stack for main_if_body@1 -> main_after_if_else@3: b#0 -info: shared x-stack for main_else_body@2 -> main_after_if_else@3: b#0 +debug: Allocated 1 variable/s to x-stack: b#0 +debug: shared x-stack for main_if_body@1 -> main_after_if_else@3: b#0 +debug: shared x-stack for main_else_body@2 -> main_after_if_else@3: b#0 debug: examples.calculator.contract.MyContract.approval_program f-stack entry: ['a#0', 'action#0'] debug: examples.calculator.contract.MyContract.approval_program f-stack on first store: ['num_args#0'] debug: Inserted do_calc_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced do_calc_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced do_calc_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted do_calc_if_body@1.ops[3]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced do_calc_if_body@1.ops[5]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced do_calc_if_body@1.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted do_calc_else_body@2.ops[3]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced do_calc_else_body@2.ops[5]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced do_calc_else_body@2.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted do_calc_if_body@3.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced do_calc_if_body@3.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced do_calc_if_body@3.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted do_calc_else_body@4.ops[3]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced do_calc_else_body@4.ops[5]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced do_calc_else_body@4.ops[5]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted do_calc_if_body@5.ops[3]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced do_calc_if_body@5.ops[5]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced do_calc_if_body@5.ops[5]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted do_calc_else_body@6.ops[3]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced do_calc_else_body@6.ops[5]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced do_calc_else_body@6.ops[5]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted do_calc_if_body@7.ops[3]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced do_calc_if_body@7.ops[5]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced do_calc_if_body@7.ops[5]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.calculator.contract.MyContract.do_calc debug: Inserted add_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced add_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced add_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted sub_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced sub_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced sub_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted mul_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced mul_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced mul_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted div_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced div_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced div_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted itoa_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced itoa_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced itoa_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted itoa_if_body@1.ops[8]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced itoa_if_body@1.ops[10]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced itoa_if_body@1.ops[10]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted itoa_if_body@1.ops[3]: 'store index_plus_1%1#0 to l-stack (copy)' -debug: Replaced itoa_if_body@1.ops[7]: 'load index_plus_1%1#0 from scratch' with 'load index_plus_1%1#0 from l-stack (no copy)' +debug: Replaced itoa_if_body@1.ops[7]: 'load index_plus_1%1#0' with 'load index_plus_1%1#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[11]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[13]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[13]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[25]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[27]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[27]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[21]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[24]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[24]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[16]: 'store index_plus_1%6#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[20]: 'load index_plus_1%6#0 from scratch' with 'load index_plus_1%6#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[20]: 'load index_plus_1%6#0' with 'load index_plus_1%6#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[14]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[20]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[20]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[7]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[26]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[26]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.calculator.contract.itoa debug: Simplified uncover 2; uncover 2 to cover 2 debug: Inserted op_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced op_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced op_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted op_else_body@2.ops[3]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced op_else_body@2.ops[5]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced op_else_body@2.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted op_else_body@4.ops[3]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced op_else_body@4.ops[5]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced op_else_body@4.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted op_else_body@6.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced op_else_body@6.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced op_else_body@6.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.calculator.contract.MyContract.op -info: Writing /examples/calculator/out/contract.approval.teal -info: Writing /examples/calculator/out/contract.approval.debug.teal -info: Writing /examples/calculator/out/contract.clear.teal -info: Writing /examples/calculator/out/contract.clear.debug.teal +info: Writing calculator/out/contract.approval.teal +info: Writing calculator/out/contract.approval.debug.teal +info: Writing calculator/out/contract.clear.teal +info: Writing calculator/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/calculator/out/contract.approval.debug.teal b/examples/calculator/out/contract.approval.debug.teal index 8e4581e750..7b83a5d226 100644 --- a/examples/calculator/out/contract.approval.debug.teal +++ b/examples/calculator/out/contract.approval.debug.teal @@ -10,7 +10,7 @@ main: main_block@0: txn NumAppArgs // (𝕗) a#0,action#0 | {txn} Transaction.num_app_args() File "calculator/contract.py", line 20 dup // store num_args#0 to l-stack (copy) (𝕗) a#0,action#0 | num_args#0,num_args#0 num_args File "calculator/contract.py", line 20 - cover 1 // store num_args#0 to f-stack (𝕗) a#0,action#0,num_args#0 | num_args#0 num_args File "calculator/contract.py", line 20 + swap // store num_args#0 to f-stack (𝕗) a#0,action#0,num_args#0 | num_args#0 num_args File "calculator/contract.py", line 20 ! // (𝕗) a#0,action#0,num_args#0 | {!} num_args == UInt64(0): File "calculator/contract.py", line 21 bz main_else_body@2 // (𝕗) a#0,action#0,num_args#0 | if num_args == UInt64(0): File "calculator/contract.py", line 21 // Implicit fall through to main_if_body@1 // (𝕗) a#0,action#0,num_args#0 | if num_args == UInt64(0): File "calculator/contract.py", line 21 @@ -33,13 +33,13 @@ main_else_body@2: dup // load num_args#0 from f-stack (𝕗) a#0,action#0,num_args#0 | num_args#0 num_args File "calculator/contract.py", line 20 int 3 // (𝕗) a#0,action#0,num_args#0 | num_args#0,3 3 File "calculator/contract.py", line 28 == // (𝕗) a#0,action#0,num_args#0 | {==} num_args == 3, "Expected 3 args" File "calculator/contract.py", line 28 - assert // (𝕗) a#0,action#0,num_args#0 | assert num_args == 3, "Expected 3 args" File "calculator/contract.py", line 28 + assert // Expected 3 args // (𝕗) a#0,action#0,num_args#0 | assert num_args == 3, "Expected 3 args" File "calculator/contract.py", line 28 txna ApplicationArgs 0 // (𝕗) a#0,action#0,num_args#0 | {txna} Transaction.application_args(0) File "calculator/contract.py", line 29 btoi // (𝕗) a#0,action#0,num_args#0 | {btoi} btoi(action_b) File "calculator/contract.py", line 30 bury 2 // store action#0 to f-stack (𝕗) a#0,action#0,num_args#0 | action File "calculator/contract.py", line 24 txna ApplicationArgs 1 // (𝕗) a#0,action#0,num_args#0 | {txna} Transaction.application_args(1) File "calculator/contract.py", line 31 txna ApplicationArgs 2 // (𝕗) a#0,action#0,num_args#0 | a_bytes#0,{txna} Transaction.application_args(2) File "calculator/contract.py", line 32 - cover 1 // store b_bytes#0 to l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0 b_bytes File "calculator/contract.py", line 32 + swap // store b_bytes#0 to l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0 b_bytes File "calculator/contract.py", line 32 dup // load a_bytes#0 from l-stack (copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0,a_bytes#0 a_bytes File "calculator/contract.py", line 31 log // (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0 log(a_bytes) File "calculator/contract.py", line 33 dig 1 // load b_bytes#0 from l-stack (copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0,b_bytes#0 b_bytes File "calculator/contract.py", line 32 @@ -61,15 +61,15 @@ main_after_if_else@3: callsub do_calc // (𝕗) a#0,action#0,num_args#0 | b#0,action#0,a#0,{do_calc} self.do_calc(action, a, b) File "calculator/contract.py", line 38 cover 3 // store result#0 to l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,b#0,action#0,a#0 result File "calculator/contract.py", line 38 callsub itoa // (𝕗) a#0,action#0,num_args#0 | result#0,b#0,action#0,{itoa} itoa(a) File "calculator/contract.py", line 39 - uncover 1 // load action#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,b#0,tmp%4#0,action#0 action File "calculator/contract.py", line 24 + swap // load action#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,b#0,tmp%4#0,action#0 action File "calculator/contract.py", line 24 callsub op // (𝕗) a#0,action#0,num_args#0 | result#0,b#0,tmp%4#0,{op} self.op(action) File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | result#0,b#0,{concat} itoa(a) + self.op(action) File "calculator/contract.py", line 39 - uncover 1 // load b#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,tmp%6#0,b#0 b File "calculator/contract.py", line 23 + swap // load b#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,tmp%6#0,b#0 b File "calculator/contract.py", line 23 callsub itoa // (𝕗) a#0,action#0,num_args#0 | result#0,tmp%6#0,{itoa} itoa(b) File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | result#0,{concat} itoa(a) + self.op(action) + itoa(b) File "calculator/contract.py", line 39 byte " = " // (𝕗) a#0,action#0,num_args#0 | result#0,tmp%8#0," = " b" = " File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | result#0,{concat} itoa(a) + self.op(action) + itoa(b) + b" = " File "calculator/contract.py", line 39 - uncover 1 // load result#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | tmp%9#0,result#0 result File "calculator/contract.py", line 38 + swap // load result#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | tmp%9#0,result#0 result File "calculator/contract.py", line 38 callsub itoa // (𝕗) a#0,action#0,num_args#0 | tmp%9#0,{itoa} itoa(result) File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | {concat} itoa(a) + self.op(action) + itoa(b) + b" = " + itoa(result) File "calculator/contract.py", line 39 log // (𝕗) a#0,action#0,num_args#0 | log(result_b) File "calculator/contract.py", line 40 diff --git a/examples/calculator/out/contract.approval.teal b/examples/calculator/out/contract.approval.teal index c703bca774..573b47b42d 100644 --- a/examples/calculator/out/contract.approval.teal +++ b/examples/calculator/out/contract.approval.teal @@ -8,7 +8,7 @@ main: main_block@0: txn NumAppArgs dup - cover 1 + swap ! bz main_else_body@2 @@ -30,13 +30,13 @@ main_else_body@2: dup int 3 == - assert + assert // Expected 3 args txna ApplicationArgs 0 btoi bury 2 txna ApplicationArgs 1 txna ApplicationArgs 2 - cover 1 + swap dup log dig 1 @@ -57,15 +57,15 @@ main_after_if_else@3: callsub do_calc cover 3 callsub itoa - uncover 1 + swap callsub op concat - uncover 1 + swap callsub itoa concat byte " = " concat - uncover 1 + swap callsub itoa concat log diff --git a/examples/calculator/out/contract.approval_unoptimized.debug.teal b/examples/calculator/out/contract.approval_unoptimized.debug.teal index 1b487c2cc0..1000a8e0f6 100644 --- a/examples/calculator/out/contract.approval_unoptimized.debug.teal +++ b/examples/calculator/out/contract.approval_unoptimized.debug.teal @@ -10,7 +10,7 @@ main: main_block@0: txn NumAppArgs // (𝕗) a#0,action#0 | {txn} Transaction.num_app_args() File "calculator/contract.py", line 20 dup // store num_args#0 to l-stack (copy) (𝕗) a#0,action#0 | num_args#0,num_args#0 num_args File "calculator/contract.py", line 20 - cover 1 // store num_args#0 to f-stack (𝕗) a#0,action#0,num_args#0 | num_args#0 num_args File "calculator/contract.py", line 20 + swap // store num_args#0 to f-stack (𝕗) a#0,action#0,num_args#0 | num_args#0 num_args File "calculator/contract.py", line 20 int 0 // (𝕗) a#0,action#0,num_args#0 | num_args#0,0 0 File "calculator/contract.py", line 21 == // (𝕗) a#0,action#0,num_args#0 | {==} num_args == UInt64(0): File "calculator/contract.py", line 21 bz main_else_body@2 // (𝕗) a#0,action#0,num_args#0 | if num_args == UInt64(0): File "calculator/contract.py", line 21 @@ -36,13 +36,13 @@ main_else_body@2: dup // load num_args#0 from f-stack (𝕗) a#0,action#0,num_args#0 | num_args#0 num_args File "calculator/contract.py", line 20 int 3 // (𝕗) a#0,action#0,num_args#0 | num_args#0,3 3 File "calculator/contract.py", line 28 == // (𝕗) a#0,action#0,num_args#0 | {==} num_args == 3, "Expected 3 args" File "calculator/contract.py", line 28 - assert // (𝕗) a#0,action#0,num_args#0 | assert num_args == 3, "Expected 3 args" File "calculator/contract.py", line 28 + assert // Expected 3 args // (𝕗) a#0,action#0,num_args#0 | assert num_args == 3, "Expected 3 args" File "calculator/contract.py", line 28 txna ApplicationArgs 0 // (𝕗) a#0,action#0,num_args#0 | {txna} Transaction.application_args(0) File "calculator/contract.py", line 29 btoi // (𝕗) a#0,action#0,num_args#0 | {btoi} btoi(action_b) File "calculator/contract.py", line 30 bury 2 // store action#0 to f-stack (𝕗) a#0,action#0,num_args#0 | action File "calculator/contract.py", line 24 txna ApplicationArgs 1 // (𝕗) a#0,action#0,num_args#0 | {txna} Transaction.application_args(1) File "calculator/contract.py", line 31 txna ApplicationArgs 2 // (𝕗) a#0,action#0,num_args#0 | a_bytes#0,{txna} Transaction.application_args(2) File "calculator/contract.py", line 32 - cover 1 // store b_bytes#0 to l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0 b_bytes File "calculator/contract.py", line 32 + swap // store b_bytes#0 to l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0 b_bytes File "calculator/contract.py", line 32 dup // load a_bytes#0 from l-stack (copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0,a_bytes#0 a_bytes File "calculator/contract.py", line 31 log // (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0 log(a_bytes) File "calculator/contract.py", line 33 dig 1 // load b_bytes#0 from l-stack (copy) (𝕗) a#0,action#0,num_args#0 | b_bytes#0,a_bytes#0,b_bytes#0 b_bytes File "calculator/contract.py", line 32 @@ -64,15 +64,15 @@ main_after_if_else@3: callsub do_calc // (𝕗) a#0,action#0,num_args#0 | b#0,action#0,a#0,{do_calc} self.do_calc(action, a, b) File "calculator/contract.py", line 38 cover 3 // store result#0 to l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,b#0,action#0,a#0 result File "calculator/contract.py", line 38 callsub itoa // (𝕗) a#0,action#0,num_args#0 | result#0,b#0,action#0,{itoa} itoa(a) File "calculator/contract.py", line 39 - uncover 1 // load action#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,b#0,tmp%4#0,action#0 action File "calculator/contract.py", line 24 + swap // load action#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,b#0,tmp%4#0,action#0 action File "calculator/contract.py", line 24 callsub op // (𝕗) a#0,action#0,num_args#0 | result#0,b#0,tmp%4#0,{op} self.op(action) File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | result#0,b#0,{concat} itoa(a) + self.op(action) File "calculator/contract.py", line 39 - uncover 1 // load b#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,tmp%6#0,b#0 b File "calculator/contract.py", line 23 + swap // load b#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | result#0,tmp%6#0,b#0 b File "calculator/contract.py", line 23 callsub itoa // (𝕗) a#0,action#0,num_args#0 | result#0,tmp%6#0,{itoa} itoa(b) File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | result#0,{concat} itoa(a) + self.op(action) + itoa(b) File "calculator/contract.py", line 39 byte " = " // (𝕗) a#0,action#0,num_args#0 | result#0,tmp%8#0," = " b" = " File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | result#0,{concat} itoa(a) + self.op(action) + itoa(b) + b" = " File "calculator/contract.py", line 39 - uncover 1 // load result#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | tmp%9#0,result#0 result File "calculator/contract.py", line 38 + swap // load result#0 from l-stack (no copy) (𝕗) a#0,action#0,num_args#0 | tmp%9#0,result#0 result File "calculator/contract.py", line 38 callsub itoa // (𝕗) a#0,action#0,num_args#0 | tmp%9#0,{itoa} itoa(result) File "calculator/contract.py", line 39 concat // (𝕗) a#0,action#0,num_args#0 | {concat} itoa(a) + self.op(action) + itoa(b) + b" = " + itoa(result) File "calculator/contract.py", line 39 log // (𝕗) a#0,action#0,num_args#0 | log(result_b) File "calculator/contract.py", line 40 @@ -191,7 +191,7 @@ itoa: itoa_block@0: byte "0123456789" // (𝕡) i#0 | "0123456789" b"0123456789" File "calculator/contract.py", line 11 dup // store digits#0 to l-stack (copy) (𝕡) i#0 | digits#0,digits#0 digits File "calculator/contract.py", line 11 - cover 1 // store digits#0 to x-stack (no copy) (𝕡) i#0 | (𝕏) digits#0 | digits#0 digits File "calculator/contract.py", line 11 + swap // store digits#0 to x-stack (no copy) (𝕡) i#0 | (𝕏) digits#0 | digits#0 digits File "calculator/contract.py", line 11 len // (𝕡) i#0 | (𝕏) digits#0 | {len} digits.length File "calculator/contract.py", line 12 dup // store radix#0 to l-stack (copy) (𝕡) i#0 | (𝕏) digits#0 | radix#0,radix#0 radix File "calculator/contract.py", line 12 cover 2 // store radix#0 to f-stack (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0 radix File "calculator/contract.py", line 12 @@ -204,11 +204,11 @@ itoa_if_body@1: frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | i#0 digits#0 i: UInt64 File "calculator/contract.py", line 10 int 1 // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | i#0,1 digits[i] File "calculator/contract.py", line 14 + // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | {+} digits[i] File "calculator/contract.py", line 14 - uncover 1 // load digits#0 from x-stack (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0 digits File "calculator/contract.py", line 11 + swap // load digits#0 from x-stack (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0 digits File "calculator/contract.py", line 11 frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0,i#0 i: UInt64 File "calculator/contract.py", line 10 uncover 2 // load index_plus_1%1#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | digits#0,i#0,index_plus_1%1#0 digits[i] File "calculator/contract.py", line 14 substring3 // (𝕡) i#0 | (𝕗) radix#0 | {substring3} digits[i] File "calculator/contract.py", line 14 - uncover 1 + swap retsub // tmp%2#0 return digits[i] File "calculator/contract.py", line 14 itoa_after_if_else@2: @@ -218,9 +218,9 @@ itoa_after_if_else@2: cover 2 // store radix#0 to l-stack (copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,i#0,radix#0 radix File "calculator/contract.py", line 12 / // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,{/} i // radix File "calculator/contract.py", line 15 callsub itoa // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,{itoa} itoa(i // radix) File "calculator/contract.py", line 15 - cover 1 // store tmp%4#0 to l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0 itoa(i // radix) File "calculator/contract.py", line 15 + swap // store tmp%4#0 to l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0 itoa(i // radix) File "calculator/contract.py", line 15 frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0,i#0 i: UInt64 File "calculator/contract.py", line 10 - uncover 1 // load radix#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,i#0,radix#0 radix File "calculator/contract.py", line 12 + swap // load radix#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,i#0,radix#0 radix File "calculator/contract.py", line 12 % // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,{%} i % radix File "calculator/contract.py", line 15 dup // load tmp%5#0 from l-stack (copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,tmp%5#0,tmp%5#0 i % radix File "calculator/contract.py", line 15 int 1 // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,tmp%5#0,tmp%5#0,1 digits[i % radix] File "calculator/contract.py", line 15 @@ -229,7 +229,7 @@ itoa_after_if_else@2: cover 2 // virtual: 2 ops (𝕡) i#0 | (𝕗) radix#0 | tmp%4#0,digits#0,tmp%5#0,index_plus_1%6#0 digits[i % radix] File "calculator/contract.py", line 15 substring3 // (𝕡) i#0 | (𝕗) radix#0 | tmp%4#0,{substring3} digits[i % radix] File "calculator/contract.py", line 15 concat // (𝕡) i#0 | (𝕗) radix#0 | {concat} itoa(i // radix) + digits[i % radix] File "calculator/contract.py", line 15 - uncover 1 + swap retsub // tmp%8#0 return itoa(i // radix) + digits[i % radix] File "calculator/contract.py", line 15 diff --git a/examples/calculator/out/contract.approval_unoptimized.teal b/examples/calculator/out/contract.approval_unoptimized.teal index e60eacd7e4..e3869e7582 100644 --- a/examples/calculator/out/contract.approval_unoptimized.teal +++ b/examples/calculator/out/contract.approval_unoptimized.teal @@ -8,7 +8,7 @@ main: main_block@0: txn NumAppArgs dup - cover 1 + swap int 0 == bz main_else_body@2 @@ -33,13 +33,13 @@ main_else_body@2: dup int 3 == - assert + assert // Expected 3 args txna ApplicationArgs 0 btoi bury 2 txna ApplicationArgs 1 txna ApplicationArgs 2 - cover 1 + swap dup log dig 1 @@ -60,15 +60,15 @@ main_after_if_else@3: callsub do_calc cover 3 callsub itoa - uncover 1 + swap callsub op concat - uncover 1 + swap callsub itoa concat byte " = " concat - uncover 1 + swap callsub itoa concat log @@ -183,7 +183,7 @@ itoa: itoa_block@0: byte "0123456789" dup - cover 1 + swap len dup cover 2 @@ -195,11 +195,11 @@ itoa_if_body@1: frame_dig -1 int 1 + - uncover 1 + swap frame_dig -1 uncover 2 substring3 - uncover 1 + swap retsub itoa_after_if_else@2: @@ -209,9 +209,9 @@ itoa_after_if_else@2: cover 2 / callsub itoa - cover 1 + swap frame_dig -1 - uncover 1 + swap % dup int 1 @@ -220,7 +220,7 @@ itoa_after_if_else@2: cover 2 substring3 concat - uncover 1 + swap retsub diff --git a/examples/callsub/algopy.log b/examples/callsub/algopy.log index 132fe28f3b..226bc609e8 100644 --- a/examples/callsub/algopy.log +++ b/examples/callsub/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 callsub -info: Building AWST for __init__.py -info: Building AWST for callsub -info: Building AWST for callsub/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug callsub +debug: Building AWST for __init__.py +debug: Building AWST for callsub +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for callsub/contract.py debug: Sealing block@0: // L11 debug: Terminated block@0: // L11 debug: Sealing block@0: // L5 @@ -16,6 +17,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -26,6 +28,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -36,6 +39,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -59,13 +63,13 @@ debug: Coalescing local variables in examples.callsub.contract.MyContract.clear_ debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/callsub/out/contract_MyContract.final.ir debug: Inserted main_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[4]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted echo_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced echo_block@0.ops[4]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced echo_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted echo_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced echo_block@0.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' -info: Writing /examples/callsub/out/contract.approval.teal -info: Writing /examples/callsub/out/contract.approval.debug.teal -info: Writing /examples/callsub/out/contract.clear.teal -info: Writing /examples/callsub/out/contract.clear.debug.teal +debug: Replaced echo_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +info: Writing callsub/out/contract.approval.teal +info: Writing callsub/out/contract.approval.debug.teal +info: Writing callsub/out/contract.clear.teal +info: Writing callsub/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/callsub/out/contract.approval.debug.teal b/examples/callsub/out/contract.approval.debug.teal index ee268873ce..a223a98900 100644 --- a/examples/callsub/out/contract.approval.debug.teal +++ b/examples/callsub/out/contract.approval.debug.teal @@ -14,7 +14,7 @@ main_block@0: return // return UInt64(1) File "callsub/contract.py", line 8 -// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> : +// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> void: echo: proto 2 0 // (𝕡) a#0,b#0 | def echo(self, a: UInt64, b: UInt64) -> None: File "callsub/contract.py", line 11 diff --git a/examples/callsub/out/contract.approval.teal b/examples/callsub/out/contract.approval.teal index 33447d9326..bf782b934c 100644 --- a/examples/callsub/out/contract.approval.teal +++ b/examples/callsub/out/contract.approval.teal @@ -12,7 +12,7 @@ main_block@0: return -// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> : +// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> void: echo: proto 2 0 diff --git a/examples/callsub/out/contract.approval_unoptimized.debug.teal b/examples/callsub/out/contract.approval_unoptimized.debug.teal index ee268873ce..a223a98900 100644 --- a/examples/callsub/out/contract.approval_unoptimized.debug.teal +++ b/examples/callsub/out/contract.approval_unoptimized.debug.teal @@ -14,7 +14,7 @@ main_block@0: return // return UInt64(1) File "callsub/contract.py", line 8 -// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> : +// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> void: echo: proto 2 0 // (𝕡) a#0,b#0 | def echo(self, a: UInt64, b: UInt64) -> None: File "callsub/contract.py", line 11 diff --git a/examples/callsub/out/contract.approval_unoptimized.teal b/examples/callsub/out/contract.approval_unoptimized.teal index 33447d9326..bf782b934c 100644 --- a/examples/callsub/out/contract.approval_unoptimized.teal +++ b/examples/callsub/out/contract.approval_unoptimized.teal @@ -12,7 +12,7 @@ main_block@0: return -// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> : +// examples.callsub.contract.MyContract.echo(a#0: uint64, b#0: uint64) -> void: echo: proto 2 0 diff --git a/examples/chained_assignment/algopy.log b/examples/chained_assignment/algopy.log index 1834217cbc..198340e4f9 100644 --- a/examples/chained_assignment/algopy.log +++ b/examples/chained_assignment/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 chained_assignment -info: Building AWST for __init__.py -info: Building AWST for chained_assignment -info: Building AWST for chained_assignment/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug chained_assignment +debug: Building AWST for __init__.py +debug: Building AWST for chained_assignment +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for chained_assignment/contract.py debug: Sealing block@0: // L15 debug: Terminated block@0: // L15 debug: Sealing block@0: // L7 @@ -24,6 +25,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -34,6 +36,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -44,6 +47,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -54,6 +58,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -64,6 +69,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -95,20 +101,20 @@ debug: Coalescing local variables in examples.chained_assignment.contract.Chaine debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/chained_assignment/out/contract_ChainedAssignment.final.ir debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.chained_assignment.contract.ChainedAssignment.approval_program debug: Inserted BaseContract.__init___block@0.ops[3]: 'store awst_tmp%0#0 to l-stack (copy)' -debug: Replaced BaseContract.__init___block@0.ops[6]: 'load awst_tmp%0#0 from scratch' with 'load awst_tmp%0#0 from l-stack (no copy)' +debug: Replaced BaseContract.__init___block@0.ops[6]: 'load awst_tmp%0#0' with 'load awst_tmp%0#0 from l-stack (no copy)' debug: Inserted BaseContract.__init___block@0.ops[7]: 'store awst_tmp%0#0 to l-stack (copy)' -debug: Replaced BaseContract.__init___block@0.ops[10]: 'load awst_tmp%0#0 from scratch' with 'load awst_tmp%0#0 from l-stack (no copy)' +debug: Replaced BaseContract.__init___block@0.ops[10]: 'load awst_tmp%0#0' with 'load awst_tmp%0#0 from l-stack (no copy)' debug: Inserted join_log_and_return_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced join_log_and_return_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced join_log_and_return_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted join_log_and_return_block@0.ops[8]: 'store result#0 to l-stack (copy)' -debug: Replaced join_log_and_return_block@0.ops[10]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced join_log_and_return_block@0.ops[10]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted join_log_and_return_block@0.ops[11]: 'store result#0 to l-stack (copy)' -debug: Replaced join_log_and_return_block@0.ops[13]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' -info: Writing /examples/chained_assignment/out/contract.approval.teal -info: Writing /examples/chained_assignment/out/contract.approval.debug.teal -info: Writing /examples/chained_assignment/out/contract.clear.teal -info: Writing /examples/chained_assignment/out/contract.clear.debug.teal +debug: Replaced join_log_and_return_block@0.ops[13]: 'load result#0' with 'load result#0 from l-stack (no copy)' +info: Writing chained_assignment/out/contract.approval.teal +info: Writing chained_assignment/out/contract.approval.debug.teal +info: Writing chained_assignment/out/contract.clear.teal +info: Writing chained_assignment/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/chained_assignment/out/contract.approval.debug.teal b/examples/chained_assignment/out/contract.approval.debug.teal index 411de64e40..16aa7c37e3 100644 --- a/examples/chained_assignment/out/contract.approval.debug.teal +++ b/examples/chained_assignment/out/contract.approval.debug.teal @@ -17,7 +17,7 @@ main_entrypoint@2: return // return True File "chained_assignment/contract.py", line 19 -// examples.chained_assignment.contract.ChainedAssignment.__init__() -> : +// examples.chained_assignment.contract.ChainedAssignment.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "chained_assignment/contract.py", line 15 @@ -26,7 +26,7 @@ __init___block@0: retsub // -// examples.chained_assignment.contract.BaseContract.__init__() -> : +// examples.chained_assignment.contract.BaseContract.__init__() -> void: BaseContract.__init__: proto 0 0 // def __init__(self) -> None: File "chained_assignment/contract.py", line 7 @@ -38,7 +38,7 @@ BaseContract.__init___block@0: dig 1 // load awst_tmp%0#0 from l-stack (copy) awst_tmp%0#0,"state2",awst_tmp%0#0 join_log_and_return( File "chained_assignment/contract.py", line 8 app_global_put // awst_tmp%0#0 self.state1 = self.state2 = join_log_and_return( File "chained_assignment/contract.py", line 8 byte "state1" // awst_tmp%0#0,"state1" self.state1 File "chained_assignment/contract.py", line 8 - uncover 1 // load awst_tmp%0#0 from l-stack (no copy) "state1",awst_tmp%0#0 join_log_and_return( File "chained_assignment/contract.py", line 8 + swap // load awst_tmp%0#0 from l-stack (no copy) "state1",awst_tmp%0#0 join_log_and_return( File "chained_assignment/contract.py", line 8 app_global_put // self.state1 = self.state2 = join_log_and_return( File "chained_assignment/contract.py", line 8 retsub // diff --git a/examples/chained_assignment/out/contract.approval.teal b/examples/chained_assignment/out/contract.approval.teal index 45aeacffc8..164e646780 100644 --- a/examples/chained_assignment/out/contract.approval.teal +++ b/examples/chained_assignment/out/contract.approval.teal @@ -13,7 +13,7 @@ main_entrypoint@2: return -// examples.chained_assignment.contract.ChainedAssignment.__init__() -> : +// examples.chained_assignment.contract.ChainedAssignment.__init__() -> void: __init__: proto 0 0 @@ -22,7 +22,7 @@ __init___block@0: retsub -// examples.chained_assignment.contract.BaseContract.__init__() -> : +// examples.chained_assignment.contract.BaseContract.__init__() -> void: BaseContract.__init__: proto 0 0 @@ -34,7 +34,7 @@ BaseContract.__init___block@0: dig 1 app_global_put byte "state1" - uncover 1 + swap app_global_put retsub diff --git a/examples/chained_assignment/out/contract.approval_unoptimized.debug.teal b/examples/chained_assignment/out/contract.approval_unoptimized.debug.teal index 411de64e40..16aa7c37e3 100644 --- a/examples/chained_assignment/out/contract.approval_unoptimized.debug.teal +++ b/examples/chained_assignment/out/contract.approval_unoptimized.debug.teal @@ -17,7 +17,7 @@ main_entrypoint@2: return // return True File "chained_assignment/contract.py", line 19 -// examples.chained_assignment.contract.ChainedAssignment.__init__() -> : +// examples.chained_assignment.contract.ChainedAssignment.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "chained_assignment/contract.py", line 15 @@ -26,7 +26,7 @@ __init___block@0: retsub // -// examples.chained_assignment.contract.BaseContract.__init__() -> : +// examples.chained_assignment.contract.BaseContract.__init__() -> void: BaseContract.__init__: proto 0 0 // def __init__(self) -> None: File "chained_assignment/contract.py", line 7 @@ -38,7 +38,7 @@ BaseContract.__init___block@0: dig 1 // load awst_tmp%0#0 from l-stack (copy) awst_tmp%0#0,"state2",awst_tmp%0#0 join_log_and_return( File "chained_assignment/contract.py", line 8 app_global_put // awst_tmp%0#0 self.state1 = self.state2 = join_log_and_return( File "chained_assignment/contract.py", line 8 byte "state1" // awst_tmp%0#0,"state1" self.state1 File "chained_assignment/contract.py", line 8 - uncover 1 // load awst_tmp%0#0 from l-stack (no copy) "state1",awst_tmp%0#0 join_log_and_return( File "chained_assignment/contract.py", line 8 + swap // load awst_tmp%0#0 from l-stack (no copy) "state1",awst_tmp%0#0 join_log_and_return( File "chained_assignment/contract.py", line 8 app_global_put // self.state1 = self.state2 = join_log_and_return( File "chained_assignment/contract.py", line 8 retsub // diff --git a/examples/chained_assignment/out/contract.approval_unoptimized.teal b/examples/chained_assignment/out/contract.approval_unoptimized.teal index 45aeacffc8..164e646780 100644 --- a/examples/chained_assignment/out/contract.approval_unoptimized.teal +++ b/examples/chained_assignment/out/contract.approval_unoptimized.teal @@ -13,7 +13,7 @@ main_entrypoint@2: return -// examples.chained_assignment.contract.ChainedAssignment.__init__() -> : +// examples.chained_assignment.contract.ChainedAssignment.__init__() -> void: __init__: proto 0 0 @@ -22,7 +22,7 @@ __init___block@0: retsub -// examples.chained_assignment.contract.BaseContract.__init__() -> : +// examples.chained_assignment.contract.BaseContract.__init__() -> void: BaseContract.__init__: proto 0 0 @@ -34,7 +34,7 @@ BaseContract.__init___block@0: dig 1 app_global_put byte "state1" - uncover 1 + swap app_global_put retsub diff --git a/examples/conditional_execution/algopy.log b/examples/conditional_execution/algopy.log new file mode 100644 index 0000000000..107168a473 --- /dev/null +++ b/examples/conditional_execution/algopy.log @@ -0,0 +1,394 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug conditional_execution +debug: Building AWST for __init__.py +debug: Building AWST for conditional_execution +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for conditional_execution/contract.py +conditional_execution/contract.py:11 warning: expression result is ignored +conditional_execution/contract.py:17 warning: expression result is ignored +conditional_execution/contract.py:23 warning: expression result is ignored +conditional_execution/contract.py:29 warning: expression result is ignored +conditional_execution/contract.py:35 warning: expression result is ignored +conditional_execution/contract.py:41 warning: expression result is ignored +conditional_execution/contract.py:47 warning: expression result is ignored +debug: Sealing block@0: // L64 +debug: Terminated block@0: // L64 +debug: Sealing block@0: // L69 +debug: Terminated block@0: // L69 +debug: Sealing block@0: // L58 +debug: Terminated block@0: // L58 +debug: Sealing block@0: // L74 +debug: Terminated block@0: // L74 +debug: Sealing block@0: // L5 +debug: Terminated block@0: // L5 +debug: Sealing block@0: // L9 +debug: Terminated block@0: // L9 +debug: Sealing block@None: // on_create_L5 +debug: Terminated block@1: // on_create_L5 +debug: Sealing block@2: // entrypoint_L5 +debug: Terminated block@2: // entrypoint_L5 +debug: Sealing block@None: // or_contd_L11 +debug: Terminated block@3: // or_contd_L11 +debug: Sealing block@None: // bool_true_L11 +debug: Sealing block@None: // bool_false_L11 +debug: Terminated block@4: // bool_true_L11 +debug: Terminated block@5: // bool_false_L11 +debug: Sealing block@6: // bool_merge_L11 +debug: Created Phi assignment: let or_result%3#2: uint64 = undefined while trying to resolve 'or_result%3' in block@6: // bool_merge_L11 +debug: Added or_result%3#0 to Phi node: let or_result%3#2: uint64 = φ(or_result%3#0 <- block@4) in block@4: // bool_true_L11 +debug: Added or_result%3#1 to Phi node: let or_result%3#2: uint64 = φ(or_result%3#0 <- block@4, or_result%3#1 <- block@5) in block@5: // bool_false_L11 +debug: Terminated block@6: // bool_merge_L11 +debug: Sealing block@None: // and_contd_L13 +debug: Terminated block@7: // and_contd_L13 +debug: Sealing block@None: // bool_true_L13 +debug: Sealing block@None: // bool_false_L13 +debug: Terminated block@8: // bool_true_L13 +debug: Terminated block@9: // bool_false_L13 +debug: Sealing block@10: // bool_merge_L13 +debug: Created Phi assignment: let and_result%8#2: uint64 = undefined while trying to resolve 'and_result%8' in block@10: // bool_merge_L13 +debug: Added and_result%8#0 to Phi node: let and_result%8#2: uint64 = φ(and_result%8#0 <- block@8) in block@8: // bool_true_L13 +debug: Added and_result%8#1 to Phi node: let and_result%8#2: uint64 = φ(and_result%8#0 <- block@8, and_result%8#1 <- block@9) in block@9: // bool_false_L13 +debug: Terminated block@10: // bool_merge_L13 +debug: Sealing block@None: // or_contd_L17 +debug: Terminated block@11: // or_contd_L17 +debug: Sealing block@None: // bool_true_L17 +debug: Sealing block@None: // bool_false_L17 +debug: Terminated block@12: // bool_true_L17 +debug: Terminated block@13: // bool_false_L17 +debug: Sealing block@14: // bool_merge_L17 +debug: Created Phi assignment: let or_result%11#2: uint64 = undefined while trying to resolve 'or_result%11' in block@14: // bool_merge_L17 +debug: Added or_result%11#0 to Phi node: let or_result%11#2: uint64 = φ(or_result%11#0 <- block@12) in block@12: // bool_true_L17 +debug: Added or_result%11#1 to Phi node: let or_result%11#2: uint64 = φ(or_result%11#0 <- block@12, or_result%11#1 <- block@13) in block@13: // bool_false_L17 +debug: Terminated block@14: // bool_merge_L17 +debug: Sealing block@None: // and_contd_L19 +debug: Terminated block@15: // and_contd_L19 +debug: Sealing block@None: // bool_true_L19 +debug: Sealing block@None: // bool_false_L19 +debug: Terminated block@16: // bool_true_L19 +debug: Terminated block@17: // bool_false_L19 +debug: Sealing block@18: // bool_merge_L19 +debug: Created Phi assignment: let and_result%16#2: uint64 = undefined while trying to resolve 'and_result%16' in block@18: // bool_merge_L19 +debug: Added and_result%16#0 to Phi node: let and_result%16#2: uint64 = φ(and_result%16#0 <- block@16) in block@16: // bool_true_L19 +debug: Added and_result%16#1 to Phi node: let and_result%16#2: uint64 = φ(and_result%16#0 <- block@16, and_result%16#1 <- block@17) in block@17: // bool_false_L19 +debug: Terminated block@18: // bool_merge_L19 +debug: Sealing block@None: // and_contd_L23 +debug: Terminated block@19: // and_contd_L23 +debug: Sealing block@None: // bool_true_L23 +debug: Sealing block@None: // bool_false_L23 +debug: Terminated block@20: // bool_true_L23 +debug: Terminated block@21: // bool_false_L23 +debug: Sealing block@22: // bool_merge_L23 +debug: Created Phi assignment: let and_result%19#2: uint64 = undefined while trying to resolve 'and_result%19' in block@22: // bool_merge_L23 +debug: Added and_result%19#0 to Phi node: let and_result%19#2: uint64 = φ(and_result%19#0 <- block@20) in block@20: // bool_true_L23 +debug: Added and_result%19#1 to Phi node: let and_result%19#2: uint64 = φ(and_result%19#0 <- block@20, and_result%19#1 <- block@21) in block@21: // bool_false_L23 +debug: Terminated block@22: // bool_merge_L23 +debug: Sealing block@None: // and_contd_L25 +debug: Terminated block@23: // and_contd_L25 +debug: Sealing block@None: // bool_true_L25 +debug: Sealing block@None: // bool_false_L25 +debug: Terminated block@24: // bool_true_L25 +debug: Terminated block@25: // bool_false_L25 +debug: Sealing block@26: // bool_merge_L25 +debug: Created Phi assignment: let and_result%24#2: uint64 = undefined while trying to resolve 'and_result%24' in block@26: // bool_merge_L25 +debug: Added and_result%24#0 to Phi node: let and_result%24#2: uint64 = φ(and_result%24#0 <- block@24) in block@24: // bool_true_L25 +debug: Added and_result%24#1 to Phi node: let and_result%24#2: uint64 = φ(and_result%24#0 <- block@24, and_result%24#1 <- block@25) in block@25: // bool_false_L25 +debug: Terminated block@26: // bool_merge_L25 +debug: Sealing block@None: // and_contd_L29 +debug: Terminated block@27: // and_contd_L29 +debug: Sealing block@None: // bool_true_L29 +debug: Sealing block@None: // bool_false_L29 +debug: Terminated block@28: // bool_true_L29 +debug: Terminated block@29: // bool_false_L29 +debug: Sealing block@30: // bool_merge_L29 +debug: Created Phi assignment: let and_result%27#2: uint64 = undefined while trying to resolve 'and_result%27' in block@30: // bool_merge_L29 +debug: Added and_result%27#0 to Phi node: let and_result%27#2: uint64 = φ(and_result%27#0 <- block@28) in block@28: // bool_true_L29 +debug: Added and_result%27#1 to Phi node: let and_result%27#2: uint64 = φ(and_result%27#0 <- block@28, and_result%27#1 <- block@29) in block@29: // bool_false_L29 +debug: Terminated block@30: // bool_merge_L29 +debug: Sealing block@None: // and_contd_L31 +debug: Terminated block@31: // and_contd_L31 +debug: Sealing block@None: // bool_true_L31 +debug: Sealing block@None: // bool_false_L31 +debug: Terminated block@32: // bool_true_L31 +debug: Terminated block@33: // bool_false_L31 +debug: Sealing block@34: // bool_merge_L31 +debug: Created Phi assignment: let and_result%32#2: uint64 = undefined while trying to resolve 'and_result%32' in block@34: // bool_merge_L31 +debug: Added and_result%32#0 to Phi node: let and_result%32#2: uint64 = φ(and_result%32#0 <- block@32) in block@32: // bool_true_L31 +debug: Added and_result%32#1 to Phi node: let and_result%32#2: uint64 = φ(and_result%32#0 <- block@32, and_result%32#1 <- block@33) in block@33: // bool_false_L31 +debug: Terminated block@34: // bool_merge_L31 +debug: Sealing block@None: // and_contd_L37 +debug: Terminated block@35: // and_contd_L37 +debug: Sealing block@None: // bool_true_L37 +debug: Sealing block@None: // bool_false_L37 +debug: Terminated block@36: // bool_true_L37 +debug: Terminated block@37: // bool_false_L37 +debug: Sealing block@38: // bool_merge_L37 +debug: Created Phi assignment: let and_result%39#2: uint64 = undefined while trying to resolve 'and_result%39' in block@38: // bool_merge_L37 +debug: Added and_result%39#0 to Phi node: let and_result%39#2: uint64 = φ(and_result%39#0 <- block@36) in block@36: // bool_true_L37 +debug: Added and_result%39#1 to Phi node: let and_result%39#2: uint64 = φ(and_result%39#0 <- block@36, and_result%39#1 <- block@37) in block@37: // bool_false_L37 +debug: Terminated block@38: // bool_merge_L37 +debug: Sealing block@None: // ternary_true_L41 +debug: Sealing block@None: // ternary_false_L41 +debug: Terminated block@39: // ternary_true_L41 +debug: Terminated block@40: // ternary_false_L41 +debug: Sealing block@41: // ternary_merge_L41 +debug: Created Phi assignment: let ternary_result%41#2: uint64 = undefined while trying to resolve 'ternary_result%41' in block@41: // ternary_merge_L41 +debug: Added ternary_result%41#0 to Phi node: let ternary_result%41#2: uint64 = φ(ternary_result%41#0 <- block@39) in block@39: // ternary_true_L41 +debug: Added ternary_result%41#1 to Phi node: let ternary_result%41#2: uint64 = φ(ternary_result%41#0 <- block@39, ternary_result%41#1 <- block@40) in block@40: // ternary_false_L41 +debug: Terminated block@41: // ternary_merge_L41 +debug: Sealing block@None: // and_contd_L43 +debug: Terminated block@42: // and_contd_L43 +debug: Sealing block@None: // bool_true_L43 +debug: Sealing block@None: // bool_false_L43 +debug: Terminated block@43: // bool_true_L43 +debug: Terminated block@44: // bool_false_L43 +debug: Sealing block@45: // bool_merge_L43 +debug: Created Phi assignment: let and_result%46#2: uint64 = undefined while trying to resolve 'and_result%46' in block@45: // bool_merge_L43 +debug: Added and_result%46#0 to Phi node: let and_result%46#2: uint64 = φ(and_result%46#0 <- block@43) in block@43: // bool_true_L43 +debug: Added and_result%46#1 to Phi node: let and_result%46#2: uint64 = φ(and_result%46#0 <- block@43, and_result%46#1 <- block@44) in block@44: // bool_false_L43 +debug: Terminated block@45: // bool_merge_L43 +debug: Sealing block@None: // ternary_true_L47 +debug: Sealing block@None: // ternary_false_L47 +debug: Terminated block@46: // ternary_true_L47 +debug: Terminated block@47: // ternary_false_L47 +debug: Sealing block@48: // ternary_merge_L47 +debug: Created Phi assignment: let ternary_result%48#2: uint64 = undefined while trying to resolve 'ternary_result%48' in block@48: // ternary_merge_L47 +debug: Added ternary_result%48#0 to Phi node: let ternary_result%48#2: uint64 = φ(ternary_result%48#0 <- block@46) in block@46: // ternary_true_L47 +debug: Added ternary_result%48#1 to Phi node: let ternary_result%48#2: uint64 = φ(ternary_result%48#0 <- block@46, ternary_result%48#1 <- block@47) in block@47: // ternary_false_L47 +debug: Terminated block@48: // ternary_merge_L47 +debug: Sealing block@None: // and_contd_L49 +debug: Terminated block@49: // and_contd_L49 +debug: Sealing block@None: // bool_true_L49 +debug: Sealing block@None: // bool_false_L49 +debug: Terminated block@50: // bool_true_L49 +debug: Terminated block@51: // bool_false_L49 +debug: Sealing block@52: // bool_merge_L49 +debug: Created Phi assignment: let and_result%53#2: uint64 = undefined while trying to resolve 'and_result%53' in block@52: // bool_merge_L49 +debug: Added and_result%53#0 to Phi node: let and_result%53#2: uint64 = φ(and_result%53#0 <- block@50) in block@50: // bool_true_L49 +debug: Added and_result%53#1 to Phi node: let and_result%53#2: uint64 = φ(and_result%53#0 <- block@50, and_result%53#1 <- block@51) in block@51: // bool_false_L49 +debug: Terminated block@52: // bool_merge_L49 +debug: Sealing block@0: // L54 +debug: Terminated block@0: // L54 +debug: Output IR to /examples/conditional_execution/out/contract_ConditionalExecutionContract.ssa.ir +info: Optimizing examples.conditional_execution.contract.ConditionalExecutionContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.conditional_execution.contract.ConditionalExecutionContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_a +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_b +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_c +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.conditional_execution.contract.ConditionalExecutionContract.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 1, ending loop +debug: Output IR to /examples/conditional_execution/out/contract_ConditionalExecutionContract.cssa.ir +debug: Removing Phis from examples.conditional_execution.contract.ConditionalExecutionContract.approval_program +debug: Removing Phis from examples.conditional_execution.contract.ConditionalExecutionContract.func_a +debug: Removing Phis from examples.conditional_execution.contract.ConditionalExecutionContract.func_b +debug: Removing Phis from examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset +debug: Removing Phis from examples.conditional_execution.contract.ConditionalExecutionContract.func_c +debug: Removing Phis from examples.conditional_execution.contract.ConditionalExecutionContract.__init__ +debug: Removing Phis from examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program +debug: Output IR to /examples/conditional_execution/out/contract_ConditionalExecutionContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.conditional_execution.contract.ConditionalExecutionContract.approval_program +debug: Sequentializing parallel copies in examples.conditional_execution.contract.ConditionalExecutionContract.func_a +debug: Sequentializing parallel copies in examples.conditional_execution.contract.ConditionalExecutionContract.func_b +debug: Sequentializing parallel copies in examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset +debug: Sequentializing parallel copies in examples.conditional_execution.contract.ConditionalExecutionContract.func_c +debug: Sequentializing parallel copies in examples.conditional_execution.contract.ConditionalExecutionContract.__init__ +debug: Sequentializing parallel copies in examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program +debug: Output IR to /examples/conditional_execution/out/contract_ConditionalExecutionContract.parallel_copies.ir +debug: Coalescing local variables in examples.conditional_execution.contract.ConditionalExecutionContract.approval_program using strategy RootOperandGrouping +debug: Coalescing or_result%3#0 with [or_result%3#5, or_result%3#1, or_result%3#2] +debug: Coalescing and_result%8#0 with [and_result%8#5, and_result%8#1, and_result%8#2] +debug: Coalescing or_result%11#0 with [or_result%11#5, or_result%11#1, or_result%11#2] +debug: Coalescing and_result%16#0 with [and_result%16#5, and_result%16#1, and_result%16#2] +debug: Coalescing and_result%19#0 with [and_result%19#5, and_result%19#1, and_result%19#2] +debug: Coalescing and_result%24#0 with [and_result%24#5, and_result%24#1, and_result%24#2] +debug: Coalescing and_result%27#0 with [and_result%27#5, and_result%27#1, and_result%27#2] +debug: Coalescing and_result%32#0 with [and_result%32#5, and_result%32#1, and_result%32#2] +debug: Coalescing and_result%39#0 with [and_result%39#5, and_result%39#1, and_result%39#2] +debug: Coalescing ternary_result%41#0 with [ternary_result%41#5, ternary_result%41#1, ternary_result%41#2] +debug: Coalescing and_result%46#0 with [and_result%46#5, and_result%46#1, and_result%46#2] +debug: Coalescing ternary_result%48#0 with [ternary_result%48#5, ternary_result%48#1, ternary_result%48#2] +debug: Coalescing and_result%53#0 with [and_result%53#5, and_result%53#1, and_result%53#2] +debug: Coalescing resulted in 85 replacement/s +debug: Coalescing local variables in examples.conditional_execution.contract.ConditionalExecutionContract.func_a using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.conditional_execution.contract.ConditionalExecutionContract.func_b using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.conditional_execution.contract.ConditionalExecutionContract.func_c using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.conditional_execution.contract.ConditionalExecutionContract.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/conditional_execution/out/contract_ConditionalExecutionContract.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[2]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[4]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_or_contd@3.ops[2]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_or_contd@3.ops[4]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@6.ops[3]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced main_bool_merge@6.ops[6]: 'load app_global_get_ex_did_exist%5#0' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@6.ops[5]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced main_bool_merge@6.ops[9]: 'load app_global_get_ex_value%4#0' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Inserted main_and_contd@7.ops[3]: 'store app_global_get_ex_did_exist%7#0 to l-stack (copy)' +debug: Replaced main_and_contd@7.ops[6]: 'load app_global_get_ex_did_exist%7#0' with 'load app_global_get_ex_did_exist%7#0 from l-stack (no copy)' +debug: Inserted main_and_contd@7.ops[5]: 'store app_global_get_ex_value%6#0 to l-stack (copy)' +debug: Replaced main_and_contd@7.ops[9]: 'load app_global_get_ex_value%6#0' with 'load app_global_get_ex_value%6#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@10.ops[4]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_bool_merge@10.ops[6]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_or_contd@11.ops[2]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_or_contd@11.ops[4]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@14.ops[3]: 'store app_global_get_ex_did_exist%13#0 to l-stack (copy)' +debug: Replaced main_bool_merge@14.ops[6]: 'load app_global_get_ex_did_exist%13#0' with 'load app_global_get_ex_did_exist%13#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@14.ops[5]: 'store app_global_get_ex_value%12#0 to l-stack (copy)' +debug: Replaced main_bool_merge@14.ops[9]: 'load app_global_get_ex_value%12#0' with 'load app_global_get_ex_value%12#0 from l-stack (no copy)' +debug: Inserted main_and_contd@15.ops[3]: 'store app_global_get_ex_did_exist%15#0 to l-stack (copy)' +debug: Replaced main_and_contd@15.ops[6]: 'load app_global_get_ex_did_exist%15#0' with 'load app_global_get_ex_did_exist%15#0 from l-stack (no copy)' +debug: Inserted main_and_contd@15.ops[5]: 'store app_global_get_ex_value%14#0 to l-stack (copy)' +debug: Replaced main_and_contd@15.ops[9]: 'load app_global_get_ex_value%14#0' with 'load app_global_get_ex_value%14#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@18.ops[4]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_bool_merge@18.ops[6]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_and_contd@19.ops[2]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_and_contd@19.ops[4]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@22.ops[3]: 'store app_global_get_ex_did_exist%21#0 to l-stack (copy)' +debug: Replaced main_bool_merge@22.ops[6]: 'load app_global_get_ex_did_exist%21#0' with 'load app_global_get_ex_did_exist%21#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@22.ops[5]: 'store app_global_get_ex_value%20#0 to l-stack (copy)' +debug: Replaced main_bool_merge@22.ops[9]: 'load app_global_get_ex_value%20#0' with 'load app_global_get_ex_value%20#0 from l-stack (no copy)' +debug: Inserted main_and_contd@23.ops[3]: 'store app_global_get_ex_did_exist%23#0 to l-stack (copy)' +debug: Replaced main_and_contd@23.ops[6]: 'load app_global_get_ex_did_exist%23#0' with 'load app_global_get_ex_did_exist%23#0 from l-stack (no copy)' +debug: Inserted main_and_contd@23.ops[5]: 'store app_global_get_ex_value%22#0 to l-stack (copy)' +debug: Replaced main_and_contd@23.ops[9]: 'load app_global_get_ex_value%22#0' with 'load app_global_get_ex_value%22#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@26.ops[4]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_bool_merge@26.ops[6]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_and_contd@27.ops[2]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced main_and_contd@27.ops[4]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@30.ops[3]: 'store app_global_get_ex_did_exist%29#0 to l-stack (copy)' +debug: Replaced main_bool_merge@30.ops[6]: 'load app_global_get_ex_did_exist%29#0' with 'load app_global_get_ex_did_exist%29#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@30.ops[5]: 'store app_global_get_ex_value%28#0 to l-stack (copy)' +debug: Replaced main_bool_merge@30.ops[9]: 'load app_global_get_ex_value%28#0' with 'load app_global_get_ex_value%28#0 from l-stack (no copy)' +debug: Inserted main_and_contd@31.ops[3]: 'store app_global_get_ex_did_exist%31#0 to l-stack (copy)' +debug: Replaced main_and_contd@31.ops[6]: 'load app_global_get_ex_did_exist%31#0' with 'load app_global_get_ex_did_exist%31#0 from l-stack (no copy)' +debug: Inserted main_and_contd@31.ops[5]: 'store app_global_get_ex_value%30#0 to l-stack (copy)' +debug: Replaced main_and_contd@31.ops[9]: 'load app_global_get_ex_value%30#0' with 'load app_global_get_ex_value%30#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@34.ops[11]: 'store app_global_get_ex_did_exist%36#0 to l-stack (copy)' +debug: Replaced main_bool_merge@34.ops[14]: 'load app_global_get_ex_did_exist%36#0' with 'load app_global_get_ex_did_exist%36#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@34.ops[13]: 'store app_global_get_ex_value%35#0 to l-stack (copy)' +debug: Replaced main_bool_merge@34.ops[17]: 'load app_global_get_ex_value%35#0' with 'load app_global_get_ex_value%35#0 from l-stack (no copy)' +debug: Inserted main_and_contd@35.ops[3]: 'store app_global_get_ex_did_exist%38#0 to l-stack (copy)' +debug: Replaced main_and_contd@35.ops[6]: 'load app_global_get_ex_did_exist%38#0' with 'load app_global_get_ex_did_exist%38#0 from l-stack (no copy)' +debug: Inserted main_and_contd@35.ops[5]: 'store app_global_get_ex_value%37#0 to l-stack (copy)' +debug: Replaced main_and_contd@35.ops[9]: 'load app_global_get_ex_value%37#0' with 'load app_global_get_ex_value%37#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@38.ops[4]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_bool_merge@38.ops[6]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@41.ops[3]: 'store app_global_get_ex_did_exist%43#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@41.ops[6]: 'load app_global_get_ex_did_exist%43#0' with 'load app_global_get_ex_did_exist%43#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@41.ops[5]: 'store app_global_get_ex_value%42#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@41.ops[9]: 'load app_global_get_ex_value%42#0' with 'load app_global_get_ex_value%42#0 from l-stack (no copy)' +debug: Inserted main_and_contd@42.ops[3]: 'store app_global_get_ex_did_exist%45#0 to l-stack (copy)' +debug: Replaced main_and_contd@42.ops[6]: 'load app_global_get_ex_did_exist%45#0' with 'load app_global_get_ex_did_exist%45#0 from l-stack (no copy)' +debug: Inserted main_and_contd@42.ops[5]: 'store app_global_get_ex_value%44#0 to l-stack (copy)' +debug: Replaced main_and_contd@42.ops[9]: 'load app_global_get_ex_value%44#0' with 'load app_global_get_ex_value%44#0 from l-stack (no copy)' +debug: Inserted main_bool_merge@45.ops[4]: 'store tmp%47#0 to l-stack (copy)' +debug: Replaced main_bool_merge@45.ops[6]: 'load tmp%47#0' with 'load tmp%47#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@48.ops[3]: 'store app_global_get_ex_did_exist%50#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@48.ops[6]: 'load app_global_get_ex_did_exist%50#0' with 'load app_global_get_ex_did_exist%50#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@48.ops[5]: 'store app_global_get_ex_value%49#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@48.ops[9]: 'load app_global_get_ex_value%49#0' with 'load app_global_get_ex_value%49#0 from l-stack (no copy)' +debug: Inserted main_and_contd@49.ops[3]: 'store app_global_get_ex_did_exist%52#0 to l-stack (copy)' +debug: Replaced main_and_contd@49.ops[6]: 'load app_global_get_ex_did_exist%52#0' with 'load app_global_get_ex_did_exist%52#0 from l-stack (no copy)' +debug: Inserted main_and_contd@49.ops[5]: 'store app_global_get_ex_value%51#0 to l-stack (copy)' +debug: Replaced main_and_contd@49.ops[9]: 'load app_global_get_ex_value%51#0' with 'load app_global_get_ex_value%51#0 from l-stack (no copy)' +debug: Found 27 edge set/s for examples.conditional_execution.contract.ConditionalExecutionContract.approval_program +debug: Allocated 7 variable/s to x-stack: and_result%16#0, and_result%24#0, and_result%32#0, and_result%39#0, and_result%46#0, and_result%53#0, and_result%8#0 +debug: shared x-stack for main_bool_true@8 -> main_bool_merge@10: and_result%8#0 +debug: shared x-stack for main_bool_false@9 -> main_bool_merge@10: and_result%8#0 +debug: shared x-stack for main_bool_true@16 -> main_bool_merge@18: and_result%16#0 +debug: shared x-stack for main_bool_false@17 -> main_bool_merge@18: and_result%16#0 +debug: shared x-stack for main_bool_true@24 -> main_bool_merge@26: and_result%24#0 +debug: shared x-stack for main_bool_false@25 -> main_bool_merge@26: and_result%24#0 +debug: shared x-stack for main_bool_true@32 -> main_bool_merge@34: and_result%32#0 +debug: shared x-stack for main_bool_false@33 -> main_bool_merge@34: and_result%32#0 +debug: shared x-stack for main_bool_true@36 -> main_bool_merge@38: and_result%39#0 +debug: shared x-stack for main_bool_false@37 -> main_bool_merge@38: and_result%39#0 +debug: shared x-stack for main_bool_true@43 -> main_bool_merge@45: and_result%46#0 +debug: shared x-stack for main_bool_false@44 -> main_bool_merge@45: and_result%46#0 +debug: shared x-stack for main_bool_true@50 -> main_bool_merge@52: and_result%53#0 +debug: shared x-stack for main_bool_false@51 -> main_bool_merge@52: and_result%53#0 +info: Writing conditional_execution/out/contract.approval.teal +info: Writing conditional_execution/out/contract.approval.debug.teal +info: Writing conditional_execution/out/contract.clear.teal +info: Writing conditional_execution/out/contract.clear.debug.teal +>> exit code = 0 \ No newline at end of file diff --git a/examples/conditional_execution/contract.py b/examples/conditional_execution/contract.py new file mode 100644 index 0000000000..7ee6f78fdb --- /dev/null +++ b/examples/conditional_execution/contract.py @@ -0,0 +1,75 @@ +from algopy import Contract, subroutine + + +class ConditionalExecutionContract(Contract): + def __init__(self) -> None: + self.did_execute_a = False + self.did_execute_b = False + + def approval_program(self) -> bool: + # 'or' won't execute rhs if lhs is True + self.func_a(True) or self.func_b(True) + self.assert_and_reset( + self.did_execute_a and not self.did_execute_b, + ) + + # 'or' executes rhs if lhs is False + self.func_a(False) or self.func_b(True) + self.assert_and_reset( + self.did_execute_a and self.did_execute_b, + ) + + # 'and' won't execute rhs if lhs is False + self.func_a(False) and self.func_b(True) + self.assert_and_reset( + self.did_execute_a and not self.did_execute_b, + ) + + # 'and' executes rhs if lhs is True + self.func_a(True) and self.func_b(True) + self.assert_and_reset( + self.did_execute_a and self.did_execute_b, + ) + + # Tuples are fully evaluated before indexing is done + (self.func_a(True), self.func_b(True))[0] + self.assert_and_reset( + self.did_execute_a and self.did_execute_b, + ) + + # Ternary condition won't execute if condition is True + self.func_a(True) if self.func_c(True) else self.func_b(True) + self.assert_and_reset( + self.did_execute_a and not self.did_execute_b, + ) + + # Ternary condition won't execute if condition is False + self.func_a(True) if self.func_c(False) else self.func_b(True) + self.assert_and_reset( + not self.did_execute_a and self.did_execute_b, + ) + + return True + + def clear_state_program(self) -> bool: + return True + + @subroutine + def assert_and_reset(self, condition: bool) -> None: + assert condition + self.did_execute_b = False + self.did_execute_a = False + + @subroutine + def func_a(self, ret_val: bool) -> bool: + self.did_execute_a = True + return ret_val + + @subroutine + def func_b(self, ret_val: bool) -> bool: + self.did_execute_b = True + return ret_val + + @subroutine + def func_c(self, ret_val: bool) -> bool: + return ret_val diff --git a/examples/conditional_execution/out/contract.approval.debug.teal b/examples/conditional_execution/out/contract.approval.debug.teal new file mode 100644 index 0000000000..73602bfd0f --- /dev/null +++ b/examples/conditional_execution/out/contract.approval.debug.teal @@ -0,0 +1,386 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + int 1 // 1 True File "conditional_execution/contract.py", line 11 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 11 + bnz main_bool_true@4 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + // Implicit fall through to main_or_contd@3 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + +main_or_contd@3: + int 1 // 1 True File "conditional_execution/contract.py", line 11 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 11 + bz main_bool_false@5 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + // Implicit fall through to main_bool_true@4 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + +main_bool_true@4: + int 1 // 1 + pop // + b main_bool_merge@6 // + +main_bool_false@5: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@6 // + +main_bool_merge@6: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 13 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 13 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 13 + assert // check value exists // app_global_get_ex_value%4#0 self.did_execute_a File "conditional_execution/contract.py", line 13 + bz main_bool_false@9 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 13 + // Implicit fall through to main_and_contd@7 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 13 + +main_and_contd@7: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 13 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 13 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 13 + assert // check value exists // app_global_get_ex_value%6#0 self.did_execute_b File "conditional_execution/contract.py", line 13 + bnz main_bool_false@9 // not self.did_execute_b File "conditional_execution/contract.py", line 13 + // Implicit fall through to main_bool_true@8 // not self.did_execute_b File "conditional_execution/contract.py", line 13 + +main_bool_true@8: + int 1 // 1 + b main_bool_merge@10 // (𝕏) and_result%8#0 | and_result%8#0 + +main_bool_false@9: + int 0 // 0 + // Implicit fall through to main_bool_merge@10 // (𝕏) and_result%8#0 | and_result%8#0 + +main_bool_merge@10: + callsub assert_and_reset // and_result%8#0 self.assert_and_reset( File "conditional_execution/contract.py", line 12 + int 0 // 0 False File "conditional_execution/contract.py", line 17 + callsub func_a // {func_a} self.func_a(False) File "conditional_execution/contract.py", line 17 + bnz main_bool_true@12 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + // Implicit fall through to main_or_contd@11 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + +main_or_contd@11: + int 1 // 1 True File "conditional_execution/contract.py", line 17 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 17 + bz main_bool_false@13 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + // Implicit fall through to main_bool_true@12 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + +main_bool_true@12: + int 1 // 1 + pop // + b main_bool_merge@14 // + +main_bool_false@13: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@14 // + +main_bool_merge@14: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 19 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 19 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 19 + assert // check value exists // app_global_get_ex_value%12#0 self.did_execute_a File "conditional_execution/contract.py", line 19 + bz main_bool_false@17 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + // Implicit fall through to main_and_contd@15 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + +main_and_contd@15: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 19 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 19 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 19 + assert // check value exists // app_global_get_ex_value%14#0 self.did_execute_b File "conditional_execution/contract.py", line 19 + bz main_bool_false@17 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + // Implicit fall through to main_bool_true@16 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + +main_bool_true@16: + int 1 // 1 + b main_bool_merge@18 // (𝕏) and_result%16#0 | and_result%16#0 + +main_bool_false@17: + int 0 // 0 + // Implicit fall through to main_bool_merge@18 // (𝕏) and_result%16#0 | and_result%16#0 + +main_bool_merge@18: + callsub assert_and_reset // and_result%16#0 self.assert_and_reset( File "conditional_execution/contract.py", line 18 + int 0 // 0 False File "conditional_execution/contract.py", line 23 + callsub func_a // {func_a} self.func_a(False) File "conditional_execution/contract.py", line 23 + bz main_bool_false@21 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + // Implicit fall through to main_and_contd@19 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + +main_and_contd@19: + int 1 // 1 True File "conditional_execution/contract.py", line 23 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 23 + bz main_bool_false@21 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + // Implicit fall through to main_bool_true@20 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + +main_bool_true@20: + int 1 // 1 + pop // + b main_bool_merge@22 // + +main_bool_false@21: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@22 // + +main_bool_merge@22: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 25 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 25 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 25 + assert // check value exists // app_global_get_ex_value%20#0 self.did_execute_a File "conditional_execution/contract.py", line 25 + bz main_bool_false@25 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 25 + // Implicit fall through to main_and_contd@23 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 25 + +main_and_contd@23: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 25 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 25 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 25 + assert // check value exists // app_global_get_ex_value%22#0 self.did_execute_b File "conditional_execution/contract.py", line 25 + bnz main_bool_false@25 // not self.did_execute_b File "conditional_execution/contract.py", line 25 + // Implicit fall through to main_bool_true@24 // not self.did_execute_b File "conditional_execution/contract.py", line 25 + +main_bool_true@24: + int 1 // 1 + b main_bool_merge@26 // (𝕏) and_result%24#0 | and_result%24#0 + +main_bool_false@25: + int 0 // 0 + // Implicit fall through to main_bool_merge@26 // (𝕏) and_result%24#0 | and_result%24#0 + +main_bool_merge@26: + callsub assert_and_reset // and_result%24#0 self.assert_and_reset( File "conditional_execution/contract.py", line 24 + int 1 // 1 True File "conditional_execution/contract.py", line 29 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 29 + bz main_bool_false@29 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + // Implicit fall through to main_and_contd@27 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + +main_and_contd@27: + int 1 // 1 True File "conditional_execution/contract.py", line 29 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 29 + bz main_bool_false@29 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + // Implicit fall through to main_bool_true@28 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + +main_bool_true@28: + int 1 // 1 + pop // + b main_bool_merge@30 // + +main_bool_false@29: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@30 // + +main_bool_merge@30: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 31 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 31 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 31 + assert // check value exists // app_global_get_ex_value%28#0 self.did_execute_a File "conditional_execution/contract.py", line 31 + bz main_bool_false@33 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + // Implicit fall through to main_and_contd@31 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + +main_and_contd@31: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 31 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 31 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 31 + assert // check value exists // app_global_get_ex_value%30#0 self.did_execute_b File "conditional_execution/contract.py", line 31 + bz main_bool_false@33 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + // Implicit fall through to main_bool_true@32 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + +main_bool_true@32: + int 1 // 1 + b main_bool_merge@34 // (𝕏) and_result%32#0 | and_result%32#0 + +main_bool_false@33: + int 0 // 0 + // Implicit fall through to main_bool_merge@34 // (𝕏) and_result%32#0 | and_result%32#0 + +main_bool_merge@34: + callsub assert_and_reset // and_result%32#0 self.assert_and_reset( File "conditional_execution/contract.py", line 30 + int 1 // 1 True File "conditional_execution/contract.py", line 35 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 35 + pop // self.func_a(True) File "conditional_execution/contract.py", line 35 + int 1 // 1 True File "conditional_execution/contract.py", line 35 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 35 + pop // self.func_b(True) File "conditional_execution/contract.py", line 35 + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 37 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 37 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 37 + assert // check value exists // app_global_get_ex_value%35#0 self.did_execute_a File "conditional_execution/contract.py", line 37 + bz main_bool_false@37 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + // Implicit fall through to main_and_contd@35 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + +main_and_contd@35: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 37 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 37 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 37 + assert // check value exists // app_global_get_ex_value%37#0 self.did_execute_b File "conditional_execution/contract.py", line 37 + bz main_bool_false@37 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + // Implicit fall through to main_bool_true@36 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + +main_bool_true@36: + int 1 // 1 + b main_bool_merge@38 // (𝕏) and_result%39#0 | and_result%39#0 + +main_bool_false@37: + int 0 // 0 + // Implicit fall through to main_bool_merge@38 // (𝕏) and_result%39#0 | and_result%39#0 + +main_bool_merge@38: + callsub assert_and_reset // and_result%39#0 self.assert_and_reset( File "conditional_execution/contract.py", line 36 + int 1 // 1 True File "conditional_execution/contract.py", line 41 + callsub func_c // {func_c} self.func_c(True) File "conditional_execution/contract.py", line 41 + bz main_ternary_false@40 // self.func_a(True) if self.func_c(True) else self.func_b(True) File "conditional_execution/contract.py", line 41 + // Implicit fall through to main_ternary_true@39 // self.func_a(True) if self.func_c(True) else self.func_b(True) File "conditional_execution/contract.py", line 41 + +main_ternary_true@39: + int 1 // 1 True File "conditional_execution/contract.py", line 41 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 41 + pop // self.func_a(True) File "conditional_execution/contract.py", line 41 + b main_ternary_merge@41 // + +main_ternary_false@40: + int 1 // 1 True File "conditional_execution/contract.py", line 41 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 41 + pop // self.func_a(True) File "conditional_execution/contract.py", line 41 + // Implicit fall through to main_ternary_merge@41 // + +main_ternary_merge@41: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 43 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 43 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 43 + assert // check value exists // app_global_get_ex_value%42#0 self.did_execute_a File "conditional_execution/contract.py", line 43 + bz main_bool_false@44 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 43 + // Implicit fall through to main_and_contd@42 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 43 + +main_and_contd@42: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 43 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 43 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 43 + assert // check value exists // app_global_get_ex_value%44#0 self.did_execute_b File "conditional_execution/contract.py", line 43 + bnz main_bool_false@44 // not self.did_execute_b File "conditional_execution/contract.py", line 43 + // Implicit fall through to main_bool_true@43 // not self.did_execute_b File "conditional_execution/contract.py", line 43 + +main_bool_true@43: + int 1 // 1 + b main_bool_merge@45 // (𝕏) and_result%46#0 | and_result%46#0 + +main_bool_false@44: + int 0 // 0 + // Implicit fall through to main_bool_merge@45 // (𝕏) and_result%46#0 | and_result%46#0 + +main_bool_merge@45: + callsub assert_and_reset // and_result%46#0 self.assert_and_reset( File "conditional_execution/contract.py", line 42 + int 0 // 0 False File "conditional_execution/contract.py", line 47 + callsub func_c // {func_c} self.func_c(False) File "conditional_execution/contract.py", line 47 + bz main_ternary_false@47 // self.func_a(True) if self.func_c(False) else self.func_b(True) File "conditional_execution/contract.py", line 47 + // Implicit fall through to main_ternary_true@46 // self.func_a(True) if self.func_c(False) else self.func_b(True) File "conditional_execution/contract.py", line 47 + +main_ternary_true@46: + int 1 // 1 True File "conditional_execution/contract.py", line 47 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 47 + pop // self.func_a(True) File "conditional_execution/contract.py", line 47 + b main_ternary_merge@48 // + +main_ternary_false@47: + int 1 // 1 True File "conditional_execution/contract.py", line 47 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 47 + pop // self.func_a(True) File "conditional_execution/contract.py", line 47 + // Implicit fall through to main_ternary_merge@48 // + +main_ternary_merge@48: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 49 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 49 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 49 + assert // check value exists // app_global_get_ex_value%49#0 self.did_execute_a File "conditional_execution/contract.py", line 49 + bnz main_bool_false@51 // not self.did_execute_a File "conditional_execution/contract.py", line 49 + // Implicit fall through to main_and_contd@49 // not self.did_execute_a File "conditional_execution/contract.py", line 49 + +main_and_contd@49: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 49 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 49 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 49 + assert // check value exists // app_global_get_ex_value%51#0 self.did_execute_b File "conditional_execution/contract.py", line 49 + bz main_bool_false@51 // not self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 49 + // Implicit fall through to main_bool_true@50 // not self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 49 + +main_bool_true@50: + int 1 // 1 + b main_bool_merge@52 // (𝕏) and_result%53#0 | and_result%53#0 + +main_bool_false@51: + int 0 // 0 + // Implicit fall through to main_bool_merge@52 // (𝕏) and_result%53#0 | and_result%53#0 + +main_bool_merge@52: + callsub assert_and_reset // and_result%53#0 self.assert_and_reset( File "conditional_execution/contract.py", line 48 + int 1 // 1 True File "conditional_execution/contract.py", line 52 + return // return True File "conditional_execution/contract.py", line 52 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val#0: uint64) -> uint64: +func_a: + proto 1 1 // (𝕡) ret_val#0 | def func_a(self, ret_val: bool) -> bool: File "conditional_execution/contract.py", line 64 + +func_a_block@0: + byte "did_execute_a" // (𝕡) ret_val#0 | "did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 65 + int 1 // (𝕡) ret_val#0 | "did_execute_a",1 True File "conditional_execution/contract.py", line 65 + app_global_put // (𝕡) ret_val#0 | self.did_execute_a = True File "conditional_execution/contract.py", line 65 + frame_dig -1 // load ret_val#0 from parameters (𝕡) ret_val#0 | ret_val#0 ret_val: bool File "conditional_execution/contract.py", line 64 + retsub // ret_val#0 return ret_val File "conditional_execution/contract.py", line 66 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val#0: uint64) -> uint64: +func_b: + proto 1 1 // (𝕡) ret_val#0 | def func_b(self, ret_val: bool) -> bool: File "conditional_execution/contract.py", line 69 + +func_b_block@0: + byte "did_execute_b" // (𝕡) ret_val#0 | "did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 70 + int 1 // (𝕡) ret_val#0 | "did_execute_b",1 True File "conditional_execution/contract.py", line 70 + app_global_put // (𝕡) ret_val#0 | self.did_execute_b = True File "conditional_execution/contract.py", line 70 + frame_dig -1 // load ret_val#0 from parameters (𝕡) ret_val#0 | ret_val#0 ret_val: bool File "conditional_execution/contract.py", line 69 + retsub // ret_val#0 return ret_val File "conditional_execution/contract.py", line 71 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition#0: uint64) -> void: +assert_and_reset: + proto 1 0 // (𝕡) condition#0 | def assert_and_reset(self, condition: bool) -> None: File "conditional_execution/contract.py", line 58 + +assert_and_reset_block@0: + frame_dig -1 // load condition#0 from parameters (𝕡) condition#0 | condition#0 condition: bool File "conditional_execution/contract.py", line 58 + assert // (𝕡) condition#0 | assert condition File "conditional_execution/contract.py", line 59 + byte "did_execute_b" // (𝕡) condition#0 | "did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 60 + int 0 // (𝕡) condition#0 | "did_execute_b",0 False File "conditional_execution/contract.py", line 60 + app_global_put // (𝕡) condition#0 | self.did_execute_b = False File "conditional_execution/contract.py", line 60 + byte "did_execute_a" // (𝕡) condition#0 | "did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 61 + int 0 // (𝕡) condition#0 | "did_execute_a",0 False File "conditional_execution/contract.py", line 61 + app_global_put // (𝕡) condition#0 | self.did_execute_a = False File "conditional_execution/contract.py", line 61 + retsub // + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val#0: uint64) -> uint64: +func_c: + proto 1 1 // (𝕡) ret_val#0 | def func_c(self, ret_val: bool) -> bool: File "conditional_execution/contract.py", line 74 + +func_c_block@0: + frame_dig -1 // load ret_val#0 from parameters (𝕡) ret_val#0 | ret_val#0 ret_val: bool File "conditional_execution/contract.py", line 74 + retsub // ret_val#0 return ret_val File "conditional_execution/contract.py", line 75 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "conditional_execution/contract.py", line 5 + +__init___block@0: + byte "did_execute_a" // "did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 6 + int 0 // "did_execute_a",0 False File "conditional_execution/contract.py", line 6 + app_global_put // self.did_execute_a = False File "conditional_execution/contract.py", line 6 + byte "did_execute_b" // "did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 7 + int 0 // "did_execute_b",0 False File "conditional_execution/contract.py", line 7 + app_global_put // self.did_execute_b = False File "conditional_execution/contract.py", line 7 + retsub // + diff --git a/examples/conditional_execution/out/contract.approval.teal b/examples/conditional_execution/out/contract.approval.teal new file mode 100644 index 0000000000..a7d936bae4 --- /dev/null +++ b/examples/conditional_execution/out/contract.approval.teal @@ -0,0 +1,345 @@ +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + int 1 + callsub func_a + bnz main_bool_true@4 + +main_or_contd@3: + int 1 + callsub func_b + bz main_bool_false@5 + +main_bool_true@4: + int 1 + pop + b main_bool_merge@6 + +main_bool_false@5: + int 0 + pop + +main_bool_merge@6: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@9 + +main_and_contd@7: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bnz main_bool_false@9 + +main_bool_true@8: + int 1 + b main_bool_merge@10 + +main_bool_false@9: + int 0 + +main_bool_merge@10: + callsub assert_and_reset + int 0 + callsub func_a + bnz main_bool_true@12 + +main_or_contd@11: + int 1 + callsub func_b + bz main_bool_false@13 + +main_bool_true@12: + int 1 + pop + b main_bool_merge@14 + +main_bool_false@13: + int 0 + pop + +main_bool_merge@14: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@17 + +main_and_contd@15: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@17 + +main_bool_true@16: + int 1 + b main_bool_merge@18 + +main_bool_false@17: + int 0 + +main_bool_merge@18: + callsub assert_and_reset + int 0 + callsub func_a + bz main_bool_false@21 + +main_and_contd@19: + int 1 + callsub func_b + bz main_bool_false@21 + +main_bool_true@20: + int 1 + pop + b main_bool_merge@22 + +main_bool_false@21: + int 0 + pop + +main_bool_merge@22: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@25 + +main_and_contd@23: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bnz main_bool_false@25 + +main_bool_true@24: + int 1 + b main_bool_merge@26 + +main_bool_false@25: + int 0 + +main_bool_merge@26: + callsub assert_and_reset + int 1 + callsub func_a + bz main_bool_false@29 + +main_and_contd@27: + int 1 + callsub func_b + bz main_bool_false@29 + +main_bool_true@28: + int 1 + pop + b main_bool_merge@30 + +main_bool_false@29: + int 0 + pop + +main_bool_merge@30: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@33 + +main_and_contd@31: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@33 + +main_bool_true@32: + int 1 + b main_bool_merge@34 + +main_bool_false@33: + int 0 + +main_bool_merge@34: + callsub assert_and_reset + int 1 + callsub func_a + pop + int 1 + callsub func_b + pop + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@37 + +main_and_contd@35: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@37 + +main_bool_true@36: + int 1 + b main_bool_merge@38 + +main_bool_false@37: + int 0 + +main_bool_merge@38: + callsub assert_and_reset + int 1 + callsub func_c + bz main_ternary_false@40 + +main_ternary_true@39: + int 1 + callsub func_a + pop + b main_ternary_merge@41 + +main_ternary_false@40: + int 1 + callsub func_b + pop + +main_ternary_merge@41: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@44 + +main_and_contd@42: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bnz main_bool_false@44 + +main_bool_true@43: + int 1 + b main_bool_merge@45 + +main_bool_false@44: + int 0 + +main_bool_merge@45: + callsub assert_and_reset + int 0 + callsub func_c + bz main_ternary_false@47 + +main_ternary_true@46: + int 1 + callsub func_a + pop + b main_ternary_merge@48 + +main_ternary_false@47: + int 1 + callsub func_b + pop + +main_ternary_merge@48: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bnz main_bool_false@51 + +main_and_contd@49: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@51 + +main_bool_true@50: + int 1 + b main_bool_merge@52 + +main_bool_false@51: + int 0 + +main_bool_merge@52: + callsub assert_and_reset + int 1 + return + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val#0: uint64) -> uint64: +func_a: + proto 1 1 + +func_a_block@0: + byte "did_execute_a" + int 1 + app_global_put + frame_dig -1 + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val#0: uint64) -> uint64: +func_b: + proto 1 1 + +func_b_block@0: + byte "did_execute_b" + int 1 + app_global_put + frame_dig -1 + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition#0: uint64) -> void: +assert_and_reset: + proto 1 0 + +assert_and_reset_block@0: + frame_dig -1 + assert + byte "did_execute_b" + int 0 + app_global_put + byte "did_execute_a" + int 0 + app_global_put + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val#0: uint64) -> uint64: +func_c: + proto 1 1 + +func_c_block@0: + frame_dig -1 + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "did_execute_a" + int 0 + app_global_put + byte "did_execute_b" + int 0 + app_global_put + retsub + diff --git a/examples/conditional_execution/out/contract.approval_unoptimized.debug.teal b/examples/conditional_execution/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..73602bfd0f --- /dev/null +++ b/examples/conditional_execution/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,386 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + int 1 // 1 True File "conditional_execution/contract.py", line 11 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 11 + bnz main_bool_true@4 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + // Implicit fall through to main_or_contd@3 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + +main_or_contd@3: + int 1 // 1 True File "conditional_execution/contract.py", line 11 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 11 + bz main_bool_false@5 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + // Implicit fall through to main_bool_true@4 // self.func_a(True) or self.func_b(True) File "conditional_execution/contract.py", line 11 + +main_bool_true@4: + int 1 // 1 + pop // + b main_bool_merge@6 // + +main_bool_false@5: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@6 // + +main_bool_merge@6: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 13 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 13 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 13 + assert // check value exists // app_global_get_ex_value%4#0 self.did_execute_a File "conditional_execution/contract.py", line 13 + bz main_bool_false@9 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 13 + // Implicit fall through to main_and_contd@7 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 13 + +main_and_contd@7: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 13 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 13 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 13 + assert // check value exists // app_global_get_ex_value%6#0 self.did_execute_b File "conditional_execution/contract.py", line 13 + bnz main_bool_false@9 // not self.did_execute_b File "conditional_execution/contract.py", line 13 + // Implicit fall through to main_bool_true@8 // not self.did_execute_b File "conditional_execution/contract.py", line 13 + +main_bool_true@8: + int 1 // 1 + b main_bool_merge@10 // (𝕏) and_result%8#0 | and_result%8#0 + +main_bool_false@9: + int 0 // 0 + // Implicit fall through to main_bool_merge@10 // (𝕏) and_result%8#0 | and_result%8#0 + +main_bool_merge@10: + callsub assert_and_reset // and_result%8#0 self.assert_and_reset( File "conditional_execution/contract.py", line 12 + int 0 // 0 False File "conditional_execution/contract.py", line 17 + callsub func_a // {func_a} self.func_a(False) File "conditional_execution/contract.py", line 17 + bnz main_bool_true@12 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + // Implicit fall through to main_or_contd@11 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + +main_or_contd@11: + int 1 // 1 True File "conditional_execution/contract.py", line 17 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 17 + bz main_bool_false@13 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + // Implicit fall through to main_bool_true@12 // self.func_a(False) or self.func_b(True) File "conditional_execution/contract.py", line 17 + +main_bool_true@12: + int 1 // 1 + pop // + b main_bool_merge@14 // + +main_bool_false@13: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@14 // + +main_bool_merge@14: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 19 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 19 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 19 + assert // check value exists // app_global_get_ex_value%12#0 self.did_execute_a File "conditional_execution/contract.py", line 19 + bz main_bool_false@17 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + // Implicit fall through to main_and_contd@15 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + +main_and_contd@15: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 19 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 19 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 19 + assert // check value exists // app_global_get_ex_value%14#0 self.did_execute_b File "conditional_execution/contract.py", line 19 + bz main_bool_false@17 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + // Implicit fall through to main_bool_true@16 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 19 + +main_bool_true@16: + int 1 // 1 + b main_bool_merge@18 // (𝕏) and_result%16#0 | and_result%16#0 + +main_bool_false@17: + int 0 // 0 + // Implicit fall through to main_bool_merge@18 // (𝕏) and_result%16#0 | and_result%16#0 + +main_bool_merge@18: + callsub assert_and_reset // and_result%16#0 self.assert_and_reset( File "conditional_execution/contract.py", line 18 + int 0 // 0 False File "conditional_execution/contract.py", line 23 + callsub func_a // {func_a} self.func_a(False) File "conditional_execution/contract.py", line 23 + bz main_bool_false@21 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + // Implicit fall through to main_and_contd@19 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + +main_and_contd@19: + int 1 // 1 True File "conditional_execution/contract.py", line 23 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 23 + bz main_bool_false@21 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + // Implicit fall through to main_bool_true@20 // self.func_a(False) and self.func_b(True) File "conditional_execution/contract.py", line 23 + +main_bool_true@20: + int 1 // 1 + pop // + b main_bool_merge@22 // + +main_bool_false@21: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@22 // + +main_bool_merge@22: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 25 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 25 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 25 + assert // check value exists // app_global_get_ex_value%20#0 self.did_execute_a File "conditional_execution/contract.py", line 25 + bz main_bool_false@25 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 25 + // Implicit fall through to main_and_contd@23 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 25 + +main_and_contd@23: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 25 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 25 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 25 + assert // check value exists // app_global_get_ex_value%22#0 self.did_execute_b File "conditional_execution/contract.py", line 25 + bnz main_bool_false@25 // not self.did_execute_b File "conditional_execution/contract.py", line 25 + // Implicit fall through to main_bool_true@24 // not self.did_execute_b File "conditional_execution/contract.py", line 25 + +main_bool_true@24: + int 1 // 1 + b main_bool_merge@26 // (𝕏) and_result%24#0 | and_result%24#0 + +main_bool_false@25: + int 0 // 0 + // Implicit fall through to main_bool_merge@26 // (𝕏) and_result%24#0 | and_result%24#0 + +main_bool_merge@26: + callsub assert_and_reset // and_result%24#0 self.assert_and_reset( File "conditional_execution/contract.py", line 24 + int 1 // 1 True File "conditional_execution/contract.py", line 29 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 29 + bz main_bool_false@29 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + // Implicit fall through to main_and_contd@27 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + +main_and_contd@27: + int 1 // 1 True File "conditional_execution/contract.py", line 29 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 29 + bz main_bool_false@29 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + // Implicit fall through to main_bool_true@28 // self.func_a(True) and self.func_b(True) File "conditional_execution/contract.py", line 29 + +main_bool_true@28: + int 1 // 1 + pop // + b main_bool_merge@30 // + +main_bool_false@29: + int 0 // 0 + pop // + // Implicit fall through to main_bool_merge@30 // + +main_bool_merge@30: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 31 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 31 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 31 + assert // check value exists // app_global_get_ex_value%28#0 self.did_execute_a File "conditional_execution/contract.py", line 31 + bz main_bool_false@33 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + // Implicit fall through to main_and_contd@31 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + +main_and_contd@31: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 31 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 31 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 31 + assert // check value exists // app_global_get_ex_value%30#0 self.did_execute_b File "conditional_execution/contract.py", line 31 + bz main_bool_false@33 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + // Implicit fall through to main_bool_true@32 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 31 + +main_bool_true@32: + int 1 // 1 + b main_bool_merge@34 // (𝕏) and_result%32#0 | and_result%32#0 + +main_bool_false@33: + int 0 // 0 + // Implicit fall through to main_bool_merge@34 // (𝕏) and_result%32#0 | and_result%32#0 + +main_bool_merge@34: + callsub assert_and_reset // and_result%32#0 self.assert_and_reset( File "conditional_execution/contract.py", line 30 + int 1 // 1 True File "conditional_execution/contract.py", line 35 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 35 + pop // self.func_a(True) File "conditional_execution/contract.py", line 35 + int 1 // 1 True File "conditional_execution/contract.py", line 35 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 35 + pop // self.func_b(True) File "conditional_execution/contract.py", line 35 + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 37 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 37 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 37 + assert // check value exists // app_global_get_ex_value%35#0 self.did_execute_a File "conditional_execution/contract.py", line 37 + bz main_bool_false@37 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + // Implicit fall through to main_and_contd@35 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + +main_and_contd@35: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 37 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 37 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 37 + assert // check value exists // app_global_get_ex_value%37#0 self.did_execute_b File "conditional_execution/contract.py", line 37 + bz main_bool_false@37 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + // Implicit fall through to main_bool_true@36 // self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 37 + +main_bool_true@36: + int 1 // 1 + b main_bool_merge@38 // (𝕏) and_result%39#0 | and_result%39#0 + +main_bool_false@37: + int 0 // 0 + // Implicit fall through to main_bool_merge@38 // (𝕏) and_result%39#0 | and_result%39#0 + +main_bool_merge@38: + callsub assert_and_reset // and_result%39#0 self.assert_and_reset( File "conditional_execution/contract.py", line 36 + int 1 // 1 True File "conditional_execution/contract.py", line 41 + callsub func_c // {func_c} self.func_c(True) File "conditional_execution/contract.py", line 41 + bz main_ternary_false@40 // self.func_a(True) if self.func_c(True) else self.func_b(True) File "conditional_execution/contract.py", line 41 + // Implicit fall through to main_ternary_true@39 // self.func_a(True) if self.func_c(True) else self.func_b(True) File "conditional_execution/contract.py", line 41 + +main_ternary_true@39: + int 1 // 1 True File "conditional_execution/contract.py", line 41 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 41 + pop // self.func_a(True) File "conditional_execution/contract.py", line 41 + b main_ternary_merge@41 // + +main_ternary_false@40: + int 1 // 1 True File "conditional_execution/contract.py", line 41 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 41 + pop // self.func_a(True) File "conditional_execution/contract.py", line 41 + // Implicit fall through to main_ternary_merge@41 // + +main_ternary_merge@41: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 43 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 43 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 43 + assert // check value exists // app_global_get_ex_value%42#0 self.did_execute_a File "conditional_execution/contract.py", line 43 + bz main_bool_false@44 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 43 + // Implicit fall through to main_and_contd@42 // self.did_execute_a and not self.did_execute_b File "conditional_execution/contract.py", line 43 + +main_and_contd@42: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 43 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 43 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 43 + assert // check value exists // app_global_get_ex_value%44#0 self.did_execute_b File "conditional_execution/contract.py", line 43 + bnz main_bool_false@44 // not self.did_execute_b File "conditional_execution/contract.py", line 43 + // Implicit fall through to main_bool_true@43 // not self.did_execute_b File "conditional_execution/contract.py", line 43 + +main_bool_true@43: + int 1 // 1 + b main_bool_merge@45 // (𝕏) and_result%46#0 | and_result%46#0 + +main_bool_false@44: + int 0 // 0 + // Implicit fall through to main_bool_merge@45 // (𝕏) and_result%46#0 | and_result%46#0 + +main_bool_merge@45: + callsub assert_and_reset // and_result%46#0 self.assert_and_reset( File "conditional_execution/contract.py", line 42 + int 0 // 0 False File "conditional_execution/contract.py", line 47 + callsub func_c // {func_c} self.func_c(False) File "conditional_execution/contract.py", line 47 + bz main_ternary_false@47 // self.func_a(True) if self.func_c(False) else self.func_b(True) File "conditional_execution/contract.py", line 47 + // Implicit fall through to main_ternary_true@46 // self.func_a(True) if self.func_c(False) else self.func_b(True) File "conditional_execution/contract.py", line 47 + +main_ternary_true@46: + int 1 // 1 True File "conditional_execution/contract.py", line 47 + callsub func_a // {func_a} self.func_a(True) File "conditional_execution/contract.py", line 47 + pop // self.func_a(True) File "conditional_execution/contract.py", line 47 + b main_ternary_merge@48 // + +main_ternary_false@47: + int 1 // 1 True File "conditional_execution/contract.py", line 47 + callsub func_b // {func_b} self.func_b(True) File "conditional_execution/contract.py", line 47 + pop // self.func_a(True) File "conditional_execution/contract.py", line 47 + // Implicit fall through to main_ternary_merge@48 // + +main_ternary_merge@48: + int 0 // 0 self.did_execute_a File "conditional_execution/contract.py", line 49 + byte "did_execute_a" // 0,"did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 49 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_a File "conditional_execution/contract.py", line 49 + assert // check value exists // app_global_get_ex_value%49#0 self.did_execute_a File "conditional_execution/contract.py", line 49 + bnz main_bool_false@51 // not self.did_execute_a File "conditional_execution/contract.py", line 49 + // Implicit fall through to main_and_contd@49 // not self.did_execute_a File "conditional_execution/contract.py", line 49 + +main_and_contd@49: + int 0 // 0 self.did_execute_b File "conditional_execution/contract.py", line 49 + byte "did_execute_b" // 0,"did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 49 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.did_execute_b File "conditional_execution/contract.py", line 49 + assert // check value exists // app_global_get_ex_value%51#0 self.did_execute_b File "conditional_execution/contract.py", line 49 + bz main_bool_false@51 // not self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 49 + // Implicit fall through to main_bool_true@50 // not self.did_execute_a and self.did_execute_b File "conditional_execution/contract.py", line 49 + +main_bool_true@50: + int 1 // 1 + b main_bool_merge@52 // (𝕏) and_result%53#0 | and_result%53#0 + +main_bool_false@51: + int 0 // 0 + // Implicit fall through to main_bool_merge@52 // (𝕏) and_result%53#0 | and_result%53#0 + +main_bool_merge@52: + callsub assert_and_reset // and_result%53#0 self.assert_and_reset( File "conditional_execution/contract.py", line 48 + int 1 // 1 True File "conditional_execution/contract.py", line 52 + return // return True File "conditional_execution/contract.py", line 52 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val#0: uint64) -> uint64: +func_a: + proto 1 1 // (𝕡) ret_val#0 | def func_a(self, ret_val: bool) -> bool: File "conditional_execution/contract.py", line 64 + +func_a_block@0: + byte "did_execute_a" // (𝕡) ret_val#0 | "did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 65 + int 1 // (𝕡) ret_val#0 | "did_execute_a",1 True File "conditional_execution/contract.py", line 65 + app_global_put // (𝕡) ret_val#0 | self.did_execute_a = True File "conditional_execution/contract.py", line 65 + frame_dig -1 // load ret_val#0 from parameters (𝕡) ret_val#0 | ret_val#0 ret_val: bool File "conditional_execution/contract.py", line 64 + retsub // ret_val#0 return ret_val File "conditional_execution/contract.py", line 66 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val#0: uint64) -> uint64: +func_b: + proto 1 1 // (𝕡) ret_val#0 | def func_b(self, ret_val: bool) -> bool: File "conditional_execution/contract.py", line 69 + +func_b_block@0: + byte "did_execute_b" // (𝕡) ret_val#0 | "did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 70 + int 1 // (𝕡) ret_val#0 | "did_execute_b",1 True File "conditional_execution/contract.py", line 70 + app_global_put // (𝕡) ret_val#0 | self.did_execute_b = True File "conditional_execution/contract.py", line 70 + frame_dig -1 // load ret_val#0 from parameters (𝕡) ret_val#0 | ret_val#0 ret_val: bool File "conditional_execution/contract.py", line 69 + retsub // ret_val#0 return ret_val File "conditional_execution/contract.py", line 71 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition#0: uint64) -> void: +assert_and_reset: + proto 1 0 // (𝕡) condition#0 | def assert_and_reset(self, condition: bool) -> None: File "conditional_execution/contract.py", line 58 + +assert_and_reset_block@0: + frame_dig -1 // load condition#0 from parameters (𝕡) condition#0 | condition#0 condition: bool File "conditional_execution/contract.py", line 58 + assert // (𝕡) condition#0 | assert condition File "conditional_execution/contract.py", line 59 + byte "did_execute_b" // (𝕡) condition#0 | "did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 60 + int 0 // (𝕡) condition#0 | "did_execute_b",0 False File "conditional_execution/contract.py", line 60 + app_global_put // (𝕡) condition#0 | self.did_execute_b = False File "conditional_execution/contract.py", line 60 + byte "did_execute_a" // (𝕡) condition#0 | "did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 61 + int 0 // (𝕡) condition#0 | "did_execute_a",0 False File "conditional_execution/contract.py", line 61 + app_global_put // (𝕡) condition#0 | self.did_execute_a = False File "conditional_execution/contract.py", line 61 + retsub // + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val#0: uint64) -> uint64: +func_c: + proto 1 1 // (𝕡) ret_val#0 | def func_c(self, ret_val: bool) -> bool: File "conditional_execution/contract.py", line 74 + +func_c_block@0: + frame_dig -1 // load ret_val#0 from parameters (𝕡) ret_val#0 | ret_val#0 ret_val: bool File "conditional_execution/contract.py", line 74 + retsub // ret_val#0 return ret_val File "conditional_execution/contract.py", line 75 + + +// examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "conditional_execution/contract.py", line 5 + +__init___block@0: + byte "did_execute_a" // "did_execute_a" self.did_execute_a File "conditional_execution/contract.py", line 6 + int 0 // "did_execute_a",0 False File "conditional_execution/contract.py", line 6 + app_global_put // self.did_execute_a = False File "conditional_execution/contract.py", line 6 + byte "did_execute_b" // "did_execute_b" self.did_execute_b File "conditional_execution/contract.py", line 7 + int 0 // "did_execute_b",0 False File "conditional_execution/contract.py", line 7 + app_global_put // self.did_execute_b = False File "conditional_execution/contract.py", line 7 + retsub // + diff --git a/examples/conditional_execution/out/contract.approval_unoptimized.teal b/examples/conditional_execution/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..a7d936bae4 --- /dev/null +++ b/examples/conditional_execution/out/contract.approval_unoptimized.teal @@ -0,0 +1,345 @@ +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + int 1 + callsub func_a + bnz main_bool_true@4 + +main_or_contd@3: + int 1 + callsub func_b + bz main_bool_false@5 + +main_bool_true@4: + int 1 + pop + b main_bool_merge@6 + +main_bool_false@5: + int 0 + pop + +main_bool_merge@6: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@9 + +main_and_contd@7: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bnz main_bool_false@9 + +main_bool_true@8: + int 1 + b main_bool_merge@10 + +main_bool_false@9: + int 0 + +main_bool_merge@10: + callsub assert_and_reset + int 0 + callsub func_a + bnz main_bool_true@12 + +main_or_contd@11: + int 1 + callsub func_b + bz main_bool_false@13 + +main_bool_true@12: + int 1 + pop + b main_bool_merge@14 + +main_bool_false@13: + int 0 + pop + +main_bool_merge@14: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@17 + +main_and_contd@15: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@17 + +main_bool_true@16: + int 1 + b main_bool_merge@18 + +main_bool_false@17: + int 0 + +main_bool_merge@18: + callsub assert_and_reset + int 0 + callsub func_a + bz main_bool_false@21 + +main_and_contd@19: + int 1 + callsub func_b + bz main_bool_false@21 + +main_bool_true@20: + int 1 + pop + b main_bool_merge@22 + +main_bool_false@21: + int 0 + pop + +main_bool_merge@22: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@25 + +main_and_contd@23: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bnz main_bool_false@25 + +main_bool_true@24: + int 1 + b main_bool_merge@26 + +main_bool_false@25: + int 0 + +main_bool_merge@26: + callsub assert_and_reset + int 1 + callsub func_a + bz main_bool_false@29 + +main_and_contd@27: + int 1 + callsub func_b + bz main_bool_false@29 + +main_bool_true@28: + int 1 + pop + b main_bool_merge@30 + +main_bool_false@29: + int 0 + pop + +main_bool_merge@30: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@33 + +main_and_contd@31: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@33 + +main_bool_true@32: + int 1 + b main_bool_merge@34 + +main_bool_false@33: + int 0 + +main_bool_merge@34: + callsub assert_and_reset + int 1 + callsub func_a + pop + int 1 + callsub func_b + pop + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@37 + +main_and_contd@35: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@37 + +main_bool_true@36: + int 1 + b main_bool_merge@38 + +main_bool_false@37: + int 0 + +main_bool_merge@38: + callsub assert_and_reset + int 1 + callsub func_c + bz main_ternary_false@40 + +main_ternary_true@39: + int 1 + callsub func_a + pop + b main_ternary_merge@41 + +main_ternary_false@40: + int 1 + callsub func_b + pop + +main_ternary_merge@41: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bz main_bool_false@44 + +main_and_contd@42: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bnz main_bool_false@44 + +main_bool_true@43: + int 1 + b main_bool_merge@45 + +main_bool_false@44: + int 0 + +main_bool_merge@45: + callsub assert_and_reset + int 0 + callsub func_c + bz main_ternary_false@47 + +main_ternary_true@46: + int 1 + callsub func_a + pop + b main_ternary_merge@48 + +main_ternary_false@47: + int 1 + callsub func_b + pop + +main_ternary_merge@48: + int 0 + byte "did_execute_a" + app_global_get_ex + assert // check value exists + bnz main_bool_false@51 + +main_and_contd@49: + int 0 + byte "did_execute_b" + app_global_get_ex + assert // check value exists + bz main_bool_false@51 + +main_bool_true@50: + int 1 + b main_bool_merge@52 + +main_bool_false@51: + int 0 + +main_bool_merge@52: + callsub assert_and_reset + int 1 + return + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val#0: uint64) -> uint64: +func_a: + proto 1 1 + +func_a_block@0: + byte "did_execute_a" + int 1 + app_global_put + frame_dig -1 + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val#0: uint64) -> uint64: +func_b: + proto 1 1 + +func_b_block@0: + byte "did_execute_b" + int 1 + app_global_put + frame_dig -1 + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition#0: uint64) -> void: +assert_and_reset: + proto 1 0 + +assert_and_reset_block@0: + frame_dig -1 + assert + byte "did_execute_b" + int 0 + app_global_put + byte "did_execute_a" + int 0 + app_global_put + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val#0: uint64) -> uint64: +func_c: + proto 1 1 + +func_c_block@0: + frame_dig -1 + retsub + + +// examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "did_execute_a" + int 0 + app_global_put + byte "did_execute_b" + int 0 + app_global_put + retsub + diff --git a/examples/conditional_execution/out/contract.awst b/examples/conditional_execution/out/contract.awst new file mode 100644 index 0000000000..fa1a15f8b3 --- /dev/null +++ b/examples/conditional_execution/out/contract.awst @@ -0,0 +1,61 @@ +contract ConditionalExecutionContract +{ + globals { + ['did_execute_a']: bool + ['did_execute_b']: bool + } + + constructor() + { + this.globals['did_execute_a']: bool = false + this.globals['did_execute_b']: bool = false + } + + approval_program(): bool + { + this::func_a(true) or this::func_b(true) + this::assert_and_reset(this.globals['did_execute_a'] and !(this.globals['did_execute_b'])) + this::func_a(false) or this::func_b(true) + this::assert_and_reset(this.globals['did_execute_a'] and this.globals['did_execute_b']) + this::func_a(false) and this::func_b(true) + this::assert_and_reset(this.globals['did_execute_a'] and !(this.globals['did_execute_b'])) + this::func_a(true) and this::func_b(true) + this::assert_and_reset(this.globals['did_execute_a'] and this.globals['did_execute_b']) + (this::func_a(true), this::func_b(true))[0] + this::assert_and_reset(this.globals['did_execute_a'] and this.globals['did_execute_b']) + (this::func_c(true)) ? (this::func_a(true)) : (this::func_b(true)) + this::assert_and_reset(this.globals['did_execute_a'] and !(this.globals['did_execute_b'])) + (this::func_c(false)) ? (this::func_a(true)) : (this::func_b(true)) + this::assert_and_reset(!(this.globals['did_execute_a']) and this.globals['did_execute_b']) + return true + } + + clear_state_program(): bool + { + return true + } + + subroutine assert_and_reset(condition: bool): None + { + assert(condition) + this.globals['did_execute_b']: bool = false + this.globals['did_execute_a']: bool = false + } + + subroutine func_a(ret_val: bool): bool + { + this.globals['did_execute_a']: bool = true + return ret_val + } + + subroutine func_b(ret_val: bool): bool + { + this.globals['did_execute_b']: bool = true + return ret_val + } + + subroutine func_c(ret_val: bool): bool + { + return ret_val + } +} \ No newline at end of file diff --git a/examples/conditional_execution/out/contract.clear.debug.teal b/examples/conditional_execution/out/contract.clear.debug.teal new file mode 100644 index 0000000000..6303f8d57e --- /dev/null +++ b/examples/conditional_execution/out/contract.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "conditional_execution/contract.py", line 55 + return // return True File "conditional_execution/contract.py", line 55 + diff --git a/examples/conditional_execution/out/contract.clear.teal b/examples/conditional_execution/out/contract.clear.teal new file mode 100644 index 0000000000..84a26a3c64 --- /dev/null +++ b/examples/conditional_execution/out/contract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/conditional_execution/out/contract.clear_unoptimized.debug.teal b/examples/conditional_execution/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..6303f8d57e --- /dev/null +++ b/examples/conditional_execution/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "conditional_execution/contract.py", line 55 + return // return True File "conditional_execution/contract.py", line 55 + diff --git a/examples/conditional_execution/out/contract.clear_unoptimized.teal b/examples/conditional_execution/out/contract.clear_unoptimized.teal new file mode 100644 index 0000000000..84a26a3c64 --- /dev/null +++ b/examples/conditional_execution/out/contract.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/conditional_execution/out/contract_ConditionalExecutionContract.cssa.ir b/examples/conditional_execution/out/contract_ConditionalExecutionContract.cssa.ir new file mode 100644 index 0000000000..fde3b1a987 --- /dev/null +++ b/examples/conditional_execution/out/contract_ConditionalExecutionContract.cssa.ir @@ -0,0 +1,268 @@ +contract examples.conditional_execution.contract.ConditionalExecutionContract: + program approval: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: + block@0: // L9 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L5 + examples.conditional_execution.contract.ConditionalExecutionContract.__init__() + goto block@2 + block@2: // entrypoint_L5 + let tmp%1#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%1#0 ? block@4 : block@3 + block@3: // or_contd_L11 + let tmp%2#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%2#0 ? block@4 : block@5 + block@4: // bool_true_L11 + let or_result%3#0: uint64 = 1u + let or_result%3#3: uint64 = or_result%3#0 + goto block@6 + block@5: // bool_false_L11 + let or_result%3#1: uint64 = 0u + let or_result%3#4: uint64 = or_result%3#1 + goto block@6 + block@6: // bool_merge_L11 + let or_result%3#5: uint64 = φ(or_result%3#3 <- block@4, or_result%3#4 <- block@5) + let or_result%3#2: uint64 = or_result%3#5 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%5#0) // check value exists + goto app_global_get_ex_value%4#0 ? block@7 : block@9 + block@7: // and_contd_L13 + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + goto app_global_get_ex_value%6#0 ? block@9 : block@8 + block@8: // bool_true_L13 + let and_result%8#0: uint64 = 1u + let and_result%8#3: uint64 = and_result%8#0 + goto block@10 + block@9: // bool_false_L13 + let and_result%8#1: uint64 = 0u + let and_result%8#4: uint64 = and_result%8#1 + goto block@10 + block@10: // bool_merge_L13 + let and_result%8#5: uint64 = φ(and_result%8#3 <- block@8, and_result%8#4 <- block@9) + let and_result%8#2: uint64 = and_result%8#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%8#2) + let tmp%9#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%9#0 ? block@12 : block@11 + block@11: // or_contd_L17 + let tmp%10#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%10#0 ? block@12 : block@13 + block@12: // bool_true_L17 + let or_result%11#0: uint64 = 1u + let or_result%11#3: uint64 = or_result%11#0 + goto block@14 + block@13: // bool_false_L17 + let or_result%11#1: uint64 = 0u + let or_result%11#4: uint64 = or_result%11#1 + goto block@14 + block@14: // bool_merge_L17 + let or_result%11#5: uint64 = φ(or_result%11#3 <- block@12, or_result%11#4 <- block@13) + let or_result%11#2: uint64 = or_result%11#5 + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + goto app_global_get_ex_value%12#0 ? block@15 : block@17 + block@15: // and_contd_L19 + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + goto app_global_get_ex_value%14#0 ? block@16 : block@17 + block@16: // bool_true_L19 + let and_result%16#0: uint64 = 1u + let and_result%16#3: uint64 = and_result%16#0 + goto block@18 + block@17: // bool_false_L19 + let and_result%16#1: uint64 = 0u + let and_result%16#4: uint64 = and_result%16#1 + goto block@18 + block@18: // bool_merge_L19 + let and_result%16#5: uint64 = φ(and_result%16#3 <- block@16, and_result%16#4 <- block@17) + let and_result%16#2: uint64 = and_result%16#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%16#2) + let tmp%17#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%17#0 ? block@19 : block@21 + block@19: // and_contd_L23 + let tmp%18#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%18#0 ? block@20 : block@21 + block@20: // bool_true_L23 + let and_result%19#0: uint64 = 1u + let and_result%19#3: uint64 = and_result%19#0 + goto block@22 + block@21: // bool_false_L23 + let and_result%19#1: uint64 = 0u + let and_result%19#4: uint64 = and_result%19#1 + goto block@22 + block@22: // bool_merge_L23 + let and_result%19#5: uint64 = φ(and_result%19#3 <- block@20, and_result%19#4 <- block@21) + let and_result%19#2: uint64 = and_result%19#5 + let (app_global_get_ex_value%20#0: uint64, app_global_get_ex_did_exist%21#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%21#0) // check value exists + goto app_global_get_ex_value%20#0 ? block@23 : block@25 + block@23: // and_contd_L25 + let (app_global_get_ex_value%22#0: uint64, app_global_get_ex_did_exist%23#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%23#0) // check value exists + goto app_global_get_ex_value%22#0 ? block@25 : block@24 + block@24: // bool_true_L25 + let and_result%24#0: uint64 = 1u + let and_result%24#3: uint64 = and_result%24#0 + goto block@26 + block@25: // bool_false_L25 + let and_result%24#1: uint64 = 0u + let and_result%24#4: uint64 = and_result%24#1 + goto block@26 + block@26: // bool_merge_L25 + let and_result%24#5: uint64 = φ(and_result%24#3 <- block@24, and_result%24#4 <- block@25) + let and_result%24#2: uint64 = and_result%24#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%24#2) + let tmp%25#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%25#0 ? block@27 : block@29 + block@27: // and_contd_L29 + let tmp%26#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%26#0 ? block@28 : block@29 + block@28: // bool_true_L29 + let and_result%27#0: uint64 = 1u + let and_result%27#3: uint64 = and_result%27#0 + goto block@30 + block@29: // bool_false_L29 + let and_result%27#1: uint64 = 0u + let and_result%27#4: uint64 = and_result%27#1 + goto block@30 + block@30: // bool_merge_L29 + let and_result%27#5: uint64 = φ(and_result%27#3 <- block@28, and_result%27#4 <- block@29) + let and_result%27#2: uint64 = and_result%27#5 + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%29#0) // check value exists + goto app_global_get_ex_value%28#0 ? block@31 : block@33 + block@31: // and_contd_L31 + let (app_global_get_ex_value%30#0: uint64, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%31#0) // check value exists + goto app_global_get_ex_value%30#0 ? block@32 : block@33 + block@32: // bool_true_L31 + let and_result%32#0: uint64 = 1u + let and_result%32#3: uint64 = and_result%32#0 + goto block@34 + block@33: // bool_false_L31 + let and_result%32#1: uint64 = 0u + let and_result%32#4: uint64 = and_result%32#1 + goto block@34 + block@34: // bool_merge_L31 + let and_result%32#5: uint64 = φ(and_result%32#3 <- block@32, and_result%32#4 <- block@33) + let and_result%32#2: uint64 = and_result%32#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%32#2) + let tmp%33#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let tmp%34#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let (app_global_get_ex_value%35#0: uint64, app_global_get_ex_did_exist%36#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%36#0) // check value exists + goto app_global_get_ex_value%35#0 ? block@35 : block@37 + block@35: // and_contd_L37 + let (app_global_get_ex_value%37#0: uint64, app_global_get_ex_did_exist%38#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%38#0) // check value exists + goto app_global_get_ex_value%37#0 ? block@36 : block@37 + block@36: // bool_true_L37 + let and_result%39#0: uint64 = 1u + let and_result%39#3: uint64 = and_result%39#0 + goto block@38 + block@37: // bool_false_L37 + let and_result%39#1: uint64 = 0u + let and_result%39#4: uint64 = and_result%39#1 + goto block@38 + block@38: // bool_merge_L37 + let and_result%39#5: uint64 = φ(and_result%39#3 <- block@36, and_result%39#4 <- block@37) + let and_result%39#2: uint64 = and_result%39#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%39#2) + let tmp%40#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(1u) + goto tmp%40#0 ? block@39 : block@40 + block@39: // ternary_true_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let ternary_result%41#3: uint64 = ternary_result%41#0 + goto block@41 + block@40: // ternary_false_L41 + let ternary_result%41#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let ternary_result%41#4: uint64 = ternary_result%41#1 + goto block@41 + block@41: // ternary_merge_L41 + let ternary_result%41#5: uint64 = φ(ternary_result%41#3 <- block@39, ternary_result%41#4 <- block@40) + let ternary_result%41#2: uint64 = ternary_result%41#5 + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%43#0) // check value exists + goto app_global_get_ex_value%42#0 ? block@42 : block@44 + block@42: // and_contd_L43 + let (app_global_get_ex_value%44#0: uint64, app_global_get_ex_did_exist%45#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%45#0) // check value exists + goto app_global_get_ex_value%44#0 ? block@44 : block@43 + block@43: // bool_true_L43 + let and_result%46#0: uint64 = 1u + let and_result%46#3: uint64 = and_result%46#0 + goto block@45 + block@44: // bool_false_L43 + let and_result%46#1: uint64 = 0u + let and_result%46#4: uint64 = and_result%46#1 + goto block@45 + block@45: // bool_merge_L43 + let and_result%46#5: uint64 = φ(and_result%46#3 <- block@43, and_result%46#4 <- block@44) + let and_result%46#2: uint64 = and_result%46#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%46#2) + let tmp%47#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(0u) + goto tmp%47#0 ? block@46 : block@47 + block@46: // ternary_true_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let ternary_result%48#3: uint64 = ternary_result%48#0 + goto block@48 + block@47: // ternary_false_L47 + let ternary_result%48#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let ternary_result%48#4: uint64 = ternary_result%48#1 + goto block@48 + block@48: // ternary_merge_L47 + let ternary_result%48#5: uint64 = φ(ternary_result%48#3 <- block@46, ternary_result%48#4 <- block@47) + let ternary_result%48#2: uint64 = ternary_result%48#5 + let (app_global_get_ex_value%49#0: uint64, app_global_get_ex_did_exist%50#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%50#0) // check value exists + goto app_global_get_ex_value%49#0 ? block@51 : block@49 + block@49: // and_contd_L49 + let (app_global_get_ex_value%51#0: uint64, app_global_get_ex_did_exist%52#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%52#0) // check value exists + goto app_global_get_ex_value%51#0 ? block@50 : block@51 + block@50: // bool_true_L49 + let and_result%53#0: uint64 = 1u + let and_result%53#3: uint64 = and_result%53#0 + goto block@52 + block@51: // bool_false_L49 + let and_result%53#1: uint64 = 0u + let and_result%53#4: uint64 = and_result%53#1 + goto block@52 + block@52: // bool_merge_L49 + let and_result%53#5: uint64 = φ(and_result%53#3 <- block@50, and_result%53#4 <- block@51) + let and_result%53#2: uint64 = and_result%53#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%53#2) + return 1u + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val: uint64) -> uint64: + block@0: // L64 + (app_global_put "did_execute_a" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val: uint64) -> uint64: + block@0: // L69 + (app_global_put "did_execute_b" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition: uint64) -> void: + block@0: // L58 + (assert condition#0) + (app_global_put "did_execute_b" 0u) + (app_global_put "did_execute_a" 0u) + return + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val: uint64) -> uint64: + block@0: // L74 + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: + block@0: // L5 + (app_global_put "did_execute_a" 0u) + (app_global_put "did_execute_b" 0u) + return + + program clear-state: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: + block@0: // L54 + return 1u \ No newline at end of file diff --git a/examples/conditional_execution/out/contract_ConditionalExecutionContract.final.ir b/examples/conditional_execution/out/contract_ConditionalExecutionContract.final.ir new file mode 100644 index 0000000000..59c5a4256f --- /dev/null +++ b/examples/conditional_execution/out/contract_ConditionalExecutionContract.final.ir @@ -0,0 +1,216 @@ +contract examples.conditional_execution.contract.ConditionalExecutionContract: + program approval: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: + block@0: // L9 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L5 + examples.conditional_execution.contract.ConditionalExecutionContract.__init__() + goto block@2 + block@2: // entrypoint_L5 + let tmp%1#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%1#0 ? block@4 : block@3 + block@3: // or_contd_L11 + let tmp%2#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%2#0 ? block@4 : block@5 + block@4: // bool_true_L11 + let or_result%3#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L11 + let or_result%3#0: uint64 = 0u + goto block@6 + block@6: // bool_merge_L11 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%5#0) // check value exists + goto app_global_get_ex_value%4#0 ? block@7 : block@9 + block@7: // and_contd_L13 + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + goto app_global_get_ex_value%6#0 ? block@9 : block@8 + block@8: // bool_true_L13 + let and_result%8#0: uint64 = 1u + goto block@10 + block@9: // bool_false_L13 + let and_result%8#0: uint64 = 0u + goto block@10 + block@10: // bool_merge_L13 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%8#0) + let tmp%9#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%9#0 ? block@12 : block@11 + block@11: // or_contd_L17 + let tmp%10#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%10#0 ? block@12 : block@13 + block@12: // bool_true_L17 + let or_result%11#0: uint64 = 1u + goto block@14 + block@13: // bool_false_L17 + let or_result%11#0: uint64 = 0u + goto block@14 + block@14: // bool_merge_L17 + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + goto app_global_get_ex_value%12#0 ? block@15 : block@17 + block@15: // and_contd_L19 + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + goto app_global_get_ex_value%14#0 ? block@16 : block@17 + block@16: // bool_true_L19 + let and_result%16#0: uint64 = 1u + goto block@18 + block@17: // bool_false_L19 + let and_result%16#0: uint64 = 0u + goto block@18 + block@18: // bool_merge_L19 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%16#0) + let tmp%17#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%17#0 ? block@19 : block@21 + block@19: // and_contd_L23 + let tmp%18#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%18#0 ? block@20 : block@21 + block@20: // bool_true_L23 + let and_result%19#0: uint64 = 1u + goto block@22 + block@21: // bool_false_L23 + let and_result%19#0: uint64 = 0u + goto block@22 + block@22: // bool_merge_L23 + let (app_global_get_ex_value%20#0: uint64, app_global_get_ex_did_exist%21#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%21#0) // check value exists + goto app_global_get_ex_value%20#0 ? block@23 : block@25 + block@23: // and_contd_L25 + let (app_global_get_ex_value%22#0: uint64, app_global_get_ex_did_exist%23#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%23#0) // check value exists + goto app_global_get_ex_value%22#0 ? block@25 : block@24 + block@24: // bool_true_L25 + let and_result%24#0: uint64 = 1u + goto block@26 + block@25: // bool_false_L25 + let and_result%24#0: uint64 = 0u + goto block@26 + block@26: // bool_merge_L25 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%24#0) + let tmp%25#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%25#0 ? block@27 : block@29 + block@27: // and_contd_L29 + let tmp%26#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%26#0 ? block@28 : block@29 + block@28: // bool_true_L29 + let and_result%27#0: uint64 = 1u + goto block@30 + block@29: // bool_false_L29 + let and_result%27#0: uint64 = 0u + goto block@30 + block@30: // bool_merge_L29 + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%29#0) // check value exists + goto app_global_get_ex_value%28#0 ? block@31 : block@33 + block@31: // and_contd_L31 + let (app_global_get_ex_value%30#0: uint64, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%31#0) // check value exists + goto app_global_get_ex_value%30#0 ? block@32 : block@33 + block@32: // bool_true_L31 + let and_result%32#0: uint64 = 1u + goto block@34 + block@33: // bool_false_L31 + let and_result%32#0: uint64 = 0u + goto block@34 + block@34: // bool_merge_L31 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%32#0) + let tmp%33#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let tmp%34#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let (app_global_get_ex_value%35#0: uint64, app_global_get_ex_did_exist%36#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%36#0) // check value exists + goto app_global_get_ex_value%35#0 ? block@35 : block@37 + block@35: // and_contd_L37 + let (app_global_get_ex_value%37#0: uint64, app_global_get_ex_did_exist%38#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%38#0) // check value exists + goto app_global_get_ex_value%37#0 ? block@36 : block@37 + block@36: // bool_true_L37 + let and_result%39#0: uint64 = 1u + goto block@38 + block@37: // bool_false_L37 + let and_result%39#0: uint64 = 0u + goto block@38 + block@38: // bool_merge_L37 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%39#0) + let tmp%40#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(1u) + goto tmp%40#0 ? block@39 : block@40 + block@39: // ternary_true_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto block@41 + block@40: // ternary_false_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto block@41 + block@41: // ternary_merge_L41 + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%43#0) // check value exists + goto app_global_get_ex_value%42#0 ? block@42 : block@44 + block@42: // and_contd_L43 + let (app_global_get_ex_value%44#0: uint64, app_global_get_ex_did_exist%45#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%45#0) // check value exists + goto app_global_get_ex_value%44#0 ? block@44 : block@43 + block@43: // bool_true_L43 + let and_result%46#0: uint64 = 1u + goto block@45 + block@44: // bool_false_L43 + let and_result%46#0: uint64 = 0u + goto block@45 + block@45: // bool_merge_L43 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%46#0) + let tmp%47#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(0u) + goto tmp%47#0 ? block@46 : block@47 + block@46: // ternary_true_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto block@48 + block@47: // ternary_false_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto block@48 + block@48: // ternary_merge_L47 + let (app_global_get_ex_value%49#0: uint64, app_global_get_ex_did_exist%50#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%50#0) // check value exists + goto app_global_get_ex_value%49#0 ? block@51 : block@49 + block@49: // and_contd_L49 + let (app_global_get_ex_value%51#0: uint64, app_global_get_ex_did_exist%52#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%52#0) // check value exists + goto app_global_get_ex_value%51#0 ? block@50 : block@51 + block@50: // bool_true_L49 + let and_result%53#0: uint64 = 1u + goto block@52 + block@51: // bool_false_L49 + let and_result%53#0: uint64 = 0u + goto block@52 + block@52: // bool_merge_L49 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%53#0) + return 1u + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val: uint64) -> uint64: + block@0: // L64 + (app_global_put "did_execute_a" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val: uint64) -> uint64: + block@0: // L69 + (app_global_put "did_execute_b" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition: uint64) -> void: + block@0: // L58 + (assert condition#0) + (app_global_put "did_execute_b" 0u) + (app_global_put "did_execute_a" 0u) + return + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val: uint64) -> uint64: + block@0: // L74 + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: + block@0: // L5 + (app_global_put "did_execute_a" 0u) + (app_global_put "did_execute_b" 0u) + return + + program clear-state: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: + block@0: // L54 + return 1u \ No newline at end of file diff --git a/examples/conditional_execution/out/contract_ConditionalExecutionContract.final_unoptimized.ir b/examples/conditional_execution/out/contract_ConditionalExecutionContract.final_unoptimized.ir new file mode 100644 index 0000000000..59c5a4256f --- /dev/null +++ b/examples/conditional_execution/out/contract_ConditionalExecutionContract.final_unoptimized.ir @@ -0,0 +1,216 @@ +contract examples.conditional_execution.contract.ConditionalExecutionContract: + program approval: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: + block@0: // L9 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L5 + examples.conditional_execution.contract.ConditionalExecutionContract.__init__() + goto block@2 + block@2: // entrypoint_L5 + let tmp%1#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%1#0 ? block@4 : block@3 + block@3: // or_contd_L11 + let tmp%2#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%2#0 ? block@4 : block@5 + block@4: // bool_true_L11 + let or_result%3#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L11 + let or_result%3#0: uint64 = 0u + goto block@6 + block@6: // bool_merge_L11 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%5#0) // check value exists + goto app_global_get_ex_value%4#0 ? block@7 : block@9 + block@7: // and_contd_L13 + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + goto app_global_get_ex_value%6#0 ? block@9 : block@8 + block@8: // bool_true_L13 + let and_result%8#0: uint64 = 1u + goto block@10 + block@9: // bool_false_L13 + let and_result%8#0: uint64 = 0u + goto block@10 + block@10: // bool_merge_L13 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%8#0) + let tmp%9#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%9#0 ? block@12 : block@11 + block@11: // or_contd_L17 + let tmp%10#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%10#0 ? block@12 : block@13 + block@12: // bool_true_L17 + let or_result%11#0: uint64 = 1u + goto block@14 + block@13: // bool_false_L17 + let or_result%11#0: uint64 = 0u + goto block@14 + block@14: // bool_merge_L17 + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + goto app_global_get_ex_value%12#0 ? block@15 : block@17 + block@15: // and_contd_L19 + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + goto app_global_get_ex_value%14#0 ? block@16 : block@17 + block@16: // bool_true_L19 + let and_result%16#0: uint64 = 1u + goto block@18 + block@17: // bool_false_L19 + let and_result%16#0: uint64 = 0u + goto block@18 + block@18: // bool_merge_L19 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%16#0) + let tmp%17#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%17#0 ? block@19 : block@21 + block@19: // and_contd_L23 + let tmp%18#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%18#0 ? block@20 : block@21 + block@20: // bool_true_L23 + let and_result%19#0: uint64 = 1u + goto block@22 + block@21: // bool_false_L23 + let and_result%19#0: uint64 = 0u + goto block@22 + block@22: // bool_merge_L23 + let (app_global_get_ex_value%20#0: uint64, app_global_get_ex_did_exist%21#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%21#0) // check value exists + goto app_global_get_ex_value%20#0 ? block@23 : block@25 + block@23: // and_contd_L25 + let (app_global_get_ex_value%22#0: uint64, app_global_get_ex_did_exist%23#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%23#0) // check value exists + goto app_global_get_ex_value%22#0 ? block@25 : block@24 + block@24: // bool_true_L25 + let and_result%24#0: uint64 = 1u + goto block@26 + block@25: // bool_false_L25 + let and_result%24#0: uint64 = 0u + goto block@26 + block@26: // bool_merge_L25 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%24#0) + let tmp%25#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%25#0 ? block@27 : block@29 + block@27: // and_contd_L29 + let tmp%26#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%26#0 ? block@28 : block@29 + block@28: // bool_true_L29 + let and_result%27#0: uint64 = 1u + goto block@30 + block@29: // bool_false_L29 + let and_result%27#0: uint64 = 0u + goto block@30 + block@30: // bool_merge_L29 + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%29#0) // check value exists + goto app_global_get_ex_value%28#0 ? block@31 : block@33 + block@31: // and_contd_L31 + let (app_global_get_ex_value%30#0: uint64, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%31#0) // check value exists + goto app_global_get_ex_value%30#0 ? block@32 : block@33 + block@32: // bool_true_L31 + let and_result%32#0: uint64 = 1u + goto block@34 + block@33: // bool_false_L31 + let and_result%32#0: uint64 = 0u + goto block@34 + block@34: // bool_merge_L31 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%32#0) + let tmp%33#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let tmp%34#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let (app_global_get_ex_value%35#0: uint64, app_global_get_ex_did_exist%36#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%36#0) // check value exists + goto app_global_get_ex_value%35#0 ? block@35 : block@37 + block@35: // and_contd_L37 + let (app_global_get_ex_value%37#0: uint64, app_global_get_ex_did_exist%38#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%38#0) // check value exists + goto app_global_get_ex_value%37#0 ? block@36 : block@37 + block@36: // bool_true_L37 + let and_result%39#0: uint64 = 1u + goto block@38 + block@37: // bool_false_L37 + let and_result%39#0: uint64 = 0u + goto block@38 + block@38: // bool_merge_L37 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%39#0) + let tmp%40#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(1u) + goto tmp%40#0 ? block@39 : block@40 + block@39: // ternary_true_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto block@41 + block@40: // ternary_false_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto block@41 + block@41: // ternary_merge_L41 + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%43#0) // check value exists + goto app_global_get_ex_value%42#0 ? block@42 : block@44 + block@42: // and_contd_L43 + let (app_global_get_ex_value%44#0: uint64, app_global_get_ex_did_exist%45#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%45#0) // check value exists + goto app_global_get_ex_value%44#0 ? block@44 : block@43 + block@43: // bool_true_L43 + let and_result%46#0: uint64 = 1u + goto block@45 + block@44: // bool_false_L43 + let and_result%46#0: uint64 = 0u + goto block@45 + block@45: // bool_merge_L43 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%46#0) + let tmp%47#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(0u) + goto tmp%47#0 ? block@46 : block@47 + block@46: // ternary_true_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto block@48 + block@47: // ternary_false_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto block@48 + block@48: // ternary_merge_L47 + let (app_global_get_ex_value%49#0: uint64, app_global_get_ex_did_exist%50#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%50#0) // check value exists + goto app_global_get_ex_value%49#0 ? block@51 : block@49 + block@49: // and_contd_L49 + let (app_global_get_ex_value%51#0: uint64, app_global_get_ex_did_exist%52#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%52#0) // check value exists + goto app_global_get_ex_value%51#0 ? block@50 : block@51 + block@50: // bool_true_L49 + let and_result%53#0: uint64 = 1u + goto block@52 + block@51: // bool_false_L49 + let and_result%53#0: uint64 = 0u + goto block@52 + block@52: // bool_merge_L49 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%53#0) + return 1u + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val: uint64) -> uint64: + block@0: // L64 + (app_global_put "did_execute_a" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val: uint64) -> uint64: + block@0: // L69 + (app_global_put "did_execute_b" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition: uint64) -> void: + block@0: // L58 + (assert condition#0) + (app_global_put "did_execute_b" 0u) + (app_global_put "did_execute_a" 0u) + return + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val: uint64) -> uint64: + block@0: // L74 + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: + block@0: // L5 + (app_global_put "did_execute_a" 0u) + (app_global_put "did_execute_b" 0u) + return + + program clear-state: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: + block@0: // L54 + return 1u \ No newline at end of file diff --git a/examples/conditional_execution/out/contract_ConditionalExecutionContract.parallel_copies.ir b/examples/conditional_execution/out/contract_ConditionalExecutionContract.parallel_copies.ir new file mode 100644 index 0000000000..020fd8dac1 --- /dev/null +++ b/examples/conditional_execution/out/contract_ConditionalExecutionContract.parallel_copies.ir @@ -0,0 +1,255 @@ +contract examples.conditional_execution.contract.ConditionalExecutionContract: + program approval: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: + block@0: // L9 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L5 + examples.conditional_execution.contract.ConditionalExecutionContract.__init__() + goto block@2 + block@2: // entrypoint_L5 + let tmp%1#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%1#0 ? block@4 : block@3 + block@3: // or_contd_L11 + let tmp%2#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%2#0 ? block@4 : block@5 + block@4: // bool_true_L11 + let or_result%3#0: uint64 = 1u + let or_result%3#5: uint64 = or_result%3#0 + goto block@6 + block@5: // bool_false_L11 + let or_result%3#1: uint64 = 0u + let or_result%3#5: uint64 = or_result%3#1 + goto block@6 + block@6: // bool_merge_L11 + let or_result%3#2: uint64 = or_result%3#5 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%5#0) // check value exists + goto app_global_get_ex_value%4#0 ? block@7 : block@9 + block@7: // and_contd_L13 + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + goto app_global_get_ex_value%6#0 ? block@9 : block@8 + block@8: // bool_true_L13 + let and_result%8#0: uint64 = 1u + let and_result%8#5: uint64 = and_result%8#0 + goto block@10 + block@9: // bool_false_L13 + let and_result%8#1: uint64 = 0u + let and_result%8#5: uint64 = and_result%8#1 + goto block@10 + block@10: // bool_merge_L13 + let and_result%8#2: uint64 = and_result%8#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%8#2) + let tmp%9#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%9#0 ? block@12 : block@11 + block@11: // or_contd_L17 + let tmp%10#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%10#0 ? block@12 : block@13 + block@12: // bool_true_L17 + let or_result%11#0: uint64 = 1u + let or_result%11#5: uint64 = or_result%11#0 + goto block@14 + block@13: // bool_false_L17 + let or_result%11#1: uint64 = 0u + let or_result%11#5: uint64 = or_result%11#1 + goto block@14 + block@14: // bool_merge_L17 + let or_result%11#2: uint64 = or_result%11#5 + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + goto app_global_get_ex_value%12#0 ? block@15 : block@17 + block@15: // and_contd_L19 + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + goto app_global_get_ex_value%14#0 ? block@16 : block@17 + block@16: // bool_true_L19 + let and_result%16#0: uint64 = 1u + let and_result%16#5: uint64 = and_result%16#0 + goto block@18 + block@17: // bool_false_L19 + let and_result%16#1: uint64 = 0u + let and_result%16#5: uint64 = and_result%16#1 + goto block@18 + block@18: // bool_merge_L19 + let and_result%16#2: uint64 = and_result%16#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%16#2) + let tmp%17#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%17#0 ? block@19 : block@21 + block@19: // and_contd_L23 + let tmp%18#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%18#0 ? block@20 : block@21 + block@20: // bool_true_L23 + let and_result%19#0: uint64 = 1u + let and_result%19#5: uint64 = and_result%19#0 + goto block@22 + block@21: // bool_false_L23 + let and_result%19#1: uint64 = 0u + let and_result%19#5: uint64 = and_result%19#1 + goto block@22 + block@22: // bool_merge_L23 + let and_result%19#2: uint64 = and_result%19#5 + let (app_global_get_ex_value%20#0: uint64, app_global_get_ex_did_exist%21#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%21#0) // check value exists + goto app_global_get_ex_value%20#0 ? block@23 : block@25 + block@23: // and_contd_L25 + let (app_global_get_ex_value%22#0: uint64, app_global_get_ex_did_exist%23#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%23#0) // check value exists + goto app_global_get_ex_value%22#0 ? block@25 : block@24 + block@24: // bool_true_L25 + let and_result%24#0: uint64 = 1u + let and_result%24#5: uint64 = and_result%24#0 + goto block@26 + block@25: // bool_false_L25 + let and_result%24#1: uint64 = 0u + let and_result%24#5: uint64 = and_result%24#1 + goto block@26 + block@26: // bool_merge_L25 + let and_result%24#2: uint64 = and_result%24#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%24#2) + let tmp%25#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%25#0 ? block@27 : block@29 + block@27: // and_contd_L29 + let tmp%26#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%26#0 ? block@28 : block@29 + block@28: // bool_true_L29 + let and_result%27#0: uint64 = 1u + let and_result%27#5: uint64 = and_result%27#0 + goto block@30 + block@29: // bool_false_L29 + let and_result%27#1: uint64 = 0u + let and_result%27#5: uint64 = and_result%27#1 + goto block@30 + block@30: // bool_merge_L29 + let and_result%27#2: uint64 = and_result%27#5 + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%29#0) // check value exists + goto app_global_get_ex_value%28#0 ? block@31 : block@33 + block@31: // and_contd_L31 + let (app_global_get_ex_value%30#0: uint64, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%31#0) // check value exists + goto app_global_get_ex_value%30#0 ? block@32 : block@33 + block@32: // bool_true_L31 + let and_result%32#0: uint64 = 1u + let and_result%32#5: uint64 = and_result%32#0 + goto block@34 + block@33: // bool_false_L31 + let and_result%32#1: uint64 = 0u + let and_result%32#5: uint64 = and_result%32#1 + goto block@34 + block@34: // bool_merge_L31 + let and_result%32#2: uint64 = and_result%32#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%32#2) + let tmp%33#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let tmp%34#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let (app_global_get_ex_value%35#0: uint64, app_global_get_ex_did_exist%36#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%36#0) // check value exists + goto app_global_get_ex_value%35#0 ? block@35 : block@37 + block@35: // and_contd_L37 + let (app_global_get_ex_value%37#0: uint64, app_global_get_ex_did_exist%38#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%38#0) // check value exists + goto app_global_get_ex_value%37#0 ? block@36 : block@37 + block@36: // bool_true_L37 + let and_result%39#0: uint64 = 1u + let and_result%39#5: uint64 = and_result%39#0 + goto block@38 + block@37: // bool_false_L37 + let and_result%39#1: uint64 = 0u + let and_result%39#5: uint64 = and_result%39#1 + goto block@38 + block@38: // bool_merge_L37 + let and_result%39#2: uint64 = and_result%39#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%39#2) + let tmp%40#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(1u) + goto tmp%40#0 ? block@39 : block@40 + block@39: // ternary_true_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let ternary_result%41#5: uint64 = ternary_result%41#0 + goto block@41 + block@40: // ternary_false_L41 + let ternary_result%41#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let ternary_result%41#5: uint64 = ternary_result%41#1 + goto block@41 + block@41: // ternary_merge_L41 + let ternary_result%41#2: uint64 = ternary_result%41#5 + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%43#0) // check value exists + goto app_global_get_ex_value%42#0 ? block@42 : block@44 + block@42: // and_contd_L43 + let (app_global_get_ex_value%44#0: uint64, app_global_get_ex_did_exist%45#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%45#0) // check value exists + goto app_global_get_ex_value%44#0 ? block@44 : block@43 + block@43: // bool_true_L43 + let and_result%46#0: uint64 = 1u + let and_result%46#5: uint64 = and_result%46#0 + goto block@45 + block@44: // bool_false_L43 + let and_result%46#1: uint64 = 0u + let and_result%46#5: uint64 = and_result%46#1 + goto block@45 + block@45: // bool_merge_L43 + let and_result%46#2: uint64 = and_result%46#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%46#2) + let tmp%47#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(0u) + goto tmp%47#0 ? block@46 : block@47 + block@46: // ternary_true_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let ternary_result%48#5: uint64 = ternary_result%48#0 + goto block@48 + block@47: // ternary_false_L47 + let ternary_result%48#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let ternary_result%48#5: uint64 = ternary_result%48#1 + goto block@48 + block@48: // ternary_merge_L47 + let ternary_result%48#2: uint64 = ternary_result%48#5 + let (app_global_get_ex_value%49#0: uint64, app_global_get_ex_did_exist%50#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%50#0) // check value exists + goto app_global_get_ex_value%49#0 ? block@51 : block@49 + block@49: // and_contd_L49 + let (app_global_get_ex_value%51#0: uint64, app_global_get_ex_did_exist%52#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%52#0) // check value exists + goto app_global_get_ex_value%51#0 ? block@50 : block@51 + block@50: // bool_true_L49 + let and_result%53#0: uint64 = 1u + let and_result%53#5: uint64 = and_result%53#0 + goto block@52 + block@51: // bool_false_L49 + let and_result%53#1: uint64 = 0u + let and_result%53#5: uint64 = and_result%53#1 + goto block@52 + block@52: // bool_merge_L49 + let and_result%53#2: uint64 = and_result%53#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%53#2) + return 1u + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val: uint64) -> uint64: + block@0: // L64 + (app_global_put "did_execute_a" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val: uint64) -> uint64: + block@0: // L69 + (app_global_put "did_execute_b" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition: uint64) -> void: + block@0: // L58 + (assert condition#0) + (app_global_put "did_execute_b" 0u) + (app_global_put "did_execute_a" 0u) + return + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val: uint64) -> uint64: + block@0: // L74 + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: + block@0: // L5 + (app_global_put "did_execute_a" 0u) + (app_global_put "did_execute_b" 0u) + return + + program clear-state: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: + block@0: // L54 + return 1u \ No newline at end of file diff --git a/examples/conditional_execution/out/contract_ConditionalExecutionContract.post_ssa.ir b/examples/conditional_execution/out/contract_ConditionalExecutionContract.post_ssa.ir new file mode 100644 index 0000000000..020fd8dac1 --- /dev/null +++ b/examples/conditional_execution/out/contract_ConditionalExecutionContract.post_ssa.ir @@ -0,0 +1,255 @@ +contract examples.conditional_execution.contract.ConditionalExecutionContract: + program approval: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: + block@0: // L9 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L5 + examples.conditional_execution.contract.ConditionalExecutionContract.__init__() + goto block@2 + block@2: // entrypoint_L5 + let tmp%1#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%1#0 ? block@4 : block@3 + block@3: // or_contd_L11 + let tmp%2#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%2#0 ? block@4 : block@5 + block@4: // bool_true_L11 + let or_result%3#0: uint64 = 1u + let or_result%3#5: uint64 = or_result%3#0 + goto block@6 + block@5: // bool_false_L11 + let or_result%3#1: uint64 = 0u + let or_result%3#5: uint64 = or_result%3#1 + goto block@6 + block@6: // bool_merge_L11 + let or_result%3#2: uint64 = or_result%3#5 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%5#0) // check value exists + goto app_global_get_ex_value%4#0 ? block@7 : block@9 + block@7: // and_contd_L13 + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + goto app_global_get_ex_value%6#0 ? block@9 : block@8 + block@8: // bool_true_L13 + let and_result%8#0: uint64 = 1u + let and_result%8#5: uint64 = and_result%8#0 + goto block@10 + block@9: // bool_false_L13 + let and_result%8#1: uint64 = 0u + let and_result%8#5: uint64 = and_result%8#1 + goto block@10 + block@10: // bool_merge_L13 + let and_result%8#2: uint64 = and_result%8#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%8#2) + let tmp%9#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%9#0 ? block@12 : block@11 + block@11: // or_contd_L17 + let tmp%10#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%10#0 ? block@12 : block@13 + block@12: // bool_true_L17 + let or_result%11#0: uint64 = 1u + let or_result%11#5: uint64 = or_result%11#0 + goto block@14 + block@13: // bool_false_L17 + let or_result%11#1: uint64 = 0u + let or_result%11#5: uint64 = or_result%11#1 + goto block@14 + block@14: // bool_merge_L17 + let or_result%11#2: uint64 = or_result%11#5 + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + goto app_global_get_ex_value%12#0 ? block@15 : block@17 + block@15: // and_contd_L19 + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + goto app_global_get_ex_value%14#0 ? block@16 : block@17 + block@16: // bool_true_L19 + let and_result%16#0: uint64 = 1u + let and_result%16#5: uint64 = and_result%16#0 + goto block@18 + block@17: // bool_false_L19 + let and_result%16#1: uint64 = 0u + let and_result%16#5: uint64 = and_result%16#1 + goto block@18 + block@18: // bool_merge_L19 + let and_result%16#2: uint64 = and_result%16#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%16#2) + let tmp%17#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%17#0 ? block@19 : block@21 + block@19: // and_contd_L23 + let tmp%18#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%18#0 ? block@20 : block@21 + block@20: // bool_true_L23 + let and_result%19#0: uint64 = 1u + let and_result%19#5: uint64 = and_result%19#0 + goto block@22 + block@21: // bool_false_L23 + let and_result%19#1: uint64 = 0u + let and_result%19#5: uint64 = and_result%19#1 + goto block@22 + block@22: // bool_merge_L23 + let and_result%19#2: uint64 = and_result%19#5 + let (app_global_get_ex_value%20#0: uint64, app_global_get_ex_did_exist%21#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%21#0) // check value exists + goto app_global_get_ex_value%20#0 ? block@23 : block@25 + block@23: // and_contd_L25 + let (app_global_get_ex_value%22#0: uint64, app_global_get_ex_did_exist%23#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%23#0) // check value exists + goto app_global_get_ex_value%22#0 ? block@25 : block@24 + block@24: // bool_true_L25 + let and_result%24#0: uint64 = 1u + let and_result%24#5: uint64 = and_result%24#0 + goto block@26 + block@25: // bool_false_L25 + let and_result%24#1: uint64 = 0u + let and_result%24#5: uint64 = and_result%24#1 + goto block@26 + block@26: // bool_merge_L25 + let and_result%24#2: uint64 = and_result%24#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%24#2) + let tmp%25#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%25#0 ? block@27 : block@29 + block@27: // and_contd_L29 + let tmp%26#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%26#0 ? block@28 : block@29 + block@28: // bool_true_L29 + let and_result%27#0: uint64 = 1u + let and_result%27#5: uint64 = and_result%27#0 + goto block@30 + block@29: // bool_false_L29 + let and_result%27#1: uint64 = 0u + let and_result%27#5: uint64 = and_result%27#1 + goto block@30 + block@30: // bool_merge_L29 + let and_result%27#2: uint64 = and_result%27#5 + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%29#0) // check value exists + goto app_global_get_ex_value%28#0 ? block@31 : block@33 + block@31: // and_contd_L31 + let (app_global_get_ex_value%30#0: uint64, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%31#0) // check value exists + goto app_global_get_ex_value%30#0 ? block@32 : block@33 + block@32: // bool_true_L31 + let and_result%32#0: uint64 = 1u + let and_result%32#5: uint64 = and_result%32#0 + goto block@34 + block@33: // bool_false_L31 + let and_result%32#1: uint64 = 0u + let and_result%32#5: uint64 = and_result%32#1 + goto block@34 + block@34: // bool_merge_L31 + let and_result%32#2: uint64 = and_result%32#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%32#2) + let tmp%33#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let tmp%34#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let (app_global_get_ex_value%35#0: uint64, app_global_get_ex_did_exist%36#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%36#0) // check value exists + goto app_global_get_ex_value%35#0 ? block@35 : block@37 + block@35: // and_contd_L37 + let (app_global_get_ex_value%37#0: uint64, app_global_get_ex_did_exist%38#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%38#0) // check value exists + goto app_global_get_ex_value%37#0 ? block@36 : block@37 + block@36: // bool_true_L37 + let and_result%39#0: uint64 = 1u + let and_result%39#5: uint64 = and_result%39#0 + goto block@38 + block@37: // bool_false_L37 + let and_result%39#1: uint64 = 0u + let and_result%39#5: uint64 = and_result%39#1 + goto block@38 + block@38: // bool_merge_L37 + let and_result%39#2: uint64 = and_result%39#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%39#2) + let tmp%40#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(1u) + goto tmp%40#0 ? block@39 : block@40 + block@39: // ternary_true_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let ternary_result%41#5: uint64 = ternary_result%41#0 + goto block@41 + block@40: // ternary_false_L41 + let ternary_result%41#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let ternary_result%41#5: uint64 = ternary_result%41#1 + goto block@41 + block@41: // ternary_merge_L41 + let ternary_result%41#2: uint64 = ternary_result%41#5 + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%43#0) // check value exists + goto app_global_get_ex_value%42#0 ? block@42 : block@44 + block@42: // and_contd_L43 + let (app_global_get_ex_value%44#0: uint64, app_global_get_ex_did_exist%45#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%45#0) // check value exists + goto app_global_get_ex_value%44#0 ? block@44 : block@43 + block@43: // bool_true_L43 + let and_result%46#0: uint64 = 1u + let and_result%46#5: uint64 = and_result%46#0 + goto block@45 + block@44: // bool_false_L43 + let and_result%46#1: uint64 = 0u + let and_result%46#5: uint64 = and_result%46#1 + goto block@45 + block@45: // bool_merge_L43 + let and_result%46#2: uint64 = and_result%46#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%46#2) + let tmp%47#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(0u) + goto tmp%47#0 ? block@46 : block@47 + block@46: // ternary_true_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let ternary_result%48#5: uint64 = ternary_result%48#0 + goto block@48 + block@47: // ternary_false_L47 + let ternary_result%48#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let ternary_result%48#5: uint64 = ternary_result%48#1 + goto block@48 + block@48: // ternary_merge_L47 + let ternary_result%48#2: uint64 = ternary_result%48#5 + let (app_global_get_ex_value%49#0: uint64, app_global_get_ex_did_exist%50#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%50#0) // check value exists + goto app_global_get_ex_value%49#0 ? block@51 : block@49 + block@49: // and_contd_L49 + let (app_global_get_ex_value%51#0: uint64, app_global_get_ex_did_exist%52#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%52#0) // check value exists + goto app_global_get_ex_value%51#0 ? block@50 : block@51 + block@50: // bool_true_L49 + let and_result%53#0: uint64 = 1u + let and_result%53#5: uint64 = and_result%53#0 + goto block@52 + block@51: // bool_false_L49 + let and_result%53#1: uint64 = 0u + let and_result%53#5: uint64 = and_result%53#1 + goto block@52 + block@52: // bool_merge_L49 + let and_result%53#2: uint64 = and_result%53#5 + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%53#2) + return 1u + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val: uint64) -> uint64: + block@0: // L64 + (app_global_put "did_execute_a" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val: uint64) -> uint64: + block@0: // L69 + (app_global_put "did_execute_b" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition: uint64) -> void: + block@0: // L58 + (assert condition#0) + (app_global_put "did_execute_b" 0u) + (app_global_put "did_execute_a" 0u) + return + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val: uint64) -> uint64: + block@0: // L74 + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: + block@0: // L5 + (app_global_put "did_execute_a" 0u) + (app_global_put "did_execute_b" 0u) + return + + program clear-state: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: + block@0: // L54 + return 1u \ No newline at end of file diff --git a/examples/conditional_execution/out/contract_ConditionalExecutionContract.ssa.ir b/examples/conditional_execution/out/contract_ConditionalExecutionContract.ssa.ir new file mode 100644 index 0000000000..a8b85c1d09 --- /dev/null +++ b/examples/conditional_execution/out/contract_ConditionalExecutionContract.ssa.ir @@ -0,0 +1,229 @@ +contract examples.conditional_execution.contract.ConditionalExecutionContract: + program approval: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.approval_program() -> uint64: + block@0: // L9 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L5 + examples.conditional_execution.contract.ConditionalExecutionContract.__init__() + goto block@2 + block@2: // entrypoint_L5 + let tmp%1#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%1#0 ? block@4 : block@3 + block@3: // or_contd_L11 + let tmp%2#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%2#0 ? block@4 : block@5 + block@4: // bool_true_L11 + let or_result%3#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L11 + let or_result%3#1: uint64 = 0u + goto block@6 + block@6: // bool_merge_L11 + let or_result%3#2: uint64 = φ(or_result%3#0 <- block@4, or_result%3#1 <- block@5) + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%5#0) // check value exists + goto app_global_get_ex_value%4#0 ? block@7 : block@9 + block@7: // and_contd_L13 + let (app_global_get_ex_value%6#0: uint64, app_global_get_ex_did_exist%7#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%7#0) // check value exists + goto app_global_get_ex_value%6#0 ? block@9 : block@8 + block@8: // bool_true_L13 + let and_result%8#0: uint64 = 1u + goto block@10 + block@9: // bool_false_L13 + let and_result%8#1: uint64 = 0u + goto block@10 + block@10: // bool_merge_L13 + let and_result%8#2: uint64 = φ(and_result%8#0 <- block@8, and_result%8#1 <- block@9) + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%8#2) + let tmp%9#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%9#0 ? block@12 : block@11 + block@11: // or_contd_L17 + let tmp%10#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%10#0 ? block@12 : block@13 + block@12: // bool_true_L17 + let or_result%11#0: uint64 = 1u + goto block@14 + block@13: // bool_false_L17 + let or_result%11#1: uint64 = 0u + goto block@14 + block@14: // bool_merge_L17 + let or_result%11#2: uint64 = φ(or_result%11#0 <- block@12, or_result%11#1 <- block@13) + let (app_global_get_ex_value%12#0: uint64, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%13#0) // check value exists + goto app_global_get_ex_value%12#0 ? block@15 : block@17 + block@15: // and_contd_L19 + let (app_global_get_ex_value%14#0: uint64, app_global_get_ex_did_exist%15#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%15#0) // check value exists + goto app_global_get_ex_value%14#0 ? block@16 : block@17 + block@16: // bool_true_L19 + let and_result%16#0: uint64 = 1u + goto block@18 + block@17: // bool_false_L19 + let and_result%16#1: uint64 = 0u + goto block@18 + block@18: // bool_merge_L19 + let and_result%16#2: uint64 = φ(and_result%16#0 <- block@16, and_result%16#1 <- block@17) + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%16#2) + let tmp%17#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(0u) + goto tmp%17#0 ? block@19 : block@21 + block@19: // and_contd_L23 + let tmp%18#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%18#0 ? block@20 : block@21 + block@20: // bool_true_L23 + let and_result%19#0: uint64 = 1u + goto block@22 + block@21: // bool_false_L23 + let and_result%19#1: uint64 = 0u + goto block@22 + block@22: // bool_merge_L23 + let and_result%19#2: uint64 = φ(and_result%19#0 <- block@20, and_result%19#1 <- block@21) + let (app_global_get_ex_value%20#0: uint64, app_global_get_ex_did_exist%21#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%21#0) // check value exists + goto app_global_get_ex_value%20#0 ? block@23 : block@25 + block@23: // and_contd_L25 + let (app_global_get_ex_value%22#0: uint64, app_global_get_ex_did_exist%23#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%23#0) // check value exists + goto app_global_get_ex_value%22#0 ? block@25 : block@24 + block@24: // bool_true_L25 + let and_result%24#0: uint64 = 1u + goto block@26 + block@25: // bool_false_L25 + let and_result%24#1: uint64 = 0u + goto block@26 + block@26: // bool_merge_L25 + let and_result%24#2: uint64 = φ(and_result%24#0 <- block@24, and_result%24#1 <- block@25) + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%24#2) + let tmp%25#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto tmp%25#0 ? block@27 : block@29 + block@27: // and_contd_L29 + let tmp%26#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto tmp%26#0 ? block@28 : block@29 + block@28: // bool_true_L29 + let and_result%27#0: uint64 = 1u + goto block@30 + block@29: // bool_false_L29 + let and_result%27#1: uint64 = 0u + goto block@30 + block@30: // bool_merge_L29 + let and_result%27#2: uint64 = φ(and_result%27#0 <- block@28, and_result%27#1 <- block@29) + let (app_global_get_ex_value%28#0: uint64, app_global_get_ex_did_exist%29#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%29#0) // check value exists + goto app_global_get_ex_value%28#0 ? block@31 : block@33 + block@31: // and_contd_L31 + let (app_global_get_ex_value%30#0: uint64, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%31#0) // check value exists + goto app_global_get_ex_value%30#0 ? block@32 : block@33 + block@32: // bool_true_L31 + let and_result%32#0: uint64 = 1u + goto block@34 + block@33: // bool_false_L31 + let and_result%32#1: uint64 = 0u + goto block@34 + block@34: // bool_merge_L31 + let and_result%32#2: uint64 = φ(and_result%32#0 <- block@32, and_result%32#1 <- block@33) + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%32#2) + let tmp%33#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + let tmp%34#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + let (app_global_get_ex_value%35#0: uint64, app_global_get_ex_did_exist%36#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%36#0) // check value exists + goto app_global_get_ex_value%35#0 ? block@35 : block@37 + block@35: // and_contd_L37 + let (app_global_get_ex_value%37#0: uint64, app_global_get_ex_did_exist%38#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%38#0) // check value exists + goto app_global_get_ex_value%37#0 ? block@36 : block@37 + block@36: // bool_true_L37 + let and_result%39#0: uint64 = 1u + goto block@38 + block@37: // bool_false_L37 + let and_result%39#1: uint64 = 0u + goto block@38 + block@38: // bool_merge_L37 + let and_result%39#2: uint64 = φ(and_result%39#0 <- block@36, and_result%39#1 <- block@37) + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%39#2) + let tmp%40#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(1u) + goto tmp%40#0 ? block@39 : block@40 + block@39: // ternary_true_L41 + let ternary_result%41#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto block@41 + block@40: // ternary_false_L41 + let ternary_result%41#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto block@41 + block@41: // ternary_merge_L41 + let ternary_result%41#2: uint64 = φ(ternary_result%41#0 <- block@39, ternary_result%41#1 <- block@40) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%43#0) // check value exists + goto app_global_get_ex_value%42#0 ? block@42 : block@44 + block@42: // and_contd_L43 + let (app_global_get_ex_value%44#0: uint64, app_global_get_ex_did_exist%45#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%45#0) // check value exists + goto app_global_get_ex_value%44#0 ? block@44 : block@43 + block@43: // bool_true_L43 + let and_result%46#0: uint64 = 1u + goto block@45 + block@44: // bool_false_L43 + let and_result%46#1: uint64 = 0u + goto block@45 + block@45: // bool_merge_L43 + let and_result%46#2: uint64 = φ(and_result%46#0 <- block@43, and_result%46#1 <- block@44) + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%46#2) + let tmp%47#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_c(0u) + goto tmp%47#0 ? block@46 : block@47 + block@46: // ternary_true_L47 + let ternary_result%48#0: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_a(1u) + goto block@48 + block@47: // ternary_false_L47 + let ternary_result%48#1: uint64 = examples.conditional_execution.contract.ConditionalExecutionContract.func_b(1u) + goto block@48 + block@48: // ternary_merge_L47 + let ternary_result%48#2: uint64 = φ(ternary_result%48#0 <- block@46, ternary_result%48#1 <- block@47) + let (app_global_get_ex_value%49#0: uint64, app_global_get_ex_did_exist%50#0: uint64) = (app_global_get_ex 0u "did_execute_a") + (assert app_global_get_ex_did_exist%50#0) // check value exists + goto app_global_get_ex_value%49#0 ? block@51 : block@49 + block@49: // and_contd_L49 + let (app_global_get_ex_value%51#0: uint64, app_global_get_ex_did_exist%52#0: uint64) = (app_global_get_ex 0u "did_execute_b") + (assert app_global_get_ex_did_exist%52#0) // check value exists + goto app_global_get_ex_value%51#0 ? block@50 : block@51 + block@50: // bool_true_L49 + let and_result%53#0: uint64 = 1u + goto block@52 + block@51: // bool_false_L49 + let and_result%53#1: uint64 = 0u + goto block@52 + block@52: // bool_merge_L49 + let and_result%53#2: uint64 = φ(and_result%53#0 <- block@50, and_result%53#1 <- block@51) + examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(and_result%53#2) + return 1u + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_a(ret_val: uint64) -> uint64: + block@0: // L64 + (app_global_put "did_execute_a" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_b(ret_val: uint64) -> uint64: + block@0: // L69 + (app_global_put "did_execute_b" 1u) + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.assert_and_reset(condition: uint64) -> void: + block@0: // L58 + (assert condition#0) + (app_global_put "did_execute_b" 0u) + (app_global_put "did_execute_a" 0u) + return + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.func_c(ret_val: uint64) -> uint64: + block@0: // L74 + return ret_val#0 + + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.__init__() -> void: + block@0: // L5 + (app_global_put "did_execute_a" 0u) + (app_global_put "did_execute_b" 0u) + return + + program clear-state: + subroutine examples.conditional_execution.contract.ConditionalExecutionContract.clear_state_program() -> uint64: + block@0: // L54 + return 1u \ No newline at end of file diff --git a/examples/conditional_execution/out/trace.O0.log b/examples/conditional_execution/out/trace.O0.log new file mode 100644 index 0000000000..546532c1d9 --- /dev/null +++ b/examples/conditional_execution/out/trace.O0.log @@ -0,0 +1,291 @@ +PC Teal Stack +1 +5 +35 txn ApplicationID 0 +37 bnz main_entrypoint@2 +40 callsub __init__ +370 proto 0 0 +373 byte "did_execute_a" "did_execute_a" +374 int 0 "did_execute_a", 0 +375 app_global_put +376 byte "did_execute_b" "did_execute_b" +377 int 0 "did_execute_b", 0 +378 app_global_put +379 retsub +43 int 1 1 +44 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +47 bnz main_bool_true@4 +57 int 1 1 +58 pop +59 b main_bool_merge@6 +64 int 0 0 +65 byte "did_execute_a" 0, "did_execute_a" +66 app_global_get_ex 1, 1 +67 assert 1 +68 bz main_bool_false@9 +71 int 0 0 +72 byte "did_execute_b" 0, "did_execute_b" +73 app_global_get_ex 0, 1 +74 assert 0 +75 bnz main_bool_false@9 +78 int 1 1 +79 b main_bool_merge@10 1 +83 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +86 int 0 0 +87 callsub func_a 0 +333 proto 1 1 0 +336 byte "did_execute_a" 0, "did_execute_a" +337 int 1 0, "did_execute_a", 1 +338 app_global_put 0 +339 frame_dig -1 0, 0 +341 retsub 0 +90 bnz main_bool_true@12 +93 int 1 1 +94 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +97 bz main_bool_false@13 +100 int 1 1 +101 pop +102 b main_bool_merge@14 +107 int 0 0 +108 byte "did_execute_a" 0, "did_execute_a" +109 app_global_get_ex 1, 1 +110 assert 1 +111 bz main_bool_false@17 +114 int 0 0 +115 byte "did_execute_b" 0, "did_execute_b" +116 app_global_get_ex 1, 1 +117 assert 1 +118 bz main_bool_false@17 +121 int 1 1 +122 b main_bool_merge@18 1 +126 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +129 int 0 0 +130 callsub func_a 0 +333 proto 1 1 0 +336 byte "did_execute_a" 0, "did_execute_a" +337 int 1 0, "did_execute_a", 1 +338 app_global_put 0 +339 frame_dig -1 0, 0 +341 retsub 0 +133 bz main_bool_false@21 +148 int 0 0 +149 pop +150 int 0 0 +151 byte "did_execute_a" 0, "did_execute_a" +152 app_global_get_ex 1, 1 +153 assert 1 +154 bz main_bool_false@25 +157 int 0 0 +158 byte "did_execute_b" 0, "did_execute_b" +159 app_global_get_ex 0, 1 +160 assert 0 +161 bnz main_bool_false@25 +164 int 1 1 +165 b main_bool_merge@26 1 +169 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +172 int 1 1 +173 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +176 bz main_bool_false@29 +179 int 1 1 +180 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +183 bz main_bool_false@29 +186 int 1 1 +187 pop +188 b main_bool_merge@30 +193 int 0 0 +194 byte "did_execute_a" 0, "did_execute_a" +195 app_global_get_ex 1, 1 +196 assert 1 +197 bz main_bool_false@33 +200 int 0 0 +201 byte "did_execute_b" 0, "did_execute_b" +202 app_global_get_ex 1, 1 +203 assert 1 +204 bz main_bool_false@33 +207 int 1 1 +208 b main_bool_merge@34 1 +212 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +215 int 1 1 +216 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +219 pop +220 int 1 1 +221 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +224 pop +225 int 0 0 +226 byte "did_execute_a" 0, "did_execute_a" +227 app_global_get_ex 1, 1 +228 assert 1 +229 bz main_bool_false@37 +232 int 0 0 +233 byte "did_execute_b" 0, "did_execute_b" +234 app_global_get_ex 1, 1 +235 assert 1 +236 bz main_bool_false@37 +239 int 1 1 +240 b main_bool_merge@38 1 +244 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +247 int 1 1 +248 callsub func_c 1 +364 proto 1 1 1 +367 frame_dig -1 1, 1 +369 retsub 1 +251 bz main_ternary_false@40 +254 int 1 1 +255 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +258 pop +259 b main_ternary_merge@41 +267 int 0 0 +268 byte "did_execute_a" 0, "did_execute_a" +269 app_global_get_ex 1, 1 +270 assert 1 +271 bz main_bool_false@44 +274 int 0 0 +275 byte "did_execute_b" 0, "did_execute_b" +276 app_global_get_ex 0, 1 +277 assert 0 +278 bnz main_bool_false@44 +281 int 1 1 +282 b main_bool_merge@45 1 +286 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +289 int 0 0 +290 callsub func_c 0 +364 proto 1 1 0 +367 frame_dig -1 0, 0 +369 retsub 0 +293 bz main_ternary_false@47 +304 int 1 1 +305 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +308 pop +309 int 0 0 +310 byte "did_execute_a" 0, "did_execute_a" +311 app_global_get_ex 0, 1 +312 assert 0 +313 bnz main_bool_false@51 +316 int 0 0 +317 byte "did_execute_b" 0, "did_execute_b" +318 app_global_get_ex 1, 1 +319 assert 1 +320 bz main_bool_false@51 +323 int 1 1 +324 b main_bool_merge@52 1 +328 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +331 int 1 1 +332 return 1 \ No newline at end of file diff --git a/examples/conditional_execution/out/trace.O1.log b/examples/conditional_execution/out/trace.O1.log new file mode 100644 index 0000000000..546532c1d9 --- /dev/null +++ b/examples/conditional_execution/out/trace.O1.log @@ -0,0 +1,291 @@ +PC Teal Stack +1 +5 +35 txn ApplicationID 0 +37 bnz main_entrypoint@2 +40 callsub __init__ +370 proto 0 0 +373 byte "did_execute_a" "did_execute_a" +374 int 0 "did_execute_a", 0 +375 app_global_put +376 byte "did_execute_b" "did_execute_b" +377 int 0 "did_execute_b", 0 +378 app_global_put +379 retsub +43 int 1 1 +44 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +47 bnz main_bool_true@4 +57 int 1 1 +58 pop +59 b main_bool_merge@6 +64 int 0 0 +65 byte "did_execute_a" 0, "did_execute_a" +66 app_global_get_ex 1, 1 +67 assert 1 +68 bz main_bool_false@9 +71 int 0 0 +72 byte "did_execute_b" 0, "did_execute_b" +73 app_global_get_ex 0, 1 +74 assert 0 +75 bnz main_bool_false@9 +78 int 1 1 +79 b main_bool_merge@10 1 +83 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +86 int 0 0 +87 callsub func_a 0 +333 proto 1 1 0 +336 byte "did_execute_a" 0, "did_execute_a" +337 int 1 0, "did_execute_a", 1 +338 app_global_put 0 +339 frame_dig -1 0, 0 +341 retsub 0 +90 bnz main_bool_true@12 +93 int 1 1 +94 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +97 bz main_bool_false@13 +100 int 1 1 +101 pop +102 b main_bool_merge@14 +107 int 0 0 +108 byte "did_execute_a" 0, "did_execute_a" +109 app_global_get_ex 1, 1 +110 assert 1 +111 bz main_bool_false@17 +114 int 0 0 +115 byte "did_execute_b" 0, "did_execute_b" +116 app_global_get_ex 1, 1 +117 assert 1 +118 bz main_bool_false@17 +121 int 1 1 +122 b main_bool_merge@18 1 +126 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +129 int 0 0 +130 callsub func_a 0 +333 proto 1 1 0 +336 byte "did_execute_a" 0, "did_execute_a" +337 int 1 0, "did_execute_a", 1 +338 app_global_put 0 +339 frame_dig -1 0, 0 +341 retsub 0 +133 bz main_bool_false@21 +148 int 0 0 +149 pop +150 int 0 0 +151 byte "did_execute_a" 0, "did_execute_a" +152 app_global_get_ex 1, 1 +153 assert 1 +154 bz main_bool_false@25 +157 int 0 0 +158 byte "did_execute_b" 0, "did_execute_b" +159 app_global_get_ex 0, 1 +160 assert 0 +161 bnz main_bool_false@25 +164 int 1 1 +165 b main_bool_merge@26 1 +169 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +172 int 1 1 +173 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +176 bz main_bool_false@29 +179 int 1 1 +180 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +183 bz main_bool_false@29 +186 int 1 1 +187 pop +188 b main_bool_merge@30 +193 int 0 0 +194 byte "did_execute_a" 0, "did_execute_a" +195 app_global_get_ex 1, 1 +196 assert 1 +197 bz main_bool_false@33 +200 int 0 0 +201 byte "did_execute_b" 0, "did_execute_b" +202 app_global_get_ex 1, 1 +203 assert 1 +204 bz main_bool_false@33 +207 int 1 1 +208 b main_bool_merge@34 1 +212 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +215 int 1 1 +216 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +219 pop +220 int 1 1 +221 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +224 pop +225 int 0 0 +226 byte "did_execute_a" 0, "did_execute_a" +227 app_global_get_ex 1, 1 +228 assert 1 +229 bz main_bool_false@37 +232 int 0 0 +233 byte "did_execute_b" 0, "did_execute_b" +234 app_global_get_ex 1, 1 +235 assert 1 +236 bz main_bool_false@37 +239 int 1 1 +240 b main_bool_merge@38 1 +244 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +247 int 1 1 +248 callsub func_c 1 +364 proto 1 1 1 +367 frame_dig -1 1, 1 +369 retsub 1 +251 bz main_ternary_false@40 +254 int 1 1 +255 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +258 pop +259 b main_ternary_merge@41 +267 int 0 0 +268 byte "did_execute_a" 0, "did_execute_a" +269 app_global_get_ex 1, 1 +270 assert 1 +271 bz main_bool_false@44 +274 int 0 0 +275 byte "did_execute_b" 0, "did_execute_b" +276 app_global_get_ex 0, 1 +277 assert 0 +278 bnz main_bool_false@44 +281 int 1 1 +282 b main_bool_merge@45 1 +286 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +289 int 0 0 +290 callsub func_c 0 +364 proto 1 1 0 +367 frame_dig -1 0, 0 +369 retsub 0 +293 bz main_ternary_false@47 +304 int 1 1 +305 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +308 pop +309 int 0 0 +310 byte "did_execute_a" 0, "did_execute_a" +311 app_global_get_ex 0, 1 +312 assert 0 +313 bnz main_bool_false@51 +316 int 0 0 +317 byte "did_execute_b" 0, "did_execute_b" +318 app_global_get_ex 1, 1 +319 assert 1 +320 bz main_bool_false@51 +323 int 1 1 +324 b main_bool_merge@52 1 +328 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +331 int 1 1 +332 return 1 \ No newline at end of file diff --git a/examples/conditional_execution/out/trace.O2.log b/examples/conditional_execution/out/trace.O2.log new file mode 100644 index 0000000000..546532c1d9 --- /dev/null +++ b/examples/conditional_execution/out/trace.O2.log @@ -0,0 +1,291 @@ +PC Teal Stack +1 +5 +35 txn ApplicationID 0 +37 bnz main_entrypoint@2 +40 callsub __init__ +370 proto 0 0 +373 byte "did_execute_a" "did_execute_a" +374 int 0 "did_execute_a", 0 +375 app_global_put +376 byte "did_execute_b" "did_execute_b" +377 int 0 "did_execute_b", 0 +378 app_global_put +379 retsub +43 int 1 1 +44 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +47 bnz main_bool_true@4 +57 int 1 1 +58 pop +59 b main_bool_merge@6 +64 int 0 0 +65 byte "did_execute_a" 0, "did_execute_a" +66 app_global_get_ex 1, 1 +67 assert 1 +68 bz main_bool_false@9 +71 int 0 0 +72 byte "did_execute_b" 0, "did_execute_b" +73 app_global_get_ex 0, 1 +74 assert 0 +75 bnz main_bool_false@9 +78 int 1 1 +79 b main_bool_merge@10 1 +83 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +86 int 0 0 +87 callsub func_a 0 +333 proto 1 1 0 +336 byte "did_execute_a" 0, "did_execute_a" +337 int 1 0, "did_execute_a", 1 +338 app_global_put 0 +339 frame_dig -1 0, 0 +341 retsub 0 +90 bnz main_bool_true@12 +93 int 1 1 +94 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +97 bz main_bool_false@13 +100 int 1 1 +101 pop +102 b main_bool_merge@14 +107 int 0 0 +108 byte "did_execute_a" 0, "did_execute_a" +109 app_global_get_ex 1, 1 +110 assert 1 +111 bz main_bool_false@17 +114 int 0 0 +115 byte "did_execute_b" 0, "did_execute_b" +116 app_global_get_ex 1, 1 +117 assert 1 +118 bz main_bool_false@17 +121 int 1 1 +122 b main_bool_merge@18 1 +126 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +129 int 0 0 +130 callsub func_a 0 +333 proto 1 1 0 +336 byte "did_execute_a" 0, "did_execute_a" +337 int 1 0, "did_execute_a", 1 +338 app_global_put 0 +339 frame_dig -1 0, 0 +341 retsub 0 +133 bz main_bool_false@21 +148 int 0 0 +149 pop +150 int 0 0 +151 byte "did_execute_a" 0, "did_execute_a" +152 app_global_get_ex 1, 1 +153 assert 1 +154 bz main_bool_false@25 +157 int 0 0 +158 byte "did_execute_b" 0, "did_execute_b" +159 app_global_get_ex 0, 1 +160 assert 0 +161 bnz main_bool_false@25 +164 int 1 1 +165 b main_bool_merge@26 1 +169 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +172 int 1 1 +173 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +176 bz main_bool_false@29 +179 int 1 1 +180 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +183 bz main_bool_false@29 +186 int 1 1 +187 pop +188 b main_bool_merge@30 +193 int 0 0 +194 byte "did_execute_a" 0, "did_execute_a" +195 app_global_get_ex 1, 1 +196 assert 1 +197 bz main_bool_false@33 +200 int 0 0 +201 byte "did_execute_b" 0, "did_execute_b" +202 app_global_get_ex 1, 1 +203 assert 1 +204 bz main_bool_false@33 +207 int 1 1 +208 b main_bool_merge@34 1 +212 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +215 int 1 1 +216 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +219 pop +220 int 1 1 +221 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +224 pop +225 int 0 0 +226 byte "did_execute_a" 0, "did_execute_a" +227 app_global_get_ex 1, 1 +228 assert 1 +229 bz main_bool_false@37 +232 int 0 0 +233 byte "did_execute_b" 0, "did_execute_b" +234 app_global_get_ex 1, 1 +235 assert 1 +236 bz main_bool_false@37 +239 int 1 1 +240 b main_bool_merge@38 1 +244 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +247 int 1 1 +248 callsub func_c 1 +364 proto 1 1 1 +367 frame_dig -1 1, 1 +369 retsub 1 +251 bz main_ternary_false@40 +254 int 1 1 +255 callsub func_a 1 +333 proto 1 1 1 +336 byte "did_execute_a" 1, "did_execute_a" +337 int 1 1, "did_execute_a", 1 +338 app_global_put 1 +339 frame_dig -1 1, 1 +341 retsub 1 +258 pop +259 b main_ternary_merge@41 +267 int 0 0 +268 byte "did_execute_a" 0, "did_execute_a" +269 app_global_get_ex 1, 1 +270 assert 1 +271 bz main_bool_false@44 +274 int 0 0 +275 byte "did_execute_b" 0, "did_execute_b" +276 app_global_get_ex 0, 1 +277 assert 0 +278 bnz main_bool_false@44 +281 int 1 1 +282 b main_bool_merge@45 1 +286 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +289 int 0 0 +290 callsub func_c 0 +364 proto 1 1 0 +367 frame_dig -1 0, 0 +369 retsub 0 +293 bz main_ternary_false@47 +304 int 1 1 +305 callsub func_b 1 +342 proto 1 1 1 +345 byte "did_execute_b" 1, "did_execute_b" +346 int 1 1, "did_execute_b", 1 +347 app_global_put 1 +348 frame_dig -1 1, 1 +350 retsub 1 +308 pop +309 int 0 0 +310 byte "did_execute_a" 0, "did_execute_a" +311 app_global_get_ex 0, 1 +312 assert 0 +313 bnz main_bool_false@51 +316 int 0 0 +317 byte "did_execute_b" 0, "did_execute_b" +318 app_global_get_ex 1, 1 +319 assert 1 +320 bz main_bool_false@51 +323 int 1 1 +324 b main_bool_merge@52 1 +328 callsub assert_and_reset 1 +351 proto 1 0 1 +354 frame_dig -1 1, 1 +356 assert 1 +357 byte "did_execute_b" 1, "did_execute_b" +358 int 0 1, "did_execute_b", 0 +359 app_global_put 1 +360 byte "did_execute_a" 1, "did_execute_a" +361 int 0 1, "did_execute_a", 0 +362 app_global_put 1 +363 retsub +331 int 1 1 +332 return 1 \ No newline at end of file diff --git a/examples/conditional_expressions/algopy.log b/examples/conditional_expressions/algopy.log index 07a0ddb051..39a8cc9095 100644 --- a/examples/conditional_expressions/algopy.log +++ b/examples/conditional_expressions/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 conditional_expressions -info: Building AWST for __init__.py -info: Building AWST for conditional_expressions/__init__.py -info: Building AWST for conditional_expressions/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug conditional_expressions +debug: Building AWST for __init__.py +debug: Building AWST for conditional_expressions/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for conditional_expressions/contract.py debug: Sealing block@0: // L32 debug: Terminated block@0: // L32 debug: Sealing block@0: // L38 @@ -313,6 +314,7 @@ debug: Found equivalence set: ternary_result%9#2, h#0 debug: Replacing {ternary_result%9#2} with h#0 made 1 modifications debug: Found equivalence set: ternary_result%11#2, i#0 debug: Replacing {ternary_result%11#2} with i#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable a#0 debug: Removing unused variable b#0 @@ -333,9 +335,10 @@ debug: Optimizer: Remove Unreachable Blocks debug: Removing unreachable blocks: block@2: // ternary_false_L11, block@4: // ternary_true_L12 debug: Removed unreachable predecessors from block@3: // ternary_merge_L11 debug: Removed unreachable predecessors from block@6: // ternary_merge_L12 -debug: Found ternary_result%0#1, ternary_result%1#0 to remove from Phi nodes +debug: Removing unreachable phi arguments: ternary_result%0#1 <- block@2 debug: Replacing trivial Phi node: let c#0: uint64 = φ(ternary_result%0#0 <- block@0) (c#0) with ternary_result%0#0 debug: Deleting Phi assignment: let c#0: uint64 = φ(ternary_result%0#0 <- block@0) +debug: Removing unreachable phi arguments: ternary_result%1#0 <- block@4 debug: Replacing trivial Phi node: let d#0: uint64 = φ(ternary_result%1#1 <- block@3) (d#0) with ternary_result%1#1 debug: Deleting Phi assignment: let d#0: uint64 = φ(ternary_result%1#1 <- block@3) debug: Optimizing subroutine examples.conditional_expressions.contract.MyContract.expensive_op @@ -343,6 +346,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -353,6 +357,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -363,6 +368,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -375,6 +381,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 1u * 2u to 2u debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable ternary_result%0#0 debug: Removing unused variable ternary_result%1#1 @@ -396,6 +403,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -405,6 +413,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -414,6 +423,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -428,6 +438,7 @@ debug: Folded 2u * 1u to 2u debug: Folded tmp%13#0 * 1u to tmp%13#0 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%10#0 debug: Removing unused variable tmp%13#0 @@ -445,13 +456,14 @@ info: Not removing empty block block@16: // ternary_true_L18 because it's used b debug: Optimizer: Remove Unreachable Blocks debug: Removing unreachable blocks: block@19: // ternary_true_L20 debug: Removed unreachable predecessors from block@21: // ternary_merge_L20 -debug: Found ternary_result%11#0 to remove from Phi nodes +debug: Removing unreachable phi arguments: ternary_result%11#0 <- block@19 debug: Replacing trivial Phi node: let i#0: uint64 = φ(ternary_result%11#1 <- block@18) (i#0) with ternary_result%11#1 debug: Deleting Phi assignment: let i#0: uint64 = φ(ternary_result%11#1 <- block@18) debug: Optimizing subroutine examples.conditional_expressions.contract.MyContract.expensive_op debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -461,6 +473,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -470,6 +483,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -481,6 +495,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -495,6 +510,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -504,6 +520,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -513,6 +530,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -524,6 +542,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -537,6 +556,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -546,6 +566,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -555,6 +576,7 @@ debug: Optimizing subroutine examples.conditional_expressions.contract.MyContrac debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -586,51 +608,51 @@ debug: Coalescing local variables in examples.conditional_expressions.contract.M debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/conditional_expressions/out/contract_MyContract.final.ir debug: Inserted main_block@0.ops[2]: 'store awst_tmp%2#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[4]: 'load awst_tmp%2#0 from scratch' with 'load awst_tmp%2#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[4]: 'load awst_tmp%2#0' with 'load awst_tmp%2#0 from l-stack (no copy)' debug: Inserted main_ternary_false@8.ops[2]: 'store ternary_result%3#1 to l-stack (copy)' -debug: Replaced main_ternary_false@8.ops[4]: 'load ternary_result%3#1 from scratch' with 'load ternary_result%3#1 from l-stack (no copy)' +debug: Replaced main_ternary_false@8.ops[4]: 'load ternary_result%3#1' with 'load ternary_result%3#1 from l-stack (no copy)' debug: Inserted main_ternary_merge@9.ops[2]: 'store awst_tmp%4#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@9.ops[4]: 'load awst_tmp%4#0 from scratch' with 'load awst_tmp%4#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@9.ops[4]: 'load awst_tmp%4#0' with 'load awst_tmp%4#0 from l-stack (no copy)' debug: Inserted main_ternary_false@11.ops[2]: 'store ternary_result%5#1 to l-stack (copy)' -debug: Replaced main_ternary_false@11.ops[4]: 'load ternary_result%5#1 from scratch' with 'load ternary_result%5#1 from l-stack (no copy)' +debug: Replaced main_ternary_false@11.ops[4]: 'load ternary_result%5#1' with 'load ternary_result%5#1 from l-stack (no copy)' debug: Inserted main_ternary_merge@12.ops[2]: 'store awst_tmp%6#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@12.ops[4]: 'load awst_tmp%6#0 from scratch' with 'load awst_tmp%6#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@12.ops[4]: 'load awst_tmp%6#0' with 'load awst_tmp%6#0 from l-stack (no copy)' debug: Inserted main_ternary_false@14.ops[2]: 'store ternary_result%7#1 to l-stack (copy)' -debug: Replaced main_ternary_false@14.ops[4]: 'load ternary_result%7#1 from scratch' with 'load ternary_result%7#1 from l-stack (no copy)' +debug: Replaced main_ternary_false@14.ops[4]: 'load ternary_result%7#1' with 'load ternary_result%7#1 from l-stack (no copy)' debug: Inserted main_ternary_merge@15.ops[2]: 'store awst_tmp%8#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@15.ops[4]: 'load awst_tmp%8#0 from scratch' with 'load awst_tmp%8#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@15.ops[4]: 'load awst_tmp%8#0' with 'load awst_tmp%8#0 from l-stack (no copy)' debug: Inserted main_ternary_false@17.ops[2]: 'store ternary_result%9#1 to l-stack (copy)' -debug: Replaced main_ternary_false@17.ops[4]: 'load ternary_result%9#1 from scratch' with 'load ternary_result%9#1 from l-stack (no copy)' +debug: Replaced main_ternary_false@17.ops[4]: 'load ternary_result%9#1' with 'load ternary_result%9#1 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[7]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[9]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[9]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[12]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[14]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[14]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[17]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[19]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[19]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[22]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[24]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[24]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[27]: 'store result#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[29]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[29]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[31]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[33]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[33]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[30]: 'store result#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[36]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[36]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[2]: 'store e#0 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[16]: 'load e#0 from scratch' with 'load e#0 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[16]: 'load e#0' with 'load e#0 from l-stack (no copy)' debug: Inserted main_ternary_merge@18.ops[4]: 'store ternary_result%11#1 to l-stack (copy)' -debug: Replaced main_ternary_merge@18.ops[27]: 'load ternary_result%11#1 from scratch' with 'load ternary_result%11#1 from l-stack (no copy)' +debug: Replaced main_ternary_merge@18.ops[27]: 'load ternary_result%11#1' with 'load ternary_result%11#1 from l-stack (no copy)' debug: Found 8 edge set/s for examples.conditional_expressions.contract.MyContract.approval_program -debug: Eliminated scratch slots for 1 variable/s: h#0 -info: shared x-stack for main_ternary_true@16 -> main_ternary_merge@18: h#0 -info: shared x-stack for main_ternary_false@17 -> main_ternary_merge@18: h#0 +debug: Allocated 1 variable/s to x-stack: h#0 +debug: shared x-stack for main_ternary_true@16 -> main_ternary_merge@18: h#0 +debug: shared x-stack for main_ternary_false@17 -> main_ternary_merge@18: h#0 debug: examples.conditional_expressions.contract.MyContract.approval_program f-stack entry: ['awst_tmp%4#0', 'awst_tmp%6#0', 'awst_tmp%8#0', 'e#0', 'f#0', 'g#0'] debug: examples.conditional_expressions.contract.MyContract.approval_program f-stack on first store: ['awst_tmp%2#0'] debug: Inserted expensive_op_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced expensive_op_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced expensive_op_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted side_effecting_op_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced side_effecting_op_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' -info: Writing /examples/conditional_expressions/out/contract.approval.teal -info: Writing /examples/conditional_expressions/out/contract.approval.debug.teal -info: Writing /examples/conditional_expressions/out/contract.clear.teal -info: Writing /examples/conditional_expressions/out/contract.clear.debug.teal +debug: Replaced side_effecting_op_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +info: Writing conditional_expressions/out/contract.approval.teal +info: Writing conditional_expressions/out/contract.approval.debug.teal +info: Writing conditional_expressions/out/contract.clear.teal +info: Writing conditional_expressions/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/conditional_expressions/out/contract.approval.debug.teal b/examples/conditional_expressions/out/contract.approval.debug.teal index 057e4db9c8..6b0cd825d4 100644 --- a/examples/conditional_expressions/out/contract.approval.debug.teal +++ b/examples/conditional_expressions/out/contract.approval.debug.teal @@ -11,7 +11,7 @@ main_block@0: int 0 // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0 | 0 0 File "conditional_expressions/contract.py", line 14 callsub expensive_op // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0 | {expensive_op} self.expensive_op(UInt64(0)) File "conditional_expressions/contract.py", line 14 dup // store awst_tmp%2#0 to l-stack (copy) (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0 | awst_tmp%2#0,awst_tmp%2#0 self.expensive_op(UInt64(0)) File "conditional_expressions/contract.py", line 14 - cover 1 // store awst_tmp%2#0 to f-stack (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | awst_tmp%2#0 self.expensive_op(UInt64(0)) File "conditional_expressions/contract.py", line 14 + swap // store awst_tmp%2#0 to f-stack (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | awst_tmp%2#0 self.expensive_op(UInt64(0)) File "conditional_expressions/contract.py", line 14 bz main_ternary_false@8 // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | self.expensive_op(UInt64(0)) or self.side_effecting_op(UInt64(1)) File "conditional_expressions/contract.py", line 14 // Implicit fall through to main_ternary_true@7 // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | self.expensive_op(UInt64(0)) or self.side_effecting_op(UInt64(1)) File "conditional_expressions/contract.py", line 14 @@ -87,13 +87,13 @@ main_ternary_merge@18: dup cover 2 // store e#0 to l-stack (copy) (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | (𝕏) h#0 | e#0,1,e#0 e File "conditional_expressions/contract.py", line 14 + // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | (𝕏) h#0 | e#0,{+} d + e File "conditional_expressions/contract.py", line 20 - cover 1 // store ternary_result%11#1 to l-stack (no copy) (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | (𝕏) h#0 | ternary_result%11#1,e#0 d + e File "conditional_expressions/contract.py", line 20 + swap // store ternary_result%11#1 to l-stack (no copy) (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | (𝕏) h#0 | ternary_result%11#1,e#0 d + e File "conditional_expressions/contract.py", line 20 int 2 // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | (𝕏) h#0 | ternary_result%11#1,e#0,2 2 File "conditional_expressions/contract.py", line 9 dig 6 // load f#0 from f-stack (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | (𝕏) h#0 | ternary_result%11#1,e#0,2,f#0 f File "conditional_expressions/contract.py", line 15 * // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | (𝕏) h#0 | ternary_result%11#1,e#0,{*} a * b * c * d * f File "conditional_expressions/contract.py", line 22 uncover 3 // load h#0 from x-stack (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | ternary_result%11#1,e#0,tmp%15#0,h#0 h File "conditional_expressions/contract.py", line 18 * // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | ternary_result%11#1,e#0,{*} a * b * c * d * f * h File "conditional_expressions/contract.py", line 22 - uncover 1 // load e#0 from l-stack (no copy) (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | ternary_result%11#1,tmp%16#0,e#0 e File "conditional_expressions/contract.py", line 14 + swap // load e#0 from l-stack (no copy) (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | ternary_result%11#1,tmp%16#0,e#0 e File "conditional_expressions/contract.py", line 14 - // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | ternary_result%11#1,{-} a * b * c * d * f * h - e File "conditional_expressions/contract.py", line 22 dig 3 // load g#0 from f-stack (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | ternary_result%11#1,tmp%17#0,g#0 g File "conditional_expressions/contract.py", line 17 - // (𝕗) awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,e#0,f#0,g#0,awst_tmp%2#0 | ternary_result%11#1,{-} a * b * c * d * f * h - e - g File "conditional_expressions/contract.py", line 22 @@ -112,7 +112,7 @@ expensive_op_block@0: frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 32 int 42 // (𝕡) val#0 | val#0,42 42 File "conditional_expressions/contract.py", line 33 != // (𝕡) val#0 | {!=} val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 33 - assert // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 33 + assert // Can't be 42 // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 33 byte "expensive_op" // (𝕡) val#0 | "expensive_op" b"expensive_op" File "conditional_expressions/contract.py", line 34 log // (𝕡) val#0 | log(b"expensive_op") File "conditional_expressions/contract.py", line 34 frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 32 @@ -127,7 +127,7 @@ side_effecting_op_block@0: frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 38 int 42 // (𝕡) val#0 | val#0,42 42 File "conditional_expressions/contract.py", line 39 != // (𝕡) val#0 | {!=} val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 39 - assert // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 39 + assert // Can't be 42 // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 39 byte "side_effecting_op" // (𝕡) val#0 | "side_effecting_op" b"side_effecting_op" File "conditional_expressions/contract.py", line 40 log // (𝕡) val#0 | log(b"side_effecting_op") File "conditional_expressions/contract.py", line 40 frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 38 diff --git a/examples/conditional_expressions/out/contract.approval.teal b/examples/conditional_expressions/out/contract.approval.teal index 33e7e3d437..a5d0da05aa 100644 --- a/examples/conditional_expressions/out/contract.approval.teal +++ b/examples/conditional_expressions/out/contract.approval.teal @@ -9,7 +9,7 @@ main_block@0: int 0 callsub expensive_op dup - cover 1 + swap bz main_ternary_false@8 main_ternary_true@7: @@ -77,13 +77,13 @@ main_ternary_merge@18: dup cover 2 + - cover 1 + swap int 2 dig 6 * uncover 3 * - uncover 1 + swap - dig 3 - @@ -102,7 +102,7 @@ expensive_op_block@0: frame_dig -1 int 42 != - assert + assert // Can't be 42 byte "expensive_op" log frame_dig -1 @@ -117,7 +117,7 @@ side_effecting_op_block@0: frame_dig -1 int 42 != - assert + assert // Can't be 42 byte "side_effecting_op" log frame_dig -1 diff --git a/examples/conditional_expressions/out/contract.approval_unoptimized.debug.teal b/examples/conditional_expressions/out/contract.approval_unoptimized.debug.teal index b5462bf4ad..e1e16bdeac 100644 --- a/examples/conditional_expressions/out/contract.approval_unoptimized.debug.teal +++ b/examples/conditional_expressions/out/contract.approval_unoptimized.debug.teal @@ -10,9 +10,9 @@ main: main_block@0: int 1 // (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0 | 1 1 File "conditional_expressions/contract.py", line 8 dup // store a#0 to l-stack (copy) (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0 | a#0,a#0 a File "conditional_expressions/contract.py", line 8 - cover 1 // store a#0 to f-stack (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0,a#0 | a#0 a File "conditional_expressions/contract.py", line 8 + swap // store a#0 to f-stack (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0,a#0 | a#0 a File "conditional_expressions/contract.py", line 8 int 2 // (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0,a#0 | a#0,2 2 File "conditional_expressions/contract.py", line 9 - cover 1 // store b#0 to f-stack (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0,a#0,b#0 | a#0 b File "conditional_expressions/contract.py", line 9 + swap // store b#0 to f-stack (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0,a#0,b#0 | a#0 b File "conditional_expressions/contract.py", line 9 bz main_ternary_false@2 // (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0,a#0,b#0 | a or b File "conditional_expressions/contract.py", line 11 // Implicit fall through to main_ternary_true@1 // (𝕗) awst_tmp%2#0,awst_tmp%4#0,awst_tmp%6#0,awst_tmp%8#0,c#0,d#0,e#0,f#0,g#0,h#0,a#0,b#0 | a or b File "conditional_expressions/contract.py", line 11 @@ -159,7 +159,7 @@ expensive_op_block@0: frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 32 int 42 // (𝕡) val#0 | val#0,42 42 File "conditional_expressions/contract.py", line 33 != // (𝕡) val#0 | {!=} val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 33 - assert // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 33 + assert // Can't be 42 // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 33 byte "expensive_op" // (𝕡) val#0 | "expensive_op" b"expensive_op" File "conditional_expressions/contract.py", line 34 log // (𝕡) val#0 | log(b"expensive_op") File "conditional_expressions/contract.py", line 34 frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 32 @@ -174,7 +174,7 @@ side_effecting_op_block@0: frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 38 int 42 // (𝕡) val#0 | val#0,42 42 File "conditional_expressions/contract.py", line 39 != // (𝕡) val#0 | {!=} val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 39 - assert // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 39 + assert // Can't be 42 // (𝕡) val#0 | assert val != 42, "Can't be 42" File "conditional_expressions/contract.py", line 39 byte "side_effecting_op" // (𝕡) val#0 | "side_effecting_op" b"side_effecting_op" File "conditional_expressions/contract.py", line 40 log // (𝕡) val#0 | log(b"side_effecting_op") File "conditional_expressions/contract.py", line 40 frame_dig -1 // load val#0 from parameters (𝕡) val#0 | val#0 val: UInt64 File "conditional_expressions/contract.py", line 38 diff --git a/examples/conditional_expressions/out/contract.approval_unoptimized.teal b/examples/conditional_expressions/out/contract.approval_unoptimized.teal index 349114a02d..d1e8db160d 100644 --- a/examples/conditional_expressions/out/contract.approval_unoptimized.teal +++ b/examples/conditional_expressions/out/contract.approval_unoptimized.teal @@ -8,9 +8,9 @@ main: main_block@0: int 1 dup - cover 1 + swap int 2 - cover 1 + swap bz main_ternary_false@2 main_ternary_true@1: @@ -143,7 +143,7 @@ expensive_op_block@0: frame_dig -1 int 42 != - assert + assert // Can't be 42 byte "expensive_op" log frame_dig -1 @@ -158,7 +158,7 @@ side_effecting_op_block@0: frame_dig -1 int 42 != - assert + assert // Can't be 42 byte "side_effecting_op" log frame_dig -1 diff --git a/examples/conditional_expressions/out/contract.awst b/examples/conditional_expressions/out/contract.awst index 96021a2c6c..66de3d21c0 100644 --- a/examples/conditional_expressions/out/contract.awst +++ b/examples/conditional_expressions/out/contract.awst @@ -4,13 +4,13 @@ contract MyContract { a: algopy.UInt64 = 1u b: algopy.UInt64 = 2u - c: algopy.UInt64 = reinterpret_cast(a) ? a : b - d: algopy.UInt64 = !(reinterpret_cast(b)) ? b : a - e: algopy.UInt64 = reinterpret_cast(tmp$0: algopy.UInt64 := this::expensive_op(0u)) ? tmp$0 : this::side_effecting_op(1u) - f: algopy.UInt64 = reinterpret_cast(tmp$1: algopy.UInt64 := this::expensive_op(3u)) ? tmp$1 : this::side_effecting_op(42u) - g: algopy.UInt64 = !(reinterpret_cast(tmp$2: algopy.UInt64 := this::side_effecting_op(0u))) ? tmp$2 : this::expensive_op(42u) - h: algopy.UInt64 = !(reinterpret_cast(tmp$3: algopy.UInt64 := this::side_effecting_op(2u))) ? tmp$3 : this::expensive_op(3u) - i: algopy.UInt64 = b < c ? a : d + e + c: algopy.UInt64 = (reinterpret_cast(a)) ? (a) : (b) + d: algopy.UInt64 = (!(reinterpret_cast(b))) ? (b) : (a) + e: algopy.UInt64 = (reinterpret_cast(tmp$0: algopy.UInt64 := this::expensive_op(0u))) ? (tmp$0) : (this::side_effecting_op(1u)) + f: algopy.UInt64 = (reinterpret_cast(tmp$1: algopy.UInt64 := this::expensive_op(3u))) ? (tmp$1) : (this::side_effecting_op(42u)) + g: algopy.UInt64 = (!(reinterpret_cast(tmp$2: algopy.UInt64 := this::side_effecting_op(0u)))) ? (tmp$2) : (this::expensive_op(42u)) + h: algopy.UInt64 = (!(reinterpret_cast(tmp$3: algopy.UInt64 := this::side_effecting_op(2u)))) ? (tmp$3) : (this::expensive_op(3u)) + i: algopy.UInt64 = (b < c) ? (a) : (d + e) result: algopy.UInt64 = a * b * c * d * f * h - e - g + i log(itob(result)) return result diff --git a/examples/contains/algopy.log b/examples/contains/algopy.log index c0596a7c5a..6d10530335 100644 --- a/examples/contains/algopy.log +++ b/examples/contains/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 contains -info: Building AWST for __init__.py -info: Building AWST for contains/__init__.py -info: Building AWST for contains/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug contains +debug: Building AWST for __init__.py +debug: Building AWST for contains/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for contains/contract.py debug: Sealing block@0: // L40 debug: Terminated block@0: // L40 debug: Sealing block@0: // L44 @@ -18,10 +19,13 @@ debug: Begin optimization pass 1/100 debug: Optimizing subroutine examples.contains.contract.MyContract.approval_program debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification +debug: Folded 32323423423423 b+ 32323423423423 to 64646846846846 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable not_ten#0 +debug: Removing unused variable tmp%2#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -31,6 +35,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -41,6 +46,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -51,6 +57,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -61,6 +68,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -72,6 +80,7 @@ debug: Optimizing subroutine examples.contains.contract.MyContract.approval_prog debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -81,6 +90,7 @@ debug: Optimizing subroutine examples.contains.contract.MyContract.is_in_tuple_1 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -90,6 +100,7 @@ debug: Optimizing subroutine examples.contains.contract.MyContract.is_in_tuple_2 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -99,6 +110,7 @@ debug: Optimizing subroutine examples.contains.contract.MyContract.is_in_tuple_3 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -108,6 +120,7 @@ debug: Optimizing subroutine examples.contains.contract.MyContract.clear_state_p debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -139,45 +152,43 @@ debug: Coalescing local variables in examples.contains.contract.MyContract.clear debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/contains/out/contract_MyContract.final.ir debug: Inserted main_block@0.ops[16]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[18]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[18]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[36]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[38]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[48]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[50]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[59]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[61]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[38]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[54]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[56]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[11]: 'store one_false#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[15]: 'load one_false#0 from scratch' with 'load one_false#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[15]: 'load one_false#0' with 'load one_false#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[32]: 'store two_false#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[36]: 'load two_false#0 from scratch' with 'load two_false#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[56]: 'store three_false#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[60]: 'load three_false#0 from scratch' with 'load three_false#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[36]: 'load two_false#0' with 'load two_false#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[51]: 'store three_false#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[55]: 'load three_false#0' with 'load three_false#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[46]: 'store three_true#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[54]: 'load three_true#0' with 'load three_true#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[5]: 'store one_true#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[14]: 'load one_true#0 from scratch' with 'load one_true#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[14]: 'load one_true#0' with 'load one_true#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[27]: 'store two_true#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[36]: 'load two_true#0 from scratch' with 'load two_true#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[48]: 'store three_true#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[61]: 'load three_true#0 from scratch' with 'load three_true#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[36]: 'load two_true#0' with 'load two_true#0 from l-stack (no copy)' debug: Inserted is_in_tuple_1_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced is_in_tuple_1_block@0.ops[13]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_1_block@0.ops[13]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted is_in_tuple_1_block@0.ops[7]: 'store is_equal%1#0 to l-stack (copy)' -debug: Replaced is_in_tuple_1_block@0.ops[10]: 'load is_equal%1#0 from scratch' with 'load is_equal%1#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_1_block@0.ops[10]: 'load is_equal%1#0' with 'load is_equal%1#0 from l-stack (no copy)' debug: Inserted is_in_tuple_1_block@0.ops[3]: 'store contains%0#0 to l-stack (copy)' -debug: Replaced is_in_tuple_1_block@0.ops[10]: 'load contains%0#0 from scratch' with 'load contains%0#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_1_block@0.ops[10]: 'load contains%0#0' with 'load contains%0#0 from l-stack (no copy)' debug: Inserted is_in_tuple_2_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced is_in_tuple_2_block@0.ops[13]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_2_block@0.ops[13]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted is_in_tuple_2_block@0.ops[7]: 'store is_equal%1#0 to l-stack (copy)' -debug: Replaced is_in_tuple_2_block@0.ops[10]: 'load is_equal%1#0 from scratch' with 'load is_equal%1#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_2_block@0.ops[10]: 'load is_equal%1#0' with 'load is_equal%1#0 from l-stack (no copy)' debug: Inserted is_in_tuple_2_block@0.ops[3]: 'store contains%0#0 to l-stack (copy)' -debug: Replaced is_in_tuple_2_block@0.ops[10]: 'load contains%0#0 from scratch' with 'load contains%0#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_2_block@0.ops[10]: 'load contains%0#0' with 'load contains%0#0 from l-stack (no copy)' debug: Inserted is_in_tuple_3_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced is_in_tuple_3_block@0.ops[13]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_3_block@0.ops[13]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted is_in_tuple_3_block@0.ops[7]: 'store is_equal%1#0 to l-stack (copy)' -debug: Replaced is_in_tuple_3_block@0.ops[10]: 'load is_equal%1#0 from scratch' with 'load is_equal%1#0 from l-stack (no copy)' +debug: Replaced is_in_tuple_3_block@0.ops[10]: 'load is_equal%1#0' with 'load is_equal%1#0 from l-stack (no copy)' debug: Inserted is_in_tuple_3_block@0.ops[3]: 'store contains%0#0 to l-stack (copy)' -debug: Replaced is_in_tuple_3_block@0.ops[10]: 'load contains%0#0 from scratch' with 'load contains%0#0 from l-stack (no copy)' -info: Writing /examples/contains/out/contract.approval.teal -info: Writing /examples/contains/out/contract.approval.debug.teal -info: Writing /examples/contains/out/contract.clear.teal -info: Writing /examples/contains/out/contract.clear.debug.teal +debug: Replaced is_in_tuple_3_block@0.ops[10]: 'load contains%0#0' with 'load contains%0#0 from l-stack (no copy)' +info: Writing contains/out/contract.approval.teal +info: Writing contains/out/contract.approval.debug.teal +info: Writing contains/out/contract.clear.teal +info: Writing contains/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/contains/out/contract.approval.debug.teal b/examples/contains/out/contract.approval.debug.teal index eb3618b516..a525874bf5 100644 --- a/examples/contains/out/contract.approval.debug.teal +++ b/examples/contains/out/contract.approval.debug.teal @@ -1,96 +1,94 @@ -// Op // Op Description Stack (out) Source code Source line +// Op // Op Description Stack (out) Source code Source line #pragma version 8 // examples.contains.contract.MyContract.approval_program() -> uint64: main_block@0: - int 10 // 10 10 File "contains/contract.py", line 10 - int 10 // 10,10 10 File "contains/contract.py", line 10 - int 15 // 10,10,15 15 File "contains/contract.py", line 8 - byte "five" // 10,10,15,"five" b"five" File "contains/contract.py", line 10 - callsub is_in_tuple_1 // {is_in_tuple_1} self.is_in_tuple_1(UInt64(10), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 10 - int 5 // one_true#0,5 5 File "contains/contract.py", line 11 - int 10 // one_true#0,5,10 10 File "contains/contract.py", line 11 - int 15 // one_true#0,5,10,15 15 File "contains/contract.py", line 8 - byte "five" // one_true#0,5,10,15,"five" b"five" File "contains/contract.py", line 11 - callsub is_in_tuple_1 // one_true#0,{is_in_tuple_1} self.is_in_tuple_1(UInt64(5), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 11 - uncover 1 // load one_true#0 from l-stack (no copy) one_false#0,one_true#0 one_true File "contains/contract.py", line 10 - assert // one_false#0 assert one_true, "Should be true" File "contains/contract.py", line 12 - ! // {!} not one_false File "contains/contract.py", line 13 - assert // assert not one_false, "Should be false" File "contains/contract.py", line 13 - byte "hello" // "hello" b"hello" File "contains/contract.py", line 16 - byte "hello" // "hello","hello" b"hello" File "contains/contract.py", line 16 - int 0 // "hello","hello",0 0 File "contains/contract.py", line 16 - byte "bonjour" // "hello","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 16 - callsub is_in_tuple_2 // {is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 15 - byte "ciao" // two_true#0,"ciao" b"ciao" File "contains/contract.py", line 19 - byte "hello" // two_true#0,"ciao","hello" b"hello" File "contains/contract.py", line 19 - int 0 // two_true#0,"ciao","hello",0 0 File "contains/contract.py", line 19 - byte "bonjour" // two_true#0,"ciao","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 19 - callsub is_in_tuple_2 // two_true#0,{is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 18 - uncover 1 // load two_true#0 from l-stack (no copy) two_false#0,two_true#0 two_true File "contains/contract.py", line 15 - assert // two_false#0 assert two_true, "Should be true" File "contains/contract.py", line 21 - ! // {!} not two_false File "contains/contract.py", line 22 - assert // assert not two_false, "Should be false" File "contains/contract.py", line 22 - byte 0x1d65e22bcbbf // 0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 - byte 0x1d65e22bcbbf // 0x1d65e22bcbbf,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 - byte 0x07acf5cae41e // 0x1d65e22bcbbf,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 25 - callsub is_in_tuple_3 // {is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 24 - byte 0x1d65e22bcbbf // three_true#0,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 28 - byte 0x1d65e22bcbbf // three_true#0,0x1d65e22bcbbf,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 28 - b+ // three_true#0,{b+} BigUInt(32323423423423) + BigUInt(32323423423423) File "contains/contract.py", line 28 - byte 0x1d65e22bcbbf // three_true#0,tmp%2#0,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 29 - byte 0x07acf5cae41e // three_true#0,tmp%2#0,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 29 - callsub is_in_tuple_3 // three_true#0,{is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 27 - uncover 1 // load three_true#0 from l-stack (no copy) three_false#0,three_true#0 three_true File "contains/contract.py", line 24 - assert // three_false#0 assert three_true, "Should be true" File "contains/contract.py", line 31 - ! // {!} not three_false File "contains/contract.py", line 32 - assert // assert not three_false, "Should be false" File "contains/contract.py", line 32 - int 1 // 1 1 File "contains/contract.py", line 34 - return // return UInt64(1) File "contains/contract.py", line 34 + int 10 // 10 10 File "contains/contract.py", line 10 + int 10 // 10,10 10 File "contains/contract.py", line 10 + int 15 // 10,10,15 15 File "contains/contract.py", line 8 + byte "five" // 10,10,15,"five" b"five" File "contains/contract.py", line 10 + callsub is_in_tuple_1 // {is_in_tuple_1} self.is_in_tuple_1(UInt64(10), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 10 + int 5 // one_true#0,5 5 File "contains/contract.py", line 11 + int 10 // one_true#0,5,10 10 File "contains/contract.py", line 11 + int 15 // one_true#0,5,10,15 15 File "contains/contract.py", line 8 + byte "five" // one_true#0,5,10,15,"five" b"five" File "contains/contract.py", line 11 + callsub is_in_tuple_1 // one_true#0,{is_in_tuple_1} self.is_in_tuple_1(UInt64(5), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 11 + swap // load one_true#0 from l-stack (no copy) one_false#0,one_true#0 one_true File "contains/contract.py", line 10 + assert // Should be true // one_false#0 assert one_true, "Should be true" File "contains/contract.py", line 12 + ! // {!} not one_false File "contains/contract.py", line 13 + assert // Should be false // assert not one_false, "Should be false" File "contains/contract.py", line 13 + byte "hello" // "hello" b"hello" File "contains/contract.py", line 16 + byte "hello" // "hello","hello" b"hello" File "contains/contract.py", line 16 + int 0 // "hello","hello",0 0 File "contains/contract.py", line 16 + byte "bonjour" // "hello","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 16 + callsub is_in_tuple_2 // {is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 15 + byte "ciao" // two_true#0,"ciao" b"ciao" File "contains/contract.py", line 19 + byte "hello" // two_true#0,"ciao","hello" b"hello" File "contains/contract.py", line 19 + int 0 // two_true#0,"ciao","hello",0 0 File "contains/contract.py", line 19 + byte "bonjour" // two_true#0,"ciao","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 19 + callsub is_in_tuple_2 // two_true#0,{is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 18 + swap // load two_true#0 from l-stack (no copy) two_false#0,two_true#0 two_true File "contains/contract.py", line 15 + assert // Should be true // two_false#0 assert two_true, "Should be true" File "contains/contract.py", line 21 + ! // {!} not two_false File "contains/contract.py", line 22 + assert // Should be false // assert not two_false, "Should be false" File "contains/contract.py", line 22 + byte 0x1d65e22bcbbf // 0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 + byte 0x1d65e22bcbbf // 0x1d65e22bcbbf,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 + byte 0x07acf5cae41e // 0x1d65e22bcbbf,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 25 + callsub is_in_tuple_3 // {is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 24 + byte 0x3acbc457977e // three_true#0,0x3acbc457977e BigUInt(32323423423423) + BigUInt(32323423423423) File "contains/contract.py", line 28 + byte 0x1d65e22bcbbf // three_true#0,0x3acbc457977e,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 29 + byte 0x07acf5cae41e // three_true#0,0x3acbc457977e,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 29 + callsub is_in_tuple_3 // three_true#0,{is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 27 + swap // load three_true#0 from l-stack (no copy) three_false#0,three_true#0 three_true File "contains/contract.py", line 24 + assert // Should be true // three_false#0 assert three_true, "Should be true" File "contains/contract.py", line 31 + ! // {!} not three_false File "contains/contract.py", line 32 + assert // Should be false // assert not three_false, "Should be false" File "contains/contract.py", line 32 + int 1 // 1 1 File "contains/contract.py", line 34 + return // return UInt64(1) File "contains/contract.py", line 34 // examples.contains.contract.MyContract.is_in_tuple_1(x#0: uint64, y.0#0: uint64, y.1#0: uint64, y.2#0: bytes) -> uint64: is_in_tuple_1: - proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_1(self, x: UInt64, y: tuple[UInt64, UInt64, Bytes]) -> bool: File "contains/contract.py", line 40 + proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_1(self, x: UInt64, y: tuple[UInt64, UInt64, Bytes]) -> bool: File "contains/contract.py", line 40 is_in_tuple_1_block@0: - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: UInt64 File "contains/contract.py", line 40 - frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 41 - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: UInt64 File "contains/contract.py", line 40 - frame_dig -2 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.1#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 41 - || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 41 - retsub // tmp%2#0 return x in y File "contains/contract.py", line 41 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: UInt64 File "contains/contract.py", line 40 + frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 41 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: UInt64 File "contains/contract.py", line 40 + frame_dig -2 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.1#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 41 + || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 41 + retsub // tmp%2#0 return x in y File "contains/contract.py", line 41 // examples.contains.contract.MyContract.is_in_tuple_2(x#0: bytes, y.0#0: bytes, y.1#0: uint64, y.2#0: bytes) -> uint64: is_in_tuple_2: - proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_2(self, x: Bytes, y: tuple[Bytes, UInt64, Bytes]) -> bool: File "contains/contract.py", line 44 + proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_2(self, x: Bytes, y: tuple[Bytes, UInt64, Bytes]) -> bool: File "contains/contract.py", line 44 is_in_tuple_2_block@0: - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: Bytes File "contains/contract.py", line 44 - frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 45 - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: Bytes File "contains/contract.py", line 44 - frame_dig -1 // load y.2#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.2#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 45 - || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 45 - retsub // tmp%2#0 return x in y File "contains/contract.py", line 45 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: Bytes File "contains/contract.py", line 44 + frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 45 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: Bytes File "contains/contract.py", line 44 + frame_dig -1 // load y.2#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.2#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 45 + || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 45 + retsub // tmp%2#0 return x in y File "contains/contract.py", line 45 // examples.contains.contract.MyContract.is_in_tuple_3(x#0: bytes, y.0#0: bytes, y.1#0: bytes) -> uint64: is_in_tuple_3: - proto 3 1 // (𝕡) x#0,y.0#0,y.1#0 | def is_in_tuple_3(self, x: BigUInt, y: tuple[BigUInt, BigUInt]) -> bool: File "contains/contract.py", line 48 + proto 3 1 // (𝕡) x#0,y.0#0,y.1#0 | def is_in_tuple_3(self, x: BigUInt, y: tuple[BigUInt, BigUInt]) -> bool: File "contains/contract.py", line 48 is_in_tuple_3_block@0: - frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0 x: BigUInt File "contains/contract.py", line 48 - frame_dig -2 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0,y.0#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 - b== // (𝕡) x#0,y.0#0,y.1#0 | {b==} x in y File "contains/contract.py", line 49 - frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0 x: BigUInt File "contains/contract.py", line 48 - frame_dig -1 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0,y.1#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 - b== // (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,{b==} x in y File "contains/contract.py", line 49 - || // (𝕡) x#0,y.0#0,y.1#0 | {||} x in y File "contains/contract.py", line 49 - retsub // tmp%2#0 return x in y File "contains/contract.py", line 49 + frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0 x: BigUInt File "contains/contract.py", line 48 + frame_dig -2 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0,y.0#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 + b== // (𝕡) x#0,y.0#0,y.1#0 | {b==} x in y File "contains/contract.py", line 49 + frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0 x: BigUInt File "contains/contract.py", line 48 + frame_dig -1 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0,y.1#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 + b== // (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,{b==} x in y File "contains/contract.py", line 49 + || // (𝕡) x#0,y.0#0,y.1#0 | {||} x in y File "contains/contract.py", line 49 + retsub // tmp%2#0 return x in y File "contains/contract.py", line 49 diff --git a/examples/contains/out/contract.approval.teal b/examples/contains/out/contract.approval.teal index d443bd567a..518a2f9186 100644 --- a/examples/contains/out/contract.approval.teal +++ b/examples/contains/out/contract.approval.teal @@ -12,10 +12,10 @@ main_block@0: int 15 byte "five" callsub is_in_tuple_1 - uncover 1 - assert + swap + assert // Should be true ! - assert + assert // Should be false byte "hello" byte "hello" int 0 @@ -26,24 +26,22 @@ main_block@0: int 0 byte "bonjour" callsub is_in_tuple_2 - uncover 1 - assert + swap + assert // Should be true ! - assert + assert // Should be false byte 0x1d65e22bcbbf byte 0x1d65e22bcbbf byte 0x07acf5cae41e callsub is_in_tuple_3 - byte 0x1d65e22bcbbf - byte 0x1d65e22bcbbf - b+ + byte 0x3acbc457977e byte 0x1d65e22bcbbf byte 0x07acf5cae41e callsub is_in_tuple_3 - uncover 1 - assert + swap + assert // Should be true ! - assert + assert // Should be false int 1 return diff --git a/examples/contains/out/contract.approval_unoptimized.debug.teal b/examples/contains/out/contract.approval_unoptimized.debug.teal index a773da2883..c8858df835 100644 --- a/examples/contains/out/contract.approval_unoptimized.debug.teal +++ b/examples/contains/out/contract.approval_unoptimized.debug.teal @@ -1,98 +1,98 @@ -// Op // Op Description Stack (out) Source code Source line +// Op // Op Description Stack (out) Source code Source line #pragma version 8 // examples.contains.contract.MyContract.approval_program() -> uint64: main_block@0: - int 15 // 15 15 File "contains/contract.py", line 8 - int 10 // not_ten#0,10 10 File "contains/contract.py", line 10 - int 10 // not_ten#0,10,10 10 File "contains/contract.py", line 10 - dig 2 // load not_ten#0 from l-stack (copy) not_ten#0,10,10,not_ten#0 not_ten File "contains/contract.py", line 8 - byte "five" // not_ten#0,10,10,not_ten#0,"five" b"five" File "contains/contract.py", line 10 - callsub is_in_tuple_1 // not_ten#0,{is_in_tuple_1} self.is_in_tuple_1(UInt64(10), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 10 - cover 1 // store one_true#0 to l-stack (no copy) one_true#0,not_ten#0 one_true File "contains/contract.py", line 10 - int 5 // one_true#0,not_ten#0,5 5 File "contains/contract.py", line 11 - int 10 // one_true#0,not_ten#0,5,10 10 File "contains/contract.py", line 11 - uncover 2 // load not_ten#0 from l-stack (no copy) one_true#0,5,10,not_ten#0 not_ten File "contains/contract.py", line 8 - byte "five" // one_true#0,5,10,not_ten#0,"five" b"five" File "contains/contract.py", line 11 - callsub is_in_tuple_1 // one_true#0,{is_in_tuple_1} self.is_in_tuple_1(UInt64(5), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 11 - uncover 1 // load one_true#0 from l-stack (no copy) one_false#0,one_true#0 one_true File "contains/contract.py", line 10 - assert // one_false#0 assert one_true, "Should be true" File "contains/contract.py", line 12 - ! // {!} not one_false File "contains/contract.py", line 13 - assert // assert not one_false, "Should be false" File "contains/contract.py", line 13 - byte "hello" // "hello" b"hello" File "contains/contract.py", line 16 - byte "hello" // "hello","hello" b"hello" File "contains/contract.py", line 16 - int 0 // "hello","hello",0 0 File "contains/contract.py", line 16 - byte "bonjour" // "hello","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 16 - callsub is_in_tuple_2 // {is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 15 - byte "ciao" // two_true#0,"ciao" b"ciao" File "contains/contract.py", line 19 - byte "hello" // two_true#0,"ciao","hello" b"hello" File "contains/contract.py", line 19 - int 0 // two_true#0,"ciao","hello",0 0 File "contains/contract.py", line 19 - byte "bonjour" // two_true#0,"ciao","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 19 - callsub is_in_tuple_2 // two_true#0,{is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 18 - uncover 1 // load two_true#0 from l-stack (no copy) two_false#0,two_true#0 two_true File "contains/contract.py", line 15 - assert // two_false#0 assert two_true, "Should be true" File "contains/contract.py", line 21 - ! // {!} not two_false File "contains/contract.py", line 22 - assert // assert not two_false, "Should be false" File "contains/contract.py", line 22 - byte 0x1d65e22bcbbf // 0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 - byte 0x1d65e22bcbbf // 0x1d65e22bcbbf,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 - byte 0x07acf5cae41e // 0x1d65e22bcbbf,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 25 - callsub is_in_tuple_3 // {is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 24 - byte 0x1d65e22bcbbf // three_true#0,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 28 - byte 0x1d65e22bcbbf // three_true#0,0x1d65e22bcbbf,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 28 - b+ // three_true#0,{b+} BigUInt(32323423423423) + BigUInt(32323423423423) File "contains/contract.py", line 28 - byte 0x1d65e22bcbbf // three_true#0,tmp%2#0,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 29 - byte 0x07acf5cae41e // three_true#0,tmp%2#0,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 29 - callsub is_in_tuple_3 // three_true#0,{is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 27 - uncover 1 // load three_true#0 from l-stack (no copy) three_false#0,three_true#0 three_true File "contains/contract.py", line 24 - assert // three_false#0 assert three_true, "Should be true" File "contains/contract.py", line 31 - ! // {!} not three_false File "contains/contract.py", line 32 - assert // assert not three_false, "Should be false" File "contains/contract.py", line 32 - int 1 // 1 1 File "contains/contract.py", line 34 - return // return UInt64(1) File "contains/contract.py", line 34 + int 15 // 15 15 File "contains/contract.py", line 8 + int 10 // not_ten#0,10 10 File "contains/contract.py", line 10 + int 10 // not_ten#0,10,10 10 File "contains/contract.py", line 10 + dig 2 // load not_ten#0 from l-stack (copy) not_ten#0,10,10,not_ten#0 not_ten File "contains/contract.py", line 8 + byte "five" // not_ten#0,10,10,not_ten#0,"five" b"five" File "contains/contract.py", line 10 + callsub is_in_tuple_1 // not_ten#0,{is_in_tuple_1} self.is_in_tuple_1(UInt64(10), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 10 + swap // store one_true#0 to l-stack (no copy) one_true#0,not_ten#0 one_true File "contains/contract.py", line 10 + int 5 // one_true#0,not_ten#0,5 5 File "contains/contract.py", line 11 + int 10 // one_true#0,not_ten#0,5,10 10 File "contains/contract.py", line 11 + uncover 2 // load not_ten#0 from l-stack (no copy) one_true#0,5,10,not_ten#0 not_ten File "contains/contract.py", line 8 + byte "five" // one_true#0,5,10,not_ten#0,"five" b"five" File "contains/contract.py", line 11 + callsub is_in_tuple_1 // one_true#0,{is_in_tuple_1} self.is_in_tuple_1(UInt64(5), (UInt64(10), not_ten, Bytes(b"five"))) File "contains/contract.py", line 11 + swap // load one_true#0 from l-stack (no copy) one_false#0,one_true#0 one_true File "contains/contract.py", line 10 + assert // Should be true // one_false#0 assert one_true, "Should be true" File "contains/contract.py", line 12 + ! // {!} not one_false File "contains/contract.py", line 13 + assert // Should be false // assert not one_false, "Should be false" File "contains/contract.py", line 13 + byte "hello" // "hello" b"hello" File "contains/contract.py", line 16 + byte "hello" // "hello","hello" b"hello" File "contains/contract.py", line 16 + int 0 // "hello","hello",0 0 File "contains/contract.py", line 16 + byte "bonjour" // "hello","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 16 + callsub is_in_tuple_2 // {is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 15 + byte "ciao" // two_true#0,"ciao" b"ciao" File "contains/contract.py", line 19 + byte "hello" // two_true#0,"ciao","hello" b"hello" File "contains/contract.py", line 19 + int 0 // two_true#0,"ciao","hello",0 0 File "contains/contract.py", line 19 + byte "bonjour" // two_true#0,"ciao","hello",0,"bonjour" b"bonjour" File "contains/contract.py", line 19 + callsub is_in_tuple_2 // two_true#0,{is_in_tuple_2} self.is_in_tuple_2( File "contains/contract.py", line 18 + swap // load two_true#0 from l-stack (no copy) two_false#0,two_true#0 two_true File "contains/contract.py", line 15 + assert // Should be true // two_false#0 assert two_true, "Should be true" File "contains/contract.py", line 21 + ! // {!} not two_false File "contains/contract.py", line 22 + assert // Should be false // assert not two_false, "Should be false" File "contains/contract.py", line 22 + byte 0x1d65e22bcbbf // 0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 + byte 0x1d65e22bcbbf // 0x1d65e22bcbbf,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 25 + byte 0x07acf5cae41e // 0x1d65e22bcbbf,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 25 + callsub is_in_tuple_3 // {is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 24 + byte 0x1d65e22bcbbf // three_true#0,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 28 + byte 0x1d65e22bcbbf // three_true#0,0x1d65e22bcbbf,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 28 + b+ // three_true#0,{b+} BigUInt(32323423423423) + BigUInt(32323423423423) File "contains/contract.py", line 28 + byte 0x1d65e22bcbbf // three_true#0,tmp%2#0,0x1d65e22bcbbf 32323423423423 File "contains/contract.py", line 29 + byte 0x07acf5cae41e // three_true#0,tmp%2#0,0x1d65e22bcbbf,0x07acf5cae41e 8439439483934 File "contains/contract.py", line 29 + callsub is_in_tuple_3 // three_true#0,{is_in_tuple_3} self.is_in_tuple_3( File "contains/contract.py", line 27 + swap // load three_true#0 from l-stack (no copy) three_false#0,three_true#0 three_true File "contains/contract.py", line 24 + assert // Should be true // three_false#0 assert three_true, "Should be true" File "contains/contract.py", line 31 + ! // {!} not three_false File "contains/contract.py", line 32 + assert // Should be false // assert not three_false, "Should be false" File "contains/contract.py", line 32 + int 1 // 1 1 File "contains/contract.py", line 34 + return // return UInt64(1) File "contains/contract.py", line 34 // examples.contains.contract.MyContract.is_in_tuple_1(x#0: uint64, y.0#0: uint64, y.1#0: uint64, y.2#0: bytes) -> uint64: is_in_tuple_1: - proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_1(self, x: UInt64, y: tuple[UInt64, UInt64, Bytes]) -> bool: File "contains/contract.py", line 40 + proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_1(self, x: UInt64, y: tuple[UInt64, UInt64, Bytes]) -> bool: File "contains/contract.py", line 40 is_in_tuple_1_block@0: - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: UInt64 File "contains/contract.py", line 40 - frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 41 - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: UInt64 File "contains/contract.py", line 40 - frame_dig -2 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.1#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 41 - || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 41 - retsub // tmp%2#0 return x in y File "contains/contract.py", line 41 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: UInt64 File "contains/contract.py", line 40 + frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 41 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: UInt64 File "contains/contract.py", line 40 + frame_dig -2 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.1#0 y: tuple[UInt64, UInt64, Bytes] File "contains/contract.py", line 40 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 41 + || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 41 + retsub // tmp%2#0 return x in y File "contains/contract.py", line 41 // examples.contains.contract.MyContract.is_in_tuple_2(x#0: bytes, y.0#0: bytes, y.1#0: uint64, y.2#0: bytes) -> uint64: is_in_tuple_2: - proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_2(self, x: Bytes, y: tuple[Bytes, UInt64, Bytes]) -> bool: File "contains/contract.py", line 44 + proto 4 1 // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | def is_in_tuple_2(self, x: Bytes, y: tuple[Bytes, UInt64, Bytes]) -> bool: File "contains/contract.py", line 44 is_in_tuple_2_block@0: - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: Bytes File "contains/contract.py", line 44 - frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 45 - frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: Bytes File "contains/contract.py", line 44 - frame_dig -1 // load y.2#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.2#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 - == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 45 - || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 45 - retsub // tmp%2#0 return x in y File "contains/contract.py", line 45 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0 x: Bytes File "contains/contract.py", line 44 + frame_dig -3 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | x#0,y.0#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {==} x in y File "contains/contract.py", line 45 + frame_dig -4 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0 x: Bytes File "contains/contract.py", line 44 + frame_dig -1 // load y.2#0 from parameters (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,x#0,y.2#0 y: tuple[Bytes, UInt64, Bytes] File "contains/contract.py", line 44 + == // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | contains%0#0,{==} x in y File "contains/contract.py", line 45 + || // (𝕡) x#0,y.0#0,y.1#0,y.2#0 | {||} x in y File "contains/contract.py", line 45 + retsub // tmp%2#0 return x in y File "contains/contract.py", line 45 // examples.contains.contract.MyContract.is_in_tuple_3(x#0: bytes, y.0#0: bytes, y.1#0: bytes) -> uint64: is_in_tuple_3: - proto 3 1 // (𝕡) x#0,y.0#0,y.1#0 | def is_in_tuple_3(self, x: BigUInt, y: tuple[BigUInt, BigUInt]) -> bool: File "contains/contract.py", line 48 + proto 3 1 // (𝕡) x#0,y.0#0,y.1#0 | def is_in_tuple_3(self, x: BigUInt, y: tuple[BigUInt, BigUInt]) -> bool: File "contains/contract.py", line 48 is_in_tuple_3_block@0: - frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0 x: BigUInt File "contains/contract.py", line 48 - frame_dig -2 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0,y.0#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 - b== // (𝕡) x#0,y.0#0,y.1#0 | {b==} x in y File "contains/contract.py", line 49 - frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0 x: BigUInt File "contains/contract.py", line 48 - frame_dig -1 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0,y.1#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 - b== // (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,{b==} x in y File "contains/contract.py", line 49 - || // (𝕡) x#0,y.0#0,y.1#0 | {||} x in y File "contains/contract.py", line 49 - retsub // tmp%2#0 return x in y File "contains/contract.py", line 49 + frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0 x: BigUInt File "contains/contract.py", line 48 + frame_dig -2 // load y.0#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | x#0,y.0#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 + b== // (𝕡) x#0,y.0#0,y.1#0 | {b==} x in y File "contains/contract.py", line 49 + frame_dig -3 // load x#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0 x: BigUInt File "contains/contract.py", line 48 + frame_dig -1 // load y.1#0 from parameters (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,x#0,y.1#0 y: tuple[BigUInt, BigUInt] File "contains/contract.py", line 48 + b== // (𝕡) x#0,y.0#0,y.1#0 | contains%0#0,{b==} x in y File "contains/contract.py", line 49 + || // (𝕡) x#0,y.0#0,y.1#0 | {||} x in y File "contains/contract.py", line 49 + retsub // tmp%2#0 return x in y File "contains/contract.py", line 49 diff --git a/examples/contains/out/contract.approval_unoptimized.teal b/examples/contains/out/contract.approval_unoptimized.teal index 5197e92451..87e11ce31a 100644 --- a/examples/contains/out/contract.approval_unoptimized.teal +++ b/examples/contains/out/contract.approval_unoptimized.teal @@ -8,16 +8,16 @@ main_block@0: dig 2 byte "five" callsub is_in_tuple_1 - cover 1 + swap int 5 int 10 uncover 2 byte "five" callsub is_in_tuple_1 - uncover 1 - assert + swap + assert // Should be true ! - assert + assert // Should be false byte "hello" byte "hello" int 0 @@ -28,10 +28,10 @@ main_block@0: int 0 byte "bonjour" callsub is_in_tuple_2 - uncover 1 - assert + swap + assert // Should be true ! - assert + assert // Should be false byte 0x1d65e22bcbbf byte 0x1d65e22bcbbf byte 0x07acf5cae41e @@ -42,10 +42,10 @@ main_block@0: byte 0x1d65e22bcbbf byte 0x07acf5cae41e callsub is_in_tuple_3 - uncover 1 - assert + swap + assert // Should be true ! - assert + assert // Should be false int 1 return diff --git a/examples/contains/out/contract_MyContract.cssa.ir b/examples/contains/out/contract_MyContract.cssa.ir index 4f7d3f7309..c6bdc146d7 100644 --- a/examples/contains/out/contract_MyContract.cssa.ir +++ b/examples/contains/out/contract_MyContract.cssa.ir @@ -13,8 +13,7 @@ contract examples.contains.contract.MyContract: let tmp%1#0: uint64 = (! two_false#0) (assert tmp%1#0) // Should be false let three_true#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(32323423423423b, 32323423423423b, 8439439483934b) - let tmp%2#0: bytes = (b+ 32323423423423b 32323423423423b) - let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(tmp%2#0, 32323423423423b, 8439439483934b) + let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(64646846846846b, 32323423423423b, 8439439483934b) (assert three_true#0) // Should be true let tmp%3#0: uint64 = (! three_false#0) (assert tmp%3#0) // Should be false diff --git a/examples/contains/out/contract_MyContract.final.ir b/examples/contains/out/contract_MyContract.final.ir index 4f7d3f7309..c6bdc146d7 100644 --- a/examples/contains/out/contract_MyContract.final.ir +++ b/examples/contains/out/contract_MyContract.final.ir @@ -13,8 +13,7 @@ contract examples.contains.contract.MyContract: let tmp%1#0: uint64 = (! two_false#0) (assert tmp%1#0) // Should be false let three_true#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(32323423423423b, 32323423423423b, 8439439483934b) - let tmp%2#0: bytes = (b+ 32323423423423b 32323423423423b) - let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(tmp%2#0, 32323423423423b, 8439439483934b) + let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(64646846846846b, 32323423423423b, 8439439483934b) (assert three_true#0) // Should be true let tmp%3#0: uint64 = (! three_false#0) (assert tmp%3#0) // Should be false diff --git a/examples/contains/out/contract_MyContract.parallel_copies.ir b/examples/contains/out/contract_MyContract.parallel_copies.ir index 4f7d3f7309..c6bdc146d7 100644 --- a/examples/contains/out/contract_MyContract.parallel_copies.ir +++ b/examples/contains/out/contract_MyContract.parallel_copies.ir @@ -13,8 +13,7 @@ contract examples.contains.contract.MyContract: let tmp%1#0: uint64 = (! two_false#0) (assert tmp%1#0) // Should be false let three_true#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(32323423423423b, 32323423423423b, 8439439483934b) - let tmp%2#0: bytes = (b+ 32323423423423b 32323423423423b) - let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(tmp%2#0, 32323423423423b, 8439439483934b) + let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(64646846846846b, 32323423423423b, 8439439483934b) (assert three_true#0) // Should be true let tmp%3#0: uint64 = (! three_false#0) (assert tmp%3#0) // Should be false diff --git a/examples/contains/out/contract_MyContract.post_ssa.ir b/examples/contains/out/contract_MyContract.post_ssa.ir index 4f7d3f7309..c6bdc146d7 100644 --- a/examples/contains/out/contract_MyContract.post_ssa.ir +++ b/examples/contains/out/contract_MyContract.post_ssa.ir @@ -13,8 +13,7 @@ contract examples.contains.contract.MyContract: let tmp%1#0: uint64 = (! two_false#0) (assert tmp%1#0) // Should be false let three_true#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(32323423423423b, 32323423423423b, 8439439483934b) - let tmp%2#0: bytes = (b+ 32323423423423b 32323423423423b) - let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(tmp%2#0, 32323423423423b, 8439439483934b) + let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(64646846846846b, 32323423423423b, 8439439483934b) (assert three_true#0) // Should be true let tmp%3#0: uint64 = (! three_false#0) (assert tmp%3#0) // Should be false diff --git a/examples/contains/out/contract_MyContract.ssa.opt_pass_1.ir b/examples/contains/out/contract_MyContract.ssa.opt_pass_1.ir index 4f7d3f7309..c6bdc146d7 100644 --- a/examples/contains/out/contract_MyContract.ssa.opt_pass_1.ir +++ b/examples/contains/out/contract_MyContract.ssa.opt_pass_1.ir @@ -13,8 +13,7 @@ contract examples.contains.contract.MyContract: let tmp%1#0: uint64 = (! two_false#0) (assert tmp%1#0) // Should be false let three_true#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(32323423423423b, 32323423423423b, 8439439483934b) - let tmp%2#0: bytes = (b+ 32323423423423b 32323423423423b) - let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(tmp%2#0, 32323423423423b, 8439439483934b) + let three_false#0: uint64 = examples.contains.contract.MyContract.is_in_tuple_3(64646846846846b, 32323423423423b, 8439439483934b) (assert three_true#0) // Should be true let tmp%3#0: uint64 = (! three_false#0) (assert tmp%3#0) // Should be false diff --git a/examples/edverify/algopy.log b/examples/edverify/algopy.log new file mode 100644 index 0000000000..94ad72f5d6 --- /dev/null +++ b/examples/edverify/algopy.log @@ -0,0 +1,81 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug edverify +debug: Building AWST for __init__.py +debug: Building AWST for edverify +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for edverify/contract.py +debug: Sealing block@0: // L5 +debug: Terminated block@0: // L5 +debug: Sealing block@None: // ternary_true_L12 +debug: Sealing block@None: // ternary_false_L12 +debug: Terminated block@1: // ternary_true_L12 +debug: Terminated block@2: // ternary_false_L12 +debug: Sealing block@3: // ternary_merge_L12 +debug: Created Phi assignment: let ternary_result%5#2: uint64 = undefined while trying to resolve 'ternary_result%5' in block@3: // ternary_merge_L12 +debug: Added ternary_result%5#0 to Phi node: let ternary_result%5#2: uint64 = φ(ternary_result%5#0 <- block@1) in block@1: // ternary_true_L12 +debug: Added ternary_result%5#1 to Phi node: let ternary_result%5#2: uint64 = φ(ternary_result%5#0 <- block@1, ternary_result%5#1 <- block@2) in block@2: // ternary_false_L12 +debug: Terminated block@3: // ternary_merge_L12 +debug: Sealing block@0: // L15 +debug: Terminated block@0: // L15 +debug: Output IR to /examples/edverify/out/contract_VerifyContract.ssa.ir +info: Optimizing examples.edverify.contract.VerifyContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.edverify.contract.VerifyContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.edverify.contract.VerifyContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 1, ending loop +debug: Output IR to /examples/edverify/out/contract_VerifyContract.cssa.ir +debug: Removing Phis from examples.edverify.contract.VerifyContract.approval_program +debug: Removing Phis from examples.edverify.contract.VerifyContract.clear_state_program +debug: Output IR to /examples/edverify/out/contract_VerifyContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.edverify.contract.VerifyContract.approval_program +debug: Sequentializing parallel copies in examples.edverify.contract.VerifyContract.clear_state_program +debug: Output IR to /examples/edverify/out/contract_VerifyContract.parallel_copies.ir +debug: Coalescing local variables in examples.edverify.contract.VerifyContract.approval_program using strategy RootOperandGrouping +debug: Coalescing ternary_result%5#0 with [ternary_result%5#5, ternary_result%5#1, ternary_result%5#2] +debug: Coalescing resulted in 7 replacement/s +debug: Coalescing local variables in examples.edverify.contract.VerifyContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/edverify/out/contract_VerifyContract.final.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_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[8]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[20]: 'store result#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[22]: 'load result#0' with 'load result#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[15]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[19]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[13]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[19]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_block@0.ops[11]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[19]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_ternary_merge@3.ops[2]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_ternary_merge@3.ops[4]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.edverify.contract.VerifyContract.approval_program +debug: Allocated 1 variable/s to x-stack: ternary_result%5#0 +debug: shared x-stack for main_ternary_true@1 -> main_ternary_merge@3: ternary_result%5#0 +debug: shared x-stack for main_ternary_false@2 -> main_ternary_merge@3: ternary_result%5#0 +debug: Simplified uncover 2; uncover 2; uncover 2 to +info: Writing edverify/out/contract.approval.teal +info: Writing edverify/out/contract.approval.debug.teal +info: Writing edverify/out/contract.clear.teal +info: Writing edverify/out/contract.clear.debug.teal +>> exit code = 0 \ No newline at end of file diff --git a/examples/edverify/contract.py b/examples/edverify/contract.py new file mode 100644 index 0000000000..4d10ee0608 --- /dev/null +++ b/examples/edverify/contract.py @@ -0,0 +1,16 @@ +from algopy import Contract, ed25519verify_bare, Transaction, itob, log, UInt64 + + +class VerifyContract(Contract): + def approval_program(self) -> bool: + assert Transaction.num_app_args() == 3 + result = ed25519verify_bare( + Transaction.application_args(0), + Transaction.application_args(1), + Transaction.application_args(2), + ) + log(itob(UInt64(1) if result else UInt64(0))) + return True + + def clear_state_program(self) -> bool: + return True diff --git a/examples/edverify/out/contract.approval.debug.teal b/examples/edverify/out/contract.approval.debug.teal new file mode 100644 index 0000000000..dcb1524880 --- /dev/null +++ b/examples/edverify/out/contract.approval.debug.teal @@ -0,0 +1,31 @@ +// Op // Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.edverify.contract.VerifyContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} Transaction.num_app_args() File "edverify/contract.py", line 6 + int 3 // tmp%0#0,3 3 File "edverify/contract.py", line 6 + == // {==} Transaction.num_app_args() == 3 File "edverify/contract.py", line 6 + assert // assert Transaction.num_app_args() == 3 File "edverify/contract.py", line 6 + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "edverify/contract.py", line 8 + txna ApplicationArgs 1 // tmp%2#0,{txna} Transaction.application_args(1) File "edverify/contract.py", line 9 + txna ApplicationArgs 2 // tmp%2#0,tmp%3#0,{txna} Transaction.application_args(2) File "edverify/contract.py", line 10 + ed25519verify_bare // {ed25519verify_bare} ed25519verify_bare( File "edverify/contract.py", line 7 + bz main_ternary_false@2 // UInt64(1) if result else UInt64(0) File "edverify/contract.py", line 12 + // Implicit fall through to main_ternary_true@1 // UInt64(1) if result else UInt64(0) File "edverify/contract.py", line 12 + +main_ternary_true@1: + int 1 // 1 1 File "edverify/contract.py", line 12 + b main_ternary_merge@3 // (𝕏) ternary_result%5#0 | ternary_result%5#0 + +main_ternary_false@2: + int 0 // 0 0 File "edverify/contract.py", line 12 + // Implicit fall through to main_ternary_merge@3 // (𝕏) ternary_result%5#0 | ternary_result%5#0 + +main_ternary_merge@3: + itob // {itob} ternary_result%5#0 itob(UInt64(1) if result else UInt64(0)) File "edverify/contract.py", line 12 + log // log(itob(UInt64(1) if result else UInt64(0))) File "edverify/contract.py", line 12 + int 1 // 1 True File "edverify/contract.py", line 13 + return // return True File "edverify/contract.py", line 13 + diff --git a/examples/edverify/out/contract.approval.teal b/examples/edverify/out/contract.approval.teal new file mode 100644 index 0000000000..fbf1937bff --- /dev/null +++ b/examples/edverify/out/contract.approval.teal @@ -0,0 +1,27 @@ +#pragma version 8 + +// examples.edverify.contract.VerifyContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs + int 3 + == + assert + txna ApplicationArgs 0 + txna ApplicationArgs 1 + txna ApplicationArgs 2 + ed25519verify_bare + bz main_ternary_false@2 + +main_ternary_true@1: + int 1 + b main_ternary_merge@3 + +main_ternary_false@2: + int 0 + +main_ternary_merge@3: + itob + log + int 1 + return + diff --git a/examples/edverify/out/contract.approval_unoptimized.debug.teal b/examples/edverify/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..dcb1524880 --- /dev/null +++ b/examples/edverify/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,31 @@ +// Op // Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.edverify.contract.VerifyContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} Transaction.num_app_args() File "edverify/contract.py", line 6 + int 3 // tmp%0#0,3 3 File "edverify/contract.py", line 6 + == // {==} Transaction.num_app_args() == 3 File "edverify/contract.py", line 6 + assert // assert Transaction.num_app_args() == 3 File "edverify/contract.py", line 6 + txna ApplicationArgs 0 // {txna} Transaction.application_args(0) File "edverify/contract.py", line 8 + txna ApplicationArgs 1 // tmp%2#0,{txna} Transaction.application_args(1) File "edverify/contract.py", line 9 + txna ApplicationArgs 2 // tmp%2#0,tmp%3#0,{txna} Transaction.application_args(2) File "edverify/contract.py", line 10 + ed25519verify_bare // {ed25519verify_bare} ed25519verify_bare( File "edverify/contract.py", line 7 + bz main_ternary_false@2 // UInt64(1) if result else UInt64(0) File "edverify/contract.py", line 12 + // Implicit fall through to main_ternary_true@1 // UInt64(1) if result else UInt64(0) File "edverify/contract.py", line 12 + +main_ternary_true@1: + int 1 // 1 1 File "edverify/contract.py", line 12 + b main_ternary_merge@3 // (𝕏) ternary_result%5#0 | ternary_result%5#0 + +main_ternary_false@2: + int 0 // 0 0 File "edverify/contract.py", line 12 + // Implicit fall through to main_ternary_merge@3 // (𝕏) ternary_result%5#0 | ternary_result%5#0 + +main_ternary_merge@3: + itob // {itob} ternary_result%5#0 itob(UInt64(1) if result else UInt64(0)) File "edverify/contract.py", line 12 + log // log(itob(UInt64(1) if result else UInt64(0))) File "edverify/contract.py", line 12 + int 1 // 1 True File "edverify/contract.py", line 13 + return // return True File "edverify/contract.py", line 13 + diff --git a/examples/edverify/out/contract.approval_unoptimized.teal b/examples/edverify/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..fbf1937bff --- /dev/null +++ b/examples/edverify/out/contract.approval_unoptimized.teal @@ -0,0 +1,27 @@ +#pragma version 8 + +// examples.edverify.contract.VerifyContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs + int 3 + == + assert + txna ApplicationArgs 0 + txna ApplicationArgs 1 + txna ApplicationArgs 2 + ed25519verify_bare + bz main_ternary_false@2 + +main_ternary_true@1: + int 1 + b main_ternary_merge@3 + +main_ternary_false@2: + int 0 + +main_ternary_merge@3: + itob + log + int 1 + return + diff --git a/examples/edverify/out/contract.awst b/examples/edverify/out/contract.awst new file mode 100644 index 0000000000..aeb650aec7 --- /dev/null +++ b/examples/edverify/out/contract.awst @@ -0,0 +1,15 @@ +contract VerifyContract +{ + approval_program(): bool + { + assert(txn() == 3u) + result: bool = ed25519verify_bare(txna(), txna(), txna()) + log(itob((result) ? (1u) : (0u))) + return true + } + + clear_state_program(): bool + { + return true + } +} \ No newline at end of file diff --git a/examples/edverify/out/contract.clear.debug.teal b/examples/edverify/out/contract.clear.debug.teal new file mode 100644 index 0000000000..46aba07505 --- /dev/null +++ b/examples/edverify/out/contract.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "edverify/contract.py", line 16 + return // return True File "edverify/contract.py", line 16 + diff --git a/examples/edverify/out/contract.clear.teal b/examples/edverify/out/contract.clear.teal new file mode 100644 index 0000000000..6d98e0dedd --- /dev/null +++ b/examples/edverify/out/contract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/edverify/out/contract.clear_unoptimized.debug.teal b/examples/edverify/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..46aba07505 --- /dev/null +++ b/examples/edverify/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "edverify/contract.py", line 16 + return // return True File "edverify/contract.py", line 16 + diff --git a/examples/edverify/out/contract.clear_unoptimized.teal b/examples/edverify/out/contract.clear_unoptimized.teal new file mode 100644 index 0000000000..6d98e0dedd --- /dev/null +++ b/examples/edverify/out/contract.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/edverify/out/contract_VerifyContract.cssa.ir b/examples/edverify/out/contract_VerifyContract.cssa.ir new file mode 100644 index 0000000000..e25a9fccd3 --- /dev/null +++ b/examples/edverify/out/contract_VerifyContract.cssa.ir @@ -0,0 +1,31 @@ +contract examples.edverify.contract.VerifyContract: + program approval: + subroutine examples.edverify.contract.VerifyContract.approval_program() -> uint64: + block@0: // L5 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: uint64 = (== tmp%0#0 3u) + (assert tmp%1#0) + let tmp%2#0: bytes = (txna ApplicationArgs 0) + let tmp%3#0: bytes = (txna ApplicationArgs 1) + let tmp%4#0: bytes = (txna ApplicationArgs 2) + let result#0: uint64 = (ed25519verify_bare tmp%2#0 tmp%3#0 tmp%4#0) + goto result#0 ? block@1 : block@2 + block@1: // ternary_true_L12 + let ternary_result%5#0: uint64 = 1u + let ternary_result%5#3: uint64 = ternary_result%5#0 + goto block@3 + block@2: // ternary_false_L12 + let ternary_result%5#1: uint64 = 0u + let ternary_result%5#4: uint64 = ternary_result%5#1 + goto block@3 + block@3: // ternary_merge_L12 + let ternary_result%5#5: uint64 = φ(ternary_result%5#3 <- block@1, ternary_result%5#4 <- block@2) + let ternary_result%5#2: uint64 = ternary_result%5#5 + let tmp%6#0: bytes = (itob ternary_result%5#2) + (log tmp%6#0) + return 1u + + program clear-state: + subroutine examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: + block@0: // L15 + return 1u \ No newline at end of file diff --git a/examples/edverify/out/contract_VerifyContract.final.ir b/examples/edverify/out/contract_VerifyContract.final.ir new file mode 100644 index 0000000000..747cf063b0 --- /dev/null +++ b/examples/edverify/out/contract_VerifyContract.final.ir @@ -0,0 +1,27 @@ +contract examples.edverify.contract.VerifyContract: + program approval: + subroutine examples.edverify.contract.VerifyContract.approval_program() -> uint64: + block@0: // L5 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: uint64 = (== tmp%0#0 3u) + (assert tmp%1#0) + let tmp%2#0: bytes = (txna ApplicationArgs 0) + let tmp%3#0: bytes = (txna ApplicationArgs 1) + let tmp%4#0: bytes = (txna ApplicationArgs 2) + let result#0: uint64 = (ed25519verify_bare tmp%2#0 tmp%3#0 tmp%4#0) + goto result#0 ? block@1 : block@2 + block@1: // ternary_true_L12 + let ternary_result%5#0: uint64 = 1u + goto block@3 + block@2: // ternary_false_L12 + let ternary_result%5#0: uint64 = 0u + goto block@3 + block@3: // ternary_merge_L12 + let tmp%6#0: bytes = (itob ternary_result%5#0) + (log tmp%6#0) + return 1u + + program clear-state: + subroutine examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: + block@0: // L15 + return 1u \ No newline at end of file diff --git a/examples/edverify/out/contract_VerifyContract.final_unoptimized.ir b/examples/edverify/out/contract_VerifyContract.final_unoptimized.ir new file mode 100644 index 0000000000..747cf063b0 --- /dev/null +++ b/examples/edverify/out/contract_VerifyContract.final_unoptimized.ir @@ -0,0 +1,27 @@ +contract examples.edverify.contract.VerifyContract: + program approval: + subroutine examples.edverify.contract.VerifyContract.approval_program() -> uint64: + block@0: // L5 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: uint64 = (== tmp%0#0 3u) + (assert tmp%1#0) + let tmp%2#0: bytes = (txna ApplicationArgs 0) + let tmp%3#0: bytes = (txna ApplicationArgs 1) + let tmp%4#0: bytes = (txna ApplicationArgs 2) + let result#0: uint64 = (ed25519verify_bare tmp%2#0 tmp%3#0 tmp%4#0) + goto result#0 ? block@1 : block@2 + block@1: // ternary_true_L12 + let ternary_result%5#0: uint64 = 1u + goto block@3 + block@2: // ternary_false_L12 + let ternary_result%5#0: uint64 = 0u + goto block@3 + block@3: // ternary_merge_L12 + let tmp%6#0: bytes = (itob ternary_result%5#0) + (log tmp%6#0) + return 1u + + program clear-state: + subroutine examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: + block@0: // L15 + return 1u \ No newline at end of file diff --git a/examples/edverify/out/contract_VerifyContract.parallel_copies.ir b/examples/edverify/out/contract_VerifyContract.parallel_copies.ir new file mode 100644 index 0000000000..692e3b9218 --- /dev/null +++ b/examples/edverify/out/contract_VerifyContract.parallel_copies.ir @@ -0,0 +1,30 @@ +contract examples.edverify.contract.VerifyContract: + program approval: + subroutine examples.edverify.contract.VerifyContract.approval_program() -> uint64: + block@0: // L5 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: uint64 = (== tmp%0#0 3u) + (assert tmp%1#0) + let tmp%2#0: bytes = (txna ApplicationArgs 0) + let tmp%3#0: bytes = (txna ApplicationArgs 1) + let tmp%4#0: bytes = (txna ApplicationArgs 2) + let result#0: uint64 = (ed25519verify_bare tmp%2#0 tmp%3#0 tmp%4#0) + goto result#0 ? block@1 : block@2 + block@1: // ternary_true_L12 + let ternary_result%5#0: uint64 = 1u + let ternary_result%5#5: uint64 = ternary_result%5#0 + goto block@3 + block@2: // ternary_false_L12 + let ternary_result%5#1: uint64 = 0u + let ternary_result%5#5: uint64 = ternary_result%5#1 + goto block@3 + block@3: // ternary_merge_L12 + let ternary_result%5#2: uint64 = ternary_result%5#5 + let tmp%6#0: bytes = (itob ternary_result%5#2) + (log tmp%6#0) + return 1u + + program clear-state: + subroutine examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: + block@0: // L15 + return 1u \ No newline at end of file diff --git a/examples/edverify/out/contract_VerifyContract.post_ssa.ir b/examples/edverify/out/contract_VerifyContract.post_ssa.ir new file mode 100644 index 0000000000..692e3b9218 --- /dev/null +++ b/examples/edverify/out/contract_VerifyContract.post_ssa.ir @@ -0,0 +1,30 @@ +contract examples.edverify.contract.VerifyContract: + program approval: + subroutine examples.edverify.contract.VerifyContract.approval_program() -> uint64: + block@0: // L5 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: uint64 = (== tmp%0#0 3u) + (assert tmp%1#0) + let tmp%2#0: bytes = (txna ApplicationArgs 0) + let tmp%3#0: bytes = (txna ApplicationArgs 1) + let tmp%4#0: bytes = (txna ApplicationArgs 2) + let result#0: uint64 = (ed25519verify_bare tmp%2#0 tmp%3#0 tmp%4#0) + goto result#0 ? block@1 : block@2 + block@1: // ternary_true_L12 + let ternary_result%5#0: uint64 = 1u + let ternary_result%5#5: uint64 = ternary_result%5#0 + goto block@3 + block@2: // ternary_false_L12 + let ternary_result%5#1: uint64 = 0u + let ternary_result%5#5: uint64 = ternary_result%5#1 + goto block@3 + block@3: // ternary_merge_L12 + let ternary_result%5#2: uint64 = ternary_result%5#5 + let tmp%6#0: bytes = (itob ternary_result%5#2) + (log tmp%6#0) + return 1u + + program clear-state: + subroutine examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: + block@0: // L15 + return 1u \ No newline at end of file diff --git a/examples/edverify/out/contract_VerifyContract.ssa.ir b/examples/edverify/out/contract_VerifyContract.ssa.ir new file mode 100644 index 0000000000..d775e2e54b --- /dev/null +++ b/examples/edverify/out/contract_VerifyContract.ssa.ir @@ -0,0 +1,28 @@ +contract examples.edverify.contract.VerifyContract: + program approval: + subroutine examples.edverify.contract.VerifyContract.approval_program() -> uint64: + block@0: // L5 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: uint64 = (== tmp%0#0 3u) + (assert tmp%1#0) + let tmp%2#0: bytes = (txna ApplicationArgs 0) + let tmp%3#0: bytes = (txna ApplicationArgs 1) + let tmp%4#0: bytes = (txna ApplicationArgs 2) + let result#0: uint64 = (ed25519verify_bare tmp%2#0 tmp%3#0 tmp%4#0) + goto result#0 ? block@1 : block@2 + block@1: // ternary_true_L12 + let ternary_result%5#0: uint64 = 1u + goto block@3 + block@2: // ternary_false_L12 + let ternary_result%5#1: uint64 = 0u + goto block@3 + block@3: // ternary_merge_L12 + let ternary_result%5#2: uint64 = φ(ternary_result%5#0 <- block@1, ternary_result%5#1 <- block@2) + let tmp%6#0: bytes = (itob ternary_result%5#2) + (log tmp%6#0) + return 1u + + program clear-state: + subroutine examples.edverify.contract.VerifyContract.clear_state_program() -> uint64: + block@0: // L15 + return 1u \ No newline at end of file diff --git a/examples/edverify/out/edverify.O0.log b/examples/edverify/out/edverify.O0.log new file mode 100644 index 0000000000..04a4441f19 --- /dev/null +++ b/examples/edverify/out/edverify.O0.log @@ -0,0 +1,17 @@ +PC Teal Stack +1 +4 txn NumAppArgs 3 +6 int 3 3, 3 +8 == 1 +9 assert +10 txna ApplicationArgs 0 "random bytes" +13 txna ApplicationArgs 1 "random bytes", 0x0D34CE0AD320CBFE069CA655E7E8ACE82B9E186E72959FA1C1D64F6533318335098662E052E3ECC7FECCF985CF7C05CD07D7F2F29F10657ECE2AAF283E6C9C02 +16 txna ApplicationArgs 2 "random bytes", 0x0D34CE0AD320CBFE069CA655E7E8ACE82B9E186E72959FA1C1D64F6533318335098662E052E3ECC7FECCF985CF7C05CD07D7F2F29F10657ECE2AAF283E6C9C02, 0x0163BBB3B13D7BBA7CF64D0AC52AB4A3D34811AC88762B27C00BD0376B0E5A81 +19 ed25519verify_bare 1 +20 bz main_ternary_false@2 +23 int 1 1 +24 b main_ternary_merge@3 1 +29 itob 0x0000000000000001 +30 log +31 int 1 1 +32 return 1 \ No newline at end of file diff --git a/examples/edverify/out/edverify.O1.log b/examples/edverify/out/edverify.O1.log new file mode 100644 index 0000000000..04a4441f19 --- /dev/null +++ b/examples/edverify/out/edverify.O1.log @@ -0,0 +1,17 @@ +PC Teal Stack +1 +4 txn NumAppArgs 3 +6 int 3 3, 3 +8 == 1 +9 assert +10 txna ApplicationArgs 0 "random bytes" +13 txna ApplicationArgs 1 "random bytes", 0x0D34CE0AD320CBFE069CA655E7E8ACE82B9E186E72959FA1C1D64F6533318335098662E052E3ECC7FECCF985CF7C05CD07D7F2F29F10657ECE2AAF283E6C9C02 +16 txna ApplicationArgs 2 "random bytes", 0x0D34CE0AD320CBFE069CA655E7E8ACE82B9E186E72959FA1C1D64F6533318335098662E052E3ECC7FECCF985CF7C05CD07D7F2F29F10657ECE2AAF283E6C9C02, 0x0163BBB3B13D7BBA7CF64D0AC52AB4A3D34811AC88762B27C00BD0376B0E5A81 +19 ed25519verify_bare 1 +20 bz main_ternary_false@2 +23 int 1 1 +24 b main_ternary_merge@3 1 +29 itob 0x0000000000000001 +30 log +31 int 1 1 +32 return 1 \ No newline at end of file diff --git a/examples/edverify/out/edverify.O2.log b/examples/edverify/out/edverify.O2.log new file mode 100644 index 0000000000..04a4441f19 --- /dev/null +++ b/examples/edverify/out/edverify.O2.log @@ -0,0 +1,17 @@ +PC Teal Stack +1 +4 txn NumAppArgs 3 +6 int 3 3, 3 +8 == 1 +9 assert +10 txna ApplicationArgs 0 "random bytes" +13 txna ApplicationArgs 1 "random bytes", 0x0D34CE0AD320CBFE069CA655E7E8ACE82B9E186E72959FA1C1D64F6533318335098662E052E3ECC7FECCF985CF7C05CD07D7F2F29F10657ECE2AAF283E6C9C02 +16 txna ApplicationArgs 2 "random bytes", 0x0D34CE0AD320CBFE069CA655E7E8ACE82B9E186E72959FA1C1D64F6533318335098662E052E3ECC7FECCF985CF7C05CD07D7F2F29F10657ECE2AAF283E6C9C02, 0x0163BBB3B13D7BBA7CF64D0AC52AB4A3D34811AC88762B27C00BD0376B0E5A81 +19 ed25519verify_bare 1 +20 bz main_ternary_false@2 +23 int 1 1 +24 b main_ternary_merge@3 1 +29 itob 0x0000000000000001 +30 log +31 int 1 1 +32 return 1 \ No newline at end of file diff --git a/examples/enumeration/algopy.log b/examples/enumeration/algopy.log index f8a4a17838..c58e35a37b 100644 --- a/examples/enumeration/algopy.log +++ b/examples/enumeration/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 enumeration -info: Building AWST for __init__.py -info: Building AWST for enumeration -info: Building AWST for enumeration/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug enumeration +debug: Building AWST for __init__.py +debug: Building AWST for enumeration +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for enumeration/contract.py debug: Sealing block@0: // L33 debug: Terminated block@0: // L33 debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@1: // for_header_L38 @@ -321,8 +322,6 @@ debug: Sealing block@0: // L68 debug: Terminated block@0: // L68 debug: Looking for 'item_index_internal%1' in an unsealed block creating an incomplete Phi: block@1: // for_header_L73 debug: Created Phi assignment: let item_index_internal%1#1: uint64 = undefined while trying to resolve 'item_index_internal%1' in block@1: // for_header_L73 -debug: Looking for 'bytes_length%0' in an unsealed block creating an incomplete Phi: block@1: // for_header_L73 -debug: Created Phi assignment: let bytes_length%0#1: uint64 = undefined while trying to resolve 'bytes_length%0' in block@1: // for_header_L73 debug: Terminated block@1: // for_header_L73 debug: Sealing block@None: // for_body_L73 debug: Looking for 'iteration_count' in an unsealed block creating an incomplete Phi: block@1: // for_header_L73 @@ -336,11 +335,6 @@ debug: Terminated block@3: // for_footer_L73 debug: Sealing block@1: // for_header_L73 debug: Added item_index_internal%1#0 to Phi node: let item_index_internal%1#1: uint64 = φ(item_index_internal%1#0 <- block@0) in block@0: // L68 debug: Added item_index_internal%1#2 to Phi node: let item_index_internal%1#1: uint64 = φ(item_index_internal%1#0 <- block@0, item_index_internal%1#2 <- block@3) in block@3: // for_footer_L73 -debug: Added bytes_length%0#0 to Phi node: let bytes_length%0#1: uint64 = φ(bytes_length%0#0 <- block@0) in block@0: // L68 -debug: Added bytes_length%0#1 to Phi node: let bytes_length%0#1: uint64 = φ(bytes_length%0#0 <- block@0, bytes_length%0#1 <- block@3) in block@3: // for_footer_L73 -debug: Replacing trivial Phi node: let bytes_length%0#1: uint64 = φ(bytes_length%0#0 <- block@0, bytes_length%0#1 <- block@3) (bytes_length%0#1) with bytes_length%0#0 -debug: Deleting Phi assignment: let bytes_length%0#1: uint64 = φ(bytes_length%0#0 <- block@0, bytes_length%0#1 <- block@3) -debug: Replaced trivial Phi node: let bytes_length%0#1: uint64 = φ(bytes_length%0#0 <- block@0, bytes_length%0#1 <- block@3) (bytes_length%0#1) with bytes_length%0#0 in current definition for 3 blocks debug: Added iteration_count#0 to Phi node: let iteration_count#1: uint64 = φ(iteration_count#0 <- block@0) in block@0: // L68 debug: Added iteration_count#2 to Phi node: let iteration_count#1: uint64 = φ(iteration_count#0 <- block@0, iteration_count#2 <- block@3) in block@3: // for_footer_L73 debug: Added item_concat#0 to Phi node: let item_concat#1: bytes = φ(item_concat#0 <- block@0) in block@0: // L68 @@ -354,8 +348,6 @@ debug: Replaced trivial Phi node: let bytes#1: bytes = φ(bytes#0 <- block@0, by debug: Terminated block@4: // after_for_L73 debug: Looking for 'item_index_internal%4' in an unsealed block creating an incomplete Phi: block@5: // for_header_L76 debug: Created Phi assignment: let item_index_internal%4#1: uint64 = undefined while trying to resolve 'item_index_internal%4' in block@5: // for_header_L76 -debug: Looking for 'bytes_length%3' in an unsealed block creating an incomplete Phi: block@5: // for_header_L76 -debug: Created Phi assignment: let bytes_length%3#1: uint64 = undefined while trying to resolve 'bytes_length%3' in block@5: // for_header_L76 debug: Terminated block@5: // for_header_L76 debug: Sealing block@None: // for_body_L76 debug: Looking for 'iteration_count' in an unsealed block creating an incomplete Phi: block@5: // for_header_L76 @@ -371,11 +363,6 @@ debug: Terminated block@7: // for_footer_L76 debug: Sealing block@5: // for_header_L76 debug: Added item_index_internal%4#0 to Phi node: let item_index_internal%4#1: uint64 = φ(item_index_internal%4#0 <- block@4) in block@4: // after_for_L73 debug: Added item_index_internal%4#2 to Phi node: let item_index_internal%4#1: uint64 = φ(item_index_internal%4#0 <- block@4, item_index_internal%4#2 <- block@7) in block@7: // for_footer_L76 -debug: Added bytes_length%3#0 to Phi node: let bytes_length%3#1: uint64 = φ(bytes_length%3#0 <- block@4) in block@4: // after_for_L73 -debug: Added bytes_length%3#1 to Phi node: let bytes_length%3#1: uint64 = φ(bytes_length%3#0 <- block@4, bytes_length%3#1 <- block@7) in block@7: // for_footer_L76 -debug: Replacing trivial Phi node: let bytes_length%3#1: uint64 = φ(bytes_length%3#0 <- block@4, bytes_length%3#1 <- block@7) (bytes_length%3#1) with bytes_length%3#0 -debug: Deleting Phi assignment: let bytes_length%3#1: uint64 = φ(bytes_length%3#0 <- block@4, bytes_length%3#1 <- block@7) -debug: Replaced trivial Phi node: let bytes_length%3#1: uint64 = φ(bytes_length%3#0 <- block@4, bytes_length%3#1 <- block@7) (bytes_length%3#1) with bytes_length%3#0 in current definition for 3 blocks debug: Added iteration_count#1 to Phi node: let iteration_count#3: uint64 = φ(iteration_count#1 <- block@4) in block@4: // after_for_L73 debug: Added iteration_count#4 to Phi node: let iteration_count#3: uint64 = φ(iteration_count#1 <- block@4, iteration_count#4 <- block@7) in block@7: // for_footer_L76 debug: Added item_concat#1 to Phi node: let item_concat#3: bytes = φ(item_concat#1 <- block@4) in block@4: // after_for_L73 @@ -419,6 +406,7 @@ debug: Found equivalence set: tuple_assignment%13#0, item_concat#1 debug: Replacing {tuple_assignment%13#0} with item_concat#1 made 1 modifications debug: Found equivalence set: tuple_assignment%14#0, index_sum#2 debug: Replacing {tuple_assignment%14#0} with index_sum#2 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -437,6 +425,7 @@ debug: Found equivalence set: range_item%2#1, item#1 debug: Replacing {range_item%2#1} with item#1 made 3 modifications debug: Found equivalence set: range_index%3#1, index#0 debug: Replacing {range_index%3#1} with index#0 made 2 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -461,6 +450,7 @@ debug: Found equivalence set: tup.3#0, item#3, item#8 debug: Replacing {item#3, item#8} with tup.3#0 made 2 modifications debug: Found equivalence set: tuple_index%1#1, index#0 debug: Replacing {tuple_index%1#1} with index#0 made 3 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -493,6 +483,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: item_index_internal%4#1, index#0 debug: Replacing {item_index_internal%4#1} with index#0 made 4 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -507,6 +498,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -518,6 +510,7 @@ debug: Optimizing subroutine examples.enumeration.contract.EnumerationContract.a debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -527,6 +520,7 @@ debug: Optimizing subroutine examples.enumeration.contract.enumerate_urange debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -536,6 +530,7 @@ debug: Optimizing subroutine examples.enumeration.contract.enumerate_tuple debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -551,6 +546,7 @@ debug: Optimizing subroutine examples.enumeration.contract.enumerate_bytes debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -560,6 +556,7 @@ debug: Optimizing subroutine examples.enumeration.contract.EnumerationContract.c debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -972,105 +969,105 @@ debug: Coalescing local variables in examples.enumeration.contract.EnumerationCo debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/enumeration/out/contract_EnumerationContract.final.ir debug: Inserted main_block@0.ops[6]: 'store iteration_count#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[8]: 'load iteration_count#0 from scratch' with 'load iteration_count#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[8]: 'load iteration_count#0' with 'load iteration_count#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[11]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[13]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[13]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[18]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[20]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[20]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[25]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[27]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[27]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[36]: 'store iteration_count#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[38]: 'load iteration_count#0 from scratch' with 'load iteration_count#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[38]: 'load iteration_count#0' with 'load iteration_count#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[41]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[43]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[43]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[48]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[50]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[50]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[55]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[57]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[57]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[63]: 'store iteration_count#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[65]: 'load iteration_count#0 from scratch' with 'load iteration_count#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[65]: 'load iteration_count#0' with 'load iteration_count#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[68]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[70]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[70]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[75]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[77]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[77]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[82]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[84]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[84]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[5]: 'store item_sum#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[16]: 'load item_sum#0 from scratch' with 'load item_sum#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[16]: 'load item_sum#0' with 'load item_sum#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[36]: 'store item_concat#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[47]: 'load item_concat#0 from scratch' with 'load item_concat#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[47]: 'load item_concat#0' with 'load item_concat#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[64]: 'store item_concat#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[75]: 'load item_concat#0 from scratch' with 'load item_concat#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[75]: 'load item_concat#0' with 'load item_concat#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[4]: 'store index_sum#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[24]: 'load index_sum#0 from scratch' with 'load index_sum#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[24]: 'load index_sum#0' with 'load index_sum#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[36]: 'store index_sum#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[56]: 'load index_sum#0 from scratch' with 'load index_sum#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[56]: 'load index_sum#0' with 'load index_sum#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[65]: 'store index_sum#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[85]: 'load index_sum#0 from scratch' with 'load index_sum#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[85]: 'load index_sum#0' with 'load index_sum#0 from l-stack (no copy)' debug: Inserted enumerate_urange_for_header@1.ops[3]: 'store continue_looping%1#0 to l-stack (copy)' -debug: Replaced enumerate_urange_for_header@1.ops[5]: 'load continue_looping%1#0 from scratch' with 'load continue_looping%1#0 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_header@1.ops[5]: 'load continue_looping%1#0' with 'load continue_looping%1#0 from l-stack (no copy)' debug: Inserted enumerate_urange_for_body@2.ops[11]: 'store range_item%0#2 to l-stack (copy)' -debug: Replaced enumerate_urange_for_body@2.ops[13]: 'load range_item%0#2 from scratch' with 'load range_item%0#2 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_body@2.ops[13]: 'load range_item%0#2' with 'load range_item%0#2 from l-stack (no copy)' debug: Inserted enumerate_urange_for_body@2.ops[6]: 'store item#0 to l-stack (copy)' -debug: Replaced enumerate_urange_for_body@2.ops[9]: 'load item#0 from scratch' with 'load item#0 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_body@2.ops[9]: 'load item#0' with 'load item#0 from l-stack (no copy)' debug: Inserted enumerate_urange_after_for@4.ops[1]: 'store range_index%3#0 to l-stack (copy)' -debug: Replaced enumerate_urange_after_for@4.ops[5]: 'load range_index%3#0 from scratch' with 'load range_index%3#0 from l-stack (no copy)' +debug: Replaced enumerate_urange_after_for@4.ops[5]: 'load range_index%3#0' with 'load range_index%3#0 from l-stack (no copy)' debug: Inserted enumerate_urange_for_header@5.ops[3]: 'store continue_looping%4#0 to l-stack (copy)' -debug: Replaced enumerate_urange_for_header@5.ops[5]: 'load continue_looping%4#0 from scratch' with 'load continue_looping%4#0 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_header@5.ops[5]: 'load continue_looping%4#0' with 'load continue_looping%4#0 from l-stack (no copy)' debug: Inserted enumerate_urange_for_body@6.ops[19]: 'store range_index%3#0 to l-stack (copy)' -debug: Replaced enumerate_urange_for_body@6.ops[23]: 'load range_index%3#0 from scratch' with 'load range_index%3#0 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_body@6.ops[23]: 'load range_index%3#0' with 'load range_index%3#0 from l-stack (no copy)' debug: Inserted enumerate_urange_for_body@6.ops[15]: 'store range_item%2#2 to l-stack (copy)' -debug: Replaced enumerate_urange_for_body@6.ops[22]: 'load range_item%2#2 from scratch' with 'load range_item%2#2 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_body@6.ops[22]: 'load range_item%2#2' with 'load range_item%2#2 from l-stack (no copy)' debug: Inserted enumerate_urange_for_body@6.ops[6]: 'store item#0 to l-stack (copy)' -debug: Replaced enumerate_urange_for_body@6.ops[13]: 'load item#0 from scratch' with 'load item#0 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_body@6.ops[13]: 'load item#0' with 'load item#0 from l-stack (no copy)' debug: Inserted enumerate_urange_for_body@6.ops[11]: 'store index#0 to l-stack (copy)' -debug: Replaced enumerate_urange_for_body@6.ops[19]: 'load index#0 from scratch' with 'load index#0 from l-stack (no copy)' +debug: Replaced enumerate_urange_for_body@6.ops[19]: 'load index#0' with 'load index#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.enumeration.contract.enumerate_urange debug: examples.enumeration.contract.enumerate_urange f-stack entry: ['index#0'] debug: examples.enumeration.contract.enumerate_urange f-stack on first store: ['iteration_count#0', 'item_sum#0', 'index_sum#0', 'item#0'] debug: Inserted enumerate_tuple_for_body@5.ops[9]: 'store tuple_index%0#0 to l-stack (copy)' -debug: Replaced enumerate_tuple_for_body@5.ops[13]: 'load tuple_index%0#0 from scratch' with 'load tuple_index%0#0 from l-stack (no copy)' +debug: Replaced enumerate_tuple_for_body@5.ops[13]: 'load tuple_index%0#0' with 'load tuple_index%0#0 from l-stack (no copy)' debug: Inserted enumerate_tuple_after_for@7.ops[1]: 'store tuple_index%1#0 to l-stack (copy)' -debug: Replaced enumerate_tuple_after_for@7.ops[3]: 'load tuple_index%1#0 from scratch' with 'load tuple_index%1#0 from l-stack (no copy)' +debug: Replaced enumerate_tuple_after_for@7.ops[3]: 'load tuple_index%1#0' with 'load tuple_index%1#0 from l-stack (no copy)' debug: Inserted enumerate_tuple_for_body@12.ops[10]: 'store index#0 to l-stack (copy)' -debug: Replaced enumerate_tuple_for_body@12.ops[13]: 'load index#0 from scratch' with 'load index#0 from l-stack (no copy)' +debug: Replaced enumerate_tuple_for_body@12.ops[13]: 'load index#0' with 'load index#0 from l-stack (no copy)' debug: Inserted enumerate_tuple_for_body@12.ops[14]: 'store index#0 to l-stack (copy)' -debug: Replaced enumerate_tuple_for_body@12.ops[18]: 'load index#0 from scratch' with 'load index#0 from l-stack (no copy)' +debug: Replaced enumerate_tuple_for_body@12.ops[18]: 'load index#0' with 'load index#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.enumeration.contract.enumerate_tuple -debug: Eliminated scratch slots for 2 variable/s: index#0, tuple_index%0#0 -info: shared x-stack for enumerate_tuple_block@0 -> enumerate_tuple_for_body@5: tuple_index%0#0 -info: shared x-stack for enumerate_tuple_for_header_1@2 -> enumerate_tuple_for_body@5: tuple_index%0#0 -info: shared x-stack for enumerate_tuple_for_header_2@3 -> enumerate_tuple_for_body@5: tuple_index%0#0 -info: shared x-stack for enumerate_tuple_for_header_3@4 -> enumerate_tuple_for_body@5: tuple_index%0#0 -info: shared x-stack for enumerate_tuple_after_for@7 -> enumerate_tuple_for_body@12: index#0 -info: shared x-stack for enumerate_tuple_for_header_1@9 -> enumerate_tuple_for_body@12: index#0 -info: shared x-stack for enumerate_tuple_for_header_2@10 -> enumerate_tuple_for_body@12: index#0 -info: shared x-stack for enumerate_tuple_for_header_3@11 -> enumerate_tuple_for_body@12: index#0 +debug: Allocated 2 variable/s to x-stack: index#0, tuple_index%0#0 +debug: shared x-stack for enumerate_tuple_block@0 -> enumerate_tuple_for_body@5: tuple_index%0#0 +debug: shared x-stack for enumerate_tuple_for_header_1@2 -> enumerate_tuple_for_body@5: tuple_index%0#0 +debug: shared x-stack for enumerate_tuple_for_header_2@3 -> enumerate_tuple_for_body@5: tuple_index%0#0 +debug: shared x-stack for enumerate_tuple_for_header_3@4 -> enumerate_tuple_for_body@5: tuple_index%0#0 +debug: shared x-stack for enumerate_tuple_after_for@7 -> enumerate_tuple_for_body@12: index#0 +debug: shared x-stack for enumerate_tuple_for_header_1@9 -> enumerate_tuple_for_body@12: index#0 +debug: shared x-stack for enumerate_tuple_for_header_2@10 -> enumerate_tuple_for_body@12: index#0 +debug: shared x-stack for enumerate_tuple_for_header_3@11 -> enumerate_tuple_for_body@12: index#0 debug: examples.enumeration.contract.enumerate_tuple f-stack entry: ['tuple_index%0#5', 'tuple_index%1#0'] debug: examples.enumeration.contract.enumerate_tuple f-stack on first store: ['iteration_count#0', 'item_concat#0', 'index_sum#0', 'item#4'] debug: Inserted enumerate_bytes_for_header@1.ops[3]: 'store continue_looping%2#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_header@1.ops[5]: 'load continue_looping%2#0 from scratch' with 'load continue_looping%2#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_header@1.ops[5]: 'load continue_looping%2#0' with 'load continue_looping%2#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_for_body@2.ops[4]: 'store item#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_body@2.ops[11]: 'load item#0 from scratch' with 'load item#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_body@2.ops[11]: 'load item#0' with 'load item#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_for_body@2.ops[2]: 'store item_index_internal%1#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_body@2.ops[15]: 'load item_index_internal%1#0 from scratch' with 'load item_index_internal%1#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_body@2.ops[15]: 'load item_index_internal%1#0' with 'load item_index_internal%1#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_after_for@4.ops[4]: 'store item_index_internal%4#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_after_for@4.ops[6]: 'load item_index_internal%4#0 from scratch' with 'load item_index_internal%4#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_after_for@4.ops[6]: 'load item_index_internal%4#0' with 'load item_index_internal%4#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_for_header@5.ops[3]: 'store continue_looping%5#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_header@5.ops[5]: 'load continue_looping%5#0 from scratch' with 'load continue_looping%5#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_header@5.ops[5]: 'load continue_looping%5#0' with 'load continue_looping%5#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_for_body@6.ops[20]: 'store item_index_internal%4#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_body@6.ops[22]: 'load item_index_internal%4#0 from scratch' with 'load item_index_internal%4#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_body@6.ops[22]: 'load item_index_internal%4#0' with 'load item_index_internal%4#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_for_body@6.ops[15]: 'store index#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_body@6.ops[18]: 'load index#0 from scratch' with 'load index#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_body@6.ops[18]: 'load index#0' with 'load index#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_for_body@6.ops[4]: 'store item#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_body@6.ops[11]: 'load item#0 from scratch' with 'load item#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_body@6.ops[11]: 'load item#0' with 'load item#0 from l-stack (no copy)' debug: Inserted enumerate_bytes_for_body@6.ops[2]: 'store index#0 to l-stack (copy)' -debug: Replaced enumerate_bytes_for_body@6.ops[16]: 'load index#0 from scratch' with 'load index#0 from l-stack (no copy)' +debug: Replaced enumerate_bytes_for_body@6.ops[16]: 'load index#0' with 'load index#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.enumeration.contract.enumerate_bytes debug: examples.enumeration.contract.enumerate_bytes f-stack entry: ['bytes_length%3#0', 'index#0'] debug: examples.enumeration.contract.enumerate_bytes f-stack on first store: ['iteration_count#0', 'item_concat#0', 'index_sum#0', 'bytes_length%0#0', 'item_index_internal%1#0'] -info: Writing /examples/enumeration/out/contract.approval.teal -info: Writing /examples/enumeration/out/contract.approval.debug.teal -info: Writing /examples/enumeration/out/contract.clear.teal -info: Writing /examples/enumeration/out/contract.clear.debug.teal +info: Writing enumeration/out/contract.approval.teal +info: Writing enumeration/out/contract.approval.debug.teal +info: Writing enumeration/out/contract.clear.teal +info: Writing enumeration/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/enumeration/out/contract.approval.debug.teal b/examples/enumeration/out/contract.approval.debug.teal index afa7cb1667..0da2908469 100644 --- a/examples/enumeration/out/contract.approval.debug.teal +++ b/examples/enumeration/out/contract.approval.debug.teal @@ -9,7 +9,7 @@ main_block@0: int 5 // 10,21,5 5 File "enumeration/contract.py", line 6 callsub enumerate_urange // {enumerate_urange}.0,{enumerate_urange}.1,{enumerate_urange}.2 enumerate_urange(UInt64(10), UInt64(21), UInt64(5)) File "enumeration/contract.py", line 6 cover 2 // store index_sum#0 to l-stack (no copy) index_sum#0,{enumerate_urange}.0,{enumerate_urange}.1 index_sum File "enumeration/contract.py", line 6 - cover 1 // store item_sum#0 to l-stack (no copy) index_sum#0,item_sum#0,{enumerate_urange}.0 item_sum File "enumeration/contract.py", line 6 + swap // store item_sum#0 to l-stack (no copy) index_sum#0,item_sum#0,{enumerate_urange}.0 item_sum File "enumeration/contract.py", line 6 int 6 // index_sum#0,item_sum#0,iteration_count#0,6 6 File "enumeration/contract.py", line 8 == // index_sum#0,item_sum#0,{==} iteration_count == 6 File "enumeration/contract.py", line 8 assert // index_sum#0,item_sum#0 assert iteration_count == 6 File "enumeration/contract.py", line 8 @@ -25,7 +25,7 @@ main_block@0: byte "Cow" // "How","Now","Brown","Cow" b"Cow" File "enumeration/contract.py", line 13 callsub enumerate_tuple // {enumerate_tuple}.0,{enumerate_tuple}.1,{enumerate_tuple}.2 enumerate_tuple( File "enumeration/contract.py", line 12 cover 2 // store index_sum#0 to l-stack (no copy) index_sum#0,{enumerate_tuple}.0,{enumerate_tuple}.1 index_sum File "enumeration/contract.py", line 6 - cover 1 // store item_concat#0 to l-stack (no copy) index_sum#0,item_concat#0,{enumerate_tuple}.0 item_concat File "enumeration/contract.py", line 12 + swap // store item_concat#0 to l-stack (no copy) index_sum#0,item_concat#0,{enumerate_tuple}.0 item_concat File "enumeration/contract.py", line 12 int 8 // index_sum#0,item_concat#0,iteration_count#0,8 8 File "enumeration/contract.py", line 16 == // index_sum#0,item_concat#0,{==} iteration_count == 8 File "enumeration/contract.py", line 16 assert // index_sum#0,item_concat#0 assert iteration_count == 8 File "enumeration/contract.py", line 16 @@ -38,7 +38,7 @@ main_block@0: byte "abcdefg" // "abcdefg" b"abcdefg" File "enumeration/contract.py", line 20 callsub enumerate_bytes // {enumerate_bytes}.0,{enumerate_bytes}.1,{enumerate_bytes}.2 enumerate_bytes((Bytes(b"abcdefg"))) File "enumeration/contract.py", line 20 cover 2 // store index_sum#0 to l-stack (no copy) index_sum#0,{enumerate_bytes}.0,{enumerate_bytes}.1 index_sum File "enumeration/contract.py", line 6 - cover 1 // store item_concat#0 to l-stack (no copy) index_sum#0,item_concat#0,{enumerate_bytes}.0 item_concat File "enumeration/contract.py", line 12 + swap // store item_concat#0 to l-stack (no copy) index_sum#0,item_concat#0,{enumerate_bytes}.0 item_concat File "enumeration/contract.py", line 12 int 14 // index_sum#0,item_concat#0,iteration_count#0,14 14 File "enumeration/contract.py", line 22 == // index_sum#0,item_concat#0,{==} iteration_count == 14 File "enumeration/contract.py", line 22 assert // index_sum#0,item_concat#0 assert iteration_count == 14 File "enumeration/contract.py", line 22 @@ -120,10 +120,10 @@ enumerate_urange_for_body@6: frame_bury 3 // store index_sum#0 to f-stack (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | index#0,item#0 index_sum File "enumeration/contract.py", line 36 frame_dig -1 // load step#0 from parameters (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | index#0,item#0,step#0 step: UInt64 File "enumeration/contract.py", line 33 + // (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | index#0,{+} urange(start, stop, step) File "enumeration/contract.py", line 42 - uncover 1 // load index#0 from l-stack (no copy) (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | range_item%2#2,index#0 index File "enumeration/contract.py", line 42 + swap // load index#0 from l-stack (no copy) (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | range_item%2#2,index#0 index File "enumeration/contract.py", line 42 int 1 // (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | range_item%2#2,index#0,1 + // (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | range_item%2#2,{+} - uncover 1 // load range_item%2#2 from l-stack (no copy) (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | range_index%3#0,range_item%2#2 item File "enumeration/contract.py", line 42 + swap // load range_item%2#2 from l-stack (no copy) (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | range_index%3#0,range_item%2#2 item File "enumeration/contract.py", line 42 frame_bury 4 // store item#0 to f-stack (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | range_index%3#0 item File "enumeration/contract.py", line 38 frame_bury 0 // store index#0 to f-stack (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | index File "enumeration/contract.py", line 42 b enumerate_urange_for_header@5 // (𝕡) start#0,stop#0,step#0 | (𝕗) index#0,iteration_count#0,item_sum#0,index_sum#0,item#0 | @@ -150,7 +150,7 @@ enumerate_tuple_block@0: int 0 // (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0 | 0 0 File "enumeration/contract.py", line 54 int 0 // (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0 | 0 frame_dig -4 // load tup.0#0 from parameters (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0 | (𝕏) tuple_index%0#0 | tup.0#0 tup: tuple[Bytes, Bytes, Bytes, Bytes] File "enumeration/contract.py", line 51 - cover 1 // store item#4 to f-stack (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | (𝕏) tuple_index%0#0 | + swap // store item#4 to f-stack (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | (𝕏) tuple_index%0#0 | b enumerate_tuple_for_body@5 // (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | (𝕏) tuple_index%0#0 | tuple_index%0#0 enumerate_tuple_for_header_1@2: @@ -221,7 +221,7 @@ enumerate_tuple_for_body@12: concat // (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | (𝕏) index#0 | {concat} item_concat += item File "enumeration/contract.py", line 61 frame_bury 3 // store item_concat#0 to f-stack (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | (𝕏) index#0 | item_concat File "enumeration/contract.py", line 53 frame_dig 4 // load index_sum#0 from f-stack (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | (𝕏) index#0 | index_sum#0 index_sum File "enumeration/contract.py", line 54 - uncover 1 // load index#0 from x-stack (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | index_sum#0,index#0 index File "enumeration/contract.py", line 59 + swap // load index#0 from x-stack (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | index_sum#0,index#0 index File "enumeration/contract.py", line 59 dup cover 2 // store index#0 to l-stack (copy) (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | index#0,index_sum#0,index#0 index File "enumeration/contract.py", line 59 + // (𝕡) tup.0#0,tup.1#0,tup.2#0,tup.3#0 | (𝕗) tuple_index%0#5,tuple_index%1#0,iteration_count#0,item_concat#0,index_sum#0,item#4 | index#0,{+} index_sum += index File "enumeration/contract.py", line 62 @@ -277,7 +277,7 @@ enumerate_bytes_for_body@2: + // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0,item#0,{+} iteration_count += 1 File "enumeration/contract.py", line 74 frame_bury 2 // store iteration_count#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0,item#0 iteration_count File "enumeration/contract.py", line 69 frame_dig 3 // load item_concat#0 from f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0,item#0,item_concat#0 item_concat File "enumeration/contract.py", line 70 - uncover 1 // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0,item_concat#0,item#0 item File "enumeration/contract.py", line 73 + swap // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0,item_concat#0,item#0 item File "enumeration/contract.py", line 73 concat // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0,{concat} item_concat += item File "enumeration/contract.py", line 75 frame_bury 3 // store item_concat#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0 item_concat File "enumeration/contract.py", line 70 int 1 // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_index_internal%1#0,1 @@ -312,7 +312,7 @@ enumerate_bytes_for_body@6: + // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item#0,{+} iteration_count += 1 File "enumeration/contract.py", line 77 frame_bury 2 // store iteration_count#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item#0 iteration_count File "enumeration/contract.py", line 69 frame_dig 3 // load item_concat#0 from f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item#0,item_concat#0 item_concat File "enumeration/contract.py", line 70 - uncover 1 // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item_concat#0,item#0 item File "enumeration/contract.py", line 73 + swap // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item_concat#0,item#0 item File "enumeration/contract.py", line 73 concat // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,{concat} item_concat += item File "enumeration/contract.py", line 78 frame_bury 3 // store item_concat#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0 item_concat File "enumeration/contract.py", line 70 frame_dig 4 // load index_sum#0 from f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,index#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,index_sum#0 index_sum File "enumeration/contract.py", line 71 diff --git a/examples/enumeration/out/contract.approval.teal b/examples/enumeration/out/contract.approval.teal index cdfd0607a9..d910b65b02 100644 --- a/examples/enumeration/out/contract.approval.teal +++ b/examples/enumeration/out/contract.approval.teal @@ -7,7 +7,7 @@ main_block@0: int 5 callsub enumerate_urange cover 2 - cover 1 + swap int 6 == assert @@ -23,7 +23,7 @@ main_block@0: byte "Cow" callsub enumerate_tuple cover 2 - cover 1 + swap int 8 == assert @@ -36,7 +36,7 @@ main_block@0: byte "abcdefg" callsub enumerate_bytes cover 2 - cover 1 + swap int 14 == assert @@ -114,10 +114,10 @@ enumerate_urange_for_body@6: frame_bury 3 frame_dig -1 + - uncover 1 + swap int 1 + - uncover 1 + swap frame_bury 4 frame_bury 0 b enumerate_urange_for_header@5 @@ -144,7 +144,7 @@ enumerate_tuple_block@0: int 0 int 0 frame_dig -4 - cover 1 + swap b enumerate_tuple_for_body@5 enumerate_tuple_for_header_1@2: @@ -212,7 +212,7 @@ enumerate_tuple_for_body@12: concat frame_bury 3 frame_dig 4 - uncover 1 + swap dup cover 2 + @@ -265,7 +265,7 @@ enumerate_bytes_for_body@2: + frame_bury 2 frame_dig 3 - uncover 1 + swap concat frame_bury 3 int 1 @@ -298,7 +298,7 @@ enumerate_bytes_for_body@6: + frame_bury 2 frame_dig 3 - uncover 1 + swap concat frame_bury 3 frame_dig 4 diff --git a/examples/enumeration/out/contract.approval_unoptimized.debug.teal b/examples/enumeration/out/contract.approval_unoptimized.debug.teal index b217f23544..61a4f6c363 100644 --- a/examples/enumeration/out/contract.approval_unoptimized.debug.teal +++ b/examples/enumeration/out/contract.approval_unoptimized.debug.teal @@ -10,7 +10,7 @@ main_block@0: callsub enumerate_urange // {enumerate_urange}.0,{enumerate_urange}.1,{enumerate_urange}.2 enumerate_urange(UInt64(10), UInt64(21), UInt64(5)) File "enumeration/contract.py", line 6 cover 2 // store tuple_assignment%2#0 to l-stack (no copy) tuple_assignment%2#0,{enumerate_urange}.0,{enumerate_urange}.1 enumerate_urange(UInt64(10), UInt64(21), UInt64(5)) File "enumeration/contract.py", line 6 cover 2 // store item_sum#0 to l-stack (no copy) item_sum#0,tuple_assignment%2#0,iteration_count#0 item_sum File "enumeration/contract.py", line 6 - uncover 1 // load tuple_assignment%2#0 from l-stack (no copy) item_sum#0,iteration_count#0,tuple_assignment%2#0 enumerate_urange(UInt64(10), UInt64(21), UInt64(5)) File "enumeration/contract.py", line 6 + swap // load tuple_assignment%2#0 from l-stack (no copy) item_sum#0,iteration_count#0,tuple_assignment%2#0 enumerate_urange(UInt64(10), UInt64(21), UInt64(5)) File "enumeration/contract.py", line 6 cover 2 // store index_sum#0 to l-stack (no copy) index_sum#0,item_sum#0,iteration_count#0 index_sum File "enumeration/contract.py", line 6 int 6 // index_sum#0,item_sum#0,iteration_count#0,6 6 File "enumeration/contract.py", line 8 == // index_sum#0,item_sum#0,{==} iteration_count == 6 File "enumeration/contract.py", line 8 @@ -28,7 +28,7 @@ main_block@0: callsub enumerate_tuple // {enumerate_tuple}.0,{enumerate_tuple}.1,{enumerate_tuple}.2 enumerate_tuple( File "enumeration/contract.py", line 12 cover 2 // store tuple_assignment%8#0 to l-stack (no copy) tuple_assignment%8#0,{enumerate_tuple}.0,{enumerate_tuple}.1 enumerate_tuple( File "enumeration/contract.py", line 12 cover 2 // store item_concat#0 to l-stack (no copy) item_concat#0,tuple_assignment%8#0,iteration_count#0 item_concat File "enumeration/contract.py", line 12 - uncover 1 // load tuple_assignment%8#0 from l-stack (no copy) item_concat#0,iteration_count#0,tuple_assignment%8#0 enumerate_tuple( File "enumeration/contract.py", line 12 + swap // load tuple_assignment%8#0 from l-stack (no copy) item_concat#0,iteration_count#0,tuple_assignment%8#0 enumerate_tuple( File "enumeration/contract.py", line 12 cover 2 // store index_sum#0 to l-stack (no copy) index_sum#0,item_concat#0,iteration_count#0 index_sum File "enumeration/contract.py", line 6 int 8 // index_sum#0,item_concat#0,iteration_count#0,8 8 File "enumeration/contract.py", line 16 == // index_sum#0,item_concat#0,{==} iteration_count == 8 File "enumeration/contract.py", line 16 @@ -43,7 +43,7 @@ main_block@0: callsub enumerate_bytes // {enumerate_bytes}.0,{enumerate_bytes}.1,{enumerate_bytes}.2 enumerate_bytes((Bytes(b"abcdefg"))) File "enumeration/contract.py", line 20 cover 2 // store tuple_assignment%14#0 to l-stack (no copy) tuple_assignment%14#0,{enumerate_bytes}.0,{enumerate_bytes}.1 enumerate_bytes((Bytes(b"abcdefg"))) File "enumeration/contract.py", line 20 cover 2 // store item_concat#0 to l-stack (no copy) item_concat#0,tuple_assignment%14#0,iteration_count#0 item_concat File "enumeration/contract.py", line 12 - uncover 1 // load tuple_assignment%14#0 from l-stack (no copy) item_concat#0,iteration_count#0,tuple_assignment%14#0 enumerate_bytes((Bytes(b"abcdefg"))) File "enumeration/contract.py", line 20 + swap // load tuple_assignment%14#0 from l-stack (no copy) item_concat#0,iteration_count#0,tuple_assignment%14#0 enumerate_bytes((Bytes(b"abcdefg"))) File "enumeration/contract.py", line 20 cover 2 // store index_sum#0 to l-stack (no copy) index_sum#0,item_concat#0,iteration_count#0 index_sum File "enumeration/contract.py", line 6 int 14 // index_sum#0,item_concat#0,iteration_count#0,14 14 File "enumeration/contract.py", line 22 == // index_sum#0,item_concat#0,{==} iteration_count == 14 File "enumeration/contract.py", line 22 @@ -113,7 +113,7 @@ enumerate_urange_for_header@5: enumerate_urange_for_body@6: frame_dig 1 // load range_item%2#0 from f-stack (𝕡) start#0,stop#0,step#0 | (𝕗) range_index%3#0,range_item%2#0,iteration_count#0,item_sum#0,index_sum#0,range_item%0#0 | range_item%2#0 item File "enumeration/contract.py", line 42 frame_dig 0 // load range_index%3#0 from f-stack (𝕡) start#0,stop#0,step#0 | (𝕗) range_index%3#0,range_item%2#0,iteration_count#0,item_sum#0,index_sum#0,range_item%0#0 | item#0,range_index%3#0 index File "enumeration/contract.py", line 42 - cover 1 // store index#0 to l-stack (no copy) (𝕡) start#0,stop#0,step#0 | (𝕗) range_index%3#0,range_item%2#0,iteration_count#0,item_sum#0,index_sum#0,range_item%0#0 | index#0,item#0 index File "enumeration/contract.py", line 42 + swap // store index#0 to l-stack (no copy) (𝕡) start#0,stop#0,step#0 | (𝕗) range_index%3#0,range_item%2#0,iteration_count#0,item_sum#0,index_sum#0,range_item%0#0 | index#0,item#0 index File "enumeration/contract.py", line 42 frame_dig 2 // load iteration_count#0 from f-stack (𝕡) start#0,stop#0,step#0 | (𝕗) range_index%3#0,range_item%2#0,iteration_count#0,item_sum#0,index_sum#0,range_item%0#0 | index#0,item#0,iteration_count#0 iteration_count File "enumeration/contract.py", line 34 int 1 // (𝕡) start#0,stop#0,step#0 | (𝕗) range_index%3#0,range_item%2#0,iteration_count#0,item_sum#0,index_sum#0,range_item%0#0 | index#0,item#0,iteration_count#0,1 1 File "enumeration/contract.py", line 43 + // (𝕡) start#0,stop#0,step#0 | (𝕗) range_index%3#0,range_item%2#0,iteration_count#0,item_sum#0,index_sum#0,range_item%0#0 | index#0,item#0,{+} iteration_count += 1 File "enumeration/contract.py", line 43 @@ -305,7 +305,7 @@ enumerate_bytes_for_body@2: + // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item#0,{+} iteration_count += 1 File "enumeration/contract.py", line 74 frame_bury 2 // store iteration_count#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item#0 iteration_count File "enumeration/contract.py", line 69 frame_dig 3 // load item_concat#0 from f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item#0,item_concat#0 item_concat File "enumeration/contract.py", line 70 - uncover 1 // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_concat#0,item#0 item File "enumeration/contract.py", line 73 + swap // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_concat#0,item#0 item File "enumeration/contract.py", line 73 concat // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | {concat} item_concat += item File "enumeration/contract.py", line 75 frame_bury 3 // store item_concat#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | item_concat File "enumeration/contract.py", line 70 // Implicit fall through to enumerate_bytes_for_footer@3 // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | @@ -344,7 +344,7 @@ enumerate_bytes_for_body@6: + // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item#0,{+} iteration_count += 1 File "enumeration/contract.py", line 77 frame_bury 2 // store iteration_count#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item#0 iteration_count File "enumeration/contract.py", line 69 frame_dig 3 // load item_concat#0 from f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item#0,item_concat#0 item_concat File "enumeration/contract.py", line 70 - uncover 1 // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item_concat#0,item#0 item File "enumeration/contract.py", line 73 + swap // load item#0 from l-stack (no copy) (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,item_concat#0,item#0 item File "enumeration/contract.py", line 73 concat // (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,{concat} item_concat += item File "enumeration/contract.py", line 78 frame_bury 3 // store item_concat#0 to f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0 item_concat File "enumeration/contract.py", line 70 frame_dig 4 // load index_sum#0 from f-stack (𝕡) bytes#0 | (𝕗) bytes_length%3#0,item_index_internal%4#0,iteration_count#0,item_concat#0,index_sum#0,bytes_length%0#0,item_index_internal%1#0 | index#0,index_sum#0 index_sum File "enumeration/contract.py", line 71 diff --git a/examples/enumeration/out/contract.approval_unoptimized.teal b/examples/enumeration/out/contract.approval_unoptimized.teal index fcd03d91ce..e9fc0e2752 100644 --- a/examples/enumeration/out/contract.approval_unoptimized.teal +++ b/examples/enumeration/out/contract.approval_unoptimized.teal @@ -8,7 +8,7 @@ main_block@0: callsub enumerate_urange cover 2 cover 2 - uncover 1 + swap cover 2 int 6 == @@ -26,7 +26,7 @@ main_block@0: callsub enumerate_tuple cover 2 cover 2 - uncover 1 + swap cover 2 int 8 == @@ -41,7 +41,7 @@ main_block@0: callsub enumerate_bytes cover 2 cover 2 - uncover 1 + swap cover 2 int 14 == @@ -106,7 +106,7 @@ enumerate_urange_for_header@5: enumerate_urange_for_body@6: frame_dig 1 frame_dig 0 - cover 1 + swap frame_dig 2 int 1 + @@ -287,7 +287,7 @@ enumerate_bytes_for_body@2: + frame_bury 2 frame_dig 3 - uncover 1 + swap concat frame_bury 3 @@ -323,7 +323,7 @@ enumerate_bytes_for_body@6: + frame_bury 2 frame_dig 3 - uncover 1 + swap concat frame_bury 3 frame_dig 4 diff --git a/examples/everything/algopy.log b/examples/everything/algopy.log index 6fa395a9ba..eabec33a57 100644 --- a/examples/everything/algopy.log +++ b/examples/everything/algopy.log @@ -1,14 +1,624 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 everything -info: Building AWST for __init__.py -info: Building AWST for everything/constants.py -info: Building AWST for everything/__init__.py -info: Building AWST for everything/my_base.py -info: Building AWST for everything/contract.py -everything/contract.py:30 warning: TODO: @abimethod config handling -everything/contract.py:36 warning: TODO: @abimethod config handling -everything/contract.py:45 warning: TODO: @abimethod config handling -everything/contract.py:53 warning: TODO: @abimethod config handling -everything/contract.py:58 warning: TODO: @abimethod config handling -everything/contract.py:25 error: TODO: synthesise approval / clear methods for ARC4 contracts -error: Build failed ->> exit code = 1 \ No newline at end of file +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug everything +debug: Building AWST for __init__.py +debug: Building AWST for everything/constants.py +debug: Building AWST for everything/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for everything/my_base.py +debug: Building AWST for everything/contract.py +debug: Sealing block@0: // L34 +debug: Terminated block@0: // L34 +debug: Sealing block@0: // L70 +debug: Terminated block@0: // L70 +debug: Sealing block@0: // L16 +debug: Terminated block@0: // L16 +debug: Sealing block@0: // L8 +debug: Terminated block@0: // L8 +debug: Sealing block@0: // L40 +debug: Terminated block@0: // L40 +debug: Sealing block@None: // if_body_L42 +debug: Sealing block@None: // else_body_L42 +debug: Terminated block@1: // if_body_L42 +debug: Sealing block@None: // if_body_L44 +debug: Sealing block@None: // else_body_L44 +debug: Terminated block@2: // if_body_L44 +debug: Sealing block@3: // after_if_else_L44 +debug: Terminated block@3: // after_if_else_L44 +debug: Sealing block@4: // after_if_else_L42 +debug: Created Phi assignment: let name#1: bytes = undefined while trying to resolve 'name' in block@4: // after_if_else_L42 +debug: Added name#0 to Phi node: let name#1: bytes = φ(name#0 <- block@0) in block@0: // L40 +debug: Created Phi assignment: let name#2: bytes = undefined while trying to resolve 'name' in block@3: // after_if_else_L44 +debug: Added name#0 to Phi node: let name#2: bytes = φ(name#0 <- block@1) in block@1: // if_body_L42 +debug: Added name#0 to Phi node: let name#2: bytes = φ(name#0 <- block@1, name#0 <- block@2) in block@2: // if_body_L44 +debug: Replacing trivial Phi node: let name#2: bytes = φ(name#0 <- block@1, name#0 <- block@2) (name#2) with name#0 +debug: Deleting Phi assignment: let name#2: bytes = φ(name#0 <- block@1, name#0 <- block@2) +debug: Replaced trivial Phi node: let name#2: bytes = φ(name#0 <- block@1, name#0 <- block@2) (name#2) with name#0 in current definition for 1 blocks +debug: Added name#0 to Phi node: let name#1: bytes = φ(name#0 <- block@0, name#0 <- block@3) in block@3: // after_if_else_L44 +debug: Replacing trivial Phi node: let name#1: bytes = φ(name#0 <- block@0, name#0 <- block@3) (name#1) with name#0 +debug: Deleting Phi assignment: let name#1: bytes = φ(name#0 <- block@0, name#0 <- block@3) +debug: Replaced trivial Phi node: let name#1: bytes = φ(name#0 <- block@0, name#0 <- block@3) (name#1) with name#0 in current definition for 1 blocks +debug: Terminated block@4: // after_if_else_L42 +debug: Sealing block@0: // L19 +debug: Terminated block@0: // L19 +debug: Sealing block@0: // L49 +debug: Terminated block@0: // L49 +debug: Sealing block@None: // if_body_L52 +debug: Sealing block@None: // else_body_L52 +debug: Terminated block@1: // if_body_L52 +debug: Sealing block@2: // after_if_else_L52 +debug: Terminated block@2: // after_if_else_L52 +debug: Sealing block@0: // L57 +debug: Terminated block@0: // L57 +debug: Sealing block@0: // L14 +debug: Terminated block@0: // L14 +debug: Sealing block@0: // L62 +debug: Terminated block@0: // L62 +debug: Sealing block@0: // L74 +debug: Terminated block@0: // L74 +debug: Sealing block@0: // L79 +debug: Terminated block@0: // L79 +debug: Sealing block@0: // L30 +debug: Terminated block@0: // L30 +debug: Sealing block@0: // L29 +debug: Terminated block@0: // L29 +debug: Sealing block@None: // on_create_L30 +debug: Terminated block@1: // on_create_L30 +debug: Sealing block@2: // entrypoint_L30 +debug: Terminated block@2: // entrypoint_L30 +debug: Sealing block@None: // abi_routing_L29 +debug: Sealing block@None: // else_body_L29 +debug: Terminated block@3: // abi_routing_L29 +debug: Sealing block@None: // switch_case_default_L29 +debug: Sealing block@None: // create_route_L33 +debug: Sealing block@None: // register_route_L39 +debug: Sealing block@None: // say_hello_route_L48 +debug: Sealing block@None: // calculate_route_L56 +debug: Sealing block@None: // close_out_route_L61 +debug: Terminated block@4: // create_route_L33 +debug: Terminated block@5: // register_route_L39 +debug: Terminated block@6: // say_hello_route_L48 +debug: Terminated block@7: // calculate_route_L56 +debug: Terminated block@8: // close_out_route_L61 +debug: Terminated block@9: // switch_case_default_L29 +debug: Sealing block@10: // switch_case_next_L29 +debug: Terminated block@10: // switch_case_next_L29 +debug: Sealing block@11: // after_if_else_L29 +debug: Terminated block@11: // after_if_else_L29 +debug: Sealing block@0: // L65 +debug: Terminated block@0: // L65 +debug: Output IR to /examples/everything/out/contract_Everything.ssa.ir +info: Optimizing examples.everything.contract.Everything at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.everything.contract.Everything.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@10: // switch_case_next_L29 with block@9: // switch_case_default_L29 in block@11: // after_if_else_L29 +debug: Merged linear block@10: // switch_case_next_L29 into block@9: // switch_case_default_L29 +debug: Optimizer: Remove Empty Blocks +debug: Removed empty block: block@9: // switch_case_default_L29 +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.create +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything._check_ban_list +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.get_banned +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable addr#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.my_base.MyBase.remember_creator +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.register +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: tuple_assignment%2#0, sender_name#0 +debug: Replacing {tuple_assignment%2#0} with sender_name#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%3#0, sender_name_existed#0 +debug: Replacing {tuple_assignment%3#0} with sender_name_existed#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Removed empty block: block@3: // after_if_else_L44 +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.my_base.multiplicative_identity +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.say_hello +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: tuple_assignment%0#0, name#0 +debug: Replacing {tuple_assignment%0#0} with name#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%1#0, exists#0 +debug: Replacing {tuple_assignment%1#0} with exists#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.calculate +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.my_base.MyMiddleBase.calculate +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.close_out +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything._remove_sender +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.positive_one +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/everything/out/contract_Everything.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.everything.contract.Everything.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.create +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything._check_ban_list +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.get_banned +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.my_base.MyBase.remember_creator +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.register +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.my_base.multiplicative_identity +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.say_hello +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.calculate +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.my_base.MyMiddleBase.calculate +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.close_out +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything._remove_sender +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.positive_one +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.everything.contract.Everything.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 2, ending loop +debug: Output IR to /examples/everything/out/contract_Everything.cssa.ir +debug: Removing Phis from examples.everything.contract.Everything.approval_program +debug: Removing Phis from examples.everything.contract.Everything.create +debug: Removing Phis from examples.everything.contract.Everything._check_ban_list +debug: Removing Phis from examples.everything.contract.get_banned +debug: Removing Phis from examples.everything.my_base.MyBase.remember_creator +debug: Removing Phis from examples.everything.contract.Everything.register +debug: Removing Phis from examples.everything.my_base.multiplicative_identity +debug: Removing Phis from examples.everything.contract.Everything.say_hello +debug: Removing Phis from examples.everything.contract.Everything.calculate +debug: Removing Phis from examples.everything.my_base.MyMiddleBase.calculate +debug: Removing Phis from examples.everything.contract.Everything.close_out +debug: Removing Phis from examples.everything.contract.Everything._remove_sender +debug: Removing Phis from examples.everything.contract.positive_one +debug: Removing Phis from examples.everything.contract.Everything.__init__ +debug: Removing Phis from examples.everything.contract.Everything.clear_state_program +debug: Output IR to /examples/everything/out/contract_Everything.post_ssa.ir +debug: Sequentializing parallel copies in examples.everything.contract.Everything.approval_program +debug: Sequentializing parallel copies in examples.everything.contract.Everything.create +debug: Sequentializing parallel copies in examples.everything.contract.Everything._check_ban_list +debug: Sequentializing parallel copies in examples.everything.contract.get_banned +debug: Sequentializing parallel copies in examples.everything.my_base.MyBase.remember_creator +debug: Sequentializing parallel copies in examples.everything.contract.Everything.register +debug: Sequentializing parallel copies in examples.everything.my_base.multiplicative_identity +debug: Sequentializing parallel copies in examples.everything.contract.Everything.say_hello +debug: Sequentializing parallel copies in examples.everything.contract.Everything.calculate +debug: Sequentializing parallel copies in examples.everything.my_base.MyMiddleBase.calculate +debug: Sequentializing parallel copies in examples.everything.contract.Everything.close_out +debug: Sequentializing parallel copies in examples.everything.contract.Everything._remove_sender +debug: Sequentializing parallel copies in examples.everything.contract.positive_one +debug: Sequentializing parallel copies in examples.everything.contract.Everything.__init__ +debug: Sequentializing parallel copies in examples.everything.contract.Everything.clear_state_program +debug: Output IR to /examples/everything/out/contract_Everything.parallel_copies.ir +debug: Coalescing local variables in examples.everything.contract.Everything.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything.create using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything._check_ban_list using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.get_banned using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.my_base.MyBase.remember_creator using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything.register using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.my_base.multiplicative_identity using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything.say_hello using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything.calculate using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.my_base.MyMiddleBase.calculate using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything.close_out using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything._remove_sender using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.positive_one using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.everything.contract.Everything.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/everything/out/contract_Everything.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@3.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_abi_routing@3.ops[8]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[5]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[7]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[10]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[12]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[14]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[16]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_register_route@5.ops[5]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_register_route@5.ops[7]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_register_route@5.ops[10]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_register_route@5.ops[12]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_register_route@5.ops[15]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_register_route@5.ops[17]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_register_route@5.ops[20]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_register_route@5.ops[22]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_register_route@5.ops[1]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_register_route@5.ops[4]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_say_hello_route@6.ops[1]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_say_hello_route@6.ops[3]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_say_hello_route@6.ops[5]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_say_hello_route@6.ops[7]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_say_hello_route@6.ops[10]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_say_hello_route@6.ops[12]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_say_hello_route@6.ops[19]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_say_hello_route@6.ops[21]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_say_hello_route@6.ops[15]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_say_hello_route@6.ops[18]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_calculate_route@7.ops[1]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_calculate_route@7.ops[3]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_calculate_route@7.ops[5]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced main_calculate_route@7.ops[7]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted main_calculate_route@7.ops[10]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_calculate_route@7.ops[12]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_calculate_route@7.ops[25]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_calculate_route@7.ops[27]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_calculate_route@7.ops[17]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_calculate_route@7.ops[20]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_calculate_route@7.ops[22]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_calculate_route@7.ops[25]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_calculate_route@7.ops[15]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_calculate_route@7.ops[20]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_close_out_route@8.ops[1]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_close_out_route@8.ops[3]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_close_out_route@8.ops[6]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_close_out_route@8.ops[8]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_close_out_route@8.ops[11]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced main_close_out_route@8.ops[13]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.everything.contract.Everything.approval_program +debug: Inserted _check_ban_list_block@0.ops[7]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced _check_ban_list_block@0.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted _check_ban_list_block@0.ops[3]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced _check_ban_list_block@0.ops[6]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted _check_ban_list_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced _check_ban_list_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted remember_creator_block@0.ops[1]: 'store new_state_value%0#0 to l-stack (copy)' +debug: Replaced remember_creator_block@0.ops[4]: 'load new_state_value%0#0' with 'load new_state_value%0#0 from l-stack (no copy)' +debug: Inserted register_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced register_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted register_block@0.ops[7]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced register_block@0.ops[9]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted register_if_body@1.ops[4]: 'store sender_name_existed#0 to l-stack (copy)' +debug: Replaced register_if_body@1.ops[7]: 'load sender_name_existed#0' with 'load sender_name_existed#0 from l-stack (no copy)' +debug: Inserted register_if_body@2.ops[3]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced register_if_body@2.ops[6]: 'load app_global_get_ex_did_exist%5#0' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted register_if_body@2.ops[9]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced register_if_body@2.ops[12]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted register_if_body@2.ops[14]: 'store new_state_value%7#0 to l-stack (copy)' +debug: Replaced register_if_body@2.ops[17]: 'load new_state_value%7#0' with 'load new_state_value%7#0 from l-stack (no copy)' +debug: Inserted register_if_body@2.ops[5]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced register_if_body@2.ops[12]: 'load app_global_get_ex_value%4#0' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Found 1 edge set/s for examples.everything.contract.Everything.register +debug: Inserted say_hello_block@0.ops[5]: 'store exists#0 to l-stack (copy)' +debug: Replaced say_hello_block@0.ops[8]: 'load exists#0' with 'load exists#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[6]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[8]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[11]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[13]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[15]: 'store length%5#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[17]: 'load length%5#0' with 'load length%5#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[19]: 'store value_as_bytes%6#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[21]: 'load value_as_bytes%6#0' with 'load value_as_bytes%6#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[23]: 'store value_as_uint16%7#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[25]: 'load value_as_uint16%7#0' with 'load value_as_uint16%7#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[28]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[30]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[2]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted say_hello_after_if_else@2.ops[15]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced say_hello_after_if_else@2.ops[28]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Found 1 edge set/s for examples.everything.contract.Everything.say_hello +debug: examples.everything.contract.Everything.say_hello f-stack entry: [] +debug: examples.everything.contract.Everything.say_hello f-stack on first store: ['name#0'] +debug: Inserted calculate_block@0.ops[3]: 'store c#0 to l-stack (copy)' +debug: Replaced calculate_block@0.ops[5]: 'load c#0' with 'load c#0 from l-stack (no copy)' +debug: Inserted calculate_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced calculate_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted calculate_block@0.ops[18]: 'store val_as_bytes%3#0 to l-stack (copy)' +debug: Replaced calculate_block@0.ops[20]: 'load val_as_bytes%3#0' with 'load val_as_bytes%3#0 from l-stack (no copy)' +debug: Inserted calculate_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced calculate_block@0.ops[13]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted calculate_block@0.ops[7]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced calculate_block@0.ops[13]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted MyMiddleBase.calculate_block@0.ops[9]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced MyMiddleBase.calculate_block@0.ops[11]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted MyMiddleBase.calculate_block@0.ops[13]: 'store val_as_bytes%3#0 to l-stack (copy)' +debug: Replaced MyMiddleBase.calculate_block@0.ops[15]: 'load val_as_bytes%3#0' with 'load val_as_bytes%3#0 from l-stack (no copy)' +debug: Inserted MyMiddleBase.calculate_block@0.ops[5]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced MyMiddleBase.calculate_block@0.ops[8]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted MyMiddleBase.calculate_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced MyMiddleBase.calculate_block@0.ops[8]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[9]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[14]: 'store new_state_value%3#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[17]: 'load new_state_value%3#0' with 'load new_state_value%3#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[12]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[9]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[14]: 'store new_state_value%3#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[17]: 'load new_state_value%3#0' with 'load new_state_value%3#0 from l-stack (no copy)' +debug: Inserted _remove_sender_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced _remove_sender_block@0.ops[12]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +info: Writing everything/out/contract.approval.teal +info: Writing everything/out/contract.approval.debug.teal +info: Writing everything/out/contract.clear.teal +info: Writing everything/out/contract.clear.debug.teal +info: Writing everything/out/application.json +>> exit code = 0 \ No newline at end of file diff --git a/examples/everything/contract.py b/examples/everything/contract.py index a973424b73..46d7e8179c 100644 --- a/examples/everything/contract.py +++ b/examples/everything/contract.py @@ -1,5 +1,9 @@ -from algopy import Address, ARC4Contract, Local, OnCompleteAction, Transaction, UInt64, subroutine -from algopy.arc4 import String, abimethod +from algopy import Account, ARC4Contract, Local, OnCompleteAction, Transaction, UInt64, subroutine +from algopy.arc4 import ( + String, + UInt64 as arc4_UInt64, + abimethod, +) from examples.everything.constants import BANNED, EXT_ONE from examples.everything.my_base import MyMiddleBase, multiplicative_identity @@ -9,8 +13,8 @@ @subroutine -def get_banned() -> Address: - addr = Address(BANNED) +def get_banned() -> Account: + addr = Account(BANNED) return addr @@ -32,7 +36,7 @@ def create(self) -> None: self.remember_creator() self.counter = UInt64(ZERO) - @abimethod(allow_actions=["no_op", "opt_in"]) + @abimethod(allow_actions=["NoOp", "OptIn"]) def register(self, name: String) -> None: self._check_ban_list() if Transaction.on_completion() == OnCompleteAction.OptIn: @@ -50,11 +54,11 @@ def say_hello(self) -> String: return String.encode(b"Hello, " + name.decode() + b"!") @abimethod - def calculate(self, a: UInt64, b: UInt64) -> UInt64: + def calculate(self, a: arc4_UInt64, b: arc4_UInt64) -> arc4_UInt64: c = super().calculate(a, b) - return c * b + return arc4_UInt64.encode(c.decode() * b.decode()) - @abimethod(allow_actions=["close_out"]) + @abimethod(allow_actions=["CloseOut"]) def close_out(self) -> None: self._remove_sender() diff --git a/examples/everything/my_base.py b/examples/everything/my_base.py index 65cecbce21..3af7bb1672 100644 --- a/examples/everything/my_base.py +++ b/examples/everything/my_base.py @@ -1,6 +1,6 @@ from abc import ABC -from algopy import Contract, Transaction, UInt64, subroutine +from algopy import Contract, Transaction, subroutine, arc4, UInt64 class MyBase(Contract, ABC): @@ -11,8 +11,8 @@ def remember_creator(self) -> None: class MyMiddleBase(MyBase): @subroutine - def calculate(self, a: UInt64, b: UInt64) -> UInt64: - return a + b + def calculate(self, a: arc4.UInt64, b: arc4.UInt64) -> arc4.UInt64: + return arc4.UInt64(a.decode() + b.decode()) @subroutine diff --git a/examples/everything/out/application.json b/examples/everything/out/application.json new file mode 100644 index 0000000000..b9f134d6c6 --- /dev/null +++ b/examples/everything/out/application.json @@ -0,0 +1,124 @@ +{ + "hints": { + "create()void": { + "call_config": { + "no_op": "CREATE" + } + }, + "register(string)void": { + "call_config": { + "no_op": "CALL", + "opt_in": "CALL" + } + }, + "say_hello()string": { + "call_config": { + "no_op": "CALL" + } + }, + "calculate(uint64,uint64)uint64": { + "call_config": { + "no_op": "CALL" + } + }, + "close_out()void": { + "call_config": { + "close_out": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmV2ZXJ5dGhpbmcuY29udHJhY3QuRXZlcnl0aGluZy5hcHByb3ZhbF9wcm9ncmFtKCkgLT4gdWludDY0OgptYWluX2Jsb2NrQDA6CiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBibnogbWFpbl9lbnRyeXBvaW50QDIKCm1haW5fb25fY3JlYXRlQDE6CiAgICAgICAgY2FsbHN1YiBfX2luaXRfXwoKbWFpbl9lbnRyeXBvaW50QDI6CiAgICAgICAgdHhuIE51bUFwcEFyZ3MKICAgICAgICBieiBtYWluX2FmdGVyX2lmX2Vsc2VAMTEKCm1haW5fYWJpX3JvdXRpbmdAMzoKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAwCiAgICAgICAgbWV0aG9kICJjcmVhdGUoKXZvaWQiCiAgICAgICAgbWV0aG9kICJyZWdpc3RlcihzdHJpbmcpdm9pZCIKICAgICAgICBtZXRob2QgInNheV9oZWxsbygpc3RyaW5nIgogICAgICAgIG1ldGhvZCAiY2FsY3VsYXRlKHVpbnQ2NCx1aW50NjQpdWludDY0IgogICAgICAgIG1ldGhvZCAiY2xvc2Vfb3V0KCl2b2lkIgogICAgICAgIHVuY292ZXIgNQogICAgICAgIG1hdGNoIG1haW5fY3JlYXRlX3JvdXRlQDQgbWFpbl9yZWdpc3Rlcl9yb3V0ZUA1IG1haW5fc2F5X2hlbGxvX3JvdXRlQDYgbWFpbl9jYWxjdWxhdGVfcm91dGVANyBtYWluX2Nsb3NlX291dF9yb3V0ZUA4CiAgICAgICAgYiBtYWluX2FmdGVyX2lmX2Vsc2VAMTEKCm1haW5fY3JlYXRlX3JvdXRlQDQ6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gaXMgY3JlYXRpbmcKICAgICAgICBjYWxsc3ViIGNyZWF0ZQogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX3JlZ2lzdGVyX3JvdXRlQDU6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgIGludCAxCiAgICAgICAgc3dhcAogICAgICAgIHNobAogICAgICAgIGludCAzCiAgICAgICAgJgogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgb25lIG9mIE5vT3AsIE9wdEluCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgICAgIGNhbGxzdWIgcmVnaXN0ZXIKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9zYXlfaGVsbG9fcm91dGVANjoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIGNhbGxzdWIgc2F5X2hlbGxvCiAgICAgICAgYnl0ZSAweDE1MWY3Yzc1CiAgICAgICAgc3dhcAogICAgICAgIGNvbmNhdAogICAgICAgIGxvZwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2NhbGN1bGF0ZV9yb3V0ZUA3OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDIKICAgICAgICBjYWxsc3ViIGNhbGN1bGF0ZQogICAgICAgIGJ5dGUgMHgxNTFmN2M3NQogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBsb2cKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9jbG9zZV9vdXRfcm91dGVAODoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgaW50IENsb3NlT3V0CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIENsb3NlT3V0CiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgY2FsbHN1YiBjbG9zZV9vdXQKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9hZnRlcl9pZl9lbHNlQDExOgogICAgICAgIGVyciAvLyByZWplY3QgdHJhbnNhY3Rpb24KCgovLyBleGFtcGxlcy5ldmVyeXRoaW5nLmNvbnRyYWN0LkV2ZXJ5dGhpbmcuY3JlYXRlKCkgLT4gdm9pZDoKY3JlYXRlOgogICAgICAgIHByb3RvIDAgMAoKY3JlYXRlX2Jsb2NrQDA6CiAgICAgICAgY2FsbHN1YiBfY2hlY2tfYmFuX2xpc3QKICAgICAgICBjYWxsc3ViIHJlbWVtYmVyX2NyZWF0b3IKICAgICAgICBieXRlICJjb3VudGVyIgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5ldmVyeXRoaW5nLmNvbnRyYWN0LkV2ZXJ5dGhpbmcuX2NoZWNrX2Jhbl9saXN0KCkgLT4gdm9pZDoKX2NoZWNrX2Jhbl9saXN0OgogICAgICAgIHByb3RvIDAgMAoKX2NoZWNrX2Jhbl9saXN0X2Jsb2NrQDA6CiAgICAgICAgdHhuIFNlbmRlcgogICAgICAgIGNhbGxzdWIgZ2V0X2Jhbm5lZAogICAgICAgICE9CiAgICAgICAgYXNzZXJ0IC8vIFlvdSBhcmUgYmFubmVkLCBnb29kYnllCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuZXZlcnl0aGluZy5jb250cmFjdC5nZXRfYmFubmVkKCkgLT4gYnl0ZXM6CmdldF9iYW5uZWQ6CiAgICAgICAgcHJvdG8gMCAxCgpnZXRfYmFubmVkX2Jsb2NrQDA6CiAgICAgICAgYWRkciBWQ01KS1dPWTVQNVA3U0tNWkZGT0NFUk9QSkNaT1RJSk1OSVlOVUNLSDdMUk80NUpNSlA2VVlCSUpBCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuZXZlcnl0aGluZy5teV9iYXNlLk15QmFzZS5yZW1lbWJlcl9jcmVhdG9yKCkgLT4gdm9pZDoKcmVtZW1iZXJfY3JlYXRvcjoKICAgICAgICBwcm90byAwIDAKCnJlbWVtYmVyX2NyZWF0b3JfYmxvY2tAMDoKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgYnl0ZSAiY3JlYXRvciIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5ldmVyeXRoaW5nLmNvbnRyYWN0LkV2ZXJ5dGhpbmcucmVnaXN0ZXIobmFtZSMwOiBieXRlcykgLT4gdm9pZDoKcmVnaXN0ZXI6CiAgICAgICAgcHJvdG8gMSAwCgpyZWdpc3Rlcl9ibG9ja0AwOgogICAgICAgIGNhbGxzdWIgX2NoZWNrX2Jhbl9saXN0CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgIGludCBPcHRJbgogICAgICAgID09CiAgICAgICAgYnogcmVnaXN0ZXJfYWZ0ZXJfaWZfZWxzZUA0CgpyZWdpc3Rlcl9pZl9ib2R5QDE6CiAgICAgICAgaW50IDAKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgIm5hbWUiCiAgICAgICAgYXBwX2xvY2FsX2dldF9leAogICAgICAgIHN3YXAKICAgICAgICBwb3AKICAgICAgICBibnogcmVnaXN0ZXJfYWZ0ZXJfaWZfZWxzZUA0CgpyZWdpc3Rlcl9pZl9ib2R5QDI6CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJjb3VudGVyIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGNhbGxzdWIgbXVsdGlwbGljYXRpdmVfaWRlbnRpdHkKICAgICAgICArCiAgICAgICAgYnl0ZSAiY291bnRlciIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKCnJlZ2lzdGVyX2FmdGVyX2lmX2Vsc2VANDoKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgIm5hbWUiCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgYXBwX2xvY2FsX3B1dAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmV2ZXJ5dGhpbmcubXlfYmFzZS5tdWx0aXBsaWNhdGl2ZV9pZGVudGl0eSgpIC0+IHVpbnQ2NDoKbXVsdGlwbGljYXRpdmVfaWRlbnRpdHk6CiAgICAgICAgcHJvdG8gMCAxCgptdWx0aXBsaWNhdGl2ZV9pZGVudGl0eV9ibG9ja0AwOgogICAgICAgIGludCAxCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuZXZlcnl0aGluZy5jb250cmFjdC5FdmVyeXRoaW5nLnNheV9oZWxsbygpIC0+IGJ5dGVzOgpzYXlfaGVsbG86CiAgICAgICAgcHJvdG8gMCAxCgpzYXlfaGVsbG9fYmxvY2tAMDoKICAgICAgICBjYWxsc3ViIF9jaGVja19iYW5fbGlzdAogICAgICAgIGludCAwCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJuYW1lIgogICAgICAgIGFwcF9sb2NhbF9nZXRfZXgKICAgICAgICBibnogc2F5X2hlbGxvX2FmdGVyX2lmX2Vsc2VAMgoKc2F5X2hlbGxvX2lmX2JvZHlAMToKICAgICAgICBieXRlICJceDAwXHgwZkhvd2R5IHN0cmFuZ2VyISIKICAgICAgICBzd2FwCiAgICAgICAgcmV0c3ViCgpzYXlfaGVsbG9fYWZ0ZXJfaWZfZWxzZUAyOgogICAgICAgIGZyYW1lX2RpZyAwCiAgICAgICAgZXh0cmFjdCAyIDAKICAgICAgICBieXRlICJIZWxsbywgIgogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBieXRlICIhIgogICAgICAgIGNvbmNhdAogICAgICAgIGR1cAogICAgICAgIGxlbgogICAgICAgIGl0b2IKICAgICAgICBleHRyYWN0IDYgMgogICAgICAgIHN3YXAKICAgICAgICBjb25jYXQKICAgICAgICBzd2FwCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMuZXZlcnl0aGluZy5jb250cmFjdC5FdmVyeXRoaW5nLmNhbGN1bGF0ZShhIzA6IGJ5dGVzLCBiIzA6IGJ5dGVzKSAtPiBieXRlczoKY2FsY3VsYXRlOgogICAgICAgIHByb3RvIDIgMQoKY2FsY3VsYXRlX2Jsb2NrQDA6CiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgY2FsbHN1YiBNeU1pZGRsZUJhc2UuY2FsY3VsYXRlCiAgICAgICAgYnRvaQogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGJ0b2kKICAgICAgICAqCiAgICAgICAgaXRvYgogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmV2ZXJ5dGhpbmcubXlfYmFzZS5NeU1pZGRsZUJhc2UuY2FsY3VsYXRlKGEjMDogYnl0ZXMsIGIjMDogYnl0ZXMpIC0+IGJ5dGVzOgpNeU1pZGRsZUJhc2UuY2FsY3VsYXRlOgogICAgICAgIHByb3RvIDIgMQoKTXlNaWRkbGVCYXNlLmNhbGN1bGF0ZV9ibG9ja0AwOgogICAgICAgIGZyYW1lX2RpZyAtMgogICAgICAgIGJ0b2kKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBidG9pCiAgICAgICAgKwogICAgICAgIGl0b2IKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5ldmVyeXRoaW5nLmNvbnRyYWN0LkV2ZXJ5dGhpbmcuY2xvc2Vfb3V0KCkgLT4gdm9pZDoKY2xvc2Vfb3V0OgogICAgICAgIHByb3RvIDAgMAoKY2xvc2Vfb3V0X2Jsb2NrQDA6CiAgICAgICAgY2FsbHN1YiBfcmVtb3ZlX3NlbmRlcgogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmV2ZXJ5dGhpbmcuY29udHJhY3QuRXZlcnl0aGluZy5fcmVtb3ZlX3NlbmRlcigpIC0+IHZvaWQ6Cl9yZW1vdmVfc2VuZGVyOgogICAgICAgIHByb3RvIDAgMAoKX3JlbW92ZV9zZW5kZXJfYmxvY2tAMDoKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImNvdW50ZXIiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgY2FsbHN1YiBwb3NpdGl2ZV9vbmUKICAgICAgICAtCiAgICAgICAgYnl0ZSAiY291bnRlciIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5ldmVyeXRoaW5nLmNvbnRyYWN0LnBvc2l0aXZlX29uZSgpIC0+IHVpbnQ2NDoKcG9zaXRpdmVfb25lOgogICAgICAgIHByb3RvIDAgMQoKcG9zaXRpdmVfb25lX2Jsb2NrQDA6CiAgICAgICAgaW50IDEKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy5ldmVyeXRoaW5nLmNvbnRyYWN0LkV2ZXJ5dGhpbmcuX19pbml0X18oKSAtPiB2b2lkOgpfX2luaXRfXzoKICAgICAgICBwcm90byAwIDAKCl9faW5pdF9fX2Jsb2NrQDA6CiAgICAgICAgcmV0c3ViCgo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLmV2ZXJ5dGhpbmcuY29udHJhY3QuRXZlcnl0aGluZy5jbGVhcl9zdGF0ZV9wcm9ncmFtKCkgLT4gdWludDY0OgptYWluX2Jsb2NrQDA6CiAgICAgICAgY2FsbHN1YiBfcmVtb3ZlX3NlbmRlcgogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgoKLy8gZXhhbXBsZXMuZXZlcnl0aGluZy5jb250cmFjdC5FdmVyeXRoaW5nLl9yZW1vdmVfc2VuZGVyKCkgLT4gdm9pZDoKX3JlbW92ZV9zZW5kZXI6CiAgICAgICAgcHJvdG8gMCAwCgpfcmVtb3ZlX3NlbmRlcl9ibG9ja0AwOgogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiY291bnRlciIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBjYWxsc3ViIHBvc2l0aXZlX29uZQogICAgICAgIC0KICAgICAgICBieXRlICJjb3VudGVyIgogICAgICAgIHN3YXAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLmV2ZXJ5dGhpbmcuY29udHJhY3QucG9zaXRpdmVfb25lKCkgLT4gdWludDY0Ogpwb3NpdGl2ZV9vbmU6CiAgICAgICAgcHJvdG8gMCAxCgpwb3NpdGl2ZV9vbmVfYmxvY2tAMDoKICAgICAgICBpbnQgMQogICAgICAgIHJldHN1YgoK" + }, + "state": { + "global": { + "num_byte_slices": 1, + "num_uints": 1 + }, + "local": { + "num_byte_slices": 1, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "counter": { + "type": "uint64", + "key": "counter" + }, + "creator": { + "type": "bytes", + "key": "creator" + } + }, + "reserved": {} + }, + "local": { + "declared": { + "name": { + "type": "bytes", + "key": "name" + } + }, + "reserved": {} + } + }, + "contract": { + "name": "MyContract", + "methods": [ + { + "name": "create", + "args": [], + "returns": { + "type": "void" + } + }, + { + "name": "register", + "args": [ + { + "type": "string", + "name": "name" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "say_hello", + "args": [], + "returns": { + "type": "string" + } + }, + { + "name": "calculate", + "args": [ + { + "type": "uint64", + "name": "a" + }, + { + "type": "uint64", + "name": "b" + } + ], + "returns": { + "type": "uint64" + } + }, + { + "name": "close_out", + "args": [], + "returns": { + "type": "void" + } + } + ], + "networks": {} + }, + "bare_call_config": {} +} \ No newline at end of file diff --git a/examples/everything/out/contract.approval.debug.teal b/examples/everything/out/contract.approval.debug.teal new file mode 100644 index 0000000000..1dc29bbc88 --- /dev/null +++ b/examples/everything/out/contract.approval.debug.teal @@ -0,0 +1,306 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.everything.contract.Everything.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + bz main_after_if_else@11 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + // Implicit fall through to main_abi_routing@3 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + method "create()void" // tmp%2#0,method<"create()void"> abimethod(create=True) File "everything/contract.py", line 33 + method "register(string)void" // tmp%2#0,method<"create()void">,method<"register(string)void"> abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + method "say_hello()string" // tmp%2#0,method<"create()void">,method<"register(string)void">,method<"say_hello()string"> abimethod File "everything/contract.py", line 48 + method "calculate(uint64,uint64)uint64" // tmp%2#0,method<"create()void">,method<"register(string)void">,method<"say_hello()string">,method<"calculate(uint64,uint64)uint64"> abimethod File "everything/contract.py", line 56 + method "close_out()void" // tmp%2#0,method<"create()void">,method<"register(string)void">,method<"say_hello()string">,method<"calculate(uint64,uint64)uint64">,method<"close_out()void"> abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + uncover 5 // load tmp%2#0 from l-stack (no copy) method<"create()void">,method<"register(string)void">,method<"say_hello()string">,method<"calculate(uint64,uint64)uint64">,method<"close_out()void">,tmp%2#0 class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + match main_create_route@4 main_register_route@5 main_say_hello_route@6 main_calculate_route@7 main_close_out_route@8 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + b main_after_if_else@11 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + +main_create_route@4: + txn OnCompletion // {txn} abimethod(create=True) File "everything/contract.py", line 33 + ! // {!} abimethod(create=True) File "everything/contract.py", line 33 + assert // OnCompletion is NoOp // abimethod(create=True) File "everything/contract.py", line 33 + txn ApplicationID // {txn} abimethod(create=True) File "everything/contract.py", line 33 + ! // {!} abimethod(create=True) File "everything/contract.py", line 33 + assert // is creating // abimethod(create=True) File "everything/contract.py", line 33 + callsub create // abimethod(create=True) File "everything/contract.py", line 33 + int 1 // 1 abimethod(create=True) File "everything/contract.py", line 33 + return // abimethod(create=True) File "everything/contract.py", line 33 + +main_register_route@5: + txn OnCompletion // {txn} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + int 1 // tmp%7#0,1 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + swap // load tmp%7#0 from l-stack (no copy) 1,tmp%7#0 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + shl // {shl} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + int 3 // tmp%8#0,3 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + & // {&} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + assert // OnCompletion is one of NoOp, OptIn // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + txn ApplicationID // {txn} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + assert // is not creating // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + txna ApplicationArgs 1 // {txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + callsub register // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + int 1 // 1 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + return // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + +main_say_hello_route@6: + txn OnCompletion // {txn} abimethod File "everything/contract.py", line 48 + ! // {!} abimethod File "everything/contract.py", line 48 + assert // OnCompletion is NoOp // abimethod File "everything/contract.py", line 48 + txn ApplicationID // {txn} abimethod File "everything/contract.py", line 48 + assert // is not creating // abimethod File "everything/contract.py", line 48 + callsub say_hello // {say_hello} abimethod File "everything/contract.py", line 48 + byte 0x151f7c75 // tmp%15#0,0x151f7c75 abimethod File "everything/contract.py", line 48 + swap // load tmp%15#0 from l-stack (no copy) 0x151f7c75,tmp%15#0 abimethod File "everything/contract.py", line 48 + concat // {concat} abimethod File "everything/contract.py", line 48 + log // abimethod File "everything/contract.py", line 48 + int 1 // 1 abimethod File "everything/contract.py", line 48 + return // abimethod File "everything/contract.py", line 48 + +main_calculate_route@7: + txn OnCompletion // {txn} abimethod File "everything/contract.py", line 56 + ! // {!} abimethod File "everything/contract.py", line 56 + assert // OnCompletion is NoOp // abimethod File "everything/contract.py", line 56 + txn ApplicationID // {txn} abimethod File "everything/contract.py", line 56 + assert // is not creating // abimethod File "everything/contract.py", line 56 + txna ApplicationArgs 1 // {txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + txna ApplicationArgs 2 // tmp%20#0,{txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + callsub calculate // {calculate} abimethod File "everything/contract.py", line 56 + byte 0x151f7c75 // tmp%22#0,0x151f7c75 abimethod File "everything/contract.py", line 56 + swap // load tmp%22#0 from l-stack (no copy) 0x151f7c75,tmp%22#0 abimethod File "everything/contract.py", line 56 + concat // {concat} abimethod File "everything/contract.py", line 56 + log // abimethod File "everything/contract.py", line 56 + int 1 // 1 abimethod File "everything/contract.py", line 56 + return // abimethod File "everything/contract.py", line 56 + +main_close_out_route@8: + txn OnCompletion // {txn} abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + int CloseOut // tmp%24#0,CloseOut abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + == // {==} abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + assert // OnCompletion is CloseOut // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + txn ApplicationID // {txn} abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + assert // is not creating // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + callsub close_out // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + int 1 // 1 abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + return // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + +main_after_if_else@11: + err // reject transaction // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + + +// examples.everything.contract.Everything.create() -> void: +create: + proto 0 0 // def create(self) -> None: File "everything/contract.py", line 34 + +create_block@0: + callsub _check_ban_list // self._check_ban_list() File "everything/contract.py", line 35 + callsub remember_creator // self.remember_creator() File "everything/contract.py", line 36 + byte "counter" // "counter" self.counter File "everything/contract.py", line 37 + int 0 // "counter",0 ZERO File "everything/contract.py", line 37 + app_global_put // self.counter = UInt64(ZERO) File "everything/contract.py", line 37 + retsub // + + +// examples.everything.contract.Everything._check_ban_list() -> void: +_check_ban_list: + proto 0 0 // def _check_ban_list(self) -> None: File "everything/contract.py", line 70 + +_check_ban_list_block@0: + txn Sender // {txn} Transaction.sender() File "everything/contract.py", line 71 + callsub get_banned // tmp%0#0,{get_banned} get_banned() File "everything/contract.py", line 71 + != // {!=} Transaction.sender() != get_banned(), "You are banned, goodbye" File "everything/contract.py", line 71 + assert // You are banned, goodbye // assert Transaction.sender() != get_banned(), "You are banned, goodbye" File "everything/contract.py", line 71 + retsub // + + +// examples.everything.contract.get_banned() -> bytes: +get_banned: + proto 0 1 // def get_banned() -> Account: File "everything/contract.py", line 16 + +get_banned_block@0: + addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA // VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA BANNED File "everything/contract.py", line 17 + retsub // VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA return addr File "everything/contract.py", line 18 + + +// examples.everything.my_base.MyBase.remember_creator() -> void: +remember_creator: + proto 0 0 // def remember_creator(self) -> None: File "everything/my_base.py", line 8 + +remember_creator_block@0: + txn Sender // {txn} Transaction.sender() File "everything/my_base.py", line 9 + byte "creator" // new_state_value%0#0,"creator" self.creator File "everything/my_base.py", line 9 + swap // load new_state_value%0#0 from l-stack (no copy) "creator",new_state_value%0#0 Transaction.sender() File "everything/my_base.py", line 9 + app_global_put // self.creator = Transaction.sender() File "everything/my_base.py", line 9 + retsub // + + +// examples.everything.contract.Everything.register(name#0: bytes) -> void: +register: + proto 1 0 // (𝕡) name#0 | def register(self, name: String) -> None: File "everything/contract.py", line 40 + +register_block@0: + callsub _check_ban_list // (𝕡) name#0 | self._check_ban_list() File "everything/contract.py", line 41 + txn OnCompletion // (𝕡) name#0 | {txn} Transaction.on_completion() File "everything/contract.py", line 42 + int OptIn // (𝕡) name#0 | tmp%0#0,OptIn OnCompleteAction.OptIn File "everything/contract.py", line 42 + == // (𝕡) name#0 | {==} Transaction.on_completion() == OnCompleteAction.OptIn: File "everything/contract.py", line 42 + bz register_after_if_else@4 // (𝕡) name#0 | if Transaction.on_completion() == OnCompleteAction.OptIn: File "everything/contract.py", line 42 + // Implicit fall through to register_if_body@1 // (𝕡) name#0 | if Transaction.on_completion() == OnCompleteAction.OptIn: File "everything/contract.py", line 42 + +register_if_body@1: + int 0 // (𝕡) name#0 | 0 0 File "everything/contract.py", line 43 + int 0 // (𝕡) name#0 | 0,0 self.name.maybe(account=0) File "everything/contract.py", line 43 + byte "name" // (𝕡) name#0 | 0,0,"name" self.name.maybe(account=0) File "everything/contract.py", line 43 + app_local_get_ex // (𝕡) name#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.name.maybe(account=0) File "everything/contract.py", line 43 + swap // store sender_name_existed#0 to l-stack (no copy) (𝕡) name#0 | sender_name_existed#0,{app_local_get_ex}.0 sender_name_existed File "everything/contract.py", line 43 + pop // (𝕡) name#0 | sender_name_existed#0 sender_name File "everything/contract.py", line 43 + bnz register_after_if_else@4 // (𝕡) name#0 | not sender_name_existed File "everything/contract.py", line 44 + // Implicit fall through to register_if_body@2 // (𝕡) name#0 | not sender_name_existed File "everything/contract.py", line 44 + +register_if_body@2: + int 0 // (𝕡) name#0 | 0 self.counter File "everything/contract.py", line 45 + byte "counter" // (𝕡) name#0 | 0,"counter" self.counter File "everything/contract.py", line 45 + app_global_get_ex // (𝕡) name#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "everything/contract.py", line 45 + assert // check value exists // (𝕡) name#0 | app_global_get_ex_value%4#0 self.counter File "everything/contract.py", line 45 + callsub multiplicative_identity // (𝕡) name#0 | app_global_get_ex_value%4#0,{multiplicative_identity} multiplicative_identity() File "everything/contract.py", line 45 + + // (𝕡) name#0 | {+} self.counter += multiplicative_identity() File "everything/contract.py", line 45 + byte "counter" // (𝕡) name#0 | new_state_value%7#0,"counter" self.counter File "everything/contract.py", line 45 + swap // load new_state_value%7#0 from l-stack (no copy) (𝕡) name#0 | "counter",new_state_value%7#0 self.counter += multiplicative_identity() File "everything/contract.py", line 45 + app_global_put // (𝕡) name#0 | self.counter += multiplicative_identity() File "everything/contract.py", line 45 + // Implicit fall through to register_after_if_else@4 // (𝕡) name#0 | + +register_after_if_else@4: + int 0 // (𝕡) name#0 | 0 0 File "everything/contract.py", line 46 + byte "name" // (𝕡) name#0 | 0,"name" self.name[0] File "everything/contract.py", line 46 + frame_dig -1 // load name#0 from parameters (𝕡) name#0 | 0,"name",name#0 name: String File "everything/contract.py", line 40 + app_local_put // (𝕡) name#0 | self.name[0] = name File "everything/contract.py", line 46 + retsub // + + +// examples.everything.my_base.multiplicative_identity() -> uint64: +multiplicative_identity: + proto 0 1 // def multiplicative_identity() -> UInt64: File "everything/my_base.py", line 19 + +multiplicative_identity_block@0: + int 1 // 1 1 File "everything/my_base.py", line 20 + retsub // 1 return UInt64(1) File "everything/my_base.py", line 20 + + +// examples.everything.contract.Everything.say_hello() -> bytes: +say_hello: + proto 0 1 // def say_hello(self) -> String: File "everything/contract.py", line 49 + +say_hello_block@0: + callsub _check_ban_list // self._check_ban_list() File "everything/contract.py", line 50 + int 0 // 0 0 File "everything/contract.py", line 51 + int 0 // 0,0 self.name.maybe(account=0) File "everything/contract.py", line 51 + byte "name" // 0,0,"name" self.name.maybe(account=0) File "everything/contract.py", line 51 + app_local_get_ex // {app_local_get_ex}.0,{app_local_get_ex}.1 self.name.maybe(account=0) File "everything/contract.py", line 51 + bnz say_hello_after_if_else@2 // (𝕗) name#0 | not exists File "everything/contract.py", line 52 + // Implicit fall through to say_hello_if_body@1 // (𝕗) name#0 | not exists File "everything/contract.py", line 52 + +say_hello_if_body@1: + byte "\x00\x0fHowdy stranger!" // (𝕗) name#0 | "\x00\x0fHowdy stranger!" String("Howdy stranger!") File "everything/contract.py", line 53 + swap + retsub // "\x00\x0fHowdy stranger!" return String("Howdy stranger!") File "everything/contract.py", line 53 + +say_hello_after_if_else@2: + frame_dig 0 // load name#0 from f-stack (𝕗) name#0 | name#0 name File "everything/contract.py", line 51 + extract 2 0 // (𝕗) name#0 | {extract} name.decode() File "everything/contract.py", line 54 + byte "Hello, " // (𝕗) name#0 | tmp%2#0,"Hello, " b"Hello, " File "everything/contract.py", line 54 + swap // load tmp%2#0 from l-stack (no copy) (𝕗) name#0 | "Hello, ",tmp%2#0 name.decode() File "everything/contract.py", line 54 + concat // (𝕗) name#0 | {concat} b"Hello, " + name.decode() File "everything/contract.py", line 54 + byte "!" // (𝕗) name#0 | tmp%3#0,"!" b"!" File "everything/contract.py", line 54 + concat // (𝕗) name#0 | {concat} b"Hello, " + name.decode() + b"!" File "everything/contract.py", line 54 + dup // load tmp%4#0 from l-stack (copy) (𝕗) name#0 | tmp%4#0,tmp%4#0 b"Hello, " + name.decode() + b"!" File "everything/contract.py", line 54 + len // (𝕗) name#0 | tmp%4#0,{len} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + itob // (𝕗) name#0 | tmp%4#0,{itob} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + extract 6 2 // (𝕗) name#0 | tmp%4#0,{extract} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + swap // load tmp%4#0 from l-stack (no copy) (𝕗) name#0 | value_as_uint16%7#0,tmp%4#0 b"Hello, " + name.decode() + b"!" File "everything/contract.py", line 54 + concat // (𝕗) name#0 | {concat} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + swap + retsub // tmp%8#0 return String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + + +// examples.everything.contract.Everything.calculate(a#0: bytes, b#0: bytes) -> bytes: +calculate: + proto 2 1 // (𝕡) a#0,b#0 | def calculate(self, a: arc4_UInt64, b: arc4_UInt64) -> arc4_UInt64: File "everything/contract.py", line 57 + +calculate_block@0: + frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | a#0 a: arc4_UInt64 File "everything/contract.py", line 57 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | a#0,b#0 b: arc4_UInt64 File "everything/contract.py", line 57 + callsub MyMiddleBase.calculate // (𝕡) a#0,b#0 | {MyMiddleBase.calculate} super().calculate(a, b) File "everything/contract.py", line 58 + btoi // (𝕡) a#0,b#0 | {btoi} c.decode() File "everything/contract.py", line 59 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | tmp%0#0,b#0 b: arc4_UInt64 File "everything/contract.py", line 57 + btoi // (𝕡) a#0,b#0 | tmp%0#0,{btoi} b.decode() File "everything/contract.py", line 59 + * // (𝕡) a#0,b#0 | {*} c.decode() * b.decode() File "everything/contract.py", line 59 + itob // (𝕡) a#0,b#0 | {itob} arc4_UInt64.encode(c.decode() * b.decode()) File "everything/contract.py", line 59 + retsub // val_as_bytes%3#0 return arc4_UInt64.encode(c.decode() * b.decode()) File "everything/contract.py", line 59 + + +// examples.everything.my_base.MyMiddleBase.calculate(a#0: bytes, b#0: bytes) -> bytes: +MyMiddleBase.calculate: + proto 2 1 // (𝕡) a#0,b#0 | def calculate(self, a: arc4.UInt64, b: arc4.UInt64) -> arc4.UInt64: File "everything/my_base.py", line 14 + +MyMiddleBase.calculate_block@0: + frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | a#0 a: arc4.UInt64 File "everything/my_base.py", line 14 + btoi // (𝕡) a#0,b#0 | {btoi} a.decode() File "everything/my_base.py", line 15 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | tmp%0#0,b#0 b: arc4.UInt64 File "everything/my_base.py", line 14 + btoi // (𝕡) a#0,b#0 | tmp%0#0,{btoi} b.decode() File "everything/my_base.py", line 15 + + // (𝕡) a#0,b#0 | {+} a.decode() + b.decode() File "everything/my_base.py", line 15 + itob // (𝕡) a#0,b#0 | {itob} arc4.UInt64(a.decode() + b.decode()) File "everything/my_base.py", line 15 + retsub // val_as_bytes%3#0 return arc4.UInt64(a.decode() + b.decode()) File "everything/my_base.py", line 15 + + +// examples.everything.contract.Everything.close_out() -> void: +close_out: + proto 0 0 // def close_out(self) -> None: File "everything/contract.py", line 62 + +close_out_block@0: + callsub _remove_sender // self._remove_sender() File "everything/contract.py", line 63 + retsub // + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 // def _remove_sender(self) -> None: File "everything/contract.py", line 74 + +_remove_sender_block@0: + int 0 // 0 self.counter File "everything/contract.py", line 75 + byte "counter" // 0,"counter" self.counter File "everything/contract.py", line 75 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "everything/contract.py", line 75 + assert // check value exists // app_global_get_ex_value%0#0 self.counter File "everything/contract.py", line 75 + callsub positive_one // app_global_get_ex_value%0#0,{positive_one} positive_one() File "everything/contract.py", line 75 + - // {-} self.counter -= positive_one() File "everything/contract.py", line 75 + byte "counter" // new_state_value%3#0,"counter" self.counter File "everything/contract.py", line 75 + swap // load new_state_value%3#0 from l-stack (no copy) "counter",new_state_value%3#0 self.counter -= positive_one() File "everything/contract.py", line 75 + app_global_put // self.counter -= positive_one() File "everything/contract.py", line 75 + retsub // + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 // def positive_one() -> UInt64: File "everything/contract.py", line 79 + +positive_one_block@0: + int 1 // 1 1 File "everything/contract.py", line 80 + retsub // 1 return UInt64(1) File "everything/contract.py", line 80 + + +// examples.everything.contract.Everything.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "everything/contract.py", line 30 + +__init___block@0: + retsub // + diff --git a/examples/everything/out/contract.approval.teal b/examples/everything/out/contract.approval.teal new file mode 100644 index 0000000000..56e70b6b00 --- /dev/null +++ b/examples/everything/out/contract.approval.teal @@ -0,0 +1,297 @@ +#pragma version 8 + +// examples.everything.contract.Everything.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_after_if_else@11 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "create()void" + method "register(string)void" + method "say_hello()string" + method "calculate(uint64,uint64)uint64" + method "close_out()void" + uncover 5 + match main_create_route@4 main_register_route@5 main_say_hello_route@6 main_calculate_route@7 main_close_out_route@8 + b main_after_if_else@11 + +main_create_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + ! + assert // is creating + callsub create + int 1 + return + +main_register_route@5: + txn OnCompletion + int 1 + swap + shl + int 3 + & + assert // OnCompletion is one of NoOp, OptIn + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub register + int 1 + return + +main_say_hello_route@6: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub say_hello + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_calculate_route@7: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + txna ApplicationArgs 2 + callsub calculate + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_close_out_route@8: + txn OnCompletion + int CloseOut + == + assert // OnCompletion is CloseOut + txn ApplicationID + assert // is not creating + callsub close_out + int 1 + return + +main_after_if_else@11: + err // reject transaction + + +// examples.everything.contract.Everything.create() -> void: +create: + proto 0 0 + +create_block@0: + callsub _check_ban_list + callsub remember_creator + byte "counter" + int 0 + app_global_put + retsub + + +// examples.everything.contract.Everything._check_ban_list() -> void: +_check_ban_list: + proto 0 0 + +_check_ban_list_block@0: + txn Sender + callsub get_banned + != + assert // You are banned, goodbye + retsub + + +// examples.everything.contract.get_banned() -> bytes: +get_banned: + proto 0 1 + +get_banned_block@0: + addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + retsub + + +// examples.everything.my_base.MyBase.remember_creator() -> void: +remember_creator: + proto 0 0 + +remember_creator_block@0: + txn Sender + byte "creator" + swap + app_global_put + retsub + + +// examples.everything.contract.Everything.register(name#0: bytes) -> void: +register: + proto 1 0 + +register_block@0: + callsub _check_ban_list + txn OnCompletion + int OptIn + == + bz register_after_if_else@4 + +register_if_body@1: + int 0 + int 0 + byte "name" + app_local_get_ex + swap + pop + bnz register_after_if_else@4 + +register_if_body@2: + int 0 + byte "counter" + app_global_get_ex + assert // check value exists + callsub multiplicative_identity + + + byte "counter" + swap + app_global_put + +register_after_if_else@4: + int 0 + byte "name" + frame_dig -1 + app_local_put + retsub + + +// examples.everything.my_base.multiplicative_identity() -> uint64: +multiplicative_identity: + proto 0 1 + +multiplicative_identity_block@0: + int 1 + retsub + + +// examples.everything.contract.Everything.say_hello() -> bytes: +say_hello: + proto 0 1 + +say_hello_block@0: + callsub _check_ban_list + int 0 + int 0 + byte "name" + app_local_get_ex + bnz say_hello_after_if_else@2 + +say_hello_if_body@1: + byte "\x00\x0fHowdy stranger!" + swap + retsub + +say_hello_after_if_else@2: + frame_dig 0 + extract 2 0 + byte "Hello, " + swap + concat + byte "!" + concat + dup + len + itob + extract 6 2 + swap + concat + swap + retsub + + +// examples.everything.contract.Everything.calculate(a#0: bytes, b#0: bytes) -> bytes: +calculate: + proto 2 1 + +calculate_block@0: + frame_dig -2 + frame_dig -1 + callsub MyMiddleBase.calculate + btoi + frame_dig -1 + btoi + * + itob + retsub + + +// examples.everything.my_base.MyMiddleBase.calculate(a#0: bytes, b#0: bytes) -> bytes: +MyMiddleBase.calculate: + proto 2 1 + +MyMiddleBase.calculate_block@0: + frame_dig -2 + btoi + frame_dig -1 + btoi + + + itob + retsub + + +// examples.everything.contract.Everything.close_out() -> void: +close_out: + proto 0 0 + +close_out_block@0: + callsub _remove_sender + retsub + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 + +_remove_sender_block@0: + int 0 + byte "counter" + app_global_get_ex + assert // check value exists + callsub positive_one + - + byte "counter" + swap + app_global_put + retsub + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 + +positive_one_block@0: + int 1 + retsub + + +// examples.everything.contract.Everything.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + retsub + diff --git a/examples/everything/out/contract.approval_unoptimized.debug.teal b/examples/everything/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..d8fad7c9b7 --- /dev/null +++ b/examples/everything/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,318 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.everything.contract.Everything.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + bz main_after_if_else@11 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + // Implicit fall through to main_abi_routing@3 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + method "create()void" // tmp%2#0,method<"create()void"> abimethod(create=True) File "everything/contract.py", line 33 + method "register(string)void" // tmp%2#0,method<"create()void">,method<"register(string)void"> abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + method "say_hello()string" // tmp%2#0,method<"create()void">,method<"register(string)void">,method<"say_hello()string"> abimethod File "everything/contract.py", line 48 + method "calculate(uint64,uint64)uint64" // tmp%2#0,method<"create()void">,method<"register(string)void">,method<"say_hello()string">,method<"calculate(uint64,uint64)uint64"> abimethod File "everything/contract.py", line 56 + method "close_out()void" // tmp%2#0,method<"create()void">,method<"register(string)void">,method<"say_hello()string">,method<"calculate(uint64,uint64)uint64">,method<"close_out()void"> abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + uncover 5 // load tmp%2#0 from l-stack (no copy) method<"create()void">,method<"register(string)void">,method<"say_hello()string">,method<"calculate(uint64,uint64)uint64">,method<"close_out()void">,tmp%2#0 class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + match main_create_route@4 main_register_route@5 main_say_hello_route@6 main_calculate_route@7 main_close_out_route@8 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + b main_switch_case_default@9 // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + +main_create_route@4: + txn OnCompletion // {txn} abimethod(create=True) File "everything/contract.py", line 33 + int NoOp // tmp%3#0,NoOp abimethod(create=True) File "everything/contract.py", line 33 + == // {==} abimethod(create=True) File "everything/contract.py", line 33 + assert // OnCompletion is NoOp // abimethod(create=True) File "everything/contract.py", line 33 + txn ApplicationID // {txn} abimethod(create=True) File "everything/contract.py", line 33 + ! // {!} abimethod(create=True) File "everything/contract.py", line 33 + assert // is creating // abimethod(create=True) File "everything/contract.py", line 33 + callsub create // abimethod(create=True) File "everything/contract.py", line 33 + int 1 // 1 abimethod(create=True) File "everything/contract.py", line 33 + return // abimethod(create=True) File "everything/contract.py", line 33 + +main_register_route@5: + txn OnCompletion // {txn} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + int 1 // tmp%7#0,1 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + swap // load tmp%7#0 from l-stack (no copy) 1,tmp%7#0 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + shl // {shl} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + int 3 // tmp%8#0,3 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + & // {&} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + assert // OnCompletion is one of NoOp, OptIn // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + txn ApplicationID // {txn} abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + assert // is not creating // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + txna ApplicationArgs 1 // {txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + callsub register // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + int 1 // 1 abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + return // abimethod(allow_actions=["NoOp", "OptIn"]) File "everything/contract.py", line 39 + +main_say_hello_route@6: + txn OnCompletion // {txn} abimethod File "everything/contract.py", line 48 + int NoOp // tmp%12#0,NoOp abimethod File "everything/contract.py", line 48 + == // {==} abimethod File "everything/contract.py", line 48 + assert // OnCompletion is NoOp // abimethod File "everything/contract.py", line 48 + txn ApplicationID // {txn} abimethod File "everything/contract.py", line 48 + assert // is not creating // abimethod File "everything/contract.py", line 48 + callsub say_hello // {say_hello} abimethod File "everything/contract.py", line 48 + byte 0x151f7c75 // tmp%15#0,0x151f7c75 abimethod File "everything/contract.py", line 48 + swap // load tmp%15#0 from l-stack (no copy) 0x151f7c75,tmp%15#0 abimethod File "everything/contract.py", line 48 + concat // {concat} abimethod File "everything/contract.py", line 48 + log // abimethod File "everything/contract.py", line 48 + int 1 // 1 abimethod File "everything/contract.py", line 48 + return // abimethod File "everything/contract.py", line 48 + +main_calculate_route@7: + txn OnCompletion // {txn} abimethod File "everything/contract.py", line 56 + int NoOp // tmp%17#0,NoOp abimethod File "everything/contract.py", line 56 + == // {==} abimethod File "everything/contract.py", line 56 + assert // OnCompletion is NoOp // abimethod File "everything/contract.py", line 56 + txn ApplicationID // {txn} abimethod File "everything/contract.py", line 56 + assert // is not creating // abimethod File "everything/contract.py", line 56 + txna ApplicationArgs 1 // {txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + txna ApplicationArgs 2 // tmp%20#0,{txna} class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + callsub calculate // {calculate} abimethod File "everything/contract.py", line 56 + byte 0x151f7c75 // tmp%22#0,0x151f7c75 abimethod File "everything/contract.py", line 56 + swap // load tmp%22#0 from l-stack (no copy) 0x151f7c75,tmp%22#0 abimethod File "everything/contract.py", line 56 + concat // {concat} abimethod File "everything/contract.py", line 56 + log // abimethod File "everything/contract.py", line 56 + int 1 // 1 abimethod File "everything/contract.py", line 56 + return // abimethod File "everything/contract.py", line 56 + +main_close_out_route@8: + txn OnCompletion // {txn} abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + int CloseOut // tmp%24#0,CloseOut abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + == // {==} abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + assert // OnCompletion is CloseOut // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + txn ApplicationID // {txn} abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + assert // is not creating // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + callsub close_out // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + int 1 // 1 abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + return // abimethod(allow_actions=["CloseOut"]) File "everything/contract.py", line 61 + +main_switch_case_default@9: + // Implicit fall through to main_switch_case_next@10 // + +main_switch_case_next@10: + // Implicit fall through to main_after_if_else@11 // + +main_after_if_else@11: + err // reject transaction // class Everything(ARC4Contract, MyMiddleBase, name="MyContract"): File "everything/contract.py", line 29 + + +// examples.everything.contract.Everything.create() -> void: +create: + proto 0 0 // def create(self) -> None: File "everything/contract.py", line 34 + +create_block@0: + callsub _check_ban_list // self._check_ban_list() File "everything/contract.py", line 35 + callsub remember_creator // self.remember_creator() File "everything/contract.py", line 36 + byte "counter" // "counter" self.counter File "everything/contract.py", line 37 + int 0 // "counter",0 ZERO File "everything/contract.py", line 37 + app_global_put // self.counter = UInt64(ZERO) File "everything/contract.py", line 37 + retsub // + + +// examples.everything.contract.Everything._check_ban_list() -> void: +_check_ban_list: + proto 0 0 // def _check_ban_list(self) -> None: File "everything/contract.py", line 70 + +_check_ban_list_block@0: + txn Sender // {txn} Transaction.sender() File "everything/contract.py", line 71 + callsub get_banned // tmp%0#0,{get_banned} get_banned() File "everything/contract.py", line 71 + != // {!=} Transaction.sender() != get_banned(), "You are banned, goodbye" File "everything/contract.py", line 71 + assert // You are banned, goodbye // assert Transaction.sender() != get_banned(), "You are banned, goodbye" File "everything/contract.py", line 71 + retsub // + + +// examples.everything.contract.get_banned() -> bytes: +get_banned: + proto 0 1 // def get_banned() -> Account: File "everything/contract.py", line 16 + +get_banned_block@0: + addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA // VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA BANNED File "everything/contract.py", line 17 + retsub // addr#0 return addr File "everything/contract.py", line 18 + + +// examples.everything.my_base.MyBase.remember_creator() -> void: +remember_creator: + proto 0 0 // def remember_creator(self) -> None: File "everything/my_base.py", line 8 + +remember_creator_block@0: + txn Sender // {txn} Transaction.sender() File "everything/my_base.py", line 9 + byte "creator" // new_state_value%0#0,"creator" self.creator File "everything/my_base.py", line 9 + swap // load new_state_value%0#0 from l-stack (no copy) "creator",new_state_value%0#0 Transaction.sender() File "everything/my_base.py", line 9 + app_global_put // self.creator = Transaction.sender() File "everything/my_base.py", line 9 + retsub // + + +// examples.everything.contract.Everything.register(name#0: bytes) -> void: +register: + proto 1 0 // (𝕡) name#0 | def register(self, name: String) -> None: File "everything/contract.py", line 40 + +register_block@0: + callsub _check_ban_list // (𝕡) name#0 | self._check_ban_list() File "everything/contract.py", line 41 + txn OnCompletion // (𝕡) name#0 | {txn} Transaction.on_completion() File "everything/contract.py", line 42 + int OptIn // (𝕡) name#0 | tmp%0#0,OptIn OnCompleteAction.OptIn File "everything/contract.py", line 42 + == // (𝕡) name#0 | {==} Transaction.on_completion() == OnCompleteAction.OptIn: File "everything/contract.py", line 42 + bz register_after_if_else@4 // (𝕡) name#0 | if Transaction.on_completion() == OnCompleteAction.OptIn: File "everything/contract.py", line 42 + // Implicit fall through to register_if_body@1 // (𝕡) name#0 | if Transaction.on_completion() == OnCompleteAction.OptIn: File "everything/contract.py", line 42 + +register_if_body@1: + int 0 // (𝕡) name#0 | 0 0 File "everything/contract.py", line 43 + int 0 // (𝕡) name#0 | 0,0 self.name.maybe(account=0) File "everything/contract.py", line 43 + byte "name" // (𝕡) name#0 | 0,0,"name" self.name.maybe(account=0) File "everything/contract.py", line 43 + app_local_get_ex // (𝕡) name#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.name.maybe(account=0) File "everything/contract.py", line 43 + swap // store tuple_assignment%3#0 to l-stack (no copy) (𝕡) name#0 | tuple_assignment%3#0,{app_local_get_ex}.0 self.name.maybe(account=0) File "everything/contract.py", line 43 + pop // (𝕡) name#0 | tuple_assignment%3#0 self.name.maybe(account=0) File "everything/contract.py", line 43 + bnz register_after_if_else@3 // (𝕡) name#0 | not sender_name_existed File "everything/contract.py", line 44 + // Implicit fall through to register_if_body@2 // (𝕡) name#0 | not sender_name_existed File "everything/contract.py", line 44 + +register_if_body@2: + int 0 // (𝕡) name#0 | 0 self.counter File "everything/contract.py", line 45 + byte "counter" // (𝕡) name#0 | 0,"counter" self.counter File "everything/contract.py", line 45 + app_global_get_ex // (𝕡) name#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "everything/contract.py", line 45 + assert // check value exists // (𝕡) name#0 | app_global_get_ex_value%4#0 self.counter File "everything/contract.py", line 45 + callsub multiplicative_identity // (𝕡) name#0 | app_global_get_ex_value%4#0,{multiplicative_identity} multiplicative_identity() File "everything/contract.py", line 45 + + // (𝕡) name#0 | {+} self.counter += multiplicative_identity() File "everything/contract.py", line 45 + byte "counter" // (𝕡) name#0 | new_state_value%7#0,"counter" self.counter File "everything/contract.py", line 45 + swap // load new_state_value%7#0 from l-stack (no copy) (𝕡) name#0 | "counter",new_state_value%7#0 self.counter += multiplicative_identity() File "everything/contract.py", line 45 + app_global_put // (𝕡) name#0 | self.counter += multiplicative_identity() File "everything/contract.py", line 45 + // Implicit fall through to register_after_if_else@3 // (𝕡) name#0 | + +register_after_if_else@3: + // Implicit fall through to register_after_if_else@4 // (𝕡) name#0 | + +register_after_if_else@4: + int 0 // (𝕡) name#0 | 0 0 File "everything/contract.py", line 46 + byte "name" // (𝕡) name#0 | 0,"name" self.name[0] File "everything/contract.py", line 46 + frame_dig -1 // load name#0 from parameters (𝕡) name#0 | 0,"name",name#0 name: String File "everything/contract.py", line 40 + app_local_put // (𝕡) name#0 | self.name[0] = name File "everything/contract.py", line 46 + retsub // + + +// examples.everything.my_base.multiplicative_identity() -> uint64: +multiplicative_identity: + proto 0 1 // def multiplicative_identity() -> UInt64: File "everything/my_base.py", line 19 + +multiplicative_identity_block@0: + int 1 // 1 1 File "everything/my_base.py", line 20 + retsub // 1 return UInt64(1) File "everything/my_base.py", line 20 + + +// examples.everything.contract.Everything.say_hello() -> bytes: +say_hello: + proto 0 1 // def say_hello(self) -> String: File "everything/contract.py", line 49 + +say_hello_block@0: + callsub _check_ban_list // self._check_ban_list() File "everything/contract.py", line 50 + int 0 // 0 0 File "everything/contract.py", line 51 + int 0 // 0,0 self.name.maybe(account=0) File "everything/contract.py", line 51 + byte "name" // 0,0,"name" self.name.maybe(account=0) File "everything/contract.py", line 51 + app_local_get_ex // {app_local_get_ex}.0,{app_local_get_ex}.1 self.name.maybe(account=0) File "everything/contract.py", line 51 + bnz say_hello_after_if_else@2 // (𝕗) name#0 | not exists File "everything/contract.py", line 52 + // Implicit fall through to say_hello_if_body@1 // (𝕗) name#0 | not exists File "everything/contract.py", line 52 + +say_hello_if_body@1: + byte "\x00\x0fHowdy stranger!" // (𝕗) name#0 | "\x00\x0fHowdy stranger!" String("Howdy stranger!") File "everything/contract.py", line 53 + swap + retsub // "\x00\x0fHowdy stranger!" return String("Howdy stranger!") File "everything/contract.py", line 53 + +say_hello_after_if_else@2: + frame_dig 0 // load name#0 from f-stack (𝕗) name#0 | name#0 name File "everything/contract.py", line 51 + extract 2 0 // (𝕗) name#0 | {extract} name.decode() File "everything/contract.py", line 54 + byte "Hello, " // (𝕗) name#0 | tmp%2#0,"Hello, " b"Hello, " File "everything/contract.py", line 54 + swap // load tmp%2#0 from l-stack (no copy) (𝕗) name#0 | "Hello, ",tmp%2#0 name.decode() File "everything/contract.py", line 54 + concat // (𝕗) name#0 | {concat} b"Hello, " + name.decode() File "everything/contract.py", line 54 + byte "!" // (𝕗) name#0 | tmp%3#0,"!" b"!" File "everything/contract.py", line 54 + concat // (𝕗) name#0 | {concat} b"Hello, " + name.decode() + b"!" File "everything/contract.py", line 54 + dup // load tmp%4#0 from l-stack (copy) (𝕗) name#0 | tmp%4#0,tmp%4#0 b"Hello, " + name.decode() + b"!" File "everything/contract.py", line 54 + len // (𝕗) name#0 | tmp%4#0,{len} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + itob // (𝕗) name#0 | tmp%4#0,{itob} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + extract 6 2 // (𝕗) name#0 | tmp%4#0,{extract} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + swap // load tmp%4#0 from l-stack (no copy) (𝕗) name#0 | value_as_uint16%7#0,tmp%4#0 b"Hello, " + name.decode() + b"!" File "everything/contract.py", line 54 + concat // (𝕗) name#0 | {concat} String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + swap + retsub // tmp%8#0 return String.encode(b"Hello, " + name.decode() + b"!") File "everything/contract.py", line 54 + + +// examples.everything.contract.Everything.calculate(a#0: bytes, b#0: bytes) -> bytes: +calculate: + proto 2 1 // (𝕡) a#0,b#0 | def calculate(self, a: arc4_UInt64, b: arc4_UInt64) -> arc4_UInt64: File "everything/contract.py", line 57 + +calculate_block@0: + frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | a#0 a: arc4_UInt64 File "everything/contract.py", line 57 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | a#0,b#0 b: arc4_UInt64 File "everything/contract.py", line 57 + callsub MyMiddleBase.calculate // (𝕡) a#0,b#0 | {MyMiddleBase.calculate} super().calculate(a, b) File "everything/contract.py", line 58 + btoi // (𝕡) a#0,b#0 | {btoi} c.decode() File "everything/contract.py", line 59 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | tmp%0#0,b#0 b: arc4_UInt64 File "everything/contract.py", line 57 + btoi // (𝕡) a#0,b#0 | tmp%0#0,{btoi} b.decode() File "everything/contract.py", line 59 + * // (𝕡) a#0,b#0 | {*} c.decode() * b.decode() File "everything/contract.py", line 59 + itob // (𝕡) a#0,b#0 | {itob} arc4_UInt64.encode(c.decode() * b.decode()) File "everything/contract.py", line 59 + retsub // val_as_bytes%3#0 return arc4_UInt64.encode(c.decode() * b.decode()) File "everything/contract.py", line 59 + + +// examples.everything.my_base.MyMiddleBase.calculate(a#0: bytes, b#0: bytes) -> bytes: +MyMiddleBase.calculate: + proto 2 1 // (𝕡) a#0,b#0 | def calculate(self, a: arc4.UInt64, b: arc4.UInt64) -> arc4.UInt64: File "everything/my_base.py", line 14 + +MyMiddleBase.calculate_block@0: + frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | a#0 a: arc4.UInt64 File "everything/my_base.py", line 14 + btoi // (𝕡) a#0,b#0 | {btoi} a.decode() File "everything/my_base.py", line 15 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | tmp%0#0,b#0 b: arc4.UInt64 File "everything/my_base.py", line 14 + btoi // (𝕡) a#0,b#0 | tmp%0#0,{btoi} b.decode() File "everything/my_base.py", line 15 + + // (𝕡) a#0,b#0 | {+} a.decode() + b.decode() File "everything/my_base.py", line 15 + itob // (𝕡) a#0,b#0 | {itob} arc4.UInt64(a.decode() + b.decode()) File "everything/my_base.py", line 15 + retsub // val_as_bytes%3#0 return arc4.UInt64(a.decode() + b.decode()) File "everything/my_base.py", line 15 + + +// examples.everything.contract.Everything.close_out() -> void: +close_out: + proto 0 0 // def close_out(self) -> None: File "everything/contract.py", line 62 + +close_out_block@0: + callsub _remove_sender // self._remove_sender() File "everything/contract.py", line 63 + retsub // + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 // def _remove_sender(self) -> None: File "everything/contract.py", line 74 + +_remove_sender_block@0: + int 0 // 0 self.counter File "everything/contract.py", line 75 + byte "counter" // 0,"counter" self.counter File "everything/contract.py", line 75 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "everything/contract.py", line 75 + assert // check value exists // app_global_get_ex_value%0#0 self.counter File "everything/contract.py", line 75 + callsub positive_one // app_global_get_ex_value%0#0,{positive_one} positive_one() File "everything/contract.py", line 75 + - // {-} self.counter -= positive_one() File "everything/contract.py", line 75 + byte "counter" // new_state_value%3#0,"counter" self.counter File "everything/contract.py", line 75 + swap // load new_state_value%3#0 from l-stack (no copy) "counter",new_state_value%3#0 self.counter -= positive_one() File "everything/contract.py", line 75 + app_global_put // self.counter -= positive_one() File "everything/contract.py", line 75 + retsub // + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 // def positive_one() -> UInt64: File "everything/contract.py", line 79 + +positive_one_block@0: + int 1 // 1 1 File "everything/contract.py", line 80 + retsub // 1 return UInt64(1) File "everything/contract.py", line 80 + + +// examples.everything.contract.Everything.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "everything/contract.py", line 30 + +__init___block@0: + retsub // + diff --git a/examples/everything/out/contract.approval_unoptimized.teal b/examples/everything/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..35c51a015f --- /dev/null +++ b/examples/everything/out/contract.approval_unoptimized.teal @@ -0,0 +1,306 @@ +#pragma version 8 + +// examples.everything.contract.Everything.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_after_if_else@11 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "create()void" + method "register(string)void" + method "say_hello()string" + method "calculate(uint64,uint64)uint64" + method "close_out()void" + uncover 5 + match main_create_route@4 main_register_route@5 main_say_hello_route@6 main_calculate_route@7 main_close_out_route@8 + b main_switch_case_default@9 + +main_create_route@4: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + ! + assert // is creating + callsub create + int 1 + return + +main_register_route@5: + txn OnCompletion + int 1 + swap + shl + int 3 + & + assert // OnCompletion is one of NoOp, OptIn + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub register + int 1 + return + +main_say_hello_route@6: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub say_hello + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_calculate_route@7: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + txna ApplicationArgs 2 + callsub calculate + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_close_out_route@8: + txn OnCompletion + int CloseOut + == + assert // OnCompletion is CloseOut + txn ApplicationID + assert // is not creating + callsub close_out + int 1 + return + +main_switch_case_default@9: + +main_switch_case_next@10: + +main_after_if_else@11: + err // reject transaction + + +// examples.everything.contract.Everything.create() -> void: +create: + proto 0 0 + +create_block@0: + callsub _check_ban_list + callsub remember_creator + byte "counter" + int 0 + app_global_put + retsub + + +// examples.everything.contract.Everything._check_ban_list() -> void: +_check_ban_list: + proto 0 0 + +_check_ban_list_block@0: + txn Sender + callsub get_banned + != + assert // You are banned, goodbye + retsub + + +// examples.everything.contract.get_banned() -> bytes: +get_banned: + proto 0 1 + +get_banned_block@0: + addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + retsub + + +// examples.everything.my_base.MyBase.remember_creator() -> void: +remember_creator: + proto 0 0 + +remember_creator_block@0: + txn Sender + byte "creator" + swap + app_global_put + retsub + + +// examples.everything.contract.Everything.register(name#0: bytes) -> void: +register: + proto 1 0 + +register_block@0: + callsub _check_ban_list + txn OnCompletion + int OptIn + == + bz register_after_if_else@4 + +register_if_body@1: + int 0 + int 0 + byte "name" + app_local_get_ex + swap + pop + bnz register_after_if_else@3 + +register_if_body@2: + int 0 + byte "counter" + app_global_get_ex + assert // check value exists + callsub multiplicative_identity + + + byte "counter" + swap + app_global_put + +register_after_if_else@3: + +register_after_if_else@4: + int 0 + byte "name" + frame_dig -1 + app_local_put + retsub + + +// examples.everything.my_base.multiplicative_identity() -> uint64: +multiplicative_identity: + proto 0 1 + +multiplicative_identity_block@0: + int 1 + retsub + + +// examples.everything.contract.Everything.say_hello() -> bytes: +say_hello: + proto 0 1 + +say_hello_block@0: + callsub _check_ban_list + int 0 + int 0 + byte "name" + app_local_get_ex + bnz say_hello_after_if_else@2 + +say_hello_if_body@1: + byte "\x00\x0fHowdy stranger!" + swap + retsub + +say_hello_after_if_else@2: + frame_dig 0 + extract 2 0 + byte "Hello, " + swap + concat + byte "!" + concat + dup + len + itob + extract 6 2 + swap + concat + swap + retsub + + +// examples.everything.contract.Everything.calculate(a#0: bytes, b#0: bytes) -> bytes: +calculate: + proto 2 1 + +calculate_block@0: + frame_dig -2 + frame_dig -1 + callsub MyMiddleBase.calculate + btoi + frame_dig -1 + btoi + * + itob + retsub + + +// examples.everything.my_base.MyMiddleBase.calculate(a#0: bytes, b#0: bytes) -> bytes: +MyMiddleBase.calculate: + proto 2 1 + +MyMiddleBase.calculate_block@0: + frame_dig -2 + btoi + frame_dig -1 + btoi + + + itob + retsub + + +// examples.everything.contract.Everything.close_out() -> void: +close_out: + proto 0 0 + +close_out_block@0: + callsub _remove_sender + retsub + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 + +_remove_sender_block@0: + int 0 + byte "counter" + app_global_get_ex + assert // check value exists + callsub positive_one + - + byte "counter" + swap + app_global_put + retsub + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 + +positive_one_block@0: + int 1 + retsub + + +// examples.everything.contract.Everything.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + retsub + diff --git a/examples/everything/out/contract.awst b/examples/everything/out/contract.awst index 9e245dbd16..dedb064b65 100644 --- a/examples/everything/out/contract.awst +++ b/examples/everything/out/contract.awst @@ -2,9 +2,9 @@ ZERO = 0 ZER0 = 0 ONE = 1 -subroutine get_banned(): algopy.Address +subroutine get_banned(): algopy.Account { - addr: algopy.Address = Address("VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA") + addr: algopy.Account = Address("VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA") return addr } @@ -59,15 +59,15 @@ contract Everything extends (examples.everything.my_base::MyMiddleBase, examples this::_check_ban_list() (name, exists): tuple[algopy.arc4.String, bool] = app_local_get_ex(0u, 0u, 'name') if (!(exists)) { - return abi_constant('\x00\x0fHowdy stranger!', algopy.arc4.String) + return arc4_encode('Howdy stranger!', algopy.arc4.String) } - return abi_encode('Hello, ' + abi_decode(name, algopy.Bytes) + '!', algopy.arc4.String) + return arc4_encode('Hello, ' + arc4_decode(name, algopy.Bytes) + '!', algopy.arc4.String) } - abimethod calculate(a: algopy.UInt64, b: algopy.UInt64): algopy.UInt64 + abimethod calculate(a: algopy.arc4.UIntN[typing.Literal[64]], b: algopy.arc4.UIntN[typing.Literal[64]]): algopy.arc4.UIntN[typing.Literal[64]] { - c: algopy.UInt64 = examples.everything.my_base::MyMiddleBase::calculate(a, b) - return c * b + c: algopy.arc4.UIntN[typing.Literal[64]] = examples.everything.my_base::MyMiddleBase::calculate(a, b) + return arc4_encode(arc4_decode(c, algopy.UInt64) * arc4_decode(b, algopy.UInt64), algopy.arc4.UIntN[typing.Literal[64]]) } abimethod close_out(): None diff --git a/examples/everything/out/contract.clear.debug.teal b/examples/everything/out/contract.clear.debug.teal new file mode 100644 index 0000000000..1ec89496ac --- /dev/null +++ b/examples/everything/out/contract.clear.debug.teal @@ -0,0 +1,36 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.everything.contract.Everything.clear_state_program() -> uint64: +main_block@0: + callsub _remove_sender // self._remove_sender() File "everything/contract.py", line 66 + int 1 // 1 True File "everything/contract.py", line 67 + return // return True File "everything/contract.py", line 67 + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 // def _remove_sender(self) -> None: File "everything/contract.py", line 74 + +_remove_sender_block@0: + int 0 // 0 self.counter File "everything/contract.py", line 75 + byte "counter" // 0,"counter" self.counter File "everything/contract.py", line 75 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "everything/contract.py", line 75 + assert // check value exists // app_global_get_ex_value%0#0 self.counter File "everything/contract.py", line 75 + callsub positive_one // app_global_get_ex_value%0#0,{positive_one} positive_one() File "everything/contract.py", line 75 + - // {-} self.counter -= positive_one() File "everything/contract.py", line 75 + byte "counter" // new_state_value%3#0,"counter" self.counter File "everything/contract.py", line 75 + swap // load new_state_value%3#0 from l-stack (no copy) "counter",new_state_value%3#0 self.counter -= positive_one() File "everything/contract.py", line 75 + app_global_put // self.counter -= positive_one() File "everything/contract.py", line 75 + retsub // + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 // def positive_one() -> UInt64: File "everything/contract.py", line 79 + +positive_one_block@0: + int 1 // 1 1 File "everything/contract.py", line 80 + retsub // 1 return UInt64(1) File "everything/contract.py", line 80 + diff --git a/examples/everything/out/contract.clear.teal b/examples/everything/out/contract.clear.teal new file mode 100644 index 0000000000..e5504320c6 --- /dev/null +++ b/examples/everything/out/contract.clear.teal @@ -0,0 +1,34 @@ +#pragma version 8 + +// examples.everything.contract.Everything.clear_state_program() -> uint64: +main_block@0: + callsub _remove_sender + int 1 + return + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 + +_remove_sender_block@0: + int 0 + byte "counter" + app_global_get_ex + assert // check value exists + callsub positive_one + - + byte "counter" + swap + app_global_put + retsub + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 + +positive_one_block@0: + int 1 + retsub + diff --git a/examples/everything/out/contract.clear_unoptimized.debug.teal b/examples/everything/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..1ec89496ac --- /dev/null +++ b/examples/everything/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,36 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.everything.contract.Everything.clear_state_program() -> uint64: +main_block@0: + callsub _remove_sender // self._remove_sender() File "everything/contract.py", line 66 + int 1 // 1 True File "everything/contract.py", line 67 + return // return True File "everything/contract.py", line 67 + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 // def _remove_sender(self) -> None: File "everything/contract.py", line 74 + +_remove_sender_block@0: + int 0 // 0 self.counter File "everything/contract.py", line 75 + byte "counter" // 0,"counter" self.counter File "everything/contract.py", line 75 + app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "everything/contract.py", line 75 + assert // check value exists // app_global_get_ex_value%0#0 self.counter File "everything/contract.py", line 75 + callsub positive_one // app_global_get_ex_value%0#0,{positive_one} positive_one() File "everything/contract.py", line 75 + - // {-} self.counter -= positive_one() File "everything/contract.py", line 75 + byte "counter" // new_state_value%3#0,"counter" self.counter File "everything/contract.py", line 75 + swap // load new_state_value%3#0 from l-stack (no copy) "counter",new_state_value%3#0 self.counter -= positive_one() File "everything/contract.py", line 75 + app_global_put // self.counter -= positive_one() File "everything/contract.py", line 75 + retsub // + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 // def positive_one() -> UInt64: File "everything/contract.py", line 79 + +positive_one_block@0: + int 1 // 1 1 File "everything/contract.py", line 80 + retsub // 1 return UInt64(1) File "everything/contract.py", line 80 + diff --git a/examples/everything/out/contract.clear_unoptimized.teal b/examples/everything/out/contract.clear_unoptimized.teal new file mode 100644 index 0000000000..e5504320c6 --- /dev/null +++ b/examples/everything/out/contract.clear_unoptimized.teal @@ -0,0 +1,34 @@ +#pragma version 8 + +// examples.everything.contract.Everything.clear_state_program() -> uint64: +main_block@0: + callsub _remove_sender + int 1 + return + + +// examples.everything.contract.Everything._remove_sender() -> void: +_remove_sender: + proto 0 0 + +_remove_sender_block@0: + int 0 + byte "counter" + app_global_get_ex + assert // check value exists + callsub positive_one + - + byte "counter" + swap + app_global_put + retsub + + +// examples.everything.contract.positive_one() -> uint64: +positive_one: + proto 0 1 + +positive_one_block@0: + int 1 + retsub + diff --git a/examples/everything/out/contract_Everything.cssa.ir b/examples/everything/out/contract_Everything.cssa.ir new file mode 100644 index 0000000000..ff5a9b7708 --- /dev/null +++ b/examples/everything/out/contract_Everything.cssa.ir @@ -0,0 +1,190 @@ +contract examples.everything.contract.Everything: + program approval: + subroutine examples.everything.contract.Everything.approval_program() -> uint64: + block@0: // L29 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L30 + examples.everything.contract.Everything.__init__() + goto block@2 + block@2: // entrypoint_L30 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L29 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create()void" => block@4, method "register(string)void" => block@5, method "say_hello()string" => block@6, method "calculate(uint64,uint64)uint64" => block@7, method "close_out()void" => block@8, * => block@11} + block@4: // create_route_L33 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + examples.everything.contract.Everything.create() + return 1u + block@5: // register_route_L39 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (shl 1u tmp%7#0) + let tmp%9#0: uint64 = (& tmp%8#0 3u) + (assert tmp%9#0) // OnCompletion is one of NoOp, OptIn + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + examples.everything.contract.Everything.register(tmp%11#0) + return 1u + block@6: // say_hello_route_L48 + 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 = examples.everything.contract.Everything.say_hello() + let tmp%16#0: bytes = (concat 0x151f7c75 tmp%15#0) + (log tmp%16#0) + return 1u + block@7: // calculate_route_L56 + let tmp%17#0: uint64 = (txn OnCompletion) + let tmp%18#0: uint64 = (! tmp%17#0) + (assert tmp%18#0) // OnCompletion is NoOp + let tmp%19#0: uint64 = (txn ApplicationID) + (assert tmp%19#0) // is not creating + let tmp%20#0: bytes = (txna ApplicationArgs 1) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: bytes = examples.everything.contract.Everything.calculate(tmp%20#0, tmp%21#0) + let tmp%23#0: bytes = (concat 0x151f7c75 tmp%22#0) + (log tmp%23#0) + return 1u + block@8: // close_out_route_L61 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 CloseOut) + (assert tmp%25#0) // OnCompletion is CloseOut + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + examples.everything.contract.Everything.close_out() + return 1u + block@11: // after_if_else_L29 + fail // reject transaction + + subroutine examples.everything.contract.Everything.create() -> void: + block@0: // L34 + examples.everything.contract.Everything._check_ban_list() + examples.everything.my_base.MyBase.remember_creator() + (app_global_put "counter" 0u) + return + + subroutine examples.everything.contract.Everything._check_ban_list() -> void: + block@0: // L70 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = examples.everything.contract.get_banned() + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // You are banned, goodbye + return + + subroutine examples.everything.contract.get_banned() -> bytes: + block@0: // L16 + return addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + + subroutine examples.everything.my_base.MyBase.remember_creator() -> void: + block@0: // L8 + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%0#0) + return + + subroutine examples.everything.contract.Everything.register(name: bytes) -> void: + block@0: // L40 + examples.everything.contract.Everything._check_ban_list() + let tmp%0#0: uint64 = (txn OnCompletion) + let tmp%1#0: uint64 = (== tmp%0#0 OptIn) + goto tmp%1#0 ? block@1 : block@4 + block@1: // if_body_L42 + let (sender_name#0: any, sender_name_existed#0: uint64) = (app_local_get_ex 0u 0u "name") + goto sender_name_existed#0 ? block@4 : block@2 + block@2: // if_body_L44 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = examples.everything.my_base.multiplicative_identity() + let new_state_value%7#0: uint64 = (+ app_global_get_ex_value%4#0 tmp%6#0) + (app_global_put "counter" new_state_value%7#0) + goto block@4 + block@4: // after_if_else_L42 + (app_local_put 0u "name" name#0) + return + + subroutine examples.everything.my_base.multiplicative_identity() -> uint64: + block@0: // L19 + return 1u + + subroutine examples.everything.contract.Everything.say_hello() -> bytes: + block@0: // L49 + examples.everything.contract.Everything._check_ban_list() + let (name#0: any, exists#0: uint64) = (app_local_get_ex 0u 0u "name") + goto exists#0 ? block@2 : block@1 + block@1: // if_body_L52 + return "\x00\x0fHowdy stranger!" + block@2: // after_if_else_L52 + let tmp%2#0: bytes = ((extract 2 0) name#0) + let tmp%3#0: bytes = (concat "Hello, " tmp%2#0) + let tmp%4#0: bytes = (concat tmp%3#0 "!") + let length%5#0: uint64 = (len tmp%4#0) + let value_as_bytes%6#0: bytes = (itob length%5#0) + let value_as_uint16%7#0: bytes = ((extract 6 2) value_as_bytes%6#0) + let tmp%8#0: bytes = (concat value_as_uint16%7#0 tmp%4#0) + return tmp%8#0 + + subroutine examples.everything.contract.Everything.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L57 + let c#0: bytes = examples.everything.my_base.MyMiddleBase.calculate(a#0, b#0) + let tmp%0#0: uint64 = (btoi c#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (* tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.my_base.MyMiddleBase.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L14 + let tmp%0#0: uint64 = (btoi a#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (+ tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.contract.Everything.close_out() -> void: + block@0: // L62 + examples.everything.contract.Everything._remove_sender() + return + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u + + subroutine examples.everything.contract.Everything.__init__() -> void: + block@0: // L30 + return + + program clear-state: + subroutine examples.everything.contract.Everything.clear_state_program() -> uint64: + block@0: // L65 + examples.everything.contract.Everything._remove_sender() + return 1u + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u \ No newline at end of file diff --git a/examples/everything/out/contract_Everything.final.ir b/examples/everything/out/contract_Everything.final.ir new file mode 100644 index 0000000000..ff5a9b7708 --- /dev/null +++ b/examples/everything/out/contract_Everything.final.ir @@ -0,0 +1,190 @@ +contract examples.everything.contract.Everything: + program approval: + subroutine examples.everything.contract.Everything.approval_program() -> uint64: + block@0: // L29 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L30 + examples.everything.contract.Everything.__init__() + goto block@2 + block@2: // entrypoint_L30 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L29 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create()void" => block@4, method "register(string)void" => block@5, method "say_hello()string" => block@6, method "calculate(uint64,uint64)uint64" => block@7, method "close_out()void" => block@8, * => block@11} + block@4: // create_route_L33 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + examples.everything.contract.Everything.create() + return 1u + block@5: // register_route_L39 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (shl 1u tmp%7#0) + let tmp%9#0: uint64 = (& tmp%8#0 3u) + (assert tmp%9#0) // OnCompletion is one of NoOp, OptIn + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + examples.everything.contract.Everything.register(tmp%11#0) + return 1u + block@6: // say_hello_route_L48 + 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 = examples.everything.contract.Everything.say_hello() + let tmp%16#0: bytes = (concat 0x151f7c75 tmp%15#0) + (log tmp%16#0) + return 1u + block@7: // calculate_route_L56 + let tmp%17#0: uint64 = (txn OnCompletion) + let tmp%18#0: uint64 = (! tmp%17#0) + (assert tmp%18#0) // OnCompletion is NoOp + let tmp%19#0: uint64 = (txn ApplicationID) + (assert tmp%19#0) // is not creating + let tmp%20#0: bytes = (txna ApplicationArgs 1) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: bytes = examples.everything.contract.Everything.calculate(tmp%20#0, tmp%21#0) + let tmp%23#0: bytes = (concat 0x151f7c75 tmp%22#0) + (log tmp%23#0) + return 1u + block@8: // close_out_route_L61 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 CloseOut) + (assert tmp%25#0) // OnCompletion is CloseOut + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + examples.everything.contract.Everything.close_out() + return 1u + block@11: // after_if_else_L29 + fail // reject transaction + + subroutine examples.everything.contract.Everything.create() -> void: + block@0: // L34 + examples.everything.contract.Everything._check_ban_list() + examples.everything.my_base.MyBase.remember_creator() + (app_global_put "counter" 0u) + return + + subroutine examples.everything.contract.Everything._check_ban_list() -> void: + block@0: // L70 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = examples.everything.contract.get_banned() + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // You are banned, goodbye + return + + subroutine examples.everything.contract.get_banned() -> bytes: + block@0: // L16 + return addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + + subroutine examples.everything.my_base.MyBase.remember_creator() -> void: + block@0: // L8 + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%0#0) + return + + subroutine examples.everything.contract.Everything.register(name: bytes) -> void: + block@0: // L40 + examples.everything.contract.Everything._check_ban_list() + let tmp%0#0: uint64 = (txn OnCompletion) + let tmp%1#0: uint64 = (== tmp%0#0 OptIn) + goto tmp%1#0 ? block@1 : block@4 + block@1: // if_body_L42 + let (sender_name#0: any, sender_name_existed#0: uint64) = (app_local_get_ex 0u 0u "name") + goto sender_name_existed#0 ? block@4 : block@2 + block@2: // if_body_L44 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = examples.everything.my_base.multiplicative_identity() + let new_state_value%7#0: uint64 = (+ app_global_get_ex_value%4#0 tmp%6#0) + (app_global_put "counter" new_state_value%7#0) + goto block@4 + block@4: // after_if_else_L42 + (app_local_put 0u "name" name#0) + return + + subroutine examples.everything.my_base.multiplicative_identity() -> uint64: + block@0: // L19 + return 1u + + subroutine examples.everything.contract.Everything.say_hello() -> bytes: + block@0: // L49 + examples.everything.contract.Everything._check_ban_list() + let (name#0: any, exists#0: uint64) = (app_local_get_ex 0u 0u "name") + goto exists#0 ? block@2 : block@1 + block@1: // if_body_L52 + return "\x00\x0fHowdy stranger!" + block@2: // after_if_else_L52 + let tmp%2#0: bytes = ((extract 2 0) name#0) + let tmp%3#0: bytes = (concat "Hello, " tmp%2#0) + let tmp%4#0: bytes = (concat tmp%3#0 "!") + let length%5#0: uint64 = (len tmp%4#0) + let value_as_bytes%6#0: bytes = (itob length%5#0) + let value_as_uint16%7#0: bytes = ((extract 6 2) value_as_bytes%6#0) + let tmp%8#0: bytes = (concat value_as_uint16%7#0 tmp%4#0) + return tmp%8#0 + + subroutine examples.everything.contract.Everything.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L57 + let c#0: bytes = examples.everything.my_base.MyMiddleBase.calculate(a#0, b#0) + let tmp%0#0: uint64 = (btoi c#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (* tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.my_base.MyMiddleBase.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L14 + let tmp%0#0: uint64 = (btoi a#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (+ tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.contract.Everything.close_out() -> void: + block@0: // L62 + examples.everything.contract.Everything._remove_sender() + return + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u + + subroutine examples.everything.contract.Everything.__init__() -> void: + block@0: // L30 + return + + program clear-state: + subroutine examples.everything.contract.Everything.clear_state_program() -> uint64: + block@0: // L65 + examples.everything.contract.Everything._remove_sender() + return 1u + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u \ No newline at end of file diff --git a/examples/everything/out/contract_Everything.final_unoptimized.ir b/examples/everything/out/contract_Everything.final_unoptimized.ir new file mode 100644 index 0000000000..82fbf0c731 --- /dev/null +++ b/examples/everything/out/contract_Everything.final_unoptimized.ir @@ -0,0 +1,201 @@ +contract examples.everything.contract.Everything: + program approval: + subroutine examples.everything.contract.Everything.approval_program() -> uint64: + block@0: // L29 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L30 + examples.everything.contract.Everything.__init__() + goto block@2 + block@2: // entrypoint_L30 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L29 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create()void" => block@4, method "register(string)void" => block@5, method "say_hello()string" => block@6, method "calculate(uint64,uint64)uint64" => block@7, method "close_out()void" => block@8, * => block@9} + block@4: // create_route_L33 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + examples.everything.contract.Everything.create() + return 1u + block@5: // register_route_L39 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (shl 1u tmp%7#0) + let tmp%9#0: uint64 = (& tmp%8#0 3u) + (assert tmp%9#0) // OnCompletion is one of NoOp, OptIn + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + examples.everything.contract.Everything.register(tmp%11#0) + return 1u + block@6: // say_hello_route_L48 + 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 = examples.everything.contract.Everything.say_hello() + let tmp%16#0: bytes = (concat 0x151f7c75 tmp%15#0) + (log tmp%16#0) + return 1u + block@7: // calculate_route_L56 + let tmp%17#0: uint64 = (txn OnCompletion) + let tmp%18#0: uint64 = (== tmp%17#0 NoOp) + (assert tmp%18#0) // OnCompletion is NoOp + let tmp%19#0: uint64 = (txn ApplicationID) + (assert tmp%19#0) // is not creating + let tmp%20#0: bytes = (txna ApplicationArgs 1) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: bytes = examples.everything.contract.Everything.calculate(tmp%20#0, tmp%21#0) + let tmp%23#0: bytes = (concat 0x151f7c75 tmp%22#0) + (log tmp%23#0) + return 1u + block@8: // close_out_route_L61 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 CloseOut) + (assert tmp%25#0) // OnCompletion is CloseOut + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + examples.everything.contract.Everything.close_out() + return 1u + block@9: // switch_case_default_L29 + goto block@10 + block@10: // switch_case_next_L29 + goto block@11 + block@11: // after_if_else_L29 + fail // reject transaction + + subroutine examples.everything.contract.Everything.create() -> void: + block@0: // L34 + examples.everything.contract.Everything._check_ban_list() + examples.everything.my_base.MyBase.remember_creator() + (app_global_put "counter" 0u) + return + + subroutine examples.everything.contract.Everything._check_ban_list() -> void: + block@0: // L70 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = examples.everything.contract.get_banned() + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // You are banned, goodbye + return + + subroutine examples.everything.contract.get_banned() -> bytes: + block@0: // L16 + let addr#0: bytes = addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + return addr#0 + + subroutine examples.everything.my_base.MyBase.remember_creator() -> void: + block@0: // L8 + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%0#0) + return + + subroutine examples.everything.contract.Everything.register(name: bytes) -> void: + block@0: // L40 + examples.everything.contract.Everything._check_ban_list() + let tmp%0#0: uint64 = (txn OnCompletion) + let tmp%1#0: uint64 = (== tmp%0#0 OptIn) + goto tmp%1#0 ? block@1 : block@4 + block@1: // if_body_L42 + let (tuple_assignment%2#0: any, tuple_assignment%3#0: uint64) = (app_local_get_ex 0u 0u "name") + let sender_name#0: any = tuple_assignment%2#0 + let sender_name_existed#0: uint64 = tuple_assignment%3#0 + goto sender_name_existed#0 ? block@3 : block@2 + block@2: // if_body_L44 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = examples.everything.my_base.multiplicative_identity() + let new_state_value%7#0: uint64 = (+ app_global_get_ex_value%4#0 tmp%6#0) + (app_global_put "counter" new_state_value%7#0) + goto block@3 + block@3: // after_if_else_L44 + goto block@4 + block@4: // after_if_else_L42 + (app_local_put 0u "name" name#0) + return + + subroutine examples.everything.my_base.multiplicative_identity() -> uint64: + block@0: // L19 + return 1u + + subroutine examples.everything.contract.Everything.say_hello() -> bytes: + block@0: // L49 + examples.everything.contract.Everything._check_ban_list() + let (tuple_assignment%0#0: any, tuple_assignment%1#0: uint64) = (app_local_get_ex 0u 0u "name") + let name#0: any = tuple_assignment%0#0 + let exists#0: uint64 = tuple_assignment%1#0 + goto exists#0 ? block@2 : block@1 + block@1: // if_body_L52 + return "\x00\x0fHowdy stranger!" + block@2: // after_if_else_L52 + let tmp%2#0: bytes = ((extract 2 0) name#0) + let tmp%3#0: bytes = (concat "Hello, " tmp%2#0) + let tmp%4#0: bytes = (concat tmp%3#0 "!") + let length%5#0: uint64 = (len tmp%4#0) + let value_as_bytes%6#0: bytes = (itob length%5#0) + let value_as_uint16%7#0: bytes = ((extract 6 2) value_as_bytes%6#0) + let tmp%8#0: bytes = (concat value_as_uint16%7#0 tmp%4#0) + return tmp%8#0 + + subroutine examples.everything.contract.Everything.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L57 + let c#0: bytes = examples.everything.my_base.MyMiddleBase.calculate(a#0, b#0) + let tmp%0#0: uint64 = (btoi c#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (* tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.my_base.MyMiddleBase.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L14 + let tmp%0#0: uint64 = (btoi a#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (+ tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.contract.Everything.close_out() -> void: + block@0: // L62 + examples.everything.contract.Everything._remove_sender() + return + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u + + subroutine examples.everything.contract.Everything.__init__() -> void: + block@0: // L30 + return + + program clear-state: + subroutine examples.everything.contract.Everything.clear_state_program() -> uint64: + block@0: // L65 + examples.everything.contract.Everything._remove_sender() + return 1u + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u \ No newline at end of file diff --git a/examples/everything/out/contract_Everything.parallel_copies.ir b/examples/everything/out/contract_Everything.parallel_copies.ir new file mode 100644 index 0000000000..ff5a9b7708 --- /dev/null +++ b/examples/everything/out/contract_Everything.parallel_copies.ir @@ -0,0 +1,190 @@ +contract examples.everything.contract.Everything: + program approval: + subroutine examples.everything.contract.Everything.approval_program() -> uint64: + block@0: // L29 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L30 + examples.everything.contract.Everything.__init__() + goto block@2 + block@2: // entrypoint_L30 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L29 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create()void" => block@4, method "register(string)void" => block@5, method "say_hello()string" => block@6, method "calculate(uint64,uint64)uint64" => block@7, method "close_out()void" => block@8, * => block@11} + block@4: // create_route_L33 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + examples.everything.contract.Everything.create() + return 1u + block@5: // register_route_L39 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (shl 1u tmp%7#0) + let tmp%9#0: uint64 = (& tmp%8#0 3u) + (assert tmp%9#0) // OnCompletion is one of NoOp, OptIn + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + examples.everything.contract.Everything.register(tmp%11#0) + return 1u + block@6: // say_hello_route_L48 + 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 = examples.everything.contract.Everything.say_hello() + let tmp%16#0: bytes = (concat 0x151f7c75 tmp%15#0) + (log tmp%16#0) + return 1u + block@7: // calculate_route_L56 + let tmp%17#0: uint64 = (txn OnCompletion) + let tmp%18#0: uint64 = (! tmp%17#0) + (assert tmp%18#0) // OnCompletion is NoOp + let tmp%19#0: uint64 = (txn ApplicationID) + (assert tmp%19#0) // is not creating + let tmp%20#0: bytes = (txna ApplicationArgs 1) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: bytes = examples.everything.contract.Everything.calculate(tmp%20#0, tmp%21#0) + let tmp%23#0: bytes = (concat 0x151f7c75 tmp%22#0) + (log tmp%23#0) + return 1u + block@8: // close_out_route_L61 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 CloseOut) + (assert tmp%25#0) // OnCompletion is CloseOut + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + examples.everything.contract.Everything.close_out() + return 1u + block@11: // after_if_else_L29 + fail // reject transaction + + subroutine examples.everything.contract.Everything.create() -> void: + block@0: // L34 + examples.everything.contract.Everything._check_ban_list() + examples.everything.my_base.MyBase.remember_creator() + (app_global_put "counter" 0u) + return + + subroutine examples.everything.contract.Everything._check_ban_list() -> void: + block@0: // L70 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = examples.everything.contract.get_banned() + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // You are banned, goodbye + return + + subroutine examples.everything.contract.get_banned() -> bytes: + block@0: // L16 + return addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + + subroutine examples.everything.my_base.MyBase.remember_creator() -> void: + block@0: // L8 + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%0#0) + return + + subroutine examples.everything.contract.Everything.register(name: bytes) -> void: + block@0: // L40 + examples.everything.contract.Everything._check_ban_list() + let tmp%0#0: uint64 = (txn OnCompletion) + let tmp%1#0: uint64 = (== tmp%0#0 OptIn) + goto tmp%1#0 ? block@1 : block@4 + block@1: // if_body_L42 + let (sender_name#0: any, sender_name_existed#0: uint64) = (app_local_get_ex 0u 0u "name") + goto sender_name_existed#0 ? block@4 : block@2 + block@2: // if_body_L44 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = examples.everything.my_base.multiplicative_identity() + let new_state_value%7#0: uint64 = (+ app_global_get_ex_value%4#0 tmp%6#0) + (app_global_put "counter" new_state_value%7#0) + goto block@4 + block@4: // after_if_else_L42 + (app_local_put 0u "name" name#0) + return + + subroutine examples.everything.my_base.multiplicative_identity() -> uint64: + block@0: // L19 + return 1u + + subroutine examples.everything.contract.Everything.say_hello() -> bytes: + block@0: // L49 + examples.everything.contract.Everything._check_ban_list() + let (name#0: any, exists#0: uint64) = (app_local_get_ex 0u 0u "name") + goto exists#0 ? block@2 : block@1 + block@1: // if_body_L52 + return "\x00\x0fHowdy stranger!" + block@2: // after_if_else_L52 + let tmp%2#0: bytes = ((extract 2 0) name#0) + let tmp%3#0: bytes = (concat "Hello, " tmp%2#0) + let tmp%4#0: bytes = (concat tmp%3#0 "!") + let length%5#0: uint64 = (len tmp%4#0) + let value_as_bytes%6#0: bytes = (itob length%5#0) + let value_as_uint16%7#0: bytes = ((extract 6 2) value_as_bytes%6#0) + let tmp%8#0: bytes = (concat value_as_uint16%7#0 tmp%4#0) + return tmp%8#0 + + subroutine examples.everything.contract.Everything.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L57 + let c#0: bytes = examples.everything.my_base.MyMiddleBase.calculate(a#0, b#0) + let tmp%0#0: uint64 = (btoi c#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (* tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.my_base.MyMiddleBase.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L14 + let tmp%0#0: uint64 = (btoi a#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (+ tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.contract.Everything.close_out() -> void: + block@0: // L62 + examples.everything.contract.Everything._remove_sender() + return + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u + + subroutine examples.everything.contract.Everything.__init__() -> void: + block@0: // L30 + return + + program clear-state: + subroutine examples.everything.contract.Everything.clear_state_program() -> uint64: + block@0: // L65 + examples.everything.contract.Everything._remove_sender() + return 1u + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u \ No newline at end of file diff --git a/examples/everything/out/contract_Everything.post_ssa.ir b/examples/everything/out/contract_Everything.post_ssa.ir new file mode 100644 index 0000000000..ff5a9b7708 --- /dev/null +++ b/examples/everything/out/contract_Everything.post_ssa.ir @@ -0,0 +1,190 @@ +contract examples.everything.contract.Everything: + program approval: + subroutine examples.everything.contract.Everything.approval_program() -> uint64: + block@0: // L29 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L30 + examples.everything.contract.Everything.__init__() + goto block@2 + block@2: // entrypoint_L30 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L29 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create()void" => block@4, method "register(string)void" => block@5, method "say_hello()string" => block@6, method "calculate(uint64,uint64)uint64" => block@7, method "close_out()void" => block@8, * => block@11} + block@4: // create_route_L33 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + examples.everything.contract.Everything.create() + return 1u + block@5: // register_route_L39 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (shl 1u tmp%7#0) + let tmp%9#0: uint64 = (& tmp%8#0 3u) + (assert tmp%9#0) // OnCompletion is one of NoOp, OptIn + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + examples.everything.contract.Everything.register(tmp%11#0) + return 1u + block@6: // say_hello_route_L48 + 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 = examples.everything.contract.Everything.say_hello() + let tmp%16#0: bytes = (concat 0x151f7c75 tmp%15#0) + (log tmp%16#0) + return 1u + block@7: // calculate_route_L56 + let tmp%17#0: uint64 = (txn OnCompletion) + let tmp%18#0: uint64 = (! tmp%17#0) + (assert tmp%18#0) // OnCompletion is NoOp + let tmp%19#0: uint64 = (txn ApplicationID) + (assert tmp%19#0) // is not creating + let tmp%20#0: bytes = (txna ApplicationArgs 1) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: bytes = examples.everything.contract.Everything.calculate(tmp%20#0, tmp%21#0) + let tmp%23#0: bytes = (concat 0x151f7c75 tmp%22#0) + (log tmp%23#0) + return 1u + block@8: // close_out_route_L61 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 CloseOut) + (assert tmp%25#0) // OnCompletion is CloseOut + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + examples.everything.contract.Everything.close_out() + return 1u + block@11: // after_if_else_L29 + fail // reject transaction + + subroutine examples.everything.contract.Everything.create() -> void: + block@0: // L34 + examples.everything.contract.Everything._check_ban_list() + examples.everything.my_base.MyBase.remember_creator() + (app_global_put "counter" 0u) + return + + subroutine examples.everything.contract.Everything._check_ban_list() -> void: + block@0: // L70 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = examples.everything.contract.get_banned() + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // You are banned, goodbye + return + + subroutine examples.everything.contract.get_banned() -> bytes: + block@0: // L16 + return addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + + subroutine examples.everything.my_base.MyBase.remember_creator() -> void: + block@0: // L8 + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%0#0) + return + + subroutine examples.everything.contract.Everything.register(name: bytes) -> void: + block@0: // L40 + examples.everything.contract.Everything._check_ban_list() + let tmp%0#0: uint64 = (txn OnCompletion) + let tmp%1#0: uint64 = (== tmp%0#0 OptIn) + goto tmp%1#0 ? block@1 : block@4 + block@1: // if_body_L42 + let (sender_name#0: any, sender_name_existed#0: uint64) = (app_local_get_ex 0u 0u "name") + goto sender_name_existed#0 ? block@4 : block@2 + block@2: // if_body_L44 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = examples.everything.my_base.multiplicative_identity() + let new_state_value%7#0: uint64 = (+ app_global_get_ex_value%4#0 tmp%6#0) + (app_global_put "counter" new_state_value%7#0) + goto block@4 + block@4: // after_if_else_L42 + (app_local_put 0u "name" name#0) + return + + subroutine examples.everything.my_base.multiplicative_identity() -> uint64: + block@0: // L19 + return 1u + + subroutine examples.everything.contract.Everything.say_hello() -> bytes: + block@0: // L49 + examples.everything.contract.Everything._check_ban_list() + let (name#0: any, exists#0: uint64) = (app_local_get_ex 0u 0u "name") + goto exists#0 ? block@2 : block@1 + block@1: // if_body_L52 + return "\x00\x0fHowdy stranger!" + block@2: // after_if_else_L52 + let tmp%2#0: bytes = ((extract 2 0) name#0) + let tmp%3#0: bytes = (concat "Hello, " tmp%2#0) + let tmp%4#0: bytes = (concat tmp%3#0 "!") + let length%5#0: uint64 = (len tmp%4#0) + let value_as_bytes%6#0: bytes = (itob length%5#0) + let value_as_uint16%7#0: bytes = ((extract 6 2) value_as_bytes%6#0) + let tmp%8#0: bytes = (concat value_as_uint16%7#0 tmp%4#0) + return tmp%8#0 + + subroutine examples.everything.contract.Everything.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L57 + let c#0: bytes = examples.everything.my_base.MyMiddleBase.calculate(a#0, b#0) + let tmp%0#0: uint64 = (btoi c#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (* tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.my_base.MyMiddleBase.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L14 + let tmp%0#0: uint64 = (btoi a#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (+ tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.contract.Everything.close_out() -> void: + block@0: // L62 + examples.everything.contract.Everything._remove_sender() + return + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u + + subroutine examples.everything.contract.Everything.__init__() -> void: + block@0: // L30 + return + + program clear-state: + subroutine examples.everything.contract.Everything.clear_state_program() -> uint64: + block@0: // L65 + examples.everything.contract.Everything._remove_sender() + return 1u + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u \ No newline at end of file diff --git a/examples/everything/out/contract_Everything.ssa.ir b/examples/everything/out/contract_Everything.ssa.ir new file mode 100644 index 0000000000..82fbf0c731 --- /dev/null +++ b/examples/everything/out/contract_Everything.ssa.ir @@ -0,0 +1,201 @@ +contract examples.everything.contract.Everything: + program approval: + subroutine examples.everything.contract.Everything.approval_program() -> uint64: + block@0: // L29 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L30 + examples.everything.contract.Everything.__init__() + goto block@2 + block@2: // entrypoint_L30 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L29 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create()void" => block@4, method "register(string)void" => block@5, method "say_hello()string" => block@6, method "calculate(uint64,uint64)uint64" => block@7, method "close_out()void" => block@8, * => block@9} + block@4: // create_route_L33 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + examples.everything.contract.Everything.create() + return 1u + block@5: // register_route_L39 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (shl 1u tmp%7#0) + let tmp%9#0: uint64 = (& tmp%8#0 3u) + (assert tmp%9#0) // OnCompletion is one of NoOp, OptIn + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + examples.everything.contract.Everything.register(tmp%11#0) + return 1u + block@6: // say_hello_route_L48 + 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 = examples.everything.contract.Everything.say_hello() + let tmp%16#0: bytes = (concat 0x151f7c75 tmp%15#0) + (log tmp%16#0) + return 1u + block@7: // calculate_route_L56 + let tmp%17#0: uint64 = (txn OnCompletion) + let tmp%18#0: uint64 = (== tmp%17#0 NoOp) + (assert tmp%18#0) // OnCompletion is NoOp + let tmp%19#0: uint64 = (txn ApplicationID) + (assert tmp%19#0) // is not creating + let tmp%20#0: bytes = (txna ApplicationArgs 1) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: bytes = examples.everything.contract.Everything.calculate(tmp%20#0, tmp%21#0) + let tmp%23#0: bytes = (concat 0x151f7c75 tmp%22#0) + (log tmp%23#0) + return 1u + block@8: // close_out_route_L61 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 CloseOut) + (assert tmp%25#0) // OnCompletion is CloseOut + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + examples.everything.contract.Everything.close_out() + return 1u + block@9: // switch_case_default_L29 + goto block@10 + block@10: // switch_case_next_L29 + goto block@11 + block@11: // after_if_else_L29 + fail // reject transaction + + subroutine examples.everything.contract.Everything.create() -> void: + block@0: // L34 + examples.everything.contract.Everything._check_ban_list() + examples.everything.my_base.MyBase.remember_creator() + (app_global_put "counter" 0u) + return + + subroutine examples.everything.contract.Everything._check_ban_list() -> void: + block@0: // L70 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = examples.everything.contract.get_banned() + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // You are banned, goodbye + return + + subroutine examples.everything.contract.get_banned() -> bytes: + block@0: // L16 + let addr#0: bytes = addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + return addr#0 + + subroutine examples.everything.my_base.MyBase.remember_creator() -> void: + block@0: // L8 + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%0#0) + return + + subroutine examples.everything.contract.Everything.register(name: bytes) -> void: + block@0: // L40 + examples.everything.contract.Everything._check_ban_list() + let tmp%0#0: uint64 = (txn OnCompletion) + let tmp%1#0: uint64 = (== tmp%0#0 OptIn) + goto tmp%1#0 ? block@1 : block@4 + block@1: // if_body_L42 + let (tuple_assignment%2#0: any, tuple_assignment%3#0: uint64) = (app_local_get_ex 0u 0u "name") + let sender_name#0: any = tuple_assignment%2#0 + let sender_name_existed#0: uint64 = tuple_assignment%3#0 + goto sender_name_existed#0 ? block@3 : block@2 + block@2: // if_body_L44 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = examples.everything.my_base.multiplicative_identity() + let new_state_value%7#0: uint64 = (+ app_global_get_ex_value%4#0 tmp%6#0) + (app_global_put "counter" new_state_value%7#0) + goto block@3 + block@3: // after_if_else_L44 + goto block@4 + block@4: // after_if_else_L42 + (app_local_put 0u "name" name#0) + return + + subroutine examples.everything.my_base.multiplicative_identity() -> uint64: + block@0: // L19 + return 1u + + subroutine examples.everything.contract.Everything.say_hello() -> bytes: + block@0: // L49 + examples.everything.contract.Everything._check_ban_list() + let (tuple_assignment%0#0: any, tuple_assignment%1#0: uint64) = (app_local_get_ex 0u 0u "name") + let name#0: any = tuple_assignment%0#0 + let exists#0: uint64 = tuple_assignment%1#0 + goto exists#0 ? block@2 : block@1 + block@1: // if_body_L52 + return "\x00\x0fHowdy stranger!" + block@2: // after_if_else_L52 + let tmp%2#0: bytes = ((extract 2 0) name#0) + let tmp%3#0: bytes = (concat "Hello, " tmp%2#0) + let tmp%4#0: bytes = (concat tmp%3#0 "!") + let length%5#0: uint64 = (len tmp%4#0) + let value_as_bytes%6#0: bytes = (itob length%5#0) + let value_as_uint16%7#0: bytes = ((extract 6 2) value_as_bytes%6#0) + let tmp%8#0: bytes = (concat value_as_uint16%7#0 tmp%4#0) + return tmp%8#0 + + subroutine examples.everything.contract.Everything.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L57 + let c#0: bytes = examples.everything.my_base.MyMiddleBase.calculate(a#0, b#0) + let tmp%0#0: uint64 = (btoi c#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (* tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.my_base.MyMiddleBase.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L14 + let tmp%0#0: uint64 = (btoi a#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (+ tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.contract.Everything.close_out() -> void: + block@0: // L62 + examples.everything.contract.Everything._remove_sender() + return + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u + + subroutine examples.everything.contract.Everything.__init__() -> void: + block@0: // L30 + return + + program clear-state: + subroutine examples.everything.contract.Everything.clear_state_program() -> uint64: + block@0: // L65 + examples.everything.contract.Everything._remove_sender() + return 1u + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u \ No newline at end of file diff --git a/examples/everything/out/contract_Everything.ssa.opt_pass_1.ir b/examples/everything/out/contract_Everything.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..ff5a9b7708 --- /dev/null +++ b/examples/everything/out/contract_Everything.ssa.opt_pass_1.ir @@ -0,0 +1,190 @@ +contract examples.everything.contract.Everything: + program approval: + subroutine examples.everything.contract.Everything.approval_program() -> uint64: + block@0: // L29 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L30 + examples.everything.contract.Everything.__init__() + goto block@2 + block@2: // entrypoint_L30 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L29 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create()void" => block@4, method "register(string)void" => block@5, method "say_hello()string" => block@6, method "calculate(uint64,uint64)uint64" => block@7, method "close_out()void" => block@8, * => block@11} + block@4: // create_route_L33 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + examples.everything.contract.Everything.create() + return 1u + block@5: // register_route_L39 + let tmp%7#0: uint64 = (txn OnCompletion) + let tmp%8#0: uint64 = (shl 1u tmp%7#0) + let tmp%9#0: uint64 = (& tmp%8#0 3u) + (assert tmp%9#0) // OnCompletion is one of NoOp, OptIn + let tmp%10#0: uint64 = (txn ApplicationID) + (assert tmp%10#0) // is not creating + let tmp%11#0: bytes = (txna ApplicationArgs 1) + examples.everything.contract.Everything.register(tmp%11#0) + return 1u + block@6: // say_hello_route_L48 + 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 = examples.everything.contract.Everything.say_hello() + let tmp%16#0: bytes = (concat 0x151f7c75 tmp%15#0) + (log tmp%16#0) + return 1u + block@7: // calculate_route_L56 + let tmp%17#0: uint64 = (txn OnCompletion) + let tmp%18#0: uint64 = (! tmp%17#0) + (assert tmp%18#0) // OnCompletion is NoOp + let tmp%19#0: uint64 = (txn ApplicationID) + (assert tmp%19#0) // is not creating + let tmp%20#0: bytes = (txna ApplicationArgs 1) + let tmp%21#0: bytes = (txna ApplicationArgs 2) + let tmp%22#0: bytes = examples.everything.contract.Everything.calculate(tmp%20#0, tmp%21#0) + let tmp%23#0: bytes = (concat 0x151f7c75 tmp%22#0) + (log tmp%23#0) + return 1u + block@8: // close_out_route_L61 + let tmp%24#0: uint64 = (txn OnCompletion) + let tmp%25#0: uint64 = (== tmp%24#0 CloseOut) + (assert tmp%25#0) // OnCompletion is CloseOut + let tmp%26#0: uint64 = (txn ApplicationID) + (assert tmp%26#0) // is not creating + examples.everything.contract.Everything.close_out() + return 1u + block@11: // after_if_else_L29 + fail // reject transaction + + subroutine examples.everything.contract.Everything.create() -> void: + block@0: // L34 + examples.everything.contract.Everything._check_ban_list() + examples.everything.my_base.MyBase.remember_creator() + (app_global_put "counter" 0u) + return + + subroutine examples.everything.contract.Everything._check_ban_list() -> void: + block@0: // L70 + let tmp%0#0: bytes = (txn Sender) + let tmp%1#0: bytes = examples.everything.contract.get_banned() + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // You are banned, goodbye + return + + subroutine examples.everything.contract.get_banned() -> bytes: + block@0: // L16 + return addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA + + subroutine examples.everything.my_base.MyBase.remember_creator() -> void: + block@0: // L8 + let new_state_value%0#0: bytes = (txn Sender) + (app_global_put "creator" new_state_value%0#0) + return + + subroutine examples.everything.contract.Everything.register(name: bytes) -> void: + block@0: // L40 + examples.everything.contract.Everything._check_ban_list() + let tmp%0#0: uint64 = (txn OnCompletion) + let tmp%1#0: uint64 = (== tmp%0#0 OptIn) + goto tmp%1#0 ? block@1 : block@4 + block@1: // if_body_L42 + let (sender_name#0: any, sender_name_existed#0: uint64) = (app_local_get_ex 0u 0u "name") + goto sender_name_existed#0 ? block@4 : block@2 + block@2: // if_body_L44 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: uint64 = examples.everything.my_base.multiplicative_identity() + let new_state_value%7#0: uint64 = (+ app_global_get_ex_value%4#0 tmp%6#0) + (app_global_put "counter" new_state_value%7#0) + goto block@4 + block@4: // after_if_else_L42 + (app_local_put 0u "name" name#0) + return + + subroutine examples.everything.my_base.multiplicative_identity() -> uint64: + block@0: // L19 + return 1u + + subroutine examples.everything.contract.Everything.say_hello() -> bytes: + block@0: // L49 + examples.everything.contract.Everything._check_ban_list() + let (name#0: any, exists#0: uint64) = (app_local_get_ex 0u 0u "name") + goto exists#0 ? block@2 : block@1 + block@1: // if_body_L52 + return "\x00\x0fHowdy stranger!" + block@2: // after_if_else_L52 + let tmp%2#0: bytes = ((extract 2 0) name#0) + let tmp%3#0: bytes = (concat "Hello, " tmp%2#0) + let tmp%4#0: bytes = (concat tmp%3#0 "!") + let length%5#0: uint64 = (len tmp%4#0) + let value_as_bytes%6#0: bytes = (itob length%5#0) + let value_as_uint16%7#0: bytes = ((extract 6 2) value_as_bytes%6#0) + let tmp%8#0: bytes = (concat value_as_uint16%7#0 tmp%4#0) + return tmp%8#0 + + subroutine examples.everything.contract.Everything.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L57 + let c#0: bytes = examples.everything.my_base.MyMiddleBase.calculate(a#0, b#0) + let tmp%0#0: uint64 = (btoi c#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (* tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.my_base.MyMiddleBase.calculate(a: bytes, b: bytes) -> bytes: + block@0: // L14 + let tmp%0#0: uint64 = (btoi a#0) + let tmp%1#0: uint64 = (btoi b#0) + let tmp%2#0: uint64 = (+ tmp%0#0 tmp%1#0) + let val_as_bytes%3#0: bytes = (itob tmp%2#0) + return val_as_bytes%3#0 + + subroutine examples.everything.contract.Everything.close_out() -> void: + block@0: // L62 + examples.everything.contract.Everything._remove_sender() + return + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u + + subroutine examples.everything.contract.Everything.__init__() -> void: + block@0: // L30 + return + + program clear-state: + subroutine examples.everything.contract.Everything.clear_state_program() -> uint64: + block@0: // L65 + examples.everything.contract.Everything._remove_sender() + return 1u + + subroutine examples.everything.contract.Everything._remove_sender() -> void: + block@0: // L74 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "counter") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = examples.everything.contract.positive_one() + let new_state_value%3#0: uint64 = (- app_global_get_ex_value%0#0 tmp%2#0) + (app_global_put "counter" new_state_value%3#0) + return + + subroutine examples.everything.contract.positive_one() -> uint64: + block@0: // L79 + return 1u \ No newline at end of file diff --git a/examples/everything/out/my_base.awst b/examples/everything/out/my_base.awst index d83244c36e..9b7d046db3 100644 --- a/examples/everything/out/my_base.awst +++ b/examples/everything/out/my_base.awst @@ -1,20 +1,20 @@ abstract contract MyBase { globals { - ['creator']: algopy.Address + ['creator']: algopy.Account } subroutine remember_creator(): None { - this.globals['creator']: algopy.Address = txn() + this.globals['creator']: algopy.Account = txn() } } abstract contract MyMiddleBase extends (examples.everything.my_base::MyBase) { - subroutine calculate(a: algopy.UInt64, b: algopy.UInt64): algopy.UInt64 + subroutine calculate(a: algopy.arc4.UIntN[typing.Literal[64]], b: algopy.arc4.UIntN[typing.Literal[64]]): algopy.arc4.UIntN[typing.Literal[64]] { - return a + b + return arc4_encode(arc4_decode(a, algopy.UInt64) + arc4_decode(b, algopy.UInt64), algopy.arc4.UIntN[typing.Literal[64]]) } } diff --git a/examples/koopman/algopy.log b/examples/koopman/algopy.log index 9fbf8a0901..c0b32f067a 100644 --- a/examples/koopman/algopy.log +++ b/examples/koopman/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 koopman -info: Building AWST for __init__.py -info: Building AWST for koopman -info: Building AWST for koopman/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug koopman +debug: Building AWST for __init__.py +debug: Building AWST for koopman +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for koopman/contract.py debug: Sealing block@0: // L7 debug: Terminated block@0: // L7 debug: Sealing block@0: // L16 @@ -14,6 +15,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable a#0 debug: Removing unused variable c#0 @@ -26,6 +28,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -38,6 +41,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 75 + 77 to 152 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable b#0 debug: Optimizer: Simplify Conditional Branches @@ -48,6 +52,7 @@ debug: Optimizing subroutine examples.koopman.contract.MyContract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -60,6 +65,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 152 + 5 to 157 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable a#1 debug: Optimizer: Simplify Conditional Branches @@ -70,6 +76,7 @@ debug: Optimizing subroutine examples.koopman.contract.MyContract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -82,6 +89,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 152 + 157 to 309 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable c#1 debug: Optimizer: Simplify Conditional Branches @@ -92,6 +100,7 @@ debug: Optimizing subroutine examples.koopman.contract.MyContract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -103,6 +112,7 @@ debug: Optimizing subroutine examples.koopman.contract.MyContract.approval_progr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -112,6 +122,7 @@ debug: Optimizing subroutine examples.koopman.contract.MyContract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -130,8 +141,8 @@ debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in examples.koopman.contract.MyContract.clear_state_program using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/koopman/out/contract_MyContract.final.ir -info: Writing /examples/koopman/out/contract.approval.teal -info: Writing /examples/koopman/out/contract.approval.debug.teal -info: Writing /examples/koopman/out/contract.clear.teal -info: Writing /examples/koopman/out/contract.clear.debug.teal +info: Writing koopman/out/contract.approval.teal +info: Writing koopman/out/contract.approval.debug.teal +info: Writing koopman/out/contract.clear.teal +info: Writing koopman/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/less_simple/algopy.log b/examples/less_simple/algopy.log index 6988f5078f..d7120d916f 100644 --- a/examples/less_simple/algopy.log +++ b/examples/less_simple/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 less_simple -info: Building AWST for __init__.py -info: Building AWST for less_simple/__init__.py -info: Building AWST for less_simple/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug less_simple +debug: Building AWST for __init__.py +debug: Building AWST for less_simple/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for less_simple/contract.py debug: Sealing block@0: // L7 debug: Terminated block@0: // L7 debug: Looking for 'a' in an unsealed block creating an incomplete Phi: block@1: // while_top_L11 @@ -136,6 +137,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: a#1, product_of_odds#2 debug: Replacing {product_of_odds#2} with a#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -151,6 +153,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: range_item%0#1, i#0 debug: Replacing {range_item%0#1} with i#0 made 3 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -165,6 +168,7 @@ debug: Optimizing subroutine examples.less_simple.contract.MyContract.approval_p debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -176,6 +180,7 @@ debug: Optimizing subroutine examples.less_simple.contract.MyContract.clear_stat debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -315,53 +320,53 @@ debug: Coalescing i#0 with [i#1] debug: Coalescing resulted in 23 replacement/s debug: Output IR to /examples/less_simple/out/contract_MyContract.final.ir debug: Inserted main_while_top@1.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_while_top@1.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_while_top@1.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_while_body@2.ops[3]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_while_body@2.ops[5]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_while_body@2.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_while_body@2.ops[7]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_while_body@2.ops[9]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_while_body@2.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_after_if_else@6.ops[3]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_after_if_else@6.ops[5]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@6.ops[5]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_after_if_else@6.ops[7]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_after_if_else@6.ops[9]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@6.ops[9]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_else_body@8.ops[2]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_else_body@8.ops[4]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_else_body@8.ops[4]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_after_while@13.ops[3]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced main_after_while@13.ops[5]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced main_after_while@13.ops[5]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Found 7 edge set/s for examples.less_simple.contract.MyContract.approval_program debug: examples.less_simple.contract.MyContract.approval_program f-stack entry: [] debug: examples.less_simple.contract.MyContract.approval_program f-stack on first store: ['a#0', 'sum_of_evens#0', 'product_of_odds#0'] debug: Inserted main_block@0.ops[3]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[5]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[5]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted main_for_header@1.ops[3]: 'store continue_looping%1#0 to l-stack (copy)' -debug: Replaced main_for_header@1.ops[7]: 'load continue_looping%1#0 from scratch' with 'load continue_looping%1#0 from l-stack (no copy)' +debug: Replaced main_for_header@1.ops[7]: 'load continue_looping%1#0' with 'load continue_looping%1#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[2]: 'store square_root#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[4]: 'load square_root#0 from scratch' with 'load square_root#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[4]: 'load square_root#0' with 'load square_root#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[5]: 'store square_root#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[6]: 'load square_root#0 from scratch' with 'load square_root#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[6]: 'load square_root#0' with 'load square_root#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[8]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[10]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[10]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[13]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[17]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[17]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[1]: 'store i#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[12]: 'load i#0 from scratch' with 'load i#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[12]: 'load i#0' with 'load i#0 from l-stack (no copy)' debug: Inserted main_if_body@3.ops[3]: 'store sum_of_squares#0 to l-stack (copy)' -debug: Replaced main_if_body@3.ops[5]: 'load sum_of_squares#0 from scratch' with 'load sum_of_squares#0 from l-stack (no copy)' +debug: Replaced main_if_body@3.ops[5]: 'load sum_of_squares#0' with 'load sum_of_squares#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[1]: 'store sum_of_squares#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[3]: 'load sum_of_squares#0 from scratch' with 'load sum_of_squares#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[3]: 'load sum_of_squares#0' with 'load sum_of_squares#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[6]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[8]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[8]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_after_if_else@6.ops[3]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced main_after_if_else@6.ops[5]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@6.ops[5]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted main_after_for@8.ops[1]: 'store sum_of_squares#0 to l-stack (copy)' -debug: Replaced main_after_for@8.ops[3]: 'load sum_of_squares#0 from scratch' with 'load sum_of_squares#0 from l-stack (no copy)' +debug: Replaced main_after_for@8.ops[3]: 'load sum_of_squares#0' with 'load sum_of_squares#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.less_simple.contract.MyContract.clear_state_program debug: examples.less_simple.contract.MyContract.clear_state_program f-stack entry: ['sum_of_squares#10'] debug: examples.less_simple.contract.MyContract.clear_state_program f-stack on first store: ['sum_of_squares#0', 'i#0'] -info: Writing /examples/less_simple/out/contract.approval.teal -info: Writing /examples/less_simple/out/contract.approval.debug.teal -info: Writing /examples/less_simple/out/contract.clear.teal -info: Writing /examples/less_simple/out/contract.clear.debug.teal +info: Writing less_simple/out/contract.approval.teal +info: Writing less_simple/out/contract.approval.debug.teal +info: Writing less_simple/out/contract.clear.teal +info: Writing less_simple/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/local_storage/algopy.log b/examples/local_storage/algopy.log index 26e4b09889..0763f460db 100644 --- a/examples/local_storage/algopy.log +++ b/examples/local_storage/algopy.log @@ -1,8 +1,9 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 local_storage -info: Building AWST for __init__.py -info: Building AWST for local_storage -info: Building AWST for local_storage/local_storage_with_offsets.py -info: Building AWST for local_storage/local_storage_contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug local_storage +debug: Building AWST for __init__.py +debug: Building AWST for local_storage +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for local_storage/local_storage_with_offsets.py +debug: Building AWST for local_storage/local_storage_contract.py debug: Sealing block@0: // L54 debug: Terminated block@0: // L54 debug: Sealing block@0: // L62 @@ -179,6 +180,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -194,6 +196,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -208,6 +211,7 @@ debug: Found equivalence set: tuple_assignment%0#0, result#0 debug: Replacing {tuple_assignment%0#0} with result#0 made 1 modifications debug: Found equivalence set: tuple_assignment%1#0, exists#0 debug: Replacing {tuple_assignment%1#0} with exists#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -218,6 +222,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -228,6 +233,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -242,6 +248,7 @@ debug: Found equivalence set: default#0, ternary_result%1#1 debug: Replacing {ternary_result%1#1} with default#0 made 1 modifications debug: Found equivalence set: awst_tmp%0.0#0, ternary_result%1#0 debug: Replacing {ternary_result%1#0} with awst_tmp%0.0#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -254,6 +261,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -264,6 +272,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -275,6 +284,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -284,6 +294,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -293,6 +304,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -302,6 +314,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -311,6 +324,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -320,6 +334,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -331,6 +346,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -340,6 +356,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_contract.Local debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -384,80 +401,80 @@ debug: Coalescing local variables in examples.local_storage.local_storage_contra debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/local_storage/out/local_storage_contract_LocalStorageContract.final.ir debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[5]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[7]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[7]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[3]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[13]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[15]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[15]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[9]: 'store is_equal%5#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[12]: 'load is_equal%5#0 from scratch' with 'load is_equal%5#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[12]: 'load is_equal%5#0' with 'load is_equal%5#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[4]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[7]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[7]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[6]: 'store contains%4#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[13]: 'load contains%4#0 from scratch' with 'load contains%4#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[13]: 'load contains%4#0' with 'load contains%4#0 from l-stack (no copy)' debug: Inserted main_after_if_else@6.ops[1]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced main_after_if_else@6.ops[3]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@6.ops[3]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted main_after_if_else@6.ops[5]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_after_if_else@6.ops[7]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@6.ops[7]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted main_after_if_else@8.ops[3]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_after_if_else@8.ops[5]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@8.ops[5]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_after_if_else@8.ops[8]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_after_if_else@8.ops[10]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@8.ops[10]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted main_if_body@9.ops[3]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_if_body@9.ops[5]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced main_if_body@9.ops[5]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted main_if_body@10.ops[1]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_if_body@10.ops[3]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced main_if_body@10.ops[3]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted main_if_body@10.ops[5]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_if_body@10.ops[7]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced main_if_body@10.ops[7]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted main_else_body@11.ops[3]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_else_body@11.ops[5]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced main_else_body@11.ops[5]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted main_if_body@12.ops[1]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_if_body@12.ops[3]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_if_body@12.ops[3]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_if_body@12.ops[5]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_if_body@12.ops[7]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_if_body@12.ops[7]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_else_body@13.ops[3]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_else_body@13.ops[5]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_else_body@13.ops[5]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_if_body@14.ops[1]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_if_body@14.ops[3]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Replaced main_if_body@14.ops[3]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted main_else_body@19.ops[1]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_else_body@19.ops[3]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Replaced main_else_body@19.ops[3]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' debug: Inserted main_else_body@19.ops[6]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced main_else_body@19.ops[8]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' +debug: Replaced main_else_body@19.ops[8]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' debug: Inserted main_if_body@20.ops[3]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_if_body@20.ops[5]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' +debug: Replaced main_if_body@20.ops[5]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' debug: Inserted main_if_body@21.ops[3]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced main_if_body@21.ops[6]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' +debug: Replaced main_if_body@21.ops[6]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' debug: Inserted main_if_body@21.ops[1]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_if_body@21.ops[6]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced main_if_body@21.ops[6]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Inserted main_else_body@22.ops[3]: 'store tmp%24#0 to l-stack (copy)' -debug: Replaced main_else_body@22.ops[5]: 'load tmp%24#0 from scratch' with 'load tmp%24#0 from l-stack (no copy)' +debug: Replaced main_else_body@22.ops[5]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' debug: Inserted main_if_body@23.ops[7]: 'store tmp%27#0 to l-stack (copy)' -debug: Replaced main_if_body@23.ops[9]: 'load tmp%27#0 from scratch' with 'load tmp%27#0 from l-stack (no copy)' +debug: Replaced main_if_body@23.ops[9]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' debug: Inserted main_if_body@23.ops[3]: 'store tmp%26#0 to l-stack (copy)' -debug: Replaced main_if_body@23.ops[6]: 'load tmp%26#0 from scratch' with 'load tmp%26#0 from l-stack (no copy)' +debug: Replaced main_if_body@23.ops[6]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' debug: Inserted main_if_body@23.ops[1]: 'store tmp%25#0 to l-stack (copy)' -debug: Replaced main_if_body@23.ops[6]: 'load tmp%25#0 from scratch' with 'load tmp%25#0 from l-stack (no copy)' +debug: Replaced main_if_body@23.ops[6]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' debug: Found 13 edge set/s for examples.local_storage.local_storage_contract.LocalStorageContract.approval_program debug: examples.local_storage.local_storage_contract.LocalStorageContract.approval_program f-stack entry: ['method#0'] debug: examples.local_storage.local_storage_contract.LocalStorageContract.approval_program f-stack on first store: [] debug: Inserted get_guaranteed_data_block@0.ops[4]: 'store app_local_get_ex_did_exist%1#0 to l-stack (copy)' -debug: Replaced get_guaranteed_data_block@0.ops[7]: 'load app_local_get_ex_did_exist%1#0 from scratch' with 'load app_local_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Replaced get_guaranteed_data_block@0.ops[7]: 'load app_local_get_ex_did_exist%1#0' with 'load app_local_get_ex_did_exist%1#0 from l-stack (no copy)' debug: Inserted get_guaranteed_data_block@0.ops[6]: 'store app_local_get_ex_value%0#0 to l-stack (copy)' -debug: Replaced get_guaranteed_data_block@0.ops[10]: 'load app_local_get_ex_value%0#0 from scratch' with 'load app_local_get_ex_value%0#0 from l-stack (no copy)' +debug: Replaced get_guaranteed_data_block@0.ops[10]: 'load app_local_get_ex_value%0#0' with 'load app_local_get_ex_value%0#0 from l-stack (no copy)' debug: Inserted get_data_or_assert_block@0.ops[4]: 'store exists#0 to l-stack (copy)' -debug: Replaced get_data_or_assert_block@0.ops[7]: 'load exists#0 from scratch' with 'load exists#0 from l-stack (no copy)' +debug: Replaced get_data_or_assert_block@0.ops[7]: 'load exists#0' with 'load exists#0 from l-stack (no copy)' debug: Inserted get_data_or_assert_block@0.ops[6]: 'store result#0 to l-stack (copy)' -debug: Replaced get_data_or_assert_block@0.ops[10]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced get_data_or_assert_block@0.ops[10]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted get_data_with_default_block@0.ops[4]: 'store awst_tmp%0.1#0 to l-stack (copy)' -debug: Replaced get_data_with_default_block@0.ops[7]: 'load awst_tmp%0.1#0 from scratch' with 'load awst_tmp%0.1#0 from l-stack (no copy)' +debug: Replaced get_data_with_default_block@0.ops[7]: 'load awst_tmp%0.1#0' with 'load awst_tmp%0.1#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.local_storage.local_storage_contract.LocalStorageContract.get_data_with_default -debug: Eliminated scratch slots for 1 variable/s: ternary_result%1#2 -info: shared x-stack for get_data_with_default_ternary_true@1 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 -info: shared x-stack for get_data_with_default_ternary_false@2 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 +debug: Allocated 1 variable/s to x-stack: ternary_result%1#2 +debug: shared x-stack for get_data_with_default_ternary_true@1 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 +debug: shared x-stack for get_data_with_default_ternary_false@2 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 debug: examples.local_storage.local_storage_contract.LocalStorageContract.get_data_with_default f-stack entry: [] debug: examples.local_storage.local_storage_contract.LocalStorageContract.get_data_with_default f-stack on first store: ['awst_tmp%0.0#0'] debug: Output IR to /examples/local_storage/out/local_storage_with_offsets_LocalStorageContract.ssa.ir @@ -468,6 +485,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -483,6 +501,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -497,6 +516,7 @@ debug: Found equivalence set: tuple_assignment%0#0, result#0 debug: Replacing {tuple_assignment%0#0} with result#0 made 1 modifications debug: Found equivalence set: tuple_assignment%1#0, exists#0 debug: Replacing {tuple_assignment%1#0} with exists#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -507,6 +527,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -517,6 +538,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -531,6 +553,7 @@ debug: Found equivalence set: default#0, ternary_result%1#1 debug: Replacing {ternary_result%1#1} with default#0 made 1 modifications debug: Found equivalence set: awst_tmp%0.0#0, ternary_result%1#0 debug: Replacing {ternary_result%1#0} with awst_tmp%0.0#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -543,6 +566,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -553,6 +577,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -564,6 +589,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -573,6 +599,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -582,6 +609,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -591,6 +619,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -600,6 +629,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -609,6 +639,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -620,6 +651,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -629,6 +661,7 @@ debug: Optimizing subroutine examples.local_storage.local_storage_with_offsets.L debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -673,80 +706,80 @@ debug: Coalescing local variables in examples.local_storage.local_storage_with_o debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/local_storage/out/local_storage_with_offsets_LocalStorageContract.final.ir debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[5]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[7]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[7]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[3]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[13]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[15]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[15]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[9]: 'store is_equal%5#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[12]: 'load is_equal%5#0 from scratch' with 'load is_equal%5#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[12]: 'load is_equal%5#0' with 'load is_equal%5#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[4]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[7]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[7]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[6]: 'store contains%4#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[13]: 'load contains%4#0 from scratch' with 'load contains%4#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[13]: 'load contains%4#0' with 'load contains%4#0 from l-stack (no copy)' debug: Inserted main_after_if_else@6.ops[1]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced main_after_if_else@6.ops[3]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@6.ops[3]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted main_after_if_else@6.ops[6]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_after_if_else@6.ops[8]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@6.ops[8]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted main_after_if_else@8.ops[1]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_after_if_else@8.ops[3]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@8.ops[3]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_after_if_else@8.ops[9]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_after_if_else@8.ops[11]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@8.ops[11]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted main_after_if_else@8.ops[14]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_after_if_else@8.ops[16]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@8.ops[16]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted main_if_body@9.ops[3]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_if_body@9.ops[5]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced main_if_body@9.ops[5]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted main_if_body@10.ops[2]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_if_body@10.ops[4]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced main_if_body@10.ops[4]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted main_else_body@11.ops[3]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_else_body@11.ops[5]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced main_else_body@11.ops[5]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted main_if_body@12.ops[2]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_if_body@12.ops[4]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_if_body@12.ops[4]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_else_body@13.ops[3]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_else_body@13.ops[5]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_else_body@13.ops[5]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_else_body@19.ops[1]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_else_body@19.ops[3]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_else_body@19.ops[3]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_else_body@19.ops[6]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_else_body@19.ops[8]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Replaced main_else_body@19.ops[8]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted main_if_body@20.ops[3]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_if_body@20.ops[5]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Replaced main_if_body@20.ops[5]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' debug: Inserted main_if_body@21.ops[1]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced main_if_body@21.ops[4]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' +debug: Replaced main_if_body@21.ops[4]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' debug: Inserted main_else_body@22.ops[3]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_else_body@22.ops[5]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' +debug: Replaced main_else_body@22.ops[5]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' debug: Inserted main_if_body@23.ops[5]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced main_if_body@23.ops[7]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' +debug: Replaced main_if_body@23.ops[7]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' debug: Inserted main_if_body@23.ops[1]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_if_body@23.ops[4]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced main_if_body@23.ops[4]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Found 13 edge set/s for examples.local_storage.local_storage_with_offsets.LocalStorageContract.approval_program debug: examples.local_storage.local_storage_with_offsets.LocalStorageContract.approval_program f-stack entry: ['method#0', 'offset#0'] debug: examples.local_storage.local_storage_with_offsets.LocalStorageContract.approval_program f-stack on first store: [] debug: Inserted get_guaranteed_data_block@0.ops[4]: 'store app_local_get_ex_did_exist%1#0 to l-stack (copy)' -debug: Replaced get_guaranteed_data_block@0.ops[7]: 'load app_local_get_ex_did_exist%1#0 from scratch' with 'load app_local_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Replaced get_guaranteed_data_block@0.ops[7]: 'load app_local_get_ex_did_exist%1#0' with 'load app_local_get_ex_did_exist%1#0 from l-stack (no copy)' debug: Inserted get_guaranteed_data_block@0.ops[6]: 'store app_local_get_ex_value%0#0 to l-stack (copy)' -debug: Replaced get_guaranteed_data_block@0.ops[10]: 'load app_local_get_ex_value%0#0 from scratch' with 'load app_local_get_ex_value%0#0 from l-stack (no copy)' +debug: Replaced get_guaranteed_data_block@0.ops[10]: 'load app_local_get_ex_value%0#0' with 'load app_local_get_ex_value%0#0 from l-stack (no copy)' debug: Inserted get_data_or_assert_block@0.ops[4]: 'store exists#0 to l-stack (copy)' -debug: Replaced get_data_or_assert_block@0.ops[7]: 'load exists#0 from scratch' with 'load exists#0 from l-stack (no copy)' +debug: Replaced get_data_or_assert_block@0.ops[7]: 'load exists#0' with 'load exists#0 from l-stack (no copy)' debug: Inserted get_data_or_assert_block@0.ops[6]: 'store result#0 to l-stack (copy)' -debug: Replaced get_data_or_assert_block@0.ops[10]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced get_data_or_assert_block@0.ops[10]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted get_data_with_default_block@0.ops[4]: 'store awst_tmp%0.1#0 to l-stack (copy)' -debug: Replaced get_data_with_default_block@0.ops[7]: 'load awst_tmp%0.1#0 from scratch' with 'load awst_tmp%0.1#0 from l-stack (no copy)' +debug: Replaced get_data_with_default_block@0.ops[7]: 'load awst_tmp%0.1#0' with 'load awst_tmp%0.1#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.local_storage.local_storage_with_offsets.LocalStorageContract.get_data_with_default -debug: Eliminated scratch slots for 1 variable/s: ternary_result%1#2 -info: shared x-stack for get_data_with_default_ternary_true@1 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 -info: shared x-stack for get_data_with_default_ternary_false@2 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 +debug: Allocated 1 variable/s to x-stack: ternary_result%1#2 +debug: shared x-stack for get_data_with_default_ternary_true@1 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 +debug: shared x-stack for get_data_with_default_ternary_false@2 -> get_data_with_default_ternary_merge@3: ternary_result%1#2 debug: examples.local_storage.local_storage_with_offsets.LocalStorageContract.get_data_with_default f-stack entry: [] debug: examples.local_storage.local_storage_with_offsets.LocalStorageContract.get_data_with_default f-stack on first store: ['awst_tmp%0.0#0'] -info: Writing /examples/local_storage/out/local_storage_contract.approval.teal -info: Writing /examples/local_storage/out/local_storage_contract.approval.debug.teal -info: Writing /examples/local_storage/out/local_storage_contract.clear.teal -info: Writing /examples/local_storage/out/local_storage_contract.clear.debug.teal -info: Writing /examples/local_storage/out/local_storage_with_offsets.approval.teal -info: Writing /examples/local_storage/out/local_storage_with_offsets.approval.debug.teal -info: Writing /examples/local_storage/out/local_storage_with_offsets.clear.teal -info: Writing /examples/local_storage/out/local_storage_with_offsets.clear.debug.teal +info: Writing local_storage/out/local_storage_contract.approval.teal +info: Writing local_storage/out/local_storage_contract.approval.debug.teal +info: Writing local_storage/out/local_storage_contract.clear.teal +info: Writing local_storage/out/local_storage_contract.clear.debug.teal +info: Writing local_storage/out/local_storage_with_offsets.approval.teal +info: Writing local_storage/out/local_storage_with_offsets.approval.debug.teal +info: Writing local_storage/out/local_storage_with_offsets.clear.teal +info: Writing local_storage/out/local_storage_with_offsets.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/local_storage/local_storage_contract.py b/examples/local_storage/local_storage_contract.py index 2dddcfc3bc..06f550e2cd 100644 --- a/examples/local_storage/local_storage_contract.py +++ b/examples/local_storage/local_storage_contract.py @@ -1,4 +1,4 @@ -from algopy import Address, Bytes, Contract, Local, OnCompleteAction, Transaction, log, subroutine +from algopy import Account, Bytes, Contract, Local, OnCompleteAction, Transaction, log, subroutine class LocalStorageContract(Contract): @@ -44,23 +44,23 @@ def clear_state_program(self) -> bool: return True @subroutine - def get_guaranteed_data(self, for_account: Address) -> Bytes: + def get_guaranteed_data(self, for_account: Account) -> Bytes: return self.local[for_account] @subroutine - def get_data_with_default(self, for_account: Address, default: Bytes) -> Bytes: + def get_data_with_default(self, for_account: Account, default: Bytes) -> Bytes: return self.local.get(for_account, default) @subroutine - def get_data_or_assert(self, for_account: Address) -> Bytes: + def get_data_or_assert(self, for_account: Account) -> Bytes: result, exists = self.local.maybe(for_account) assert exists, "no data for account" return result @subroutine - def set_data(self, for_account: Address, value: Bytes) -> None: + def set_data(self, for_account: Account, value: Bytes) -> None: self.local[for_account] = value @subroutine - def delete_data(self, for_account: Address) -> None: + def delete_data(self, for_account: Account) -> None: del self.local[for_account] diff --git a/examples/local_storage/out/local_storage_contract.approval.debug.teal b/examples/local_storage/out/local_storage_contract.approval.debug.teal index 742575bae7..03e2c24427 100644 --- a/examples/local_storage/out/local_storage_contract.approval.debug.teal +++ b/examples/local_storage/out/local_storage_contract.approval.debug.teal @@ -29,7 +29,7 @@ main_after_if_else@4: txn OnCompletion // (𝕗) method#0 | {txn} Transaction.on_completion() File "local_storage/local_storage_contract.py", line 11 dup // load tmp%3#0 from l-stack (copy) (𝕗) method#0 | tmp%3#0,tmp%3#0 Transaction.on_completion() File "local_storage/local_storage_contract.py", line 11 ! // (𝕗) method#0 | tmp%3#0,{!} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 - cover 1 // store contains%4#0 to l-stack (no copy) (𝕗) method#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 + swap // store contains%4#0 to l-stack (no copy) (𝕗) method#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 int OptIn // (𝕗) method#0 | contains%4#0,tmp%3#0,OptIn OnCompleteAction.OptIn File "local_storage/local_storage_contract.py", line 11 == // (𝕗) method#0 | contains%4#0,{==} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 || // (𝕗) method#0 | {||} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 @@ -156,47 +156,47 @@ main_else_body@27: // examples.local_storage.local_storage_contract.LocalStorageContract.get_guaranteed_data(for_account#0: bytes) -> bytes: get_guaranteed_data: - proto 1 1 // (𝕡) for_account#0 | def get_guaranteed_data(self, for_account: Address) -> Bytes: File "local_storage/local_storage_contract.py", line 47 + proto 1 1 // (𝕡) for_account#0 | def get_guaranteed_data(self, for_account: Account) -> Bytes: File "local_storage/local_storage_contract.py", line 47 get_guaranteed_data_block@0: - frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 47 + frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 47 int 0 // (𝕡) for_account#0 | for_account#0,0 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local[for_account] File "local_storage/local_storage_contract.py", line 48 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 - assert // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 + assert // check value exists // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 retsub // app_local_get_ex_value%0#0 return self.local[for_account] File "local_storage/local_storage_contract.py", line 48 // examples.local_storage.local_storage_contract.LocalStorageContract.get_data_or_assert(for_account#0: bytes) -> bytes: get_data_or_assert: - proto 1 1 // (𝕡) for_account#0 | def get_data_or_assert(self, for_account: Address) -> Bytes: File "local_storage/local_storage_contract.py", line 55 + proto 1 1 // (𝕡) for_account#0 | def get_data_or_assert(self, for_account: Account) -> Bytes: File "local_storage/local_storage_contract.py", line 55 get_data_or_assert_block@0: - frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 55 + frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 55 int 0 // (𝕡) for_account#0 | for_account#0,0 self.local.maybe(for_account) File "local_storage/local_storage_contract.py", line 56 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local.maybe(for_account) File "local_storage/local_storage_contract.py", line 56 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local.maybe(for_account) File "local_storage/local_storage_contract.py", line 56 - assert // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_contract.py", line 57 + assert // no data for account // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_contract.py", line 57 retsub // result#0 return result File "local_storage/local_storage_contract.py", line 58 -// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> void: delete_data: - proto 1 0 // (𝕡) for_account#0 | def delete_data(self, for_account: Address) -> None: File "local_storage/local_storage_contract.py", line 65 + proto 1 0 // (𝕡) for_account#0 | def delete_data(self, for_account: Account) -> None: File "local_storage/local_storage_contract.py", line 65 delete_data_block@0: - frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 65 + frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 65 byte "local" // (𝕡) for_account#0 | for_account#0,"local" self.local[for_account] File "local_storage/local_storage_contract.py", line 66 app_local_del // (𝕡) for_account#0 | del self.local[for_account] File "local_storage/local_storage_contract.py", line 66 retsub // -// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> void: set_data: - proto 2 0 // (𝕡) for_account#0,value#0 | def set_data(self, for_account: Address, value: Bytes) -> None: File "local_storage/local_storage_contract.py", line 61 + proto 2 0 // (𝕡) for_account#0,value#0 | def set_data(self, for_account: Account, value: Bytes) -> None: File "local_storage/local_storage_contract.py", line 61 set_data_block@0: - frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,value#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 61 + frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,value#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 61 byte "local" // (𝕡) for_account#0,value#0 | for_account#0,"local" self.local[for_account] File "local_storage/local_storage_contract.py", line 62 frame_dig -1 // load value#0 from parameters (𝕡) for_account#0,value#0 | for_account#0,"local",value#0 value: Bytes File "local_storage/local_storage_contract.py", line 61 app_local_put // (𝕡) for_account#0,value#0 | self.local[for_account] = value File "local_storage/local_storage_contract.py", line 62 @@ -205,10 +205,10 @@ set_data_block@0: // examples.local_storage.local_storage_contract.LocalStorageContract.get_data_with_default(for_account#0: bytes, default#0: bytes) -> bytes: get_data_with_default: - proto 2 1 // (𝕡) for_account#0,default#0 | def get_data_with_default(self, for_account: Address, default: Bytes) -> Bytes: File "local_storage/local_storage_contract.py", line 51 + proto 2 1 // (𝕡) for_account#0,default#0 | def get_data_with_default(self, for_account: Account, default: Bytes) -> Bytes: File "local_storage/local_storage_contract.py", line 51 get_data_with_default_block@0: - frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,default#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 51 + frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,default#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 51 int 0 // (𝕡) for_account#0,default#0 | for_account#0,0 self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 byte "local" // (𝕡) for_account#0,default#0 | for_account#0,0,"local" self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 app_local_get_ex // (𝕡) for_account#0,default#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 @@ -224,11 +224,11 @@ get_data_with_default_ternary_false@2: // Implicit fall through to get_data_with_default_ternary_merge@3 // (𝕡) for_account#0,default#0 | (𝕗) awst_tmp%0.0#0 | (𝕏) ternary_result%1#2 | ternary_result%1#2 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub // ternary_result%1#2 ternary_result%1#2 return self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 -// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "local_storage/local_storage_contract.py", line 5 diff --git a/examples/local_storage/out/local_storage_contract.approval.teal b/examples/local_storage/out/local_storage_contract.approval.teal index b6d46cbd43..7d78d5504c 100644 --- a/examples/local_storage/out/local_storage_contract.approval.teal +++ b/examples/local_storage/out/local_storage_contract.approval.teal @@ -24,7 +24,7 @@ main_after_if_else@4: txn OnCompletion dup ! - cover 1 + swap int OptIn == || @@ -149,7 +149,7 @@ get_guaranteed_data_block@0: int 0 byte "local" app_local_get_ex - assert + assert // check value exists retsub @@ -162,11 +162,11 @@ get_data_or_assert_block@0: int 0 byte "local" app_local_get_ex - assert + assert // no data for account retsub -// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> void: delete_data: proto 1 0 @@ -177,7 +177,7 @@ delete_data_block@0: retsub -// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> void: set_data: proto 2 0 @@ -208,11 +208,11 @@ get_data_with_default_ternary_false@2: frame_dig -1 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub -// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> void: __init__: proto 0 0 diff --git a/examples/local_storage/out/local_storage_contract.approval_unoptimized.debug.teal b/examples/local_storage/out/local_storage_contract.approval_unoptimized.debug.teal index b174955203..9396cfc792 100644 --- a/examples/local_storage/out/local_storage_contract.approval_unoptimized.debug.teal +++ b/examples/local_storage/out/local_storage_contract.approval_unoptimized.debug.teal @@ -31,7 +31,7 @@ main_after_if_else@4: dup // load tmp%3#0 from l-stack (copy) (𝕗) method#0 | tmp%3#0,tmp%3#0 Transaction.on_completion() File "local_storage/local_storage_contract.py", line 11 int NoOp // (𝕗) method#0 | tmp%3#0,tmp%3#0,NoOp OnCompleteAction.NoOp File "local_storage/local_storage_contract.py", line 11 == // (𝕗) method#0 | tmp%3#0,{==} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 - cover 1 // store contains%4#0 to l-stack (no copy) (𝕗) method#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 + swap // store contains%4#0 to l-stack (no copy) (𝕗) method#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 int OptIn // (𝕗) method#0 | contains%4#0,tmp%3#0,OptIn OnCompleteAction.OptIn File "local_storage/local_storage_contract.py", line 11 == // (𝕗) method#0 | contains%4#0,{==} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 || // (𝕗) method#0 | {||} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_contract.py", line 11 @@ -168,47 +168,47 @@ main_else_body@27: // examples.local_storage.local_storage_contract.LocalStorageContract.get_guaranteed_data(for_account#0: bytes) -> bytes: get_guaranteed_data: - proto 1 1 // (𝕡) for_account#0 | def get_guaranteed_data(self, for_account: Address) -> Bytes: File "local_storage/local_storage_contract.py", line 47 + proto 1 1 // (𝕡) for_account#0 | def get_guaranteed_data(self, for_account: Account) -> Bytes: File "local_storage/local_storage_contract.py", line 47 get_guaranteed_data_block@0: - frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 47 + frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 47 int 0 // (𝕡) for_account#0 | for_account#0,0 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local[for_account] File "local_storage/local_storage_contract.py", line 48 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 - assert // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 + assert // check value exists // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_contract.py", line 48 retsub // app_local_get_ex_value%0#0 return self.local[for_account] File "local_storage/local_storage_contract.py", line 48 // examples.local_storage.local_storage_contract.LocalStorageContract.get_data_or_assert(for_account#0: bytes) -> bytes: get_data_or_assert: - proto 1 1 // (𝕡) for_account#0 | def get_data_or_assert(self, for_account: Address) -> Bytes: File "local_storage/local_storage_contract.py", line 55 + proto 1 1 // (𝕡) for_account#0 | def get_data_or_assert(self, for_account: Account) -> Bytes: File "local_storage/local_storage_contract.py", line 55 get_data_or_assert_block@0: - frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 55 + frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 55 int 0 // (𝕡) for_account#0 | for_account#0,0 self.local.maybe(for_account) File "local_storage/local_storage_contract.py", line 56 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local.maybe(for_account) File "local_storage/local_storage_contract.py", line 56 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local.maybe(for_account) File "local_storage/local_storage_contract.py", line 56 - assert // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_contract.py", line 57 + assert // no data for account // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_contract.py", line 57 retsub // result#0 return result File "local_storage/local_storage_contract.py", line 58 -// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> void: delete_data: - proto 1 0 // (𝕡) for_account#0 | def delete_data(self, for_account: Address) -> None: File "local_storage/local_storage_contract.py", line 65 + proto 1 0 // (𝕡) for_account#0 | def delete_data(self, for_account: Account) -> None: File "local_storage/local_storage_contract.py", line 65 delete_data_block@0: - frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 65 + frame_dig -1 // load for_account#0 from parameters (𝕡) for_account#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 65 byte "local" // (𝕡) for_account#0 | for_account#0,"local" self.local[for_account] File "local_storage/local_storage_contract.py", line 66 app_local_del // (𝕡) for_account#0 | del self.local[for_account] File "local_storage/local_storage_contract.py", line 66 retsub // -// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> void: set_data: - proto 2 0 // (𝕡) for_account#0,value#0 | def set_data(self, for_account: Address, value: Bytes) -> None: File "local_storage/local_storage_contract.py", line 61 + proto 2 0 // (𝕡) for_account#0,value#0 | def set_data(self, for_account: Account, value: Bytes) -> None: File "local_storage/local_storage_contract.py", line 61 set_data_block@0: - frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,value#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 61 + frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,value#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 61 byte "local" // (𝕡) for_account#0,value#0 | for_account#0,"local" self.local[for_account] File "local_storage/local_storage_contract.py", line 62 frame_dig -1 // load value#0 from parameters (𝕡) for_account#0,value#0 | for_account#0,"local",value#0 value: Bytes File "local_storage/local_storage_contract.py", line 61 app_local_put // (𝕡) for_account#0,value#0 | self.local[for_account] = value File "local_storage/local_storage_contract.py", line 62 @@ -217,10 +217,10 @@ set_data_block@0: // examples.local_storage.local_storage_contract.LocalStorageContract.get_data_with_default(for_account#0: bytes, default#0: bytes) -> bytes: get_data_with_default: - proto 2 1 // (𝕡) for_account#0,default#0 | def get_data_with_default(self, for_account: Address, default: Bytes) -> Bytes: File "local_storage/local_storage_contract.py", line 51 + proto 2 1 // (𝕡) for_account#0,default#0 | def get_data_with_default(self, for_account: Account, default: Bytes) -> Bytes: File "local_storage/local_storage_contract.py", line 51 get_data_with_default_block@0: - frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,default#0 | for_account#0 for_account: Address File "local_storage/local_storage_contract.py", line 51 + frame_dig -2 // load for_account#0 from parameters (𝕡) for_account#0,default#0 | for_account#0 for_account: Account File "local_storage/local_storage_contract.py", line 51 int 0 // (𝕡) for_account#0,default#0 | for_account#0,0 self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 byte "local" // (𝕡) for_account#0,default#0 | for_account#0,0,"local" self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 app_local_get_ex // (𝕡) for_account#0,default#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 @@ -236,11 +236,11 @@ get_data_with_default_ternary_false@2: // Implicit fall through to get_data_with_default_ternary_merge@3 // (𝕡) for_account#0,default#0 | (𝕗) awst_tmp%0.0#0 | (𝕏) ternary_result%1#0 | ternary_result%1#0 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub // ternary_result%1#0 ternary_result%1#0 return self.local.get(for_account, default) File "local_storage/local_storage_contract.py", line 52 -// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "local_storage/local_storage_contract.py", line 5 diff --git a/examples/local_storage/out/local_storage_contract.approval_unoptimized.teal b/examples/local_storage/out/local_storage_contract.approval_unoptimized.teal index db407609cc..4d7693ba4c 100644 --- a/examples/local_storage/out/local_storage_contract.approval_unoptimized.teal +++ b/examples/local_storage/out/local_storage_contract.approval_unoptimized.teal @@ -26,7 +26,7 @@ main_after_if_else@4: dup int NoOp == - cover 1 + swap int OptIn == || @@ -158,7 +158,7 @@ get_guaranteed_data_block@0: int 0 byte "local" app_local_get_ex - assert + assert // check value exists retsub @@ -171,11 +171,11 @@ get_data_or_assert_block@0: int 0 byte "local" app_local_get_ex - assert + assert // no data for account retsub -// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.delete_data(for_account#0: bytes) -> void: delete_data: proto 1 0 @@ -186,7 +186,7 @@ delete_data_block@0: retsub -// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.set_data(for_account#0: bytes, value#0: bytes) -> void: set_data: proto 2 0 @@ -217,11 +217,11 @@ get_data_with_default_ternary_false@2: frame_dig -1 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub -// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_contract.LocalStorageContract.__init__() -> void: __init__: proto 0 0 diff --git a/examples/local_storage/out/local_storage_contract.awst b/examples/local_storage/out/local_storage_contract.awst index a12b775b0c..361c46b50b 100644 --- a/examples/local_storage/out/local_storage_contract.awst +++ b/examples/local_storage/out/local_storage_contract.awst @@ -59,29 +59,29 @@ contract LocalStorageContract return true } - subroutine get_guaranteed_data(for_account: algopy.Address): algopy.Bytes + subroutine get_guaranteed_data(for_account: algopy.Account): algopy.Bytes { return this.locals['local'].account[for_account] } - subroutine get_data_with_default(for_account: algopy.Address, default: algopy.Bytes): algopy.Bytes + subroutine get_data_with_default(for_account: algopy.Account, default: algopy.Bytes): algopy.Bytes { - return tmp$0: tuple[algopy.Bytes, bool] := app_local_get_ex(for_account, 0u, 'local')[1] ? tmp$0[0] : default + return (tmp$0: tuple[algopy.Bytes, bool] := app_local_get_ex(for_account, 0u, 'local')[1]) ? (tmp$0[0]) : (default) } - subroutine get_data_or_assert(for_account: algopy.Address): algopy.Bytes + subroutine get_data_or_assert(for_account: algopy.Account): algopy.Bytes { (result, exists): tuple[algopy.Bytes, bool] = app_local_get_ex(for_account, 0u, 'local') assert(exists, comment="no data for account") return result } - subroutine set_data(for_account: algopy.Address, value: algopy.Bytes): None + subroutine set_data(for_account: algopy.Account, value: algopy.Bytes): None { this.locals['local'].account[for_account]: algopy.Bytes = value } - subroutine delete_data(for_account: algopy.Address): None + subroutine delete_data(for_account: algopy.Account): None { app_local_del(for_account, 'local') } diff --git a/examples/local_storage/out/local_storage_with_offsets.approval.debug.teal b/examples/local_storage/out/local_storage_with_offsets.approval.debug.teal index e442635c66..28f11b07dc 100644 --- a/examples/local_storage/out/local_storage_with_offsets.approval.debug.teal +++ b/examples/local_storage/out/local_storage_with_offsets.approval.debug.teal @@ -30,7 +30,7 @@ main_after_if_else@4: txn OnCompletion // (𝕗) method#0,offset#0 | {txn} Transaction.on_completion() File "local_storage/local_storage_with_offsets.py", line 21 dup // load tmp%3#0 from l-stack (copy) (𝕗) method#0,offset#0 | tmp%3#0,tmp%3#0 Transaction.on_completion() File "local_storage/local_storage_with_offsets.py", line 21 ! // (𝕗) method#0,offset#0 | tmp%3#0,{!} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 - cover 1 // store contains%4#0 to l-stack (no copy) (𝕗) method#0,offset#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 + swap // store contains%4#0 to l-stack (no copy) (𝕗) method#0,offset#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 int OptIn // (𝕗) method#0,offset#0 | contains%4#0,tmp%3#0,OptIn OnCompleteAction.OptIn File "local_storage/local_storage_with_offsets.py", line 21 == // (𝕗) method#0,offset#0 | contains%4#0,{==} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 || // (𝕗) method#0,offset#0 | {||} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 @@ -129,7 +129,7 @@ main_if_body@20: main_if_body@21: txna ApplicationArgs 2 // (𝕗) method#0,offset#0 | {txna} Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 41 dig 1 // load offset#0 from f-stack (𝕗) method#0,offset#0 | tmp%20#0,offset#0 offset File "local_storage/local_storage_with_offsets.py", line 26 - uncover 1 // load tmp%20#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%20#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 41 + swap // load tmp%20#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%20#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 41 callsub set_data // (𝕗) method#0,offset#0 | self.set_data(offset, Transaction.application_args(2)) File "local_storage/local_storage_with_offsets.py", line 41 b main_after_if_else@26 // (𝕗) method#0,offset#0 | @@ -143,7 +143,7 @@ main_else_body@22: main_if_body@23: txna ApplicationArgs 2 // (𝕗) method#0,offset#0 | {txna} Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 43 dig 1 // load offset#0 from f-stack (𝕗) method#0,offset#0 | tmp%22#0,offset#0 offset File "local_storage/local_storage_with_offsets.py", line 26 - uncover 1 // load tmp%22#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%22#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 43 + swap // load tmp%22#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%22#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 43 callsub get_data_with_default // (𝕗) method#0,offset#0 | {get_data_with_default} self.get_data_with_default(offset, Transaction.application_args(2)) File "local_storage/local_storage_with_offsets.py", line 43 log // (𝕗) method#0,offset#0 | log(self.get_data_with_default(offset, Transaction.application_args(2))) File "local_storage/local_storage_with_offsets.py", line 43 b main_after_if_else@26 // (𝕗) method#0,offset#0 | @@ -170,7 +170,7 @@ get_guaranteed_data_block@0: int 0 // (𝕡) for_account#0 | for_account#0,0 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 - assert // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 + assert // check value exists // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 retsub // app_local_get_ex_value%0#0 return self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 @@ -183,11 +183,11 @@ get_data_or_assert_block@0: int 0 // (𝕡) for_account#0 | for_account#0,0 self.local.maybe(for_account) File "local_storage/local_storage_with_offsets.py", line 63 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local.maybe(for_account) File "local_storage/local_storage_with_offsets.py", line 63 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local.maybe(for_account) File "local_storage/local_storage_with_offsets.py", line 63 - assert // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_with_offsets.py", line 64 + assert // no data for account // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_with_offsets.py", line 64 retsub // result#0 return result File "local_storage/local_storage_with_offsets.py", line 65 -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> void: delete_data: proto 1 0 // (𝕡) for_account#0 | def delete_data(self, for_account: UInt64) -> None: File "local_storage/local_storage_with_offsets.py", line 72 @@ -198,7 +198,7 @@ delete_data_block@0: retsub // -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> void: set_data: proto 2 0 // (𝕡) for_account#0,value#0 | def set_data(self, for_account: UInt64, value: Bytes) -> None: File "local_storage/local_storage_with_offsets.py", line 68 @@ -231,11 +231,11 @@ get_data_with_default_ternary_false@2: // Implicit fall through to get_data_with_default_ternary_merge@3 // (𝕡) for_account#0,default#0 | (𝕗) awst_tmp%0.0#0 | (𝕏) ternary_result%1#2 | ternary_result%1#2 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub // ternary_result%1#2 ternary_result%1#2 return self.local.get(for_account, default) File "local_storage/local_storage_with_offsets.py", line 59 -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "local_storage/local_storage_with_offsets.py", line 15 diff --git a/examples/local_storage/out/local_storage_with_offsets.approval.teal b/examples/local_storage/out/local_storage_with_offsets.approval.teal index afbbf9e51f..44b5b8fa06 100644 --- a/examples/local_storage/out/local_storage_with_offsets.approval.teal +++ b/examples/local_storage/out/local_storage_with_offsets.approval.teal @@ -25,7 +25,7 @@ main_after_if_else@4: txn OnCompletion dup ! - cover 1 + swap int OptIn == || @@ -116,7 +116,7 @@ main_if_body@20: main_if_body@21: txna ApplicationArgs 2 dig 1 - uncover 1 + swap callsub set_data b main_after_if_else@26 @@ -129,7 +129,7 @@ main_else_body@22: main_if_body@23: txna ApplicationArgs 2 dig 1 - uncover 1 + swap callsub get_data_with_default log b main_after_if_else@26 @@ -156,7 +156,7 @@ get_guaranteed_data_block@0: int 0 byte "local" app_local_get_ex - assert + assert // check value exists retsub @@ -169,11 +169,11 @@ get_data_or_assert_block@0: int 0 byte "local" app_local_get_ex - assert + assert // no data for account retsub -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> void: delete_data: proto 1 0 @@ -184,7 +184,7 @@ delete_data_block@0: retsub -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> void: set_data: proto 2 0 @@ -215,11 +215,11 @@ get_data_with_default_ternary_false@2: frame_dig -1 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> void: __init__: proto 0 0 diff --git a/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.debug.teal b/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.debug.teal index 860a559f33..4fac975532 100644 --- a/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.debug.teal +++ b/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.debug.teal @@ -32,7 +32,7 @@ main_after_if_else@4: dup // load tmp%3#0 from l-stack (copy) (𝕗) method#0,offset#0 | tmp%3#0,tmp%3#0 Transaction.on_completion() File "local_storage/local_storage_with_offsets.py", line 21 int NoOp // (𝕗) method#0,offset#0 | tmp%3#0,tmp%3#0,NoOp OnCompleteAction.NoOp File "local_storage/local_storage_with_offsets.py", line 21 == // (𝕗) method#0,offset#0 | tmp%3#0,{==} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 - cover 1 // store contains%4#0 to l-stack (no copy) (𝕗) method#0,offset#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 + swap // store contains%4#0 to l-stack (no copy) (𝕗) method#0,offset#0 | contains%4#0,tmp%3#0 Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 int OptIn // (𝕗) method#0,offset#0 | contains%4#0,tmp%3#0,OptIn OnCompleteAction.OptIn File "local_storage/local_storage_with_offsets.py", line 21 == // (𝕗) method#0,offset#0 | contains%4#0,{==} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 || // (𝕗) method#0,offset#0 | {||} Transaction.on_completion() not in (OnCompleteAction.NoOp, OnCompleteAction.OptIn): File "local_storage/local_storage_with_offsets.py", line 21 @@ -137,7 +137,7 @@ main_if_body@20: main_if_body@21: txna ApplicationArgs 2 // (𝕗) method#0,offset#0 | {txna} Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 41 dig 1 // load offset#0 from f-stack (𝕗) method#0,offset#0 | tmp%20#0,offset#0 offset File "local_storage/local_storage_with_offsets.py", line 26 - uncover 1 // load tmp%20#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%20#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 41 + swap // load tmp%20#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%20#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 41 callsub set_data // (𝕗) method#0,offset#0 | self.set_data(offset, Transaction.application_args(2)) File "local_storage/local_storage_with_offsets.py", line 41 b main_after_if_else@26 // (𝕗) method#0,offset#0 | @@ -151,7 +151,7 @@ main_else_body@22: main_if_body@23: txna ApplicationArgs 2 // (𝕗) method#0,offset#0 | {txna} Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 43 dig 1 // load offset#0 from f-stack (𝕗) method#0,offset#0 | tmp%22#0,offset#0 offset File "local_storage/local_storage_with_offsets.py", line 26 - uncover 1 // load tmp%22#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%22#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 43 + swap // load tmp%22#0 from l-stack (no copy) (𝕗) method#0,offset#0 | offset#0,tmp%22#0 Transaction.application_args(2) File "local_storage/local_storage_with_offsets.py", line 43 callsub get_data_with_default // (𝕗) method#0,offset#0 | {get_data_with_default} self.get_data_with_default(offset, Transaction.application_args(2)) File "local_storage/local_storage_with_offsets.py", line 43 log // (𝕗) method#0,offset#0 | log(self.get_data_with_default(offset, Transaction.application_args(2))) File "local_storage/local_storage_with_offsets.py", line 43 b main_after_if_else@25 // (𝕗) method#0,offset#0 | @@ -181,7 +181,7 @@ get_guaranteed_data_block@0: int 0 // (𝕡) for_account#0 | for_account#0,0 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 - assert // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 + assert // check value exists // (𝕡) for_account#0 | app_local_get_ex_value%0#0 self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 retsub // app_local_get_ex_value%0#0 return self.local[for_account] File "local_storage/local_storage_with_offsets.py", line 55 @@ -194,11 +194,11 @@ get_data_or_assert_block@0: int 0 // (𝕡) for_account#0 | for_account#0,0 self.local.maybe(for_account) File "local_storage/local_storage_with_offsets.py", line 63 byte "local" // (𝕡) for_account#0 | for_account#0,0,"local" self.local.maybe(for_account) File "local_storage/local_storage_with_offsets.py", line 63 app_local_get_ex // (𝕡) for_account#0 | {app_local_get_ex}.0,{app_local_get_ex}.1 self.local.maybe(for_account) File "local_storage/local_storage_with_offsets.py", line 63 - assert // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_with_offsets.py", line 64 + assert // no data for account // (𝕡) for_account#0 | result#0 assert exists, "no data for account" File "local_storage/local_storage_with_offsets.py", line 64 retsub // result#0 return result File "local_storage/local_storage_with_offsets.py", line 65 -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> void: delete_data: proto 1 0 // (𝕡) for_account#0 | def delete_data(self, for_account: UInt64) -> None: File "local_storage/local_storage_with_offsets.py", line 72 @@ -209,7 +209,7 @@ delete_data_block@0: retsub // -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> void: set_data: proto 2 0 // (𝕡) for_account#0,value#0 | def set_data(self, for_account: UInt64, value: Bytes) -> None: File "local_storage/local_storage_with_offsets.py", line 68 @@ -242,11 +242,11 @@ get_data_with_default_ternary_false@2: // Implicit fall through to get_data_with_default_ternary_merge@3 // (𝕡) for_account#0,default#0 | (𝕗) awst_tmp%0.0#0 | (𝕏) ternary_result%1#0 | ternary_result%1#0 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub // ternary_result%1#0 ternary_result%1#0 return self.local.get(for_account, default) File "local_storage/local_storage_with_offsets.py", line 59 -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "local_storage/local_storage_with_offsets.py", line 15 diff --git a/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.teal b/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.teal index 25509db4bf..5470db7d47 100644 --- a/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.teal +++ b/examples/local_storage/out/local_storage_with_offsets.approval_unoptimized.teal @@ -27,7 +27,7 @@ main_after_if_else@4: dup int NoOp == - cover 1 + swap int OptIn == || @@ -122,7 +122,7 @@ main_if_body@20: main_if_body@21: txna ApplicationArgs 2 dig 1 - uncover 1 + swap callsub set_data b main_after_if_else@26 @@ -135,7 +135,7 @@ main_else_body@22: main_if_body@23: txna ApplicationArgs 2 dig 1 - uncover 1 + swap callsub get_data_with_default log b main_after_if_else@25 @@ -164,7 +164,7 @@ get_guaranteed_data_block@0: int 0 byte "local" app_local_get_ex - assert + assert // check value exists retsub @@ -177,11 +177,11 @@ get_data_or_assert_block@0: int 0 byte "local" app_local_get_ex - assert + assert // no data for account retsub -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.delete_data(for_account#0: uint64) -> void: delete_data: proto 1 0 @@ -192,7 +192,7 @@ delete_data_block@0: retsub -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.set_data(for_account#0: uint64, value#0: bytes) -> void: set_data: proto 2 0 @@ -223,11 +223,11 @@ get_data_with_default_ternary_false@2: frame_dig -1 get_data_with_default_ternary_merge@3: - uncover 1 + swap retsub -// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> : +// examples.local_storage.local_storage_with_offsets.LocalStorageContract.__init__() -> void: __init__: proto 0 0 diff --git a/examples/local_storage/out/local_storage_with_offsets.awst b/examples/local_storage/out/local_storage_with_offsets.awst index e3ca1c8cf0..a8ba1a7f64 100644 --- a/examples/local_storage/out/local_storage_with_offsets.awst +++ b/examples/local_storage/out/local_storage_with_offsets.awst @@ -67,7 +67,7 @@ contract LocalStorageContract subroutine get_data_with_default(for_account: algopy.UInt64, default: algopy.Bytes): algopy.Bytes { - return tmp$0: tuple[algopy.Bytes, bool] := app_local_get_ex(for_account, 0u, 'local')[1] ? tmp$0[0] : default + return (tmp$0: tuple[algopy.Bytes, bool] := app_local_get_ex(for_account, 0u, 'local')[1]) ? (tmp$0[0]) : (default) } subroutine get_data_or_assert(for_account: algopy.UInt64): algopy.Bytes diff --git a/examples/module_consts/algopy.log b/examples/module_consts/algopy.log index 40b726d0b3..262135410d 100644 --- a/examples/module_consts/algopy.log +++ b/examples/module_consts/algopy.log @@ -1,10 +1,11 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 module_consts -info: Building AWST for __init__.py -info: Building AWST for module_consts/constants3.py -info: Building AWST for module_consts/constants2.py -info: Building AWST for module_consts/constants.py -info: Building AWST for module_consts/__init__.py -info: Building AWST for module_consts/constants4.py -info: Building AWST for module_consts/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug module_consts +debug: Building AWST for __init__.py +debug: Building AWST for module_consts/constants3.py +debug: Building AWST for module_consts/constants2.py +debug: Building AWST for module_consts/constants.py +debug: Building AWST for module_consts/__init__.py +debug: Building AWST for module_consts/constants4.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for module_consts/contract.py error: No contracts discovered in any source files >> exit code = 0 \ No newline at end of file diff --git a/examples/mylib/algopy.log b/examples/mylib/algopy.log index 50ff13e70f..95670b997f 100644 --- a/examples/mylib/algopy.log +++ b/examples/mylib/algopy.log @@ -1,6 +1,7 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 mylib -info: Building AWST for __init__.py -info: Building AWST for mylib/__init__.py -info: Building AWST for mylib/simple_functions.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug mylib +debug: Building AWST for __init__.py +debug: Building AWST for mylib/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for mylib/simple_functions.py error: No contracts discovered in any source files >> exit code = 0 \ No newline at end of file diff --git a/examples/mylib/out/simple_functions.awst b/examples/mylib/out/simple_functions.awst index defe59cd0d..248e7e1c87 100644 --- a/examples/mylib/out/simple_functions.awst +++ b/examples/mylib/out/simple_functions.awst @@ -11,7 +11,7 @@ subroutine three(): algopy.UInt64 subroutine hello_world(): algopy.Bytes { hello: algopy.Bytes = '\xf0\x9f\x91\x8b' - comma: algopy.Bytes = Bytes.from_base64("4aCI") + comma: algopy.Bytes = b64<"4aCI"> world: algopy.Bytes = ' world' return hello + comma + world } @@ -71,5 +71,5 @@ subroutine inefficient_multiply(a: algopy.UInt64, b: algopy.UInt64): algopy.UInt subroutine test_and_uint64(): algopy.UInt64 { - return !(reinterpret_cast(1u)) ? 1u : 2u + return (!(reinterpret_cast(1u))) ? (1u) : (2u) } \ No newline at end of file diff --git a/examples/nested_loops/algopy.log b/examples/nested_loops/algopy.log index 00bbc8fe7f..c457683222 100644 --- a/examples/nested_loops/algopy.log +++ b/examples/nested_loops/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 nested_loops -info: Building AWST for __init__.py -info: Building AWST for nested_loops -info: Building AWST for nested_loops/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug nested_loops +debug: Building AWST for __init__.py +debug: Building AWST for nested_loops +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for nested_loops/contract.py debug: Sealing block@0: // L7 debug: Terminated block@0: // L7 debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@1: // for_header_L11 @@ -388,6 +389,7 @@ debug: Found equivalence set: range_item%8#1, e#0 debug: Replacing {range_item%8#1} with e#0 made 3 modifications debug: Found equivalence set: range_item%10#1, f#0 debug: Replacing {range_item%10#1} with f#0 made 3 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable n#0 debug: Optimizer: Simplify Conditional Branches @@ -413,6 +415,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -424,6 +427,7 @@ debug: Optimizing subroutine examples.nested_loops.contract.Nested.approval_prog debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -433,6 +437,7 @@ debug: Optimizing subroutine examples.nested_loops.contract.Nested.clear_state_p debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -689,80 +694,80 @@ debug: Coalescing local variables in examples.nested_loops.contract.Nested.clear debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/nested_loops/out/contract_Nested.final.ir debug: Inserted main_block@0.ops[3]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[5]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[5]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted main_for_header@1.ops[3]: 'store continue_looping%1#0 to l-stack (copy)' -debug: Replaced main_for_header@1.ops[5]: 'load continue_looping%1#0 from scratch' with 'load continue_looping%1#0 from l-stack (no copy)' +debug: Replaced main_for_header@1.ops[5]: 'load continue_looping%1#0' with 'load continue_looping%1#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[1]: 'store range_item%2#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[3]: 'load range_item%2#0 from scratch' with 'load range_item%2#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[3]: 'load range_item%2#0' with 'load range_item%2#0 from l-stack (no copy)' debug: Inserted main_for_header@3.ops[3]: 'store continue_looping%3#0 to l-stack (copy)' -debug: Replaced main_for_header@3.ops[5]: 'load continue_looping%3#0 from scratch' with 'load continue_looping%3#0 from l-stack (no copy)' +debug: Replaced main_for_header@3.ops[5]: 'load continue_looping%3#0' with 'load continue_looping%3#0 from l-stack (no copy)' debug: Inserted main_for_body@4.ops[1]: 'store range_item%4#0 to l-stack (copy)' -debug: Replaced main_for_body@4.ops[3]: 'load range_item%4#0 from scratch' with 'load range_item%4#0 from l-stack (no copy)' +debug: Replaced main_for_body@4.ops[3]: 'load range_item%4#0' with 'load range_item%4#0 from l-stack (no copy)' debug: Inserted main_for_header@5.ops[3]: 'store continue_looping%5#0 to l-stack (copy)' -debug: Replaced main_for_header@5.ops[5]: 'load continue_looping%5#0 from scratch' with 'load continue_looping%5#0 from l-stack (no copy)' +debug: Replaced main_for_header@5.ops[5]: 'load continue_looping%5#0' with 'load continue_looping%5#0 from l-stack (no copy)' debug: Inserted main_for_body@6.ops[1]: 'store range_item%6#0 to l-stack (copy)' -debug: Replaced main_for_body@6.ops[3]: 'load range_item%6#0 from scratch' with 'load range_item%6#0 from l-stack (no copy)' +debug: Replaced main_for_body@6.ops[3]: 'load range_item%6#0' with 'load range_item%6#0 from l-stack (no copy)' debug: Inserted main_for_header@7.ops[3]: 'store continue_looping%7#0 to l-stack (copy)' -debug: Replaced main_for_header@7.ops[5]: 'load continue_looping%7#0 from scratch' with 'load continue_looping%7#0 from l-stack (no copy)' +debug: Replaced main_for_header@7.ops[5]: 'load continue_looping%7#0' with 'load continue_looping%7#0 from l-stack (no copy)' debug: Inserted main_for_body@8.ops[1]: 'store range_item%8#0 to l-stack (copy)' -debug: Replaced main_for_body@8.ops[3]: 'load range_item%8#0 from scratch' with 'load range_item%8#0 from l-stack (no copy)' +debug: Replaced main_for_body@8.ops[3]: 'load range_item%8#0' with 'load range_item%8#0 from l-stack (no copy)' debug: Inserted main_for_header@9.ops[3]: 'store continue_looping%9#0 to l-stack (copy)' -debug: Replaced main_for_header@9.ops[5]: 'load continue_looping%9#0 from scratch' with 'load continue_looping%9#0 from l-stack (no copy)' +debug: Replaced main_for_header@9.ops[5]: 'load continue_looping%9#0' with 'load continue_looping%9#0 from l-stack (no copy)' debug: Inserted main_for_body@10.ops[1]: 'store range_item%10#0 to l-stack (copy)' -debug: Replaced main_for_body@10.ops[3]: 'load range_item%10#0 from scratch' with 'load range_item%10#0 from l-stack (no copy)' +debug: Replaced main_for_body@10.ops[3]: 'load range_item%10#0' with 'load range_item%10#0 from l-stack (no copy)' debug: Inserted main_for_header@11.ops[3]: 'store continue_looping%11#0 to l-stack (copy)' -debug: Replaced main_for_header@11.ops[5]: 'load continue_looping%11#0 from scratch' with 'load continue_looping%11#0 from l-stack (no copy)' +debug: Replaced main_for_header@11.ops[5]: 'load continue_looping%11#0' with 'load continue_looping%11#0 from l-stack (no copy)' debug: Inserted main_for_body@12.ops[3]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_for_body@12.ops[5]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced main_for_body@12.ops[5]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted main_for_body@12.ops[8]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_for_body@12.ops[10]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced main_for_body@12.ops[10]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted main_for_body@12.ops[13]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_for_body@12.ops[15]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced main_for_body@12.ops[15]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted main_for_body@12.ops[18]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_for_body@12.ops[20]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_for_body@12.ops[20]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_for_body@12.ops[31]: 'store range_item%10#0 to l-stack (copy)' -debug: Replaced main_for_body@12.ops[33]: 'load range_item%10#0 from scratch' with 'load range_item%10#0 from l-stack (no copy)' +debug: Replaced main_for_body@12.ops[33]: 'load range_item%10#0' with 'load range_item%10#0 from l-stack (no copy)' debug: Inserted main_for_body@12.ops[23]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_for_body@12.ops[26]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_for_body@12.ops[26]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_for_body@12.ops[22]: 'store f#0 to l-stack (copy)' -debug: Replaced main_for_body@12.ops[30]: 'load f#0 from scratch' with 'load f#0 from l-stack (no copy)' +debug: Replaced main_for_body@12.ops[30]: 'load f#0' with 'load f#0 from l-stack (no copy)' debug: Inserted main_after_for@14.ops[3]: 'store range_item%8#0 to l-stack (copy)' -debug: Replaced main_after_for@14.ops[5]: 'load range_item%8#0 from scratch' with 'load range_item%8#0 from l-stack (no copy)' +debug: Replaced main_after_for@14.ops[5]: 'load range_item%8#0' with 'load range_item%8#0 from l-stack (no copy)' debug: Inserted main_after_for@16.ops[3]: 'store range_item%6#0 to l-stack (copy)' -debug: Replaced main_after_for@16.ops[5]: 'load range_item%6#0 from scratch' with 'load range_item%6#0 from l-stack (no copy)' +debug: Replaced main_after_for@16.ops[5]: 'load range_item%6#0' with 'load range_item%6#0 from l-stack (no copy)' debug: Inserted main_after_for@18.ops[3]: 'store range_item%4#0 to l-stack (copy)' -debug: Replaced main_after_for@18.ops[5]: 'load range_item%4#0 from scratch' with 'load range_item%4#0 from l-stack (no copy)' +debug: Replaced main_after_for@18.ops[5]: 'load range_item%4#0' with 'load range_item%4#0 from l-stack (no copy)' debug: Inserted main_after_for@20.ops[3]: 'store range_item%2#0 to l-stack (copy)' -debug: Replaced main_after_for@20.ops[5]: 'load range_item%2#0 from scratch' with 'load range_item%2#0 from l-stack (no copy)' +debug: Replaced main_after_for@20.ops[5]: 'load range_item%2#0' with 'load range_item%2#0 from l-stack (no copy)' debug: Inserted main_after_for@22.ops[7]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced main_after_for@22.ops[9]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced main_after_for@22.ops[9]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted main_after_for@22.ops[1]: 'store a#0 to l-stack (copy)' -debug: Replaced main_after_for@22.ops[5]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' +debug: Replaced main_after_for@22.ops[5]: 'load a#0' with 'load a#0 from l-stack (no copy)' debug: Inserted main_after_for@24.ops[2]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_after_for@24.ops[4]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_after_for@24.ops[4]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_after_for@24.ops[9]: 'store range_item%18#0 to l-stack (copy)' -debug: Replaced main_after_for@24.ops[13]: 'load range_item%18#0 from scratch' with 'load range_item%18#0 from l-stack (no copy)' +debug: Replaced main_after_for@24.ops[13]: 'load range_item%18#0' with 'load range_item%18#0 from l-stack (no copy)' debug: Inserted main_after_for@24.ops[12]: 'store range_index%19#0 to l-stack (copy)' -debug: Replaced main_after_for@24.ops[16]: 'load range_index%19#0 from scratch' with 'load range_index%19#0 from l-stack (no copy)' +debug: Replaced main_after_for@24.ops[16]: 'load range_index%19#0' with 'load range_index%19#0 from l-stack (no copy)' debug: Inserted main_for_header@25.ops[3]: 'store continue_looping%20#0 to l-stack (copy)' -debug: Replaced main_for_header@25.ops[5]: 'load continue_looping%20#0 from scratch' with 'load continue_looping%20#0 from l-stack (no copy)' +debug: Replaced main_for_header@25.ops[5]: 'load continue_looping%20#0' with 'load continue_looping%20#0 from l-stack (no copy)' debug: Inserted main_for_body@26.ops[3]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_for_body@26.ops[6]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' +debug: Replaced main_for_body@26.ops[6]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' debug: Inserted main_for_body@26.ops[16]: 'store range_index%19#0 to l-stack (copy)' -debug: Replaced main_for_body@26.ops[20]: 'load range_index%19#0 from scratch' with 'load range_index%19#0 from l-stack (no copy)' +debug: Replaced main_for_body@26.ops[20]: 'load range_index%19#0' with 'load range_index%19#0 from l-stack (no copy)' debug: Inserted main_for_body@26.ops[12]: 'store range_item%18#0 to l-stack (copy)' -debug: Replaced main_for_body@26.ops[19]: 'load range_item%18#0 from scratch' with 'load range_item%18#0 from l-stack (no copy)' +debug: Replaced main_for_body@26.ops[19]: 'load range_item%18#0' with 'load range_item%18#0 from l-stack (no copy)' debug: Inserted main_for_body@26.ops[1]: 'store item#0 to l-stack (copy)' -debug: Replaced main_for_body@26.ops[10]: 'load item#0 from scratch' with 'load item#0 from l-stack (no copy)' +debug: Replaced main_for_body@26.ops[10]: 'load item#0' with 'load item#0 from l-stack (no copy)' debug: Inserted main_for_body@26.ops[3]: 'store index#0 to l-stack (copy)' -debug: Replaced main_for_body@26.ops[16]: 'load index#0 from scratch' with 'load index#0 from l-stack (no copy)' +debug: Replaced main_for_body@26.ops[16]: 'load index#0' with 'load index#0 from l-stack (no copy)' debug: Inserted main_after_for@28.ops[2]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_after_for@28.ops[4]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced main_after_for@28.ops[4]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Found 14 edge set/s for examples.nested_loops.contract.Nested.approval_program debug: examples.nested_loops.contract.Nested.approval_program f-stack entry: ['b#0', 'c#0', 'd#0', 'e#0', 'f#0', 'index#0', 'item#0', 'y#0'] debug: examples.nested_loops.contract.Nested.approval_program f-stack on first store: ['x#0', 'a#0'] -info: Writing /examples/nested_loops/out/contract.approval.teal -info: Writing /examples/nested_loops/out/contract.approval.debug.teal -info: Writing /examples/nested_loops/out/contract.clear.teal -info: Writing /examples/nested_loops/out/contract.clear.debug.teal +info: Writing nested_loops/out/contract.approval.teal +info: Writing nested_loops/out/contract.approval.debug.teal +info: Writing nested_loops/out/contract.clear.teal +info: Writing nested_loops/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/nested_loops/out/contract.approval.debug.teal b/examples/nested_loops/out/contract.approval.debug.teal index 40ac36a93c..3be62f803a 100644 --- a/examples/nested_loops/out/contract.approval.debug.teal +++ b/examples/nested_loops/out/contract.approval.debug.teal @@ -148,7 +148,7 @@ main_after_for@24: bury 3 // store y#0 to f-stack (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | y File "nested_loops/contract.py", line 24 int 0 // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | 0 urange(UInt64(10)) File "nested_loops/contract.py", line 25 int 0 // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_item%18#0,0 - cover 1 // store range_index%19#0 to l-stack (no copy) (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_index%19#0,range_item%18#0 index File "nested_loops/contract.py", line 25 + swap // store range_index%19#0 to l-stack (no copy) (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_index%19#0,range_item%18#0 index File "nested_loops/contract.py", line 25 bury 5 // store item#0 to f-stack (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_index%19#0 item File "nested_loops/contract.py", line 25 bury 5 // store index#0 to f-stack (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | index File "nested_loops/contract.py", line 25 // Implicit fall through to main_for_header@25 // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | @@ -172,10 +172,10 @@ main_for_body@26: bury 5 // store y#0 to f-stack (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | index#0,item#0 y File "nested_loops/contract.py", line 24 int 1 // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | index#0,item#0,1 urange(UInt64(10)) File "nested_loops/contract.py", line 25 + // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | index#0,{+} urange(UInt64(10)) File "nested_loops/contract.py", line 25 - uncover 1 // load index#0 from l-stack (no copy) (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_item%18#0,index#0 index File "nested_loops/contract.py", line 25 + swap // load index#0 from l-stack (no copy) (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_item%18#0,index#0 index File "nested_loops/contract.py", line 25 int 1 // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_item%18#0,index#0,1 + // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_item%18#0,{+} - uncover 1 // load range_item%18#0 from l-stack (no copy) (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_index%19#0,range_item%18#0 item File "nested_loops/contract.py", line 25 + swap // load range_item%18#0 from l-stack (no copy) (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_index%19#0,range_item%18#0 item File "nested_loops/contract.py", line 25 bury 5 // store item#0 to f-stack (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | range_index%19#0 item File "nested_loops/contract.py", line 25 bury 5 // store index#0 to f-stack (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | index File "nested_loops/contract.py", line 25 b main_for_header@25 // (𝕗) b#0,c#0,d#0,e#0,f#0,index#0,item#0,y#0,x#0,a#0 | diff --git a/examples/nested_loops/out/contract.approval.teal b/examples/nested_loops/out/contract.approval.teal index ea7c596290..c619f160c6 100644 --- a/examples/nested_loops/out/contract.approval.teal +++ b/examples/nested_loops/out/contract.approval.teal @@ -134,7 +134,7 @@ main_after_for@24: bury 3 int 0 int 0 - cover 1 + swap bury 5 bury 5 @@ -156,10 +156,10 @@ main_for_body@26: bury 5 int 1 + - uncover 1 + swap int 1 + - uncover 1 + swap bury 5 bury 5 b main_for_header@25 diff --git a/examples/non_utf8.algopy.log b/examples/non_utf8.algopy.log index b1fe88c15c..33b2b57e82 100644 --- a/examples/non_utf8.algopy.log +++ b/examples/non_utf8.algopy.log @@ -1,6 +1,7 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 non_utf8.py -info: Building AWST for __init__.py -info: Building AWST for non_utf8.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug non_utf8.py +debug: Building AWST for __init__.py +debug: Building AWST for non_utf8.py +debug: Building AWST for embedded algopy lib at /algopy.py warning: No contracts found in explicitly named source file: /examples/non_utf8.py error: No contracts discovered in any source files >> exit code = 0 \ No newline at end of file diff --git a/examples/out/address_constant.awst b/examples/out/address_constant.awst index 9c160c7226..36505cbe52 100644 --- a/examples/out/address_constant.awst +++ b/examples/out/address_constant.awst @@ -4,9 +4,9 @@ contract AddressConstantContract { approval_program(): bool { - some_address: algopy.Address = Address("VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA") - some_address: algopy.Address = reinterpret_cast(reinterpret_cast(some_address)) - sender: algopy.Address = txn() + some_address: algopy.Account = Address("VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA") + some_address: algopy.Account = reinterpret_cast(reinterpret_cast(some_address)) + sender: algopy.Account = txn() sender_bytes: algopy.Bytes = reinterpret_cast(sender) log(sender_bytes) is_some_address: bool = txn() == some_address diff --git a/examples/out/byte_constants.approval_unoptimized.debug.teal b/examples/out/byte_constants.approval_unoptimized.debug.teal index 4a62f34206..2f42a55752 100644 --- a/examples/out/byte_constants.approval_unoptimized.debug.teal +++ b/examples/out/byte_constants.approval_unoptimized.debug.teal @@ -6,21 +6,21 @@ main_block@0: byte base64 QmFzZSA2NCBlbmNvZGVk // QmFzZSA2NCBlbmNvZGVk Bytes.from_base64("QmFzZSA2NCBlbmNvZGVk") File "byte_constants.py", line 6 byte base32 IJQXGZJAGMZCAZLOMNXWIZLE // base_64#0,IJQXGZJAGMZCAZLOMNXWIZLE Bytes.from_base32("IJQXGZJAGMZCAZLOMNXWIZLE") File "byte_constants.py", line 7 - cover 1 // store base_32#0 to l-stack (no copy) base_32#0,base_64#0 base_32 File "byte_constants.py", line 7 + swap // store base_32#0 to l-stack (no copy) base_32#0,base_64#0 base_32 File "byte_constants.py", line 7 byte 0x4261736520313620656e636f646564 // base_32#0,base_64#0,0x4261736520313620656e636f646564 Bytes.from_hex("4261736520313620656E636F646564") File "byte_constants.py", line 8 byte "UTF-8 Encoded" // base_32#0,base_64#0,base_16#0,"UTF-8 Encoded" b"UTF-8 Encoded" File "byte_constants.py", line 9 cover 3 // store utf8#0 to l-stack (no copy) utf8#0,base_32#0,base_64#0,base_16#0 utf8 File "byte_constants.py", line 9 byte "|" // utf8#0,base_32#0,base_64#0,base_16#0,"|" b"|" File "byte_constants.py", line 11 concat // utf8#0,base_32#0,base_64#0,{concat} base_16 + b"|" File "byte_constants.py", line 11 - uncover 1 // load base_64#0 from l-stack (no copy) utf8#0,base_32#0,tmp%0#0,base_64#0 base_64 File "byte_constants.py", line 6 + swap // load base_64#0 from l-stack (no copy) utf8#0,base_32#0,tmp%0#0,base_64#0 base_64 File "byte_constants.py", line 6 concat // utf8#0,base_32#0,{concat} base_16 + b"|" + base_64 File "byte_constants.py", line 11 byte "|" // utf8#0,base_32#0,tmp%1#0,"|" b"|" File "byte_constants.py", line 11 concat // utf8#0,base_32#0,{concat} base_16 + b"|" + base_64 + b"|" File "byte_constants.py", line 11 - uncover 1 // load base_32#0 from l-stack (no copy) utf8#0,tmp%2#0,base_32#0 base_32 File "byte_constants.py", line 7 + swap // load base_32#0 from l-stack (no copy) utf8#0,tmp%2#0,base_32#0 base_32 File "byte_constants.py", line 7 concat // utf8#0,{concat} base_16 + b"|" + base_64 + b"|" + base_32 File "byte_constants.py", line 11 byte "|" // utf8#0,tmp%3#0,"|" b"|" File "byte_constants.py", line 11 concat // utf8#0,{concat} base_16 + b"|" + base_64 + b"|" + base_32 + b"|" File "byte_constants.py", line 11 - uncover 1 // load utf8#0 from l-stack (no copy) tmp%4#0,utf8#0 utf8 File "byte_constants.py", line 9 + swap // load utf8#0 from l-stack (no copy) tmp%4#0,utf8#0 utf8 File "byte_constants.py", line 9 concat // {concat} base_16 + b"|" + base_64 + b"|" + base_32 + b"|" + utf8 File "byte_constants.py", line 11 dup // load result#0 from l-stack (copy) result#0,result#0 result File "byte_constants.py", line 11 log // result#0 log(result) File "byte_constants.py", line 12 diff --git a/examples/out/byte_constants.approval_unoptimized.teal b/examples/out/byte_constants.approval_unoptimized.teal index ceed6b2b5b..77950b45ca 100644 --- a/examples/out/byte_constants.approval_unoptimized.teal +++ b/examples/out/byte_constants.approval_unoptimized.teal @@ -4,21 +4,21 @@ main_block@0: byte base64 QmFzZSA2NCBlbmNvZGVk byte base32 IJQXGZJAGMZCAZLOMNXWIZLE - cover 1 + swap byte 0x4261736520313620656e636f646564 byte "UTF-8 Encoded" cover 3 byte "|" concat - uncover 1 + swap concat byte "|" concat - uncover 1 + swap concat byte "|" concat - uncover 1 + swap concat dup log diff --git a/examples/out/byte_constants.awst b/examples/out/byte_constants.awst index e51c22e53b..093824104b 100644 --- a/examples/out/byte_constants.awst +++ b/examples/out/byte_constants.awst @@ -2,9 +2,9 @@ contract ByteConstantsContract { approval_program(): algopy.UInt64 { - base_64: algopy.Bytes = Bytes.from_base64("QmFzZSA2NCBlbmNvZGVk") - base_32: algopy.Bytes = Bytes.from_base32("IJQXGZJAGMZCAZLOMNXWIZLE") - base_16: algopy.Bytes = Bytes.from_base16("4261736520313620656E636F646564") + base_64: algopy.Bytes = b64<"QmFzZSA2NCBlbmNvZGVk"> + base_32: algopy.Bytes = b32<"IJQXGZJAGMZCAZLOMNXWIZLE"> + base_16: algopy.Bytes = hex<"4261736520313620656E636F646564"> utf8: algopy.Bytes = 'UTF-8 Encoded' result: algopy.Bytes = base_16 + '|' + base_64 + '|' + base_32 + '|' + utf8 log(result) diff --git a/examples/out/tuple_support.approval.debug.teal b/examples/out/tuple_support.approval.debug.teal index 7f03628091..31c1379315 100644 --- a/examples/out/tuple_support.approval.debug.teal +++ b/examples/out/tuple_support.approval.debug.teal @@ -1,4 +1,4 @@ -// Op // Op Description Stack (out) X stack Source code Source line +// Op // Op Description Stack (out) X stack Source code Source line #pragma version 8 @@ -13,203 +13,223 @@ main_on_create@1: // Implicit fall through to main_entrypoint@2 // main_entrypoint@2: - int 101 // 101 101 File "tuple_support.py", line 9 - int 102 // 101,102 102 File "tuple_support.py", line 9 - int 103 // 101,102,103 103 File "tuple_support.py", line 9 - callsub add_three_values // {add_three_values} add_three_values((UInt64(101), UInt64(102), UInt64(103))) File "tuple_support.py", line 9 - itob // {itob} itob(total) File "tuple_support.py", line 10 - log // log(itob(total)) File "tuple_support.py", line 10 - int 1 // 1 1 File "tuple_support.py", line 11 - int 2 // 1,2 2 File "tuple_support.py", line 11 - addw // {addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 12 - byte "state" // did_overflow#0,tuple_assignment%3#0,"state" self.state File "tuple_support.py", line 12 - uncover 1 // load tuple_assignment%3#0 from l-stack (no copy) did_overflow#0,"state",tuple_assignment%3#0 addw(a, b) File "tuple_support.py", line 12 - app_global_put // did_overflow#0 (did_overflow, self.state) = addw(a, b) File "tuple_support.py", line 12 - ! // {!} not did_overflow File "tuple_support.py", line 13 - assert // assert not did_overflow, "overflow!" File "tuple_support.py", line 13 - int 1 // 1 1 File "tuple_support.py", line 11 - int 2 // 1,2 2 File "tuple_support.py", line 11 - addw // {addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 15 - pop // {addw}.0 result File "tuple_support.py", line 15 - ! // {!} not result[0] File "tuple_support.py", line 16 - assert // assert not result[0], "overflow!" File "tuple_support.py", line 16 - int 1 // 1 a2 == a File "tuple_support.py", line 26 - assert // assert a2 == a File "tuple_support.py", line 26 - int 1 // 1 b2 == b File "tuple_support.py", line 27 - assert // assert b2 == b File "tuple_support.py", line 27 - int 1 // 1 cd[0] == tup[0] File "tuple_support.py", line 28 - assert // assert cd[0] == tup[0] File "tuple_support.py", line 28 - int 1 // 1 cd[1] == tup[1] File "tuple_support.py", line 29 - assert // assert cd[1] == tup[1] File "tuple_support.py", line 29 - byte "Hello, " // "Hello, " b"Hello, " File "tuple_support.py", line 33 - byte "world!" // "Hello, ","world!" b"world!" File "tuple_support.py", line 33 - callsub bytes_combine // {bytes_combine} bytes_combine((Bytes(b"Hello, "), Bytes(b"world!"))) File "tuple_support.py", line 33 - log // log(bytes_combine((Bytes(b"Hello, "), Bytes(b"world!")))) File "tuple_support.py", line 33 - int 18446744073709551615 // 18446744073709551615 2**64 - 1 File "tuple_support.py", line 34 - int 18446744073709551615 // 18446744073709551615,18446744073709551615 2**64 - 1 File "tuple_support.py", line 34 - addw // {addw}.0,{addw}.1 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - cover 1 // store tmp%13#0 to l-stack (no copy) tmp%13#0,{addw}.0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - int 1 // tmp%13#0,tmp%12#0,1 1 File "tuple_support.py", line 11 - int 2 // tmp%13#0,tmp%12#0,1,2 2 File "tuple_support.py", line 11 - addw // tmp%13#0,tmp%12#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 35 - cover 1 // store tmp%15#0 to l-stack (no copy) tmp%13#0,tmp%12#0,tmp%15#0,{addw}.0 addw(a, b) File "tuple_support.py", line 35 - uncover 2 // load tmp%12#0 from l-stack (no copy) tmp%13#0,tmp%15#0,tmp%14#0,tmp%12#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - uncover 3 // load tmp%13#0 from l-stack (no copy) tmp%15#0,tmp%14#0,tmp%12#0,tmp%13#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - uncover 2 // load tmp%14#0 from l-stack (no copy) tmp%15#0,tmp%12#0,tmp%13#0,tmp%14#0 addw(a, b) File "tuple_support.py", line 35 - uncover 3 // load tmp%15#0 from l-stack (no copy) tmp%12#0,tmp%13#0,tmp%14#0,tmp%15#0 addw(a, b) File "tuple_support.py", line 35 - callsub addw2 // {addw2}.0,{addw2}.1,{addw2}.2 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 - cover 2 // store lo#0 to l-stack (no copy) lo#0,{addw2}.0,{addw2}.1 lo File "tuple_support.py", line 35 - cover 1 // store mid#0 to l-stack (no copy) lo#0,mid#0,{addw2}.0 mid File "tuple_support.py", line 35 - itob // lo#0,mid#0,{itob} itob(hi) File "tuple_support.py", line 36 - log // lo#0,mid#0 log(itob(hi)) File "tuple_support.py", line 36 - itob // lo#0,{itob} itob(mid) File "tuple_support.py", line 37 - log // lo#0 log(itob(mid)) File "tuple_support.py", line 37 - itob // {itob} itob(lo) File "tuple_support.py", line 38 - log // log(itob(lo)) File "tuple_support.py", line 38 - byte "na" // "na" b"na" File "tuple_support.py", line 39 - int 5 // "na",5 5 File "tuple_support.py", line 39 - callsub bytes_multiply // {bytes_multiply} bytes_multiply((Bytes(b"na"), UInt64(5))) File "tuple_support.py", line 39 - log // log(bytes_multiply((Bytes(b"na"), UInt64(5)))) File "tuple_support.py", line 39 - int 0 // 0 0 File "tuple_support.py", line 40 - callsub test_tuple_swap // test_tuple_swap(zero=UInt64(0)) File "tuple_support.py", line 40 - int 3 // 3 a + b File "tuple_support.py", line 41 - return // return a + b File "tuple_support.py", line 41 + int 101 // 101 101 File "tuple_support.py", line 9 + int 102 // 101,102 102 File "tuple_support.py", line 9 + int 103 // 101,102,103 103 File "tuple_support.py", line 9 + callsub add_three_values // {add_three_values} add_three_values((UInt64(101), UInt64(102), UInt64(103))) File "tuple_support.py", line 9 + itob // {itob} itob(total) File "tuple_support.py", line 10 + log // log(itob(total)) File "tuple_support.py", line 10 + int 1 // 1 1 File "tuple_support.py", line 11 + int 2 // 1,2 2 File "tuple_support.py", line 11 + addw // {addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 12 + byte "state" // did_overflow#0,tuple_assignment%3#0,"state" self.state File "tuple_support.py", line 12 + swap // load tuple_assignment%3#0 from l-stack (no copy) did_overflow#0,"state",tuple_assignment%3#0 addw(a, b) File "tuple_support.py", line 12 + app_global_put // did_overflow#0 (did_overflow, self.state) = addw(a, b) File "tuple_support.py", line 12 + ! // {!} not did_overflow File "tuple_support.py", line 13 + assert // overflow! // assert not did_overflow, "overflow!" File "tuple_support.py", line 13 + int 1 // 1 1 File "tuple_support.py", line 11 + int 2 // 1,2 2 File "tuple_support.py", line 11 + addw // {addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 15 + pop // {addw}.0 result File "tuple_support.py", line 15 + ! // {!} not result[0] File "tuple_support.py", line 16 + assert // overflow! // assert not result[0], "overflow!" File "tuple_support.py", line 16 + byte "Hello, " // "Hello, " b"Hello, " File "tuple_support.py", line 33 + byte "world!" // "Hello, ","world!" b"world!" File "tuple_support.py", line 33 + callsub bytes_combine // {bytes_combine} bytes_combine((Bytes(b"Hello, "), Bytes(b"world!"))) File "tuple_support.py", line 33 + log // log(bytes_combine((Bytes(b"Hello, "), Bytes(b"world!")))) File "tuple_support.py", line 33 + int 18446744073709551615 // 18446744073709551615 2**64 - 1 File "tuple_support.py", line 34 + int 18446744073709551615 // 18446744073709551615,18446744073709551615 2**64 - 1 File "tuple_support.py", line 34 + addw // {addw}.0,{addw}.1 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + swap // store tmp%13#0 to l-stack (no copy) tmp%13#0,{addw}.0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + int 1 // tmp%13#0,tmp%12#0,1 1 File "tuple_support.py", line 11 + int 2 // tmp%13#0,tmp%12#0,1,2 2 File "tuple_support.py", line 11 + addw // tmp%13#0,tmp%12#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 35 + swap // store tmp%15#0 to l-stack (no copy) tmp%13#0,tmp%12#0,tmp%15#0,{addw}.0 addw(a, b) File "tuple_support.py", line 35 + uncover 2 // load tmp%12#0 from l-stack (no copy) tmp%13#0,tmp%15#0,tmp%14#0,tmp%12#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + uncover 3 // load tmp%13#0 from l-stack (no copy) tmp%15#0,tmp%14#0,tmp%12#0,tmp%13#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + uncover 2 // load tmp%14#0 from l-stack (no copy) tmp%15#0,tmp%12#0,tmp%13#0,tmp%14#0 addw(a, b) File "tuple_support.py", line 35 + uncover 3 // load tmp%15#0 from l-stack (no copy) tmp%12#0,tmp%13#0,tmp%14#0,tmp%15#0 addw(a, b) File "tuple_support.py", line 35 + callsub addw2 // {addw2}.0,{addw2}.1,{addw2}.2 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 + cover 2 // store lo#0 to l-stack (no copy) lo#0,{addw2}.0,{addw2}.1 lo File "tuple_support.py", line 35 + swap // store mid#0 to l-stack (no copy) lo#0,mid#0,{addw2}.0 mid File "tuple_support.py", line 35 + itob // lo#0,mid#0,{itob} itob(hi) File "tuple_support.py", line 36 + log // lo#0,mid#0 log(itob(hi)) File "tuple_support.py", line 36 + itob // lo#0,{itob} itob(mid) File "tuple_support.py", line 37 + log // lo#0 log(itob(mid)) File "tuple_support.py", line 37 + itob // {itob} itob(lo) File "tuple_support.py", line 38 + log // log(itob(lo)) File "tuple_support.py", line 38 + byte "na" // "na" b"na" File "tuple_support.py", line 39 + int 5 // "na",5 5 File "tuple_support.py", line 39 + callsub bytes_multiply // {bytes_multiply} bytes_multiply((Bytes(b"na"), UInt64(5))) File "tuple_support.py", line 39 + log // log(bytes_multiply((Bytes(b"na"), UInt64(5)))) File "tuple_support.py", line 39 + int 0 // 0 0 File "tuple_support.py", line 40 + callsub test_tuple_swap // test_tuple_swap(zero=UInt64(0)) File "tuple_support.py", line 40 + int 1 // 1 1 File "tuple_support.py", line 43 + int 2 // 1,2 2 File "tuple_support.py", line 44 + int 3 // 1,2,3 3 File "tuple_support.py", line 45 + int 4 // 1,2,3,4 4 File "tuple_support.py", line 46 + int 5 // 1,2,3,4,5 5 File "tuple_support.py", line 47 + int 6 // 1,2,3,4,5,6 6 File "tuple_support.py", line 48 + int 7 // 1,2,3,4,5,6,7 7 File "tuple_support.py", line 49 + int 8 // 1,2,3,4,5,6,7,8 8 File "tuple_support.py", line 50 + callsub slicing // slicing( File "tuple_support.py", line 41 + int 3 // 3 a + b File "tuple_support.py", line 53 + return // return a + b File "tuple_support.py", line 53 // examples.tuple_support.add_three_values(values.0#0: uint64, values.1#0: uint64, values.2#0: uint64) -> uint64: add_three_values: - proto 3 1 // (𝕡) values.0#0,values.1#0,values.2#0 | def add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: File "tuple_support.py", line 65 + proto 3 1 // (𝕡) values.0#0,values.1#0,values.2#0 | def add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: File "tuple_support.py", line 76 byte "" // allocate 1 to stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4 | add_three_values_block@0: - int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4 | 0 0 File "tuple_support.py", line 66 + int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4 | 0 0 File "tuple_support.py", line 77 int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | 0 - frame_dig -3 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | values.0#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 65 - b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | value#3 + frame_dig -3 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | values.0#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 76 + b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | value#3 add_three_values_for_header_1@2: - frame_dig -2 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | values.1#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 65 + frame_dig -2 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | values.1#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 76 frame_dig 0 // load tuple_index%0#4 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | tuple_index%0#4 frame_bury 2 // store tuple_index%0#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | - b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | value#3 + b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | value#3 add_three_values_for_header_2@3: - frame_dig -1 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | values.2#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 65 + frame_dig -1 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | values.2#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 76 frame_dig 0 // load tuple_index%0#4 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | tuple_index%0#4 frame_bury 2 // store tuple_index%0#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | - // Implicit fall through to add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | value#3 + // Implicit fall through to add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | value#3 add_three_values_for_body@4: - frame_dig 1 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | total#0 value#3 total File "tuple_support.py", line 66 - + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | {+} total += value File "tuple_support.py", line 69 - frame_bury 1 // store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | total File "tuple_support.py", line 66 + frame_dig 1 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | (𝕏) value#3 | total#0 value#3 total File "tuple_support.py", line 77 + + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | {+} total += value File "tuple_support.py", line 80 + frame_bury 1 // store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | total File "tuple_support.py", line 77 frame_dig 2 // load tuple_index%0#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | tuple_index%0#0 dup // store tuple_index%0#0 to l-stack (copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | tuple_index%0#0,tuple_index%0#0 int 1 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | tuple_index%0#0,tuple_index%0#0,1 + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | tuple_index%0#0,{+} frame_bury 0 // store tuple_index%0#4 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | tuple_index%0#0 - switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | for value in values: File "tuple_support.py", line 67 - // Implicit fall through to add_three_values_after_for@6 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | for value in values: File "tuple_support.py", line 67 + switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | for value in values: File "tuple_support.py", line 78 + // Implicit fall through to add_three_values_after_for@6 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | for value in values: File "tuple_support.py", line 78 add_three_values_after_for@6: - frame_dig 1 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | total#0 total File "tuple_support.py", line 66 + frame_dig 1 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0,tuple_index%0#0 | total#0 total File "tuple_support.py", line 77 frame_bury 0 - retsub // total#0 return total File "tuple_support.py", line 72 + retsub // total#0 return total File "tuple_support.py", line 83 // examples.tuple_support.bytes_combine(arg.0#0: bytes, arg.1#0: bytes) -> bytes: bytes_combine: - proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: File "tuple_support.py", line 48 + proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: File "tuple_support.py", line 60 bytes_combine_block@0: - frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 48 - frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0,arg.1#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 48 - concat // (𝕡) arg.0#0,arg.1#0 | {concat} a + b File "tuple_support.py", line 50 - retsub // result#0 return result File "tuple_support.py", line 51 + frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 60 + frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0,arg.1#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 60 + concat // (𝕡) arg.0#0,arg.1#0 | {concat} a + b File "tuple_support.py", line 62 + retsub // result#0 return result File "tuple_support.py", line 63 // examples.tuple_support.addw2(a.0#0: uint64, a.1#0: uint64, b.0#0: uint64, b.1#0: uint64) -> uint64, uint64, uint64: addw2: - proto 4 3 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | def addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt64, UInt64]: File "tuple_support.py", line 76 + proto 4 3 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | def addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt64, UInt64]: File "tuple_support.py", line 87 addw2_block@0: - frame_dig -3 // load a.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - frame_dig -1 // load b.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0,b.1#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | {addw}.0,{addw}.1 addw(a_lo, b_lo) File "tuple_support.py", line 79 - cover 1 // store c_lo#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,{addw}.0 c_lo File "tuple_support.py", line 79 - frame_dig -4 // load a.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - frame_dig -2 // load b.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0,b.0#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,{addw}.0,{addw}.1 addw(a_hi, b_hi) File "tuple_support.py", line 80 - uncover 2 // load lo_carry#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,c_mid#0,lo_carry#0 lo_carry File "tuple_support.py", line 79 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,{addw}.0,{addw}.1 addw(c_mid, lo_carry) File "tuple_support.py", line 81 - cover 2 // store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,{addw}.0 c_mid File "tuple_support.py", line 80 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,{addw}.0,{addw}.1 addw(hi_carry1, hi_carry2) File "tuple_support.py", line 82 - cover 1 // store c_hi#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{addw}.0 c_hi File "tuple_support.py", line 82 - ! // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{!} not did_overflow File "tuple_support.py", line 83 - assert // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 assert not did_overflow, "is such a thing even possible? 👽" File "tuple_support.py", line 83 - uncover 1 // load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_hi#0,c_mid#0 c_mid File "tuple_support.py", line 80 - uncover 2 // load c_lo#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_hi#0,c_mid#0,c_lo#0 c_lo File "tuple_support.py", line 79 - retsub // c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo File "tuple_support.py", line 84 + frame_dig -3 // load a.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + frame_dig -1 // load b.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0,b.1#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | {addw}.0,{addw}.1 addw(a_lo, b_lo) File "tuple_support.py", line 90 + swap // store c_lo#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,{addw}.0 c_lo File "tuple_support.py", line 90 + frame_dig -4 // load a.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + frame_dig -2 // load b.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0,b.0#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,{addw}.0,{addw}.1 addw(a_hi, b_hi) File "tuple_support.py", line 91 + uncover 2 // load lo_carry#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,c_mid#0,lo_carry#0 lo_carry File "tuple_support.py", line 90 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,{addw}.0,{addw}.1 addw(c_mid, lo_carry) File "tuple_support.py", line 92 + cover 2 // store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,{addw}.0 c_mid File "tuple_support.py", line 91 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,{addw}.0,{addw}.1 addw(hi_carry1, hi_carry2) File "tuple_support.py", line 93 + swap // store c_hi#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{addw}.0 c_hi File "tuple_support.py", line 93 + ! // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{!} not did_overflow File "tuple_support.py", line 94 + assert // is such a thing even possible? 👽 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 assert not did_overflow, "is such a thing even possible? 👽" File "tuple_support.py", line 94 + swap // load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_hi#0,c_mid#0 c_mid File "tuple_support.py", line 91 + uncover 2 // load c_lo#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_hi#0,c_mid#0,c_lo#0 c_lo File "tuple_support.py", line 90 + retsub // c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo File "tuple_support.py", line 95 // examples.tuple_support.bytes_multiply(arg.0#0: bytes, arg.1#0: uint64) -> bytes: bytes_multiply: - proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: File "tuple_support.py", line 55 + proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: File "tuple_support.py", line 67 bytes_multiply_block@0: - byte "" // (𝕡) arg.0#0,arg.1#0 | "" b"" File "tuple_support.py", line 58 - int 0 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | 0 urange(count) File "tuple_support.py", line 59 + byte "" // (𝕡) arg.0#0,arg.1#0 | "" b"" File "tuple_support.py", line 69 + int 0 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | 0 urange(count) File "tuple_support.py", line 70 // Implicit fall through to bytes_multiply_for_header@1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | bytes_multiply_for_header@1: - frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 _i File "tuple_support.py", line 59 - frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,arg.1#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 55 - < // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {<} urange(count) File "tuple_support.py", line 59 - bz bytes_multiply_after_for@4 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 59 - // Implicit fall through to bytes_multiply_for_body@2 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 59 + frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 _i File "tuple_support.py", line 70 + frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,arg.1#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 67 + < // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {<} urange(count) File "tuple_support.py", line 70 + bz bytes_multiply_after_for@4 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 70 + // Implicit fall through to bytes_multiply_for_body@2 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 70 bytes_multiply_for_body@2: - frame_dig 0 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0 result File "tuple_support.py", line 58 - frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0,arg.0#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 55 - concat // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {concat} result + b File "tuple_support.py", line 60 - frame_bury 0 // store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result File "tuple_support.py", line 58 - frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 _i File "tuple_support.py", line 59 - int 1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,1 urange(count) File "tuple_support.py", line 59 - + // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {+} urange(count) File "tuple_support.py", line 59 - frame_bury 1 // store _i#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i File "tuple_support.py", line 59 + frame_dig 0 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0 result File "tuple_support.py", line 69 + frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0,arg.0#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 67 + concat // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {concat} result += b File "tuple_support.py", line 71 + frame_bury 0 // store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result File "tuple_support.py", line 69 + frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 _i File "tuple_support.py", line 70 + int 1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,1 urange(count) File "tuple_support.py", line 70 + + // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {+} urange(count) File "tuple_support.py", line 70 + frame_bury 1 // store _i#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i File "tuple_support.py", line 70 b bytes_multiply_for_header@1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | bytes_multiply_after_for@4: - retsub // virtual: 2 ops result#0 result = Bytes(b"") # TODO: allow no-args -> empty File "tuple_support.py", line 58 + retsub // virtual: 2 ops result#0 result = Bytes(b"") # TODO: allow no-args -> empty File "tuple_support.py", line 69 -// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> : +// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> void: test_tuple_swap: - proto 1 0 // (𝕡) zero#0 | def test_tuple_swap(zero: UInt64) -> None: File "tuple_support.py", line 88 + proto 1 0 // (𝕡) zero#0 | def test_tuple_swap(zero: UInt64) -> None: File "tuple_support.py", line 99 test_tuple_swap_block@0: - frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | zero#0 zero: UInt64 File "tuple_support.py", line 88 - int 1 // (𝕡) zero#0 | zero#0,1 1 File "tuple_support.py", line 89 - + // (𝕡) zero#0 | {+} zero + 1 File "tuple_support.py", line 89 - frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | a#0,zero#0 zero: UInt64 File "tuple_support.py", line 88 - int 2 // (𝕡) zero#0 | a#0,zero#0,2 2 File "tuple_support.py", line 90 - + // (𝕡) zero#0 | a#0,{+} zero + 2 File "tuple_support.py", line 90 - int 2 // (𝕡) zero#0 | a#0,b#0,2 2 File "tuple_support.py", line 92 - == // (𝕡) zero#0 | a#0,{==} a == 2, "a should be two" File "tuple_support.py", line 92 - assert // (𝕡) zero#0 | a#0 assert a == 2, "a should be two" File "tuple_support.py", line 92 - int 1 // (𝕡) zero#0 | a#0,1 1 File "tuple_support.py", line 93 - == // (𝕡) zero#0 | {==} b == 1, "b should be one" File "tuple_support.py", line 93 - assert // (𝕡) zero#0 | assert b == 1, "b should be one" File "tuple_support.py", line 93 + frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | zero#0 zero: UInt64 File "tuple_support.py", line 99 + int 1 // (𝕡) zero#0 | zero#0,1 1 File "tuple_support.py", line 100 + + // (𝕡) zero#0 | {+} zero + 1 File "tuple_support.py", line 100 + frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | a#0,zero#0 zero: UInt64 File "tuple_support.py", line 99 + int 2 // (𝕡) zero#0 | a#0,zero#0,2 2 File "tuple_support.py", line 101 + + // (𝕡) zero#0 | a#0,{+} zero + 2 File "tuple_support.py", line 101 + int 2 // (𝕡) zero#0 | a#0,b#0,2 2 File "tuple_support.py", line 103 + == // (𝕡) zero#0 | a#0,{==} a == 2, "a should be two" File "tuple_support.py", line 103 + assert // a should be two // (𝕡) zero#0 | a#0 assert a == 2, "a should be two" File "tuple_support.py", line 103 + int 1 // (𝕡) zero#0 | a#0,1 1 File "tuple_support.py", line 104 + == // (𝕡) zero#0 | {==} b == 1, "b should be one" File "tuple_support.py", line 104 + assert // b should be one // (𝕡) zero#0 | assert b == 1, "b should be one" File "tuple_support.py", line 104 retsub // -// examples.tuple_support.TupleSupport.__init__() -> : +// examples.tuple_support.slicing(values.0#0: uint64, values.1#0: uint64, values.2#0: uint64, values.3#0: uint64, values.4#0: uint64, values.5#0: uint64, values.6#0: uint64, values.7#0: uint64) -> void: +slicing: + proto 8 0 // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | def slicing(values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64]) -> None: File "tuple_support.py", line 108 + +slicing_block@0: + frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0,values.1#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0,values.1#0,values.2#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + callsub add_three_values // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | {add_three_values} add_three_values(one_to_three) File "tuple_support.py", line 110 + frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,values.0#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,values.0#0,values.1#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,{+} values[0] + values[1] File "tuple_support.py", line 110 + frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%1#0,values.2#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,{+} values[0] + values[1] + values[2] File "tuple_support.py", line 110 + == // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | {==} add_three_values(one_to_three) == values[0] + values[1] + values[2] File "tuple_support.py", line 110 + assert // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | assert add_three_values(one_to_three) == values[0] + values[1] + values[2] File "tuple_support.py", line 110 + retsub // + + +// examples.tuple_support.TupleSupport.__init__() -> void: __init__: - proto 0 0 // def __init__(self) -> None: File "tuple_support.py", line 5 + proto 0 0 // def __init__(self) -> None: File "tuple_support.py", line 5 __init___block@0: - byte "state" // "state" self.state File "tuple_support.py", line 6 - int 0 // "state",0 0 File "tuple_support.py", line 6 - app_global_put // self.state = UInt64(0) File "tuple_support.py", line 6 + byte "state" // "state" self.state File "tuple_support.py", line 6 + int 0 // "state",0 0 File "tuple_support.py", line 6 + app_global_put // self.state = UInt64(0) File "tuple_support.py", line 6 retsub // diff --git a/examples/out/tuple_support.approval.teal b/examples/out/tuple_support.approval.teal index 9a13708e6b..165945c37a 100644 --- a/examples/out/tuple_support.approval.teal +++ b/examples/out/tuple_support.approval.teal @@ -19,24 +19,16 @@ main_entrypoint@2: int 2 addw byte "state" - uncover 1 + swap app_global_put ! - assert + assert // overflow! int 1 int 2 addw pop ! - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert + assert // overflow! byte "Hello, " byte "world!" callsub bytes_combine @@ -44,18 +36,18 @@ main_entrypoint@2: int 18446744073709551615 int 18446744073709551615 addw - cover 1 + swap int 1 int 2 addw - cover 1 + swap uncover 2 uncover 3 uncover 2 uncover 3 callsub addw2 cover 2 - cover 1 + swap itob log itob @@ -68,6 +60,15 @@ main_entrypoint@2: log int 0 callsub test_tuple_swap + int 1 + int 2 + int 3 + int 4 + int 5 + int 6 + int 7 + int 8 + callsub slicing int 3 return @@ -130,7 +131,7 @@ addw2_block@0: frame_dig -3 frame_dig -1 addw - cover 1 + swap frame_dig -4 frame_dig -2 addw @@ -138,10 +139,10 @@ addw2_block@0: addw cover 2 addw - cover 1 + swap ! - assert - uncover 1 + assert // is such a thing even possible? 👽 + swap uncover 2 retsub @@ -175,7 +176,7 @@ bytes_multiply_after_for@4: retsub -// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> : +// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> void: test_tuple_swap: proto 1 0 @@ -188,14 +189,33 @@ test_tuple_swap_block@0: + int 2 == - assert + assert // a should be two int 1 == + assert // b should be one + retsub + + +// examples.tuple_support.slicing(values.0#0: uint64, values.1#0: uint64, values.2#0: uint64, values.3#0: uint64, values.4#0: uint64, values.5#0: uint64, values.6#0: uint64, values.7#0: uint64) -> void: +slicing: + proto 8 0 + +slicing_block@0: + frame_dig -8 + frame_dig -7 + frame_dig -6 + callsub add_three_values + frame_dig -8 + frame_dig -7 + + + frame_dig -6 + + + == assert retsub -// examples.tuple_support.TupleSupport.__init__() -> : +// examples.tuple_support.TupleSupport.__init__() -> void: __init__: proto 0 0 diff --git a/examples/out/tuple_support.approval_unoptimized.debug.teal b/examples/out/tuple_support.approval_unoptimized.debug.teal index b53fecc76a..8c0f2c9a36 100644 --- a/examples/out/tuple_support.approval_unoptimized.debug.teal +++ b/examples/out/tuple_support.approval_unoptimized.debug.teal @@ -1,4 +1,4 @@ -// Op // Op Description Stack (out) X stack Source code Source line +// Op // Op Description Stack (out) X stack Source code Source line #pragma version 8 @@ -17,156 +17,165 @@ main_on_create@1: // Implicit fall through to main_entrypoint@2 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | main_entrypoint@2: - int 101 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 101 101 File "tuple_support.py", line 9 - int 102 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 101,102 102 File "tuple_support.py", line 9 - int 103 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 101,102,103 103 File "tuple_support.py", line 9 - callsub add_three_values // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {add_three_values} add_three_values((UInt64(101), UInt64(102), UInt64(103))) File "tuple_support.py", line 9 - itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {itob} itob(total) File "tuple_support.py", line 10 - log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | log(itob(total)) File "tuple_support.py", line 10 - int 1 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 1 1 File "tuple_support.py", line 11 - dup // store a#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,a#0 a File "tuple_support.py", line 11 - bury 9 // store a#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0 a File "tuple_support.py", line 11 - int 2 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,2 2 File "tuple_support.py", line 11 - dup // store b#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,b#0 b File "tuple_support.py", line 11 - bury 6 // store b#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 b File "tuple_support.py", line 11 - dig 1 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,a#0 a File "tuple_support.py", line 11 - dig 1 // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,a#0,b#0 b File "tuple_support.py", line 11 - addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 12 - cover 1 // store tuple_assignment%3#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tuple_assignment%3#0,{addw}.0 addw(a, b) File "tuple_support.py", line 12 - byte "state" // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tuple_assignment%3#0,did_overflow#0,"state" self.state File "tuple_support.py", line 12 - uncover 2 // load tuple_assignment%3#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,did_overflow#0,"state",tuple_assignment%3#0 addw(a, b) File "tuple_support.py", line 12 - app_global_put // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,did_overflow#0 (did_overflow, self.state) = addw(a, b) File "tuple_support.py", line 12 - ! // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{!} not did_overflow File "tuple_support.py", line 13 - assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 assert not did_overflow, "overflow!" File "tuple_support.py", line 13 - dup // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,b#0 b File "tuple_support.py", line 11 - cover 2 // store ab.1#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,a#0,b#0 ab File "tuple_support.py", line 14 - dig 1 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,a#0,b#0,a#0 a File "tuple_support.py", line 11 - cover 2 // store ab.0#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0 ab File "tuple_support.py", line 14 - dig 1 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,a#0 a File "tuple_support.py", line 11 - dig 1 // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,a#0,b#0 b File "tuple_support.py", line 11 - addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 15 - pop // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,{addw}.0 result File "tuple_support.py", line 15 - ! // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,{!} not result[0] File "tuple_support.py", line 16 - assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0 assert not result[0], "overflow!" File "tuple_support.py", line 16 - int 3 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,3 3 File "tuple_support.py", line 17 - int 3 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,d#0,3 3 File "tuple_support.py", line 17 - cover 1 // store c#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0 c File "tuple_support.py", line 17 - dig 4 // load ab.0#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0,ab.0#0 ab File "tuple_support.py", line 14 - bury 13 // store a2#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0 a2 File "tuple_support.py", line 18 - dig 5 // load ab.1#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0,ab.1#0 ab File "tuple_support.py", line 14 - bury 9 // store b2#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0 b2 File "tuple_support.py", line 18 - bury 6 // store cd.1#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0 cd File "tuple_support.py", line 19 - bury 6 // store cd.0#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0 cd File "tuple_support.py", line 19 - uncover 3 // load ab.1#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.0#0,a#0,b#0,ab.1#0 ab File "tuple_support.py", line 14 - bury 8 // store ab2.1#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.0#0,a#0,b#0 ab2 File "tuple_support.py", line 20 - uncover 2 // load ab.0#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,ab.0#0 ab File "tuple_support.py", line 14 - bury 8 // store ab2.0#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 ab2 File "tuple_support.py", line 20 - == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {==} a == b: File "tuple_support.py", line 22 - bz main_else_body@4 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | if a == b: File "tuple_support.py", line 22 - // Implicit fall through to main_if_body@3 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | if a == b: File "tuple_support.py", line 22 + int 101 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 101 101 File "tuple_support.py", line 9 + int 102 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 101,102 102 File "tuple_support.py", line 9 + int 103 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 101,102,103 103 File "tuple_support.py", line 9 + callsub add_three_values // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {add_three_values} add_three_values((UInt64(101), UInt64(102), UInt64(103))) File "tuple_support.py", line 9 + itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {itob} itob(total) File "tuple_support.py", line 10 + log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | log(itob(total)) File "tuple_support.py", line 10 + int 1 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | 1 1 File "tuple_support.py", line 11 + dup // store a#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,a#0 a File "tuple_support.py", line 11 + bury 9 // store a#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0 a File "tuple_support.py", line 11 + int 2 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,2 2 File "tuple_support.py", line 11 + dup // store b#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,b#0 b File "tuple_support.py", line 11 + bury 6 // store b#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 b File "tuple_support.py", line 11 + dig 1 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,a#0 a File "tuple_support.py", line 11 + dig 1 // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,a#0,b#0 b File "tuple_support.py", line 11 + addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 12 + swap // store tuple_assignment%3#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tuple_assignment%3#0,{addw}.0 addw(a, b) File "tuple_support.py", line 12 + byte "state" // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tuple_assignment%3#0,did_overflow#0,"state" self.state File "tuple_support.py", line 12 + uncover 2 // load tuple_assignment%3#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,did_overflow#0,"state",tuple_assignment%3#0 addw(a, b) File "tuple_support.py", line 12 + app_global_put // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,did_overflow#0 (did_overflow, self.state) = addw(a, b) File "tuple_support.py", line 12 + ! // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{!} not did_overflow File "tuple_support.py", line 13 + assert // overflow! // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 assert not did_overflow, "overflow!" File "tuple_support.py", line 13 + dup // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,b#0 b File "tuple_support.py", line 11 + cover 2 // store ab.1#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,a#0,b#0 ab File "tuple_support.py", line 14 + dig 1 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,a#0,b#0,a#0 a File "tuple_support.py", line 11 + cover 2 // store ab.0#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0 ab File "tuple_support.py", line 14 + dig 1 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,a#0 a File "tuple_support.py", line 11 + dig 1 // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,a#0,b#0 b File "tuple_support.py", line 11 + addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 15 + pop // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,{addw}.0 result File "tuple_support.py", line 15 + ! // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,{!} not result[0] File "tuple_support.py", line 16 + assert // overflow! // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0 assert not result[0], "overflow!" File "tuple_support.py", line 16 + int 3 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,3 3 File "tuple_support.py", line 17 + int 3 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,d#0,3 3 File "tuple_support.py", line 17 + swap // store c#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0 c File "tuple_support.py", line 17 + dig 4 // load ab.0#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0,ab.0#0 ab File "tuple_support.py", line 14 + bury 13 // store a2#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0 a2 File "tuple_support.py", line 18 + dig 5 // load ab.1#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0,ab.1#0 ab File "tuple_support.py", line 14 + bury 9 // store b2#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0,d#0 b2 File "tuple_support.py", line 18 + bury 6 // store cd.1#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0,c#0 cd File "tuple_support.py", line 19 + bury 6 // store cd.0#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.1#0,ab.0#0,a#0,b#0 cd File "tuple_support.py", line 19 + uncover 3 // load ab.1#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.0#0,a#0,b#0,ab.1#0 ab File "tuple_support.py", line 14 + bury 8 // store ab2.1#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab.0#0,a#0,b#0 ab2 File "tuple_support.py", line 20 + uncover 2 // load ab.0#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,ab.0#0 ab File "tuple_support.py", line 14 + bury 8 // store ab2.0#0 to f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 ab2 File "tuple_support.py", line 20 + == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {==} a == b: File "tuple_support.py", line 22 + bz main_else_body@4 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | if a == b: File "tuple_support.py", line 22 + // Implicit fall through to main_if_body@3 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | if a == b: File "tuple_support.py", line 22 main_if_body@3: - dig 4 // load ab2.1#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab2.1#0 ab2 File "tuple_support.py", line 20 - dig 6 // load ab2.0#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | ab2.0#0 ab2 File "tuple_support.py", line 20 - cover 1 // store tup.0#0 to x-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup File "tuple_support.py", line 23 - b main_after_if_else@5 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup.0#0, tup.1#0 + dig 4 // load ab2.1#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | ab2.1#0 ab2 File "tuple_support.py", line 20 + dig 6 // load ab2.0#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | ab2.0#0 ab2 File "tuple_support.py", line 20 + swap // store tup.0#0 to x-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup File "tuple_support.py", line 23 + b main_after_if_else@5 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup.0#0, tup.1#0 main_else_body@4: - dup // load cd.1#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | cd.1#0 cd File "tuple_support.py", line 19 - dig 2 // load cd.0#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | cd.0#0 cd File "tuple_support.py", line 19 - cover 1 // store tup.0#0 to x-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup File "tuple_support.py", line 23 - // Implicit fall through to main_after_if_else@5 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup.0#0, tup.1#0 + dup // load cd.1#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | cd.1#0 cd File "tuple_support.py", line 19 + dig 2 // load cd.0#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | cd.0#0 cd File "tuple_support.py", line 19 + swap // store tup.0#0 to x-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup File "tuple_support.py", line 23 + // Implicit fall through to main_after_if_else@5 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | tup.0#0, tup.1#0 main_after_if_else@5: - dig 8 // load a2#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a2#0 tup.0#0, tup.1#0 a2 File "tuple_support.py", line 18 - dig 10 // load a#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a2#0,a#0 a File "tuple_support.py", line 11 + dig 8 // load a2#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a2#0 tup.0#0, tup.1#0 a2 File "tuple_support.py", line 18 + dig 10 // load a#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a2#0,a#0 a File "tuple_support.py", line 11 dup - cover 2 // store a#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,a2#0,a#0 a File "tuple_support.py", line 11 - == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,{==} a2 == a File "tuple_support.py", line 26 - assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0 assert a2 == a File "tuple_support.py", line 26 - dig 5 // load b2#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b2#0 b2 File "tuple_support.py", line 18 - dig 7 // load b#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b2#0,b#0 b File "tuple_support.py", line 11 + cover 2 // store a#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,a2#0,a#0 a File "tuple_support.py", line 11 + == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,{==} a2 == a File "tuple_support.py", line 26 + assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0 assert a2 == a File "tuple_support.py", line 26 + dig 5 // load b2#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b2#0 b2 File "tuple_support.py", line 18 + dig 7 // load b#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b2#0,b#0 b File "tuple_support.py", line 11 dup - cover 2 // store b#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0,b2#0,b#0 b File "tuple_support.py", line 11 - == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0,{==} b2 == b File "tuple_support.py", line 27 - assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0 assert b2 == b File "tuple_support.py", line 27 - dig 5 // load cd.0#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0,cd.0#0 cd File "tuple_support.py", line 19 - uncover 4 // load tup.0#0 from x-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0,cd.0#0,tup.0#0 tup File "tuple_support.py", line 23 - == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0,{==} cd[0] == tup[0] File "tuple_support.py", line 28 - assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0 assert cd[0] == tup[0] File "tuple_support.py", line 28 - dig 3 // load cd.1#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0,cd.1#0 cd File "tuple_support.py", line 19 - uncover 3 // load tup.1#0 from x-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,cd.1#0,tup.1#0 tup File "tuple_support.py", line 23 - == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{==} cd[1] == tup[1] File "tuple_support.py", line 29 - assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 assert cd[1] == tup[1] File "tuple_support.py", line 29 - byte "Hello, " // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"Hello, " b"Hello, " File "tuple_support.py", line 33 - byte "world!" // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"Hello, ","world!" b"world!" File "tuple_support.py", line 33 - callsub bytes_combine // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{bytes_combine} bytes_combine((Bytes(b"Hello, "), Bytes(b"world!"))) File "tuple_support.py", line 33 - log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 log(bytes_combine((Bytes(b"Hello, "), Bytes(b"world!")))) File "tuple_support.py", line 33 - int 18446744073709551615 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,18446744073709551615 2**64 - 1 File "tuple_support.py", line 34 - dup // load max_uint64#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,max_uint64#0,max_uint64#0 max_uint64 File "tuple_support.py", line 34 - addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{addw}.0,{addw}.1 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - cover 1 // store tmp%13#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,{addw}.0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - dig 3 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,a#0 a File "tuple_support.py", line 11 - dig 3 // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,a#0,b#0 b File "tuple_support.py", line 11 - addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 35 - cover 1 // store tmp%15#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,tmp%15#0,{addw}.0 addw(a, b) File "tuple_support.py", line 35 - uncover 2 // load tmp%12#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%15#0,tmp%14#0,tmp%12#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - uncover 3 // load tmp%13#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%15#0,tmp%14#0,tmp%12#0,tmp%13#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 - uncover 2 // load tmp%14#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%15#0,tmp%12#0,tmp%13#0,tmp%14#0 addw(a, b) File "tuple_support.py", line 35 - uncover 3 // load tmp%15#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%12#0,tmp%13#0,tmp%14#0,tmp%15#0 addw(a, b) File "tuple_support.py", line 35 - callsub addw2 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{addw2}.0,{addw2}.1,{addw2}.2 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 - cover 2 // store tuple_assignment%18#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tuple_assignment%18#0,{addw2}.0,{addw2}.1 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 - cover 2 // store mid#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,mid#0,tuple_assignment%18#0,hi#0 mid File "tuple_support.py", line 35 - uncover 1 // load tuple_assignment%18#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,mid#0,hi#0,tuple_assignment%18#0 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 - cover 2 // store lo#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,mid#0,hi#0 lo File "tuple_support.py", line 35 - itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,mid#0,{itob} itob(hi) File "tuple_support.py", line 36 - log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,mid#0 log(itob(hi)) File "tuple_support.py", line 36 - itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,{itob} itob(mid) File "tuple_support.py", line 37 - log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0 log(itob(mid)) File "tuple_support.py", line 37 - itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{itob} itob(lo) File "tuple_support.py", line 38 - log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 log(itob(lo)) File "tuple_support.py", line 38 - byte "na" // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"na" b"na" File "tuple_support.py", line 39 - int 5 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"na",5 5 File "tuple_support.py", line 39 - callsub bytes_multiply // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{bytes_multiply} bytes_multiply((Bytes(b"na"), UInt64(5))) File "tuple_support.py", line 39 - log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 log(bytes_multiply((Bytes(b"na"), UInt64(5)))) File "tuple_support.py", line 39 - int 0 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,0 0 File "tuple_support.py", line 40 - callsub test_tuple_swap // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 test_tuple_swap(zero=UInt64(0)) File "tuple_support.py", line 40 - + // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {+} a + b File "tuple_support.py", line 41 - return // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | return a + b File "tuple_support.py", line 41 + cover 2 // store b#0 to l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0,b2#0,b#0 b File "tuple_support.py", line 11 + == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0,{==} b2 == b File "tuple_support.py", line 27 + assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0 assert b2 == b File "tuple_support.py", line 27 + dig 5 // load cd.0#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.0#0,tup.1#0 | a#0,b#0,cd.0#0 cd File "tuple_support.py", line 19 + uncover 4 // load tup.0#0 from x-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0,cd.0#0,tup.0#0 tup File "tuple_support.py", line 23 + == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0,{==} cd[0] == tup[0] File "tuple_support.py", line 28 + assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0 assert cd[0] == tup[0] File "tuple_support.py", line 28 + dig 3 // load cd.1#0 from f-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | (𝕏) tup.1#0 | a#0,b#0,cd.1#0 cd File "tuple_support.py", line 19 + uncover 3 // load tup.1#0 from x-stack (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,cd.1#0,tup.1#0 tup File "tuple_support.py", line 23 + == // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{==} cd[1] == tup[1] File "tuple_support.py", line 29 + assert // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 assert cd[1] == tup[1] File "tuple_support.py", line 29 + byte "Hello, " // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"Hello, " b"Hello, " File "tuple_support.py", line 33 + byte "world!" // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"Hello, ","world!" b"world!" File "tuple_support.py", line 33 + callsub bytes_combine // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{bytes_combine} bytes_combine((Bytes(b"Hello, "), Bytes(b"world!"))) File "tuple_support.py", line 33 + log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 log(bytes_combine((Bytes(b"Hello, "), Bytes(b"world!")))) File "tuple_support.py", line 33 + int 18446744073709551615 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,18446744073709551615 2**64 - 1 File "tuple_support.py", line 34 + dup // load max_uint64#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,max_uint64#0,max_uint64#0 max_uint64 File "tuple_support.py", line 34 + addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{addw}.0,{addw}.1 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + swap // store tmp%13#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,{addw}.0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + dig 3 // load a#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,a#0 a File "tuple_support.py", line 11 + dig 3 // load b#0 from l-stack (copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,a#0,b#0 b File "tuple_support.py", line 11 + addw // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,{addw}.0,{addw}.1 addw(a, b) File "tuple_support.py", line 35 + swap // store tmp%15#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%12#0,tmp%15#0,{addw}.0 addw(a, b) File "tuple_support.py", line 35 + uncover 2 // load tmp%12#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%13#0,tmp%15#0,tmp%14#0,tmp%12#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + uncover 3 // load tmp%13#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%15#0,tmp%14#0,tmp%12#0,tmp%13#0 addw(max_uint64, max_uint64) File "tuple_support.py", line 35 + uncover 2 // load tmp%14#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%15#0,tmp%12#0,tmp%13#0,tmp%14#0 addw(a, b) File "tuple_support.py", line 35 + uncover 3 // load tmp%15#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tmp%12#0,tmp%13#0,tmp%14#0,tmp%15#0 addw(a, b) File "tuple_support.py", line 35 + callsub addw2 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{addw2}.0,{addw2}.1,{addw2}.2 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 + cover 2 // store tuple_assignment%18#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,tuple_assignment%18#0,{addw2}.0,{addw2}.1 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 + cover 2 // store mid#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,mid#0,tuple_assignment%18#0,hi#0 mid File "tuple_support.py", line 35 + swap // load tuple_assignment%18#0 from l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,mid#0,hi#0,tuple_assignment%18#0 addw2(addw(max_uint64, max_uint64), addw(a, b)) File "tuple_support.py", line 35 + cover 2 // store lo#0 to l-stack (no copy) (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,mid#0,hi#0 lo File "tuple_support.py", line 35 + itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,mid#0,{itob} itob(hi) File "tuple_support.py", line 36 + log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,mid#0 log(itob(hi)) File "tuple_support.py", line 36 + itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0,{itob} itob(mid) File "tuple_support.py", line 37 + log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,lo#0 log(itob(mid)) File "tuple_support.py", line 37 + itob // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{itob} itob(lo) File "tuple_support.py", line 38 + log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 log(itob(lo)) File "tuple_support.py", line 38 + byte "na" // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"na" b"na" File "tuple_support.py", line 39 + int 5 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,"na",5 5 File "tuple_support.py", line 39 + callsub bytes_multiply // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,{bytes_multiply} bytes_multiply((Bytes(b"na"), UInt64(5))) File "tuple_support.py", line 39 + log // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 log(bytes_multiply((Bytes(b"na"), UInt64(5)))) File "tuple_support.py", line 39 + int 0 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,0 0 File "tuple_support.py", line 40 + callsub test_tuple_swap // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 test_tuple_swap(zero=UInt64(0)) File "tuple_support.py", line 40 + int 1 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1 1 File "tuple_support.py", line 43 + int 2 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1,2 2 File "tuple_support.py", line 44 + int 3 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1,2,3 3 File "tuple_support.py", line 45 + int 4 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1,2,3,4 4 File "tuple_support.py", line 46 + int 5 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1,2,3,4,5 5 File "tuple_support.py", line 47 + int 6 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1,2,3,4,5,6 6 File "tuple_support.py", line 48 + int 7 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1,2,3,4,5,6,7 7 File "tuple_support.py", line 49 + int 8 // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0,1,2,3,4,5,6,7,8 8 File "tuple_support.py", line 50 + callsub slicing // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | a#0,b#0 slicing( File "tuple_support.py", line 41 + + // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | {+} a + b File "tuple_support.py", line 53 + return // (𝕗) a#0,a2#0,ab2.0#0,ab2.1#0,b#0,b2#0,cd.0#0,cd.1#0 | return a + b File "tuple_support.py", line 53 // examples.tuple_support.add_three_values(values.0#0: uint64, values.1#0: uint64, values.2#0: uint64) -> uint64: add_three_values: - proto 3 1 // (𝕡) values.0#0,values.1#0,values.2#0 | def add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: File "tuple_support.py", line 65 + proto 3 1 // (𝕡) values.0#0,values.1#0,values.2#0 | def add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: File "tuple_support.py", line 76 byte "" dup // allocate 2 to stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4 | add_three_values_block@0: - int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4 | 0 0 File "tuple_support.py", line 66 + int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4 | 0 0 File "tuple_support.py", line 77 // Implicit fall through to add_three_values_for_header_0@1 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | add_three_values_for_header_0@1: int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | 0 frame_bury 0 // store tuple_index%0#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | - frame_dig -3 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | values.0#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 65 - b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | value#0 + frame_dig -3 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | values.0#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 76 + b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | value#0 add_three_values_for_header_1@2: - frame_dig -2 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | values.1#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 65 + frame_dig -2 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | values.1#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 76 frame_dig 1 // load tuple_index%0#4 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | tuple_index%0#4 frame_bury 0 // store tuple_index%0#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | - b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | value#0 + b add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | value#0 add_three_values_for_header_2@3: - frame_dig -1 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | values.2#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 65 + frame_dig -1 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | values.2#0 values: tuple[UInt64, UInt64, UInt64] File "tuple_support.py", line 76 frame_dig 1 // load tuple_index%0#4 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | tuple_index%0#4 frame_bury 0 // store tuple_index%0#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | - // Implicit fall through to add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | value#0 + // Implicit fall through to add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | value#0 add_three_values_for_body@4: - frame_dig 2 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | total#0 value#0 total File "tuple_support.py", line 66 - + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | {+} total += value File "tuple_support.py", line 69 - frame_bury 2 // store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | total File "tuple_support.py", line 66 + frame_dig 2 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | (𝕏) value#0 | total#0 value#0 total File "tuple_support.py", line 77 + + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | {+} total += value File "tuple_support.py", line 80 + frame_bury 2 // store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | total File "tuple_support.py", line 77 // Implicit fall through to add_three_values_for_footer@5 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | add_three_values_for_footer@5: @@ -175,119 +184,143 @@ add_three_values_for_footer@5: int 1 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | tuple_index%0#0,tuple_index%0#0,1 + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | tuple_index%0#0,{+} frame_bury 1 // store tuple_index%0#4 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | tuple_index%0#0 - switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | for value in values: File "tuple_support.py", line 67 - // Implicit fall through to add_three_values_after_for@6 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | for value in values: File "tuple_support.py", line 67 + switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | for value in values: File "tuple_support.py", line 78 + // Implicit fall through to add_three_values_after_for@6 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | for value in values: File "tuple_support.py", line 78 add_three_values_after_for@6: - frame_dig 2 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | total#0 total File "tuple_support.py", line 66 + frame_dig 2 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#0,tuple_index%0#4,total#0 | total#0 total File "tuple_support.py", line 77 frame_bury 0 - retsub // total#0 return total File "tuple_support.py", line 72 + retsub // total#0 return total File "tuple_support.py", line 83 // examples.tuple_support.bytes_combine(arg.0#0: bytes, arg.1#0: bytes) -> bytes: bytes_combine: - proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: File "tuple_support.py", line 48 + proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: File "tuple_support.py", line 60 bytes_combine_block@0: - frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 48 - frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | a#0,arg.1#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 48 - concat // (𝕡) arg.0#0,arg.1#0 | {concat} a + b File "tuple_support.py", line 50 - retsub // result#0 return result File "tuple_support.py", line 51 + frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 60 + frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | a#0,arg.1#0 arg: tuple[Bytes, Bytes] File "tuple_support.py", line 60 + concat // (𝕡) arg.0#0,arg.1#0 | {concat} a + b File "tuple_support.py", line 62 + retsub // result#0 return result File "tuple_support.py", line 63 // examples.tuple_support.addw2(a.0#0: uint64, a.1#0: uint64, b.0#0: uint64, b.1#0: uint64) -> uint64, uint64, uint64: addw2: - proto 4 3 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | def addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt64, UInt64]: File "tuple_support.py", line 76 + proto 4 3 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | def addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt64, UInt64]: File "tuple_support.py", line 87 addw2_block@0: - frame_dig -4 // load a.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.0#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - frame_dig -3 // load a.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,a.1#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - frame_dig -2 // load b.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,a_lo#0,b.0#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - cover 1 // store b_hi#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,a_lo#0 b_hi File "tuple_support.py", line 78 - frame_dig -1 // load b.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,a_lo#0,b.1#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 76 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,{addw}.0,{addw}.1 addw(a_lo, b_lo) File "tuple_support.py", line 79 - cover 1 // store tuple_assignment%1#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,tuple_assignment%1#0,{addw}.0 addw(a_lo, b_lo) File "tuple_support.py", line 79 - cover 2 // store lo_carry#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,lo_carry#0,b_hi#0,tuple_assignment%1#0 lo_carry File "tuple_support.py", line 79 - cover 3 // store c_lo#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,a_hi#0,lo_carry#0,b_hi#0 c_lo File "tuple_support.py", line 79 - uncover 2 // load a_hi#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,b_hi#0,a_hi#0 a_hi File "tuple_support.py", line 77 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,{addw}.0,{addw}.1 addw(a_hi, b_hi) File "tuple_support.py", line 80 - uncover 2 // load lo_carry#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,c_mid#0,lo_carry#0 lo_carry File "tuple_support.py", line 79 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,{addw}.0,{addw}.1 addw(c_mid, lo_carry) File "tuple_support.py", line 81 - cover 2 // store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,hi_carry2#0 c_mid File "tuple_support.py", line 80 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,{addw}.0,{addw}.1 addw(hi_carry1, hi_carry2) File "tuple_support.py", line 82 - cover 1 // store tuple_assignment%7#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,tuple_assignment%7#0,{addw}.0 addw(hi_carry1, hi_carry2) File "tuple_support.py", line 82 - ! // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{!} not did_overflow File "tuple_support.py", line 83 - assert // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 assert not did_overflow, "is such a thing even possible? 👽" File "tuple_support.py", line 83 - uncover 1 // load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_hi#0,c_mid#0 c_mid File "tuple_support.py", line 80 - uncover 2 // load c_lo#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_hi#0,c_mid#0,c_lo#0 c_lo File "tuple_support.py", line 79 - retsub // c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo File "tuple_support.py", line 84 + frame_dig -4 // load a.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.0#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + frame_dig -3 // load a.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,a.1#0 a: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + frame_dig -2 // load b.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,a_lo#0,b.0#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + swap // store b_hi#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,a_lo#0 b_hi File "tuple_support.py", line 89 + frame_dig -1 // load b.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,a_lo#0,b.1#0 b: tuple[UInt64, UInt64] File "tuple_support.py", line 87 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,{addw}.0,{addw}.1 addw(a_lo, b_lo) File "tuple_support.py", line 90 + swap // store tuple_assignment%1#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,b_hi#0,tuple_assignment%1#0,{addw}.0 addw(a_lo, b_lo) File "tuple_support.py", line 90 + cover 2 // store lo_carry#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a_hi#0,lo_carry#0,b_hi#0,tuple_assignment%1#0 lo_carry File "tuple_support.py", line 90 + cover 3 // store c_lo#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,a_hi#0,lo_carry#0,b_hi#0 c_lo File "tuple_support.py", line 90 + uncover 2 // load a_hi#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,b_hi#0,a_hi#0 a_hi File "tuple_support.py", line 88 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,{addw}.0,{addw}.1 addw(a_hi, b_hi) File "tuple_support.py", line 91 + uncover 2 // load lo_carry#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,c_mid#0,lo_carry#0 lo_carry File "tuple_support.py", line 90 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,{addw}.0,{addw}.1 addw(c_mid, lo_carry) File "tuple_support.py", line 92 + cover 2 // store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,hi_carry2#0 c_mid File "tuple_support.py", line 91 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,{addw}.0,{addw}.1 addw(hi_carry1, hi_carry2) File "tuple_support.py", line 93 + swap // store tuple_assignment%7#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,tuple_assignment%7#0,{addw}.0 addw(hi_carry1, hi_carry2) File "tuple_support.py", line 93 + ! // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{!} not did_overflow File "tuple_support.py", line 94 + assert // is such a thing even possible? 👽 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 assert not did_overflow, "is such a thing even possible? 👽" File "tuple_support.py", line 94 + swap // load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_hi#0,c_mid#0 c_mid File "tuple_support.py", line 91 + uncover 2 // load c_lo#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_hi#0,c_mid#0,c_lo#0 c_lo File "tuple_support.py", line 90 + retsub // c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo File "tuple_support.py", line 95 // examples.tuple_support.bytes_multiply(arg.0#0: bytes, arg.1#0: uint64) -> bytes: bytes_multiply: - proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: File "tuple_support.py", line 55 + proto 2 1 // (𝕡) arg.0#0,arg.1#0 | def bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: File "tuple_support.py", line 67 bytes_multiply_block@0: - frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 55 - frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0 | arg.1#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 55 - byte "" // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0 | "" b"" File "tuple_support.py", line 58 - int 0 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0 | 0 urange(count) File "tuple_support.py", line 59 + frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 67 + frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0 | arg.1#0 arg: tuple[Bytes, UInt64] File "tuple_support.py", line 67 + byte "" // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0 | "" b"" File "tuple_support.py", line 69 + int 0 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0 | 0 urange(count) File "tuple_support.py", line 70 // Implicit fall through to bytes_multiply_for_header@1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | bytes_multiply_for_header@1: - frame_dig 3 // load range_item%0#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0 _i File "tuple_support.py", line 59 - frame_dig 1 // load count#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0,count#0 count File "tuple_support.py", line 57 - < // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | {<} urange(count) File "tuple_support.py", line 59 - bz bytes_multiply_after_for@4 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 59 - // Implicit fall through to bytes_multiply_for_body@2 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 59 + frame_dig 3 // load range_item%0#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0 _i File "tuple_support.py", line 70 + frame_dig 1 // load count#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0,count#0 count File "tuple_support.py", line 68 + < // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | {<} urange(count) File "tuple_support.py", line 70 + bz bytes_multiply_after_for@4 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 70 + // Implicit fall through to bytes_multiply_for_body@2 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | for _i in urange(count): # TODO: allow _ File "tuple_support.py", line 70 bytes_multiply_for_body@2: - frame_dig 2 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result#0 result File "tuple_support.py", line 58 - frame_dig 0 // load b#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result#0,b#0 b File "tuple_support.py", line 57 - concat // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | {concat} result + b File "tuple_support.py", line 60 - frame_bury 2 // store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result File "tuple_support.py", line 58 + frame_dig 2 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result#0 result File "tuple_support.py", line 69 + frame_dig 0 // load b#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result#0,b#0 b File "tuple_support.py", line 68 + concat // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | {concat} result += b File "tuple_support.py", line 71 + frame_bury 2 // store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result File "tuple_support.py", line 69 // Implicit fall through to bytes_multiply_for_footer@3 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | bytes_multiply_for_footer@3: - frame_dig 3 // load range_item%0#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0 _i File "tuple_support.py", line 59 - int 1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0,1 urange(count) File "tuple_support.py", line 59 - + // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | {+} urange(count) File "tuple_support.py", line 59 - frame_bury 3 // store range_item%0#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | _i File "tuple_support.py", line 59 + frame_dig 3 // load range_item%0#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0 _i File "tuple_support.py", line 70 + int 1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | range_item%0#0,1 urange(count) File "tuple_support.py", line 70 + + // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | {+} urange(count) File "tuple_support.py", line 70 + frame_bury 3 // store range_item%0#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | _i File "tuple_support.py", line 70 b bytes_multiply_for_header@1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | bytes_multiply_after_for@4: - frame_dig 2 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result#0 result File "tuple_support.py", line 58 + frame_dig 2 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) b#0,count#0,result#0,range_item%0#0 | result#0 result File "tuple_support.py", line 69 frame_bury 0 - retsub // result#0 return result File "tuple_support.py", line 61 + retsub // result#0 return result File "tuple_support.py", line 72 -// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> : +// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> void: test_tuple_swap: - proto 1 0 // (𝕡) zero#0 | def test_tuple_swap(zero: UInt64) -> None: File "tuple_support.py", line 88 + proto 1 0 // (𝕡) zero#0 | def test_tuple_swap(zero: UInt64) -> None: File "tuple_support.py", line 99 test_tuple_swap_block@0: - frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | zero#0 zero: UInt64 File "tuple_support.py", line 88 - int 1 // (𝕡) zero#0 | zero#0,1 1 File "tuple_support.py", line 89 - + // (𝕡) zero#0 | {+} zero + 1 File "tuple_support.py", line 89 - frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | a#0,zero#0 zero: UInt64 File "tuple_support.py", line 88 - int 2 // (𝕡) zero#0 | a#0,zero#0,2 2 File "tuple_support.py", line 90 - + // (𝕡) zero#0 | a#0,{+} zero + 2 File "tuple_support.py", line 90 - int 2 // (𝕡) zero#0 | b#0,a#1,2 2 File "tuple_support.py", line 92 - == // (𝕡) zero#0 | b#0,{==} a == 2, "a should be two" File "tuple_support.py", line 92 - assert // (𝕡) zero#0 | b#0 assert a == 2, "a should be two" File "tuple_support.py", line 92 - int 1 // (𝕡) zero#0 | b#0,1 1 File "tuple_support.py", line 93 - == // (𝕡) zero#0 | {==} b == 1, "b should be one" File "tuple_support.py", line 93 - assert // (𝕡) zero#0 | assert b == 1, "b should be one" File "tuple_support.py", line 93 + frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | zero#0 zero: UInt64 File "tuple_support.py", line 99 + int 1 // (𝕡) zero#0 | zero#0,1 1 File "tuple_support.py", line 100 + + // (𝕡) zero#0 | {+} zero + 1 File "tuple_support.py", line 100 + frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | a#0,zero#0 zero: UInt64 File "tuple_support.py", line 99 + int 2 // (𝕡) zero#0 | a#0,zero#0,2 2 File "tuple_support.py", line 101 + + // (𝕡) zero#0 | a#0,{+} zero + 2 File "tuple_support.py", line 101 + int 2 // (𝕡) zero#0 | b#0,a#1,2 2 File "tuple_support.py", line 103 + == // (𝕡) zero#0 | b#0,{==} a == 2, "a should be two" File "tuple_support.py", line 103 + assert // a should be two // (𝕡) zero#0 | b#0 assert a == 2, "a should be two" File "tuple_support.py", line 103 + int 1 // (𝕡) zero#0 | b#0,1 1 File "tuple_support.py", line 104 + == // (𝕡) zero#0 | {==} b == 1, "b should be one" File "tuple_support.py", line 104 + assert // b should be one // (𝕡) zero#0 | assert b == 1, "b should be one" File "tuple_support.py", line 104 retsub // -// examples.tuple_support.TupleSupport.__init__() -> : +// examples.tuple_support.slicing(values.0#0: uint64, values.1#0: uint64, values.2#0: uint64, values.3#0: uint64, values.4#0: uint64, values.5#0: uint64, values.6#0: uint64, values.7#0: uint64) -> void: +slicing: + proto 8 0 // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | def slicing(values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64]) -> None: File "tuple_support.py", line 108 + +slicing_block@0: + frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.2#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.2#0,values.1#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.2#0,one_to_three.1#0,values.0#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + dig 1 // load one_to_three.1#0 from l-stack (copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.2#0,one_to_three.1#0,one_to_three.0#0,one_to_three.1#0 one_to_three File "tuple_support.py", line 109 + uncover 3 // load one_to_three.2#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,one_to_three.0#0,one_to_three.1#0,one_to_three.2#0 one_to_three File "tuple_support.py", line 109 + callsub add_three_values // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,{add_three_values} add_three_values(one_to_three) File "tuple_support.py", line 110 + frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,tmp%0#0,values.0#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,tmp%0#0,values.0#0,values.1#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,tmp%0#0,{+} values[0] + values[1] File "tuple_support.py", line 110 + frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,tmp%0#0,tmp%1#0,values.2#0 values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64] File "tuple_support.py", line 108 + + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,tmp%0#0,{+} values[0] + values[1] + values[2] File "tuple_support.py", line 110 + == // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,{==} add_three_values(one_to_three) == values[0] + values[1] + values[2] File "tuple_support.py", line 110 + assert // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0 assert add_three_values(one_to_three) == values[0] + values[1] + values[2] File "tuple_support.py", line 110 + dup // load one_to_three.1#0 from l-stack (copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | one_to_three.1#0,one_to_three.1#0 one_to_three File "tuple_support.py", line 109 + == // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | {==} one_to_three[-2:-1][0] == one_to_three[1] File "tuple_support.py", line 112 + assert // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | assert one_to_three[-2:-1][0] == one_to_three[1] File "tuple_support.py", line 112 + retsub // + + +// examples.tuple_support.TupleSupport.__init__() -> void: __init__: - proto 0 0 // def __init__(self) -> None: File "tuple_support.py", line 5 + proto 0 0 // def __init__(self) -> None: File "tuple_support.py", line 5 __init___block@0: - byte "state" // "state" self.state File "tuple_support.py", line 6 - int 0 // "state",0 0 File "tuple_support.py", line 6 - app_global_put // self.state = UInt64(0) File "tuple_support.py", line 6 + byte "state" // "state" self.state File "tuple_support.py", line 6 + int 0 // "state",0 0 File "tuple_support.py", line 6 + app_global_put // self.state = UInt64(0) File "tuple_support.py", line 6 retsub // diff --git a/examples/out/tuple_support.approval_unoptimized.teal b/examples/out/tuple_support.approval_unoptimized.teal index d2384612dc..53ea13656d 100644 --- a/examples/out/tuple_support.approval_unoptimized.teal +++ b/examples/out/tuple_support.approval_unoptimized.teal @@ -28,12 +28,12 @@ main_entrypoint@2: dig 1 dig 1 addw - cover 1 + swap byte "state" uncover 2 app_global_put ! - assert + assert // overflow! dup cover 2 dig 1 @@ -43,10 +43,10 @@ main_entrypoint@2: addw pop ! - assert + assert // overflow! int 3 int 3 - cover 1 + swap dig 4 bury 13 dig 5 @@ -63,13 +63,13 @@ main_entrypoint@2: main_if_body@3: dig 4 dig 6 - cover 1 + swap b main_after_if_else@5 main_else_body@4: dup dig 2 - cover 1 + swap main_after_if_else@5: dig 8 @@ -99,11 +99,11 @@ main_after_if_else@5: int 18446744073709551615 dup addw - cover 1 + swap dig 3 dig 3 addw - cover 1 + swap uncover 2 uncover 3 uncover 2 @@ -111,7 +111,7 @@ main_after_if_else@5: callsub addw2 cover 2 cover 2 - uncover 1 + swap cover 2 itob log @@ -125,6 +125,15 @@ main_after_if_else@5: log int 0 callsub test_tuple_swap + int 1 + int 2 + int 3 + int 4 + int 5 + int 6 + int 7 + int 8 + callsub slicing + return @@ -193,10 +202,10 @@ addw2_block@0: frame_dig -4 frame_dig -3 frame_dig -2 - cover 1 + swap frame_dig -1 addw - cover 1 + swap cover 2 cover 3 uncover 2 @@ -205,10 +214,10 @@ addw2_block@0: addw cover 2 addw - cover 1 + swap ! - assert - uncover 1 + assert // is such a thing even possible? 👽 + swap uncover 2 retsub @@ -248,7 +257,7 @@ bytes_multiply_after_for@4: retsub -// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> : +// examples.tuple_support.test_tuple_swap(zero#0: uint64) -> void: test_tuple_swap: proto 1 0 @@ -261,14 +270,38 @@ test_tuple_swap_block@0: + int 2 == - assert + assert // a should be two int 1 == + assert // b should be one + retsub + + +// examples.tuple_support.slicing(values.0#0: uint64, values.1#0: uint64, values.2#0: uint64, values.3#0: uint64, values.4#0: uint64, values.5#0: uint64, values.6#0: uint64, values.7#0: uint64) -> void: +slicing: + proto 8 0 + +slicing_block@0: + frame_dig -6 + frame_dig -7 + frame_dig -8 + dig 1 + uncover 3 + callsub add_three_values + frame_dig -8 + frame_dig -7 + + + frame_dig -6 + + + == + assert + dup + == assert retsub -// examples.tuple_support.TupleSupport.__init__() -> : +// examples.tuple_support.TupleSupport.__init__() -> void: __init__: proto 0 0 diff --git a/examples/out/tuple_support.awst b/examples/out/tuple_support.awst index 6e002bd1d2..76ca218fa8 100644 --- a/examples/out/tuple_support.awst +++ b/examples/out/tuple_support.awst @@ -41,6 +41,7 @@ contract TupleSupport log(itob(lo)) log(examples.tuple_support::bytes_multiply(('na', 5u))) examples.tuple_support::test_tuple_swap(zero=0u) + examples.tuple_support::slicing((1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u)) return a + b } @@ -62,7 +63,7 @@ subroutine bytes_multiply(arg: tuple[algopy.Bytes, algopy.UInt64]): algopy.Bytes (b, count): tuple[algopy.Bytes, algopy.UInt64] = arg result: algopy.Bytes = '' for _i in range(0u, count, 1u) { - result: algopy.Bytes = result + b + result += b } return result } @@ -95,4 +96,11 @@ subroutine test_tuple_swap(zero: algopy.UInt64): None (a, b): tuple[algopy.UInt64, algopy.UInt64] = (b, a) assert(a == 2u, comment="a should be two") assert(b == 1u, comment="b should be one") +} + +subroutine slicing(values: tuple[algopy.UInt64, algopy.UInt64, algopy.UInt64, algopy.UInt64, algopy.UInt64, algopy.UInt64, algopy.UInt64, algopy.UInt64]): None +{ + one_to_three: tuple[algopy.UInt64, algopy.UInt64, algopy.UInt64] = values[0u:3u] + assert(examples.tuple_support::add_three_values(one_to_three) == values[0] + values[1] + values[2]) + assert(one_to_three[1u:2u][0] == one_to_three[1]) } \ No newline at end of file diff --git a/examples/out/tuple_support.clear.debug.teal b/examples/out/tuple_support.clear.debug.teal index 088ff3a5d2..fb1d1192bf 100644 --- a/examples/out/tuple_support.clear.debug.teal +++ b/examples/out/tuple_support.clear.debug.teal @@ -4,6 +4,6 @@ // examples.tuple_support.TupleSupport.clear_state_program() -> uint64: main_block@0: - int 0 // 0 0 File "tuple_support.py", line 44 - return // return UInt64(0) File "tuple_support.py", line 44 + int 0 // 0 0 File "tuple_support.py", line 56 + return // return UInt64(0) File "tuple_support.py", line 56 diff --git a/examples/out/tuple_support.clear_unoptimized.debug.teal b/examples/out/tuple_support.clear_unoptimized.debug.teal index 088ff3a5d2..fb1d1192bf 100644 --- a/examples/out/tuple_support.clear_unoptimized.debug.teal +++ b/examples/out/tuple_support.clear_unoptimized.debug.teal @@ -4,6 +4,6 @@ // examples.tuple_support.TupleSupport.clear_state_program() -> uint64: main_block@0: - int 0 // 0 0 File "tuple_support.py", line 44 - return // return UInt64(0) File "tuple_support.py", line 44 + int 0 // 0 0 File "tuple_support.py", line 56 + return // return UInt64(0) File "tuple_support.py", line 56 diff --git a/examples/out/tuple_support_TupleSupport.cssa.ir b/examples/out/tuple_support_TupleSupport.cssa.ir index 6c7b46f7f8..c4c7d75492 100644 --- a/examples/out/tuple_support_TupleSupport.cssa.ir +++ b/examples/out/tuple_support_TupleSupport.cssa.ir @@ -18,10 +18,6 @@ contract examples.tuple_support.TupleSupport: let (result.0#0: uint64, result.1#0: uint64) = (addw 1u 2u) let tmp%5#0: uint64 = (! result.0#0) (assert tmp%5#0) // overflow! - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) let tmp%11#0: bytes = examples.tuple_support.bytes_combine("Hello, ", "world!") (log tmp%11#0) let (tmp%12#0: uint64, tmp%13#0: uint64) = (addw 18446744073709551615u 18446744073709551615u) @@ -36,21 +32,22 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) return 3u subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u let (tuple_index%0#5: uint64, values.0#1: uint64, total#5: uint64) = (tuple_index%0#0, values.0#0, total#0) goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 let (tuple_index%0#6: uint64, values.1#1: uint64, total#6: uint64) = (tuple_index%0#4, values.1#0, total#4) goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 let (tuple_index%0#7: uint64, values.2#1: uint64, total#7: uint64) = (tuple_index%0#4, values.2#0, total#4) goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#8: uint64 = φ(total#5 <- block@0, total#6 <- block@2, total#7 <- block@3) let value#4: uint64 = φ(values.0#1 <- block@0, values.1#1 <- block@2, values.2#1 <- block@3) let tuple_index%0#8: uint64 = φ(tuple_index%0#5 <- block@0, tuple_index%0#6 <- block@2, tuple_index%0#7 <- block@3) @@ -58,16 +55,16 @@ contract examples.tuple_support.TupleSupport: let total#4: uint64 = (+ total#1 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -77,27 +74,27 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u let (result#3: bytes, range_item%0#3: uint64) = (result#0, range_item%0#0) goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let _i#1: uint64 = φ(range_item%0#3 <- block@0, range_item%0#4 <- block@2) let result#5: bytes = φ(result#3 <- block@0, result#4 <- block@2) let (result#1: bytes, _i#0: uint64) = (result#5, _i#1) let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#2: bytes = (concat result#1 arg.0#0) let range_item%0#2: uint64 = (+ _i#0 1u) let (result#4: bytes, range_item%0#4: uint64) = (result#2, range_item%0#2) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -106,6 +103,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -113,5 +119,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.final.ir b/examples/out/tuple_support_TupleSupport.final.ir index 5405b42f04..213f61b675 100644 --- a/examples/out/tuple_support_TupleSupport.final.ir +++ b/examples/out/tuple_support_TupleSupport.final.ir @@ -18,10 +18,6 @@ contract examples.tuple_support.TupleSupport: let (result.0#0: uint64, result.1#0: uint64) = (addw 1u 2u) let tmp%5#0: uint64 = (! result.0#0) (assert tmp%5#0) // overflow! - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) let tmp%11#0: bytes = examples.tuple_support.bytes_combine("Hello, ", "world!") (log tmp%11#0) let (tmp%12#0: uint64, tmp%13#0: uint64) = (addw 18446744073709551615u 18446744073709551615u) @@ -36,36 +32,37 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) return 3u subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u let value#3: uint64 = values.0#0 goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 let value#3: uint64 = values.1#0 let tuple_index%0#0: uint64 = tuple_index%0#4 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 let value#3: uint64 = values.2#0 let tuple_index%0#0: uint64 = tuple_index%0#4 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#0: uint64 = (+ total#0 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#0 1u) goto [block@2, block@3, ...block@6][tuple_index%0#0] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#0 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#0: uint64) = (addw c_mid#0 lo_carry#0) @@ -75,24 +72,24 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#0 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u let _i#0: uint64 = range_item%0#0 goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#0: bytes = (concat result#0 arg.0#0) let range_item%0#0: uint64 = (+ _i#0 1u) let _i#0: uint64 = range_item%0#0 goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#0 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -101,6 +98,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -108,5 +114,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.final_unoptimized.ir b/examples/out/tuple_support_TupleSupport.final_unoptimized.ir index ab5dbdb221..28e78f0fa7 100644 --- a/examples/out/tuple_support_TupleSupport.final_unoptimized.ir +++ b/examples/out/tuple_support_TupleSupport.final_unoptimized.ir @@ -68,43 +68,44 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) let tmp%23#0: uint64 = (+ a#0 b#0) return tmp%23#0 subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u goto block@1 - block@1: // for_header_0_L67 + block@1: // for_header_0_L78 let tuple_index%0#0: uint64 = 0u let value#0: uint64 = values.0#0 goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 let value#0: uint64 = values.1#0 let tuple_index%0#0: uint64 = tuple_index%0#4 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 let value#0: uint64 = values.2#0 let tuple_index%0#0: uint64 = tuple_index%0#4 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#0: uint64 = (+ total#0 value#0) goto block@5 - block@5: // for_footer_L67 + block@5: // for_footer_L78 let tuple_index%0#4: uint64 = (+ tuple_index%0#0 1u) goto [block@2, block@3, ...block@6][tuple_index%0#0] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#0 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let a#0: bytes = arg.0#0 let b#0: bytes = arg.1#0 let result#0: bytes = (concat a#0 b#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let a_hi#0: uint64 = a.0#0 let a_lo#0: uint64 = a.1#0 let b_hi#0: uint64 = b.0#0 @@ -126,27 +127,27 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#0 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let b#0: bytes = arg.0#0 let count#0: uint64 = arg.1#0 let result#0: bytes = "" let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let continue_looping%1#0: uint64 = (< range_item%0#0 count#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let _i#0: uint64 = range_item%0#0 let result#0: bytes = (concat result#0 b#0) goto block@3 - block@3: // for_footer_L59 + block@3: // for_footer_L70 let range_item%0#0: uint64 = (+ range_item%0#0 1u) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#0 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let a#1: uint64 = b#0 @@ -157,6 +158,20 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let one_to_three.2#0: uint64 = values.2#0 + let one_to_three.1#0: uint64 = values.1#0 + let one_to_three.0#0: uint64 = values.0#0 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(one_to_three.0#0, one_to_three.1#0, one_to_three.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + let tmp%4#0: uint64 = (== one_to_three.1#0 one_to_three.1#0) + (assert tmp%4#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -164,5 +179,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.parallel_copies.ir b/examples/out/tuple_support_TupleSupport.parallel_copies.ir index 1e1b9b7502..2fc3dd7787 100644 --- a/examples/out/tuple_support_TupleSupport.parallel_copies.ir +++ b/examples/out/tuple_support_TupleSupport.parallel_copies.ir @@ -18,10 +18,6 @@ contract examples.tuple_support.TupleSupport: let (result.0#0: uint64, result.1#0: uint64) = (addw 1u 2u) let tmp%5#0: uint64 = (! result.0#0) (assert tmp%5#0) // overflow! - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) let tmp%11#0: bytes = examples.tuple_support.bytes_combine("Hello, ", "world!") (log tmp%11#0) let (tmp%12#0: uint64, tmp%13#0: uint64) = (addw 18446744073709551615u 18446744073709551615u) @@ -36,43 +32,44 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) return 3u subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u let total#8: uint64 = total#0 let value#4: uint64 = values.0#0 let tuple_index%0#8: uint64 = tuple_index%0#0 goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 let total#8: uint64 = total#4 let value#4: uint64 = values.1#0 let tuple_index%0#8: uint64 = tuple_index%0#4 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 let total#8: uint64 = total#4 let value#4: uint64 = values.2#0 let tuple_index%0#8: uint64 = tuple_index%0#4 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#1: uint64 = total#8 let value#3: uint64 = value#4 let tuple_index%0#1: uint64 = tuple_index%0#8 let total#4: uint64 = (+ total#1 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -82,28 +79,28 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u let _i#1: uint64 = range_item%0#0 let result#5: bytes = result#0 goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let _i#0: uint64 = _i#1 let result#1: bytes = result#5 let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#2: bytes = (concat result#1 arg.0#0) let range_item%0#2: uint64 = (+ _i#0 1u) let _i#1: uint64 = range_item%0#2 let result#5: bytes = result#2 goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -112,6 +109,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -119,5 +125,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.post_ssa.ir b/examples/out/tuple_support_TupleSupport.post_ssa.ir index 46d0dbda83..80503c6bd6 100644 --- a/examples/out/tuple_support_TupleSupport.post_ssa.ir +++ b/examples/out/tuple_support_TupleSupport.post_ssa.ir @@ -18,10 +18,6 @@ contract examples.tuple_support.TupleSupport: let (result.0#0: uint64, result.1#0: uint64) = (addw 1u 2u) let tmp%5#0: uint64 = (! result.0#0) (assert tmp%5#0) // overflow! - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) let tmp%11#0: bytes = examples.tuple_support.bytes_combine("Hello, ", "world!") (log tmp%11#0) let (tmp%12#0: uint64, tmp%13#0: uint64) = (addw 18446744073709551615u 18446744073709551615u) @@ -36,35 +32,36 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) return 3u subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u let (tuple_index%0#8: uint64, value#4: uint64, total#8: uint64) = (tuple_index%0#0, values.0#0, total#0) goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 let (tuple_index%0#8: uint64, value#4: uint64, total#8: uint64) = (tuple_index%0#4, values.1#0, total#4) goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 let (tuple_index%0#8: uint64, value#4: uint64, total#8: uint64) = (tuple_index%0#4, values.2#0, total#4) goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let (tuple_index%0#1: uint64, value#3: uint64, total#1: uint64) = (tuple_index%0#8, value#4, total#8) let total#4: uint64 = (+ total#1 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -74,25 +71,25 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u let (result#5: bytes, _i#1: uint64) = (result#0, range_item%0#0) goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let (result#1: bytes, _i#0: uint64) = (result#5, _i#1) let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#2: bytes = (concat result#1 arg.0#0) let range_item%0#2: uint64 = (+ _i#0 1u) let (result#5: bytes, _i#1: uint64) = (result#2, range_item%0#2) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -101,6 +98,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -108,5 +114,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.ssa.ir b/examples/out/tuple_support_TupleSupport.ssa.ir index b909cd88b7..b2c18cc46f 100644 --- a/examples/out/tuple_support_TupleSupport.ssa.ir +++ b/examples/out/tuple_support_TupleSupport.ssa.ir @@ -65,44 +65,45 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) let tmp%23#0: uint64 = (+ a#0 b#0) return tmp%23#0 subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u goto block@1 - block@1: // for_header_0_L67 + block@1: // for_header_0_L78 let tuple_index%0#0: uint64 = 0u let value#0: uint64 = values.0#0 goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 let value#1: uint64 = values.1#0 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 let value#2: uint64 = values.2#0 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#1: uint64 = φ(total#0 <- block@1, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2, value#2 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) let total#4: uint64 = (+ total#1 value#3) goto block@5 - block@5: // for_footer_L67 + block@5: // for_footer_L78 let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let a#0: bytes = arg.0#0 let b#0: bytes = arg.1#0 let result#0: bytes = (concat a#0 b#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let a_hi#0: uint64 = a.0#0 let a_lo#0: uint64 = a.1#0 let b_hi#0: uint64 = b.0#0 @@ -124,29 +125,29 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let b#0: bytes = arg.0#0 let count#0: uint64 = arg.1#0 let result#0: bytes = "" let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0, range_item%0#2 <- block@3) let result#1: bytes = φ(result#0 <- block@0, result#2 <- block@3) let continue_looping%1#0: uint64 = (< range_item%0#1 count#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let _i#0: uint64 = range_item%0#1 let result#2: bytes = (concat result#1 b#0) goto block@3 - block@3: // for_footer_L59 + block@3: // for_footer_L70 let range_item%0#2: uint64 = (+ range_item%0#1 1u) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let a#1: uint64 = b#0 @@ -157,6 +158,18 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let (one_to_three.0#0: uint64, one_to_three.1#0: uint64, one_to_three.2#0: uint64) = (values.0#0, values.1#0, values.2#0) + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(one_to_three.0#0, one_to_three.1#0, one_to_three.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + let tmp%4#0: uint64 = (== one_to_three.1#0 one_to_three.1#0) + (assert tmp%4#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -164,5 +177,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_1.ir b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_1.ir index 81034dc14c..de94bf12c7 100644 --- a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_1.ir +++ b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_1.ir @@ -53,35 +53,36 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) let tmp%23#0: uint64 = (+ 1u 2u) return tmp%23#0 subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) let total#4: uint64 = (+ total#1 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -91,24 +92,24 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#2 <- block@2) let result#1: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#2: bytes = (concat result#1 arg.0#0) let range_item%0#2: uint64 = (+ _i#0 1u) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -117,6 +118,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -124,5 +134,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_2.ir b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_2.ir index 1a5cb5aead..9eaa9d2962 100644 --- a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_2.ir +++ b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_2.ir @@ -22,8 +22,6 @@ contract examples.tuple_support.TupleSupport: let tup.1#1: uint64 = 3u goto block@5 block@5: // after_if_else_L22 - (assert 1u) - (assert 1u) let tmp%9#0: uint64 = (== 3u tup.0#1) (assert tmp%9#0) let tmp%10#0: uint64 = (== 3u tup.1#1) @@ -42,34 +40,35 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) return 3u subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) let total#4: uint64 = (+ total#1 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -79,24 +78,24 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#2 <- block@2) let result#1: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#2: bytes = (concat result#1 arg.0#0) let range_item%0#2: uint64 = (+ _i#0 1u) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -105,6 +104,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -112,5 +120,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_3.ir b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_3.ir index c14229466c..b75edd353f 100644 --- a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_3.ir +++ b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_3.ir @@ -18,8 +18,6 @@ contract examples.tuple_support.TupleSupport: let (result.0#0: uint64, result.1#0: uint64) = (addw 1u 2u) let tmp%5#0: uint64 = (! result.0#0) (assert tmp%5#0) // overflow! - (assert 1u) - (assert 1u) let tmp%9#0: uint64 = (== 3u 3u) (assert tmp%9#0) let tmp%10#0: uint64 = (== 3u 3u) @@ -38,34 +36,35 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) return 3u subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) let total#4: uint64 = (+ total#1 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -75,24 +74,24 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#2 <- block@2) let result#1: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#2: bytes = (concat result#1 arg.0#0) let range_item%0#2: uint64 = (+ _i#0 1u) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -101,6 +100,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -108,5 +116,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_4.ir b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_4.ir index b32e2e3698..ed6f5d9af5 100644 --- a/examples/out/tuple_support_TupleSupport.ssa.opt_pass_4.ir +++ b/examples/out/tuple_support_TupleSupport.ssa.opt_pass_4.ir @@ -18,10 +18,6 @@ contract examples.tuple_support.TupleSupport: let (result.0#0: uint64, result.1#0: uint64) = (addw 1u 2u) let tmp%5#0: uint64 = (! result.0#0) (assert tmp%5#0) // overflow! - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) let tmp%11#0: bytes = examples.tuple_support.bytes_combine("Hello, ", "world!") (log tmp%11#0) let (tmp%12#0: uint64, tmp%13#0: uint64) = (addw 18446744073709551615u 18446744073709551615u) @@ -36,34 +32,35 @@ contract examples.tuple_support.TupleSupport: let tmp%22#0: bytes = examples.tuple_support.bytes_multiply("na", 5u) (log tmp%22#0) examples.tuple_support.test_tuple_swap(0u) + examples.tuple_support.slicing(1u, 2u, 3u, 4u, 5u, 6u, 7u, 8u) return 3u subroutine examples.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L65 + block@0: // L76 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L67 + block@2: // for_header_1_L78 goto block@4 - block@3: // for_header_2_L67 + block@3: // for_header_2_L78 goto block@4 - block@4: // for_body_L67 + block@4: // for_body_L78 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) let total#4: uint64 = (+ total#1 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto [block@2, block@3, ...block@6][tuple_index%0#1] - block@6: // after_for_L67 + block@6: // after_for_L78 return total#4 subroutine examples.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L48 + block@0: // L60 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine examples.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L76 + block@0: // L87 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -73,24 +70,24 @@ contract examples.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine examples.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L55 + block@0: // L67 let result#0: bytes = "" let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L59 + block@1: // for_header_L70 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#2 <- block@2) let result#1: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%1#0: uint64 = (< _i#0 arg.1#0) goto continue_looping%1#0 ? block@2 : block@4 - block@2: // for_body_L59 + block@2: // for_body_L70 let result#2: bytes = (concat result#1 arg.0#0) let range_item%0#2: uint64 = (+ _i#0 1u) goto block@1 - block@4: // after_for_L59 + block@4: // after_for_L70 return result#1 subroutine examples.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L88 + block@0: // L99 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: uint64 = (== b#0 2u) @@ -99,6 +96,15 @@ contract examples.tuple_support.TupleSupport: (assert tmp%1#0) // b should be one return + subroutine examples.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: + block@0: // L108 + let tmp%0#0: uint64 = examples.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) + let tmp%1#0: uint64 = (+ values.0#0 values.1#0) + let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) + let tmp%3#0: uint64 = (== tmp%0#0 tmp%2#0) + (assert tmp%3#0) + return + subroutine examples.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -106,5 +112,5 @@ contract examples.tuple_support.TupleSupport: program clear-state: subroutine examples.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L43 + block@0: // L55 return 0u \ No newline at end of file diff --git a/examples/out/typing_interactions.awst b/examples/out/typing_interactions.awst index 14e1bd0e60..48e8b9bd30 100644 --- a/examples/out/typing_interactions.awst +++ b/examples/out/typing_interactions.awst @@ -1,10 +1,2 @@ SOME_ADDRESS = 'VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA' -SOME_ADDRESS_PADDED = 'VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA==' - -subroutine typing_interactions(): None -{ - 1u - (1u, '') - 1u - assert(Address("VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA") == Bytes.from_base64("VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA==")) -} \ No newline at end of file +SOME_ADDRESS_PADDED = 'VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA==' \ No newline at end of file diff --git a/examples/simple/algopy.log b/examples/simple/algopy.log index 221253e959..53f1c0518c 100644 --- a/examples/simple/algopy.log +++ b/examples/simple/algopy.log @@ -1,11 +1,12 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 simple -info: Building AWST for __init__.py -info: Building AWST for simple/__init__.py -info: Building AWST for simple/subs.py -info: Building AWST for simple/pkg_a/pkg_1/subs.py -info: Building AWST for simple/pkg_a/pkg_1/__init__.py -info: Building AWST for simple/pkg_a/__init__.py -info: Building AWST for simple/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug simple +debug: Building AWST for __init__.py +debug: Building AWST for simple/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for simple/subs.py +debug: Building AWST for simple/pkg_a/pkg_1/subs.py +debug: Building AWST for simple/pkg_a/pkg_1/__init__.py +debug: Building AWST for simple/pkg_a/__init__.py +debug: Building AWST for simple/contract.py debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L5 @@ -40,6 +41,7 @@ debug: Folded 4 * 5 to 20 debug: Folded 3 + 2 to 5 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable a#0 debug: Removing unused variable b#0 @@ -53,6 +55,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -63,6 +66,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -73,6 +77,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -88,6 +93,7 @@ debug: Folded 3 + 5 to 8 debug: Folded 2 * 3 to 6 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%0#0 debug: Removing unused variable tmp%1#0 @@ -109,6 +115,7 @@ debug: Optimizing subroutine examples.simple.contract.MyContract.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -118,6 +125,7 @@ debug: Optimizing subroutine examples.simple.subs.zero debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -127,6 +135,7 @@ debug: Optimizing subroutine examples.simple.pkg_a.pkg_1.subs.one debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -139,6 +148,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 14 * 6 to 84 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%3#0 debug: Optimizer: Simplify Conditional Branches @@ -152,6 +162,7 @@ debug: Optimizing subroutine examples.simple.contract.MyContract.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -161,6 +172,7 @@ debug: Optimizing subroutine examples.simple.subs.zero debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -170,6 +182,7 @@ debug: Optimizing subroutine examples.simple.pkg_a.pkg_1.subs.one debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -181,6 +194,7 @@ debug: Optimizing subroutine examples.simple.contract.MyContract.approval_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -190,6 +204,7 @@ debug: Optimizing subroutine examples.simple.contract.MyContract.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -199,6 +214,7 @@ debug: Optimizing subroutine examples.simple.subs.zero debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -208,6 +224,7 @@ debug: Optimizing subroutine examples.simple.pkg_a.pkg_1.subs.one debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -235,17 +252,17 @@ debug: Coalescing local variables in examples.simple.pkg_a.pkg_1.subs.one using debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/simple/out/contract_MyContract.final.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 from scratch' with 'load tmp%0#0 from l-stack (no 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_block@0.ops[5]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[7]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[7]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[16]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[18]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[18]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[12]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[15]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[15]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[10]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[15]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -info: Writing /examples/simple/out/contract.approval.teal -info: Writing /examples/simple/out/contract.approval.debug.teal -info: Writing /examples/simple/out/contract.clear.teal -info: Writing /examples/simple/out/contract.clear.debug.teal +debug: Replaced main_block@0.ops[15]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +info: Writing simple/out/contract.approval.teal +info: Writing simple/out/contract.approval.debug.teal +info: Writing simple/out/contract.clear.teal +info: Writing simple/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/simple/out/contract.approval_unoptimized.debug.teal b/examples/simple/out/contract.approval_unoptimized.debug.teal index d6d0d2b830..f426d1fb32 100644 --- a/examples/simple/out/contract.approval_unoptimized.debug.teal +++ b/examples/simple/out/contract.approval_unoptimized.debug.teal @@ -8,11 +8,11 @@ main_block@0: int 2 // 1,2 2 File "simple/contract.py", line 10 + // {+} algo.UInt64(1) + 2 File "simple/contract.py", line 10 dup // store a#0 to l-stack (copy) a#0,a#0 a File "simple/contract.py", line 10 - cover 1 // store a#0 to f-stack (𝕗) a#0 | a#0 a File "simple/contract.py", line 10 + swap // store a#0 to f-stack (𝕗) a#0 | a#0 a File "simple/contract.py", line 10 int 4 // (𝕗) a#0 | a#0,4 4 File "simple/contract.py", line 11 int 5 // (𝕗) a#0 | a#0,4,5 5 File "simple/contract.py", line 11 * // (𝕗) a#0 | a#0,{*} algo.UInt64(4) * 5 File "simple/contract.py", line 11 - cover 1 // store b#0 to f-stack (𝕗) a#0,b#0 | a#0 b File "simple/contract.py", line 11 + swap // store b#0 to f-stack (𝕗) a#0,b#0 | a#0 b File "simple/contract.py", line 11 int 3 // (𝕗) a#0,b#0 | a#0,3 (1 + 2) * (4 - 3) File "simple/contract.py", line 12 == // (𝕗) a#0,b#0 | {==} (1 + 2) * (4 - 3) == a: File "simple/contract.py", line 12 bz main_else_body@6 // (𝕗) a#0,b#0 | if (1 + 2) * (4 - 3) == a: File "simple/contract.py", line 12 diff --git a/examples/simple/out/contract.approval_unoptimized.teal b/examples/simple/out/contract.approval_unoptimized.teal index dbe5a4abd3..b23742399a 100644 --- a/examples/simple/out/contract.approval_unoptimized.teal +++ b/examples/simple/out/contract.approval_unoptimized.teal @@ -6,11 +6,11 @@ main_block@0: int 2 + dup - cover 1 + swap int 4 int 5 * - cover 1 + swap int 3 == bz main_else_body@6 diff --git a/examples/simplish/algopy.log b/examples/simplish/algopy.log index bc219d61bb..40b68ecc05 100644 --- a/examples/simplish/algopy.log +++ b/examples/simplish/algopy.log @@ -1,8 +1,9 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 simplish -info: Building AWST for __init__.py -info: Building AWST for simplish/__init__.py -info: Building AWST for simplish/base_class.py -info: Building AWST for simplish/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug simplish +debug: Building AWST for __init__.py +debug: Building AWST for simplish/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for simplish/base_class.py +debug: Building AWST for simplish/contract.py debug: Sealing block@0: // L116 debug: Terminated block@0: // L116 debug: Sealing block@None: // if_body_L120 @@ -153,6 +154,7 @@ debug: Found equivalence set: tuple_assignment%24#0, asset_balance#0 debug: Replacing {tuple_assignment%24#0} with asset_balance#0 made 1 modifications debug: Found equivalence set: tuple_assignment%25#0, asset_exists#0 debug: Replacing {tuple_assignment%25#0} with asset_exists#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -163,6 +165,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable digits#0 debug: Optimizer: Simplify Conditional Branches @@ -174,6 +177,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -188,6 +192,7 @@ debug: Found equivalence set: tmp%5#0, area#1 debug: Replacing {tmp%5#0} with area#1 made 1 modifications debug: Found equivalence set: tmp%6#0, circumference#1 debug: Replacing {tmp%6#0} with circumference#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -198,6 +203,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -209,6 +215,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 2 * 314159 to 628318 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable two_pi#0 debug: Optimizer: Simplify Conditional Branches @@ -220,6 +227,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -230,6 +238,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -240,6 +249,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -250,6 +260,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -261,6 +272,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.approval_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -271,6 +283,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded len("0123456789") to 10 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable radix#0 debug: Optimizer: Simplify Conditional Branches @@ -281,6 +294,7 @@ debug: Optimizing subroutine examples.simplish.base_class.CallCounter.set_sender debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -290,6 +304,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.call debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -299,6 +314,7 @@ debug: Optimizing subroutine examples.simplish.contract.circle_area debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -308,6 +324,7 @@ debug: Optimizing subroutine examples.simplish.contract.circle_circumference debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -317,6 +334,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.increment_count debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -326,6 +344,7 @@ debug: Optimizing subroutine examples.simplish.base_class.CallCounter.increment_ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -335,6 +354,7 @@ debug: Optimizing subroutine examples.simplish.base_class.CallCounter.__init__ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -344,6 +364,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -355,6 +376,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.approval_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -364,6 +386,7 @@ debug: Optimizing subroutine examples.simplish.contract.itoa debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -373,6 +396,7 @@ debug: Optimizing subroutine examples.simplish.base_class.CallCounter.set_sender debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -382,6 +406,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.call debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -391,6 +416,7 @@ debug: Optimizing subroutine examples.simplish.contract.circle_area debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -400,6 +426,7 @@ debug: Optimizing subroutine examples.simplish.contract.circle_circumference debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -409,6 +436,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.increment_count debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -418,6 +446,7 @@ debug: Optimizing subroutine examples.simplish.base_class.CallCounter.increment_ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -427,6 +456,7 @@ debug: Optimizing subroutine examples.simplish.base_class.CallCounter.__init__ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -436,6 +466,7 @@ debug: Optimizing subroutine examples.simplish.contract.Simplish.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -643,143 +674,143 @@ debug: Coalescing local variables in examples.simplish.contract.Simplish.clear_s debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/simplish/out/contract_Simplish.final.ir debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[5]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[7]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[7]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[15]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[17]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[17]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[11]: 'store is_equal%4#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[14]: 'load is_equal%4#0 from scratch' with 'load is_equal%4#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[14]: 'load is_equal%4#0' with 'load is_equal%4#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[1]: 'store oca#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[5]: 'load oca#0 from scratch' with 'load oca#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[5]: 'load oca#0' with 'load oca#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[6]: 'store oca#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[10]: 'load oca#0 from scratch' with 'load oca#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[10]: 'load oca#0' with 'load oca#0 from l-stack (no copy)' debug: Inserted main_after_if_else@4.ops[9]: 'store contains%3#0 to l-stack (copy)' -debug: Replaced main_after_if_else@4.ops[16]: 'load contains%3#0 from scratch' with 'load contains%3#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@4.ops[16]: 'load contains%3#0' with 'load contains%3#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[3]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[5]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[5]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[13]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[15]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[15]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[18]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[20]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[20]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[3]: 'store app_global_get_ex_did_exist%8#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[6]: 'load app_global_get_ex_did_exist%8#0 from scratch' with 'load app_global_get_ex_did_exist%8#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[6]: 'load app_global_get_ex_did_exist%8#0' with 'load app_global_get_ex_did_exist%8#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[10]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[13]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[13]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[5]: 'store app_global_get_ex_value%7#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[9]: 'load app_global_get_ex_value%7#0 from scratch' with 'load app_global_get_ex_value%7#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[9]: 'load app_global_get_ex_value%7#0' with 'load app_global_get_ex_value%7#0 from l-stack (no copy)' debug: Inserted main_after_if_else@7.ops[1]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_after_if_else@7.ops[3]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@7.ops[3]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted main_after_if_else@7.ops[6]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_after_if_else@7.ops[8]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@7.ops[8]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted main_after_if_else@8.ops[3]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_after_if_else@8.ops[5]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@8.ops[5]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted main_if_body@9.ops[1]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_if_body@9.ops[3]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_if_body@9.ops[3]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_if_body@9.ops[6]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_if_body@9.ops[8]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_if_body@9.ops[8]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_if_body@10.ops[1]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_if_body@10.ops[3]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_if_body@10.ops[3]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_after_if_else@12.ops[3]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_after_if_else@12.ops[5]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@12.ops[5]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted main_after_if_else@14.ops[1]: 'store num_app_args#0 to l-stack (copy)' -debug: Replaced main_after_if_else@14.ops[3]: 'load num_app_args#0 from scratch' with 'load num_app_args#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@14.ops[3]: 'load num_app_args#0' with 'load num_app_args#0 from l-stack (no copy)' debug: Inserted main_after_if_else@14.ops[6]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_after_if_else@14.ops[8]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@14.ops[8]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' debug: Inserted main_if_body@15.ops[1]: 'store method_name#0 to l-stack (copy)' -debug: Replaced main_if_body@15.ops[3]: 'load method_name#0 from scratch' with 'load method_name#0 from l-stack (no copy)' +debug: Replaced main_if_body@15.ops[3]: 'load method_name#0' with 'load method_name#0 from l-stack (no copy)' debug: Inserted main_else_body@16.ops[1]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_else_body@16.ops[3]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced main_else_body@16.ops[3]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Inserted main_else_body@16.ops[6]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced main_else_body@16.ops[8]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' +debug: Replaced main_else_body@16.ops[8]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' debug: Inserted main_if_body@17.ops[3]: 'store asset_exists#0 to l-stack (copy)' -debug: Replaced main_if_body@17.ops[6]: 'load asset_exists#0 from scratch' with 'load asset_exists#0 from l-stack (no copy)' +debug: Replaced main_if_body@17.ops[6]: 'load asset_exists#0' with 'load asset_exists#0 from l-stack (no copy)' debug: Inserted main_else_body@19.ops[2]: 'store tmp%26#0 to l-stack (copy)' -debug: Replaced main_else_body@19.ops[5]: 'load tmp%26#0 from scratch' with 'load tmp%26#0 from l-stack (no copy)' +debug: Replaced main_else_body@19.ops[5]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' debug: Found 13 edge set/s for examples.simplish.contract.Simplish.approval_program debug: examples.simplish.contract.Simplish.approval_program f-stack entry: ['msg#0', 'sender#0', 'asset_balance#0', 'num_app_args#0', 'oca#0', 'result#0'] debug: examples.simplish.contract.Simplish.approval_program f-stack on first store: [] debug: Inserted itoa_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced itoa_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced itoa_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted itoa_if_body@1.ops[8]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced itoa_if_body@1.ops[10]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced itoa_if_body@1.ops[10]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted itoa_if_body@1.ops[3]: 'store index_plus_1%1#0 to l-stack (copy)' -debug: Replaced itoa_if_body@1.ops[7]: 'load index_plus_1%1#0 from scratch' with 'load index_plus_1%1#0 from l-stack (no copy)' +debug: Replaced itoa_if_body@1.ops[7]: 'load index_plus_1%1#0' with 'load index_plus_1%1#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[11]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[13]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[13]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[25]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[27]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[27]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[21]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[24]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[24]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[16]: 'store index_plus_1%6#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[20]: 'load index_plus_1%6#0 from scratch' with 'load index_plus_1%6#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[20]: 'load index_plus_1%6#0' with 'load index_plus_1%6#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[14]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[20]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[20]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[7]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[26]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[26]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.simplish.contract.itoa debug: Simplified uncover 2; uncover 2 to cover 2 debug: Inserted call_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced call_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced call_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted call_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced call_block@0.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced call_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted call_block@0.ops[18]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced call_block@0.ops[20]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced call_block@0.ops[20]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted call_if_body@1.ops[2]: 'store area#0 to l-stack (copy)' -debug: Replaced call_if_body@1.ops[4]: 'load area#0 from scratch' with 'load area#0 from l-stack (no copy)' +debug: Replaced call_if_body@1.ops[4]: 'load area#0' with 'load area#0 from l-stack (no copy)' debug: Inserted call_else_body@2.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced call_else_body@2.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced call_else_body@2.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted call_if_body@3.ops[2]: 'store circumference#0 to l-stack (copy)' -debug: Replaced call_if_body@3.ops[4]: 'load circumference#0 from scratch' with 'load circumference#0 from l-stack (no copy)' +debug: Replaced call_if_body@3.ops[4]: 'load circumference#0' with 'load circumference#0 from l-stack (no copy)' debug: Inserted call_else_body@4.ops[3]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced call_else_body@4.ops[5]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced call_else_body@4.ops[5]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[12]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[14]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[14]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[24]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[26]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[26]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[8]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[11]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[11]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[21]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[24]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[24]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[34]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[37]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[37]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[1]: 'store radius#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[4]: 'load radius#0 from scratch' with 'load radius#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[4]: 'load radius#0' with 'load radius#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[5]: 'store radius#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[8]: 'load radius#0 from scratch' with 'load radius#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[8]: 'load radius#0' with 'load radius#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[20]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[26]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[26]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[34]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[40]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[40]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[3]: 'store area#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[23]: 'load area#0 from scratch' with 'load area#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[23]: 'load area#0' with 'load area#0 from l-stack (no copy)' debug: Inserted call_if_body@5.ops[8]: 'store circumference#0 to l-stack (copy)' -debug: Replaced call_if_body@5.ops[38]: 'load circumference#0 from scratch' with 'load circumference#0 from l-stack (no copy)' +debug: Replaced call_if_body@5.ops[38]: 'load circumference#0' with 'load circumference#0 from l-stack (no copy)' debug: Found 6 edge set/s for examples.simplish.contract.Simplish.call debug: examples.simplish.contract.Simplish.call f-stack entry: ['result#0'] debug: examples.simplish.contract.Simplish.call f-stack on first store: ['radius#0', 'status#0'] debug: Inserted circle_area_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced circle_area_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced circle_area_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted circle_area_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced circle_area_block@0.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced circle_area_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted circle_area_block@0.ops[13]: 'store result#0 to l-stack (copy)' -debug: Replaced circle_area_block@0.ops[15]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced circle_area_block@0.ops[15]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted circle_circumference_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced circle_circumference_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced circle_circumference_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted circle_circumference_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced circle_circumference_block@0.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced circle_circumference_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted CallCounter.increment_counter_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' -debug: Replaced CallCounter.increment_counter_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0 from scratch' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Replaced CallCounter.increment_counter_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' debug: Inserted CallCounter.increment_counter_block@0.ops[11]: 'store new_state_value%2#0 to l-stack (copy)' -debug: Replaced CallCounter.increment_counter_block@0.ops[14]: 'load new_state_value%2#0 from scratch' with 'load new_state_value%2#0 from l-stack (no copy)' +debug: Replaced CallCounter.increment_counter_block@0.ops[14]: 'load new_state_value%2#0' with 'load new_state_value%2#0 from l-stack (no copy)' debug: Inserted CallCounter.increment_counter_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' -debug: Replaced CallCounter.increment_counter_block@0.ops[9]: 'load app_global_get_ex_value%0#0 from scratch' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' -info: Writing /examples/simplish/out/contract.approval.teal -info: Writing /examples/simplish/out/contract.approval.debug.teal -info: Writing /examples/simplish/out/contract.clear.teal -info: Writing /examples/simplish/out/contract.clear.debug.teal +debug: Replaced CallCounter.increment_counter_block@0.ops[9]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +info: Writing simplish/out/contract.approval.teal +info: Writing simplish/out/contract.approval.debug.teal +info: Writing simplish/out/contract.clear.teal +info: Writing simplish/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/simplish/out/contract.approval.debug.teal b/examples/simplish/out/contract.approval.debug.teal index 1eb5c1e6eb..9bd38117a3 100644 --- a/examples/simplish/out/contract.approval.debug.teal +++ b/examples/simplish/out/contract.approval.debug.teal @@ -37,7 +37,7 @@ main_after_if_else@4: dup // load oca#0 from l-stack (copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | oca#0,oca#0 oca File "simplish/contract.py", line 31 int UpdateApplication // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | oca#0,oca#0,UpdateApplication OnCompleteAction.UpdateApplication File "simplish/contract.py", line 34 == // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | oca#0,{==} oca in ( File "simplish/contract.py", line 33 - cover 1 // store contains%3#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,oca#0 oca in ( File "simplish/contract.py", line 33 + swap // store contains%3#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,oca#0 oca in ( File "simplish/contract.py", line 33 int DeleteApplication // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,oca#0,DeleteApplication OnCompleteAction.DeleteApplication File "simplish/contract.py", line 35 == // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,{==} oca in ( File "simplish/contract.py", line 33 || // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {||} oca in ( File "simplish/contract.py", line 33 @@ -55,10 +55,10 @@ main_if_body@6: int 0 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | 0 self.counter File "simplish/contract.py", line 38 byte "counter" // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | 0,"counter" self.counter File "simplish/contract.py", line 38 app_global_get_ex // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "simplish/contract.py", line 38 - assert // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | app_global_get_ex_value%7#0 self.counter File "simplish/contract.py", line 38 + assert // check value exists // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | app_global_get_ex_value%7#0 self.counter File "simplish/contract.py", line 38 callsub itoa // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {itoa} itoa(self.counter) File "simplish/contract.py", line 38 byte "I was used " // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tmp%9#0,"I was used " b"I was used " File "simplish/contract.py", line 38 - uncover 1 // load tmp%9#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "I was used ",tmp%9#0 itoa(self.counter) File "simplish/contract.py", line 38 + swap // load tmp%9#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "I was used ",tmp%9#0 itoa(self.counter) File "simplish/contract.py", line 38 concat // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {concat} Bytes(b"I was used ") + itoa(self.counter) File "simplish/contract.py", line 38 byte " time(s) before I died" // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tmp%10#0," time(s) before I died" b" time(s) before I died" File "simplish/contract.py", line 38 concat // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {concat} Bytes(b"I was used ") + itoa(self.counter) + b" time(s) before I died" File "simplish/contract.py", line 38 @@ -133,7 +133,7 @@ main_if_body@17: dig 4 // load sender#0 from f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | sender#0 sender File "simplish/contract.py", line 32 int 0 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | sender#0,0 0 File "simplish/contract.py", line 52 asset_holding_get AssetBalance // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {asset_holding_get}.0,{asset_holding_get}.1 AssetHoldingGet.asset_balance(sender, 0) File "simplish/contract.py", line 52 - cover 1 // store asset_exists#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | asset_exists#0,{asset_holding_get}.0 asset_exists File "simplish/contract.py", line 52 + swap // store asset_exists#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | asset_exists#0,{asset_holding_get}.0 asset_exists File "simplish/contract.py", line 52 bury 5 // store asset_balance#0 to f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | asset_exists#0 asset_balance File "simplish/contract.py", line 52 bnz main_else_body@19 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | not asset_exists File "simplish/contract.py", line 53 // Implicit fall through to main_if_body@18 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | not asset_exists File "simplish/contract.py", line 53 @@ -147,7 +147,7 @@ main_else_body@19: dig 3 // load asset_balance#0 from f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | asset_balance#0 asset_balance File "simplish/contract.py", line 52 callsub itoa // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {itoa} itoa(asset_balance) File "simplish/contract.py", line 56 byte "You have asset balance: " // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tmp%26#0,"You have asset balance: " b"You have asset balance: " File "simplish/contract.py", line 56 - uncover 1 // load tmp%26#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "You have asset balance: ",tmp%26#0 itoa(asset_balance) File "simplish/contract.py", line 56 + swap // load tmp%26#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "You have asset balance: ",tmp%26#0 itoa(asset_balance) File "simplish/contract.py", line 56 concat // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {concat} Bytes(b"You have asset balance: ") + itoa(asset_balance) File "simplish/contract.py", line 56 bury 6 // store msg#0 to f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | msg File "simplish/contract.py", line 50 // Implicit fall through to main_after_if_else@20 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | @@ -214,7 +214,7 @@ itoa_after_if_else@2: retsub // tmp%8#0 return itoa(i // radix) + digits[i % radix] File "simplish/contract.py", line 122 -// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> : +// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> void: set_sender_nickname: proto 1 0 // (𝕡) nickname#0 | def set_sender_nickname(self, nickname: Bytes) -> None: File "simplish/base_class.py", line 16 @@ -235,7 +235,7 @@ call_block@0: frame_dig -1 // load num_app_args#0 from parameters (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | num_app_args#0 num_app_args: UInt64 File "simplish/contract.py", line 69 int 2 // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | num_app_args#0,2 2 File "simplish/contract.py", line 70 == // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | {==} num_app_args == 2, "insufficient arguments" File "simplish/contract.py", line 70 - assert // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | assert num_app_args == 2, "insufficient arguments" File "simplish/contract.py", line 70 + assert // insufficient arguments // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | assert num_app_args == 2, "insufficient arguments" File "simplish/contract.py", line 70 txna ApplicationArgs 1 // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | {txna} Transaction.application_args(1) File "simplish/contract.py", line 71 btoi // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | {btoi} btoi(Transaction.application_args(1)) File "simplish/contract.py", line 71 int 1 // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0 | 1 True File "simplish/contract.py", line 73 @@ -277,22 +277,22 @@ call_if_body@5: frame_dig 1 // load radius#0 from f-stack (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | radius#0 radius File "simplish/contract.py", line 71 dup // store radius#0 to l-stack (copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | radius#0,radius#0 radius File "simplish/contract.py", line 71 callsub circle_area // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | radius#0,{circle_area} circle_area(radius) File "simplish/contract.py", line 81 - cover 1 // store area#0 to l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | area#0,radius#0 area File "simplish/contract.py", line 75 + swap // store area#0 to l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | area#0,radius#0 area File "simplish/contract.py", line 75 dup // load radius#0 from l-stack (copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | area#0,radius#0,radius#0 radius File "simplish/contract.py", line 71 callsub circle_circumference // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | area#0,radius#0,{circle_circumference} circle_circumference(radius) File "simplish/contract.py", line 81 cover 2 // store circumference#0 to l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,radius#0 circumference File "simplish/contract.py", line 78 callsub itoa // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,{itoa} itoa(radius) File "simplish/contract.py", line 84 byte "Approximate area and circumference of circle with radius " // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,tmp%7#0,"Approximate area and circumference of circle with radius " b"Approximate area and circumference of circle with radius " File "simplish/contract.py", line 83 - uncover 1 // load tmp%7#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,"Approximate area and circumference of circle with radius ",tmp%7#0 itoa(radius) File "simplish/contract.py", line 84 + swap // load tmp%7#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,"Approximate area and circumference of circle with radius ",tmp%7#0 itoa(radius) File "simplish/contract.py", line 84 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 byte " = " // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,tmp%8#0," = " b" = " File "simplish/contract.py", line 85 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 - uncover 1 // load area#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%9#0,area#0 area File "simplish/contract.py", line 75 + swap // load area#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%9#0,area#0 area File "simplish/contract.py", line 75 callsub itoa // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%9#0,{itoa} itoa(area) File "simplish/contract.py", line 86 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 byte ", " // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%11#0,", " b", " File "simplish/contract.py", line 87 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 - uncover 1 // load circumference#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%12#0,circumference#0 circumference File "simplish/contract.py", line 78 + swap // load circumference#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%12#0,circumference#0 circumference File "simplish/contract.py", line 78 callsub itoa // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%12#0,{itoa} itoa(circumference) File "simplish/contract.py", line 88 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | {concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 frame_bury 0 // store result#0 to f-stack (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | result File "simplish/contract.py", line 76 @@ -347,7 +347,7 @@ circle_circumference_block@0: retsub // tmp%1#0 return radius * two_pi // SCALE File "simplish/contract.py", line 105 -// examples.simplish.contract.Simplish.increment_counter() -> : +// examples.simplish.contract.Simplish.increment_counter() -> void: increment_counter: proto 0 0 // def increment_counter(self) -> None: File "simplish/contract.py", line 96 @@ -358,7 +358,7 @@ increment_counter_block@0: retsub // -// examples.simplish.base_class.CallCounter.increment_counter() -> : +// examples.simplish.base_class.CallCounter.increment_counter() -> void: CallCounter.increment_counter: proto 0 0 // def increment_counter(self) -> None: File "simplish/base_class.py", line 12 @@ -366,16 +366,16 @@ CallCounter.increment_counter_block@0: int 0 // 0 self.counter File "simplish/base_class.py", line 13 byte "counter" // 0,"counter" self.counter File "simplish/base_class.py", line 13 app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "simplish/base_class.py", line 13 - assert // app_global_get_ex_value%0#0 self.counter File "simplish/base_class.py", line 13 + assert // check value exists // app_global_get_ex_value%0#0 self.counter File "simplish/base_class.py", line 13 int 1 // app_global_get_ex_value%0#0,1 1 File "simplish/base_class.py", line 13 + // {+} self.counter += 1 File "simplish/base_class.py", line 13 byte "counter" // new_state_value%2#0,"counter" self.counter File "simplish/base_class.py", line 13 - uncover 1 // load new_state_value%2#0 from l-stack (no copy) "counter",new_state_value%2#0 self.counter += 1 File "simplish/base_class.py", line 13 + swap // load new_state_value%2#0 from l-stack (no copy) "counter",new_state_value%2#0 self.counter += 1 File "simplish/base_class.py", line 13 app_global_put // self.counter += 1 File "simplish/base_class.py", line 13 retsub // -// examples.simplish.base_class.CallCounter.__init__() -> : +// examples.simplish.base_class.CallCounter.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "simplish/base_class.py", line 7 diff --git a/examples/simplish/out/contract.approval.teal b/examples/simplish/out/contract.approval.teal index 7a98312f1d..eb558bd4d9 100644 --- a/examples/simplish/out/contract.approval.teal +++ b/examples/simplish/out/contract.approval.teal @@ -32,7 +32,7 @@ main_after_if_else@4: dup int UpdateApplication == - cover 1 + swap int DeleteApplication == || @@ -48,10 +48,10 @@ main_if_body@6: int 0 byte "counter" app_global_get_ex - assert + assert // check value exists callsub itoa byte "I was used " - uncover 1 + swap concat byte " time(s) before I died" concat @@ -119,7 +119,7 @@ main_if_body@17: dig 4 int 0 asset_holding_get AssetBalance - cover 1 + swap bury 5 bnz main_else_body@19 @@ -132,7 +132,7 @@ main_else_body@19: dig 3 callsub itoa byte "You have asset balance: " - uncover 1 + swap concat bury 6 @@ -195,7 +195,7 @@ itoa_after_if_else@2: retsub -// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> : +// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> void: set_sender_nickname: proto 1 0 @@ -216,7 +216,7 @@ call_block@0: frame_dig -1 int 2 == - assert + assert // insufficient arguments txna ApplicationArgs 1 btoi int 1 @@ -255,22 +255,22 @@ call_if_body@5: frame_dig 1 dup callsub circle_area - cover 1 + swap dup callsub circle_circumference cover 2 callsub itoa byte "Approximate area and circumference of circle with radius " - uncover 1 + swap concat byte " = " concat - uncover 1 + swap callsub itoa concat byte ", " concat - uncover 1 + swap callsub itoa concat frame_bury 0 @@ -322,7 +322,7 @@ circle_circumference_block@0: retsub -// examples.simplish.contract.Simplish.increment_counter() -> : +// examples.simplish.contract.Simplish.increment_counter() -> void: increment_counter: proto 0 0 @@ -333,7 +333,7 @@ increment_counter_block@0: retsub -// examples.simplish.base_class.CallCounter.increment_counter() -> : +// examples.simplish.base_class.CallCounter.increment_counter() -> void: CallCounter.increment_counter: proto 0 0 @@ -341,16 +341,16 @@ CallCounter.increment_counter_block@0: int 0 byte "counter" app_global_get_ex - assert + assert // check value exists int 1 + byte "counter" - uncover 1 + swap app_global_put retsub -// examples.simplish.base_class.CallCounter.__init__() -> : +// examples.simplish.base_class.CallCounter.__init__() -> void: __init__: proto 0 0 diff --git a/examples/simplish/out/contract.approval_unoptimized.debug.teal b/examples/simplish/out/contract.approval_unoptimized.debug.teal index 91f7f30bca..1ed93347aa 100644 --- a/examples/simplish/out/contract.approval_unoptimized.debug.teal +++ b/examples/simplish/out/contract.approval_unoptimized.debug.teal @@ -38,7 +38,7 @@ main_after_if_else@4: dup // load oca#0 from l-stack (copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | oca#0,oca#0 oca File "simplish/contract.py", line 31 int UpdateApplication // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | oca#0,oca#0,UpdateApplication OnCompleteAction.UpdateApplication File "simplish/contract.py", line 34 == // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | oca#0,{==} oca in ( File "simplish/contract.py", line 33 - cover 1 // store contains%3#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,oca#0 oca in ( File "simplish/contract.py", line 33 + swap // store contains%3#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,oca#0 oca in ( File "simplish/contract.py", line 33 int DeleteApplication // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,oca#0,DeleteApplication OnCompleteAction.DeleteApplication File "simplish/contract.py", line 35 == // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | contains%3#0,{==} oca in ( File "simplish/contract.py", line 33 || // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {||} oca in ( File "simplish/contract.py", line 33 @@ -56,10 +56,10 @@ main_if_body@6: int 0 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | 0 self.counter File "simplish/contract.py", line 38 byte "counter" // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | 0,"counter" self.counter File "simplish/contract.py", line 38 app_global_get_ex // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "simplish/contract.py", line 38 - assert // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | app_global_get_ex_value%7#0 self.counter File "simplish/contract.py", line 38 + assert // check value exists // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | app_global_get_ex_value%7#0 self.counter File "simplish/contract.py", line 38 callsub itoa // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {itoa} itoa(self.counter) File "simplish/contract.py", line 38 byte "I was used " // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tmp%9#0,"I was used " b"I was used " File "simplish/contract.py", line 38 - uncover 1 // load tmp%9#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "I was used ",tmp%9#0 itoa(self.counter) File "simplish/contract.py", line 38 + swap // load tmp%9#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "I was used ",tmp%9#0 itoa(self.counter) File "simplish/contract.py", line 38 concat // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {concat} Bytes(b"I was used ") + itoa(self.counter) File "simplish/contract.py", line 38 byte " time(s) before I died" // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tmp%10#0," time(s) before I died" b" time(s) before I died" File "simplish/contract.py", line 38 concat // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {concat} Bytes(b"I was used ") + itoa(self.counter) + b" time(s) before I died" File "simplish/contract.py", line 38 @@ -119,7 +119,7 @@ main_if_body@15: txna ApplicationArgs 0 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {txna} Transaction.application_args(0) File "simplish/contract.py", line 49 dig 3 // load num_app_args#0 from f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | method_name#0,num_app_args#0 num_app_args File "simplish/contract.py", line 48 callsub call // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {call}.0,{call}.1 self.call(method_name, num_app_args) File "simplish/contract.py", line 50 - cover 1 // store tuple_assignment%21#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tuple_assignment%21#0,{call}.0 self.call(method_name, num_app_args) File "simplish/contract.py", line 50 + swap // store tuple_assignment%21#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tuple_assignment%21#0,{call}.0 self.call(method_name, num_app_args) File "simplish/contract.py", line 50 bury 7 // store msg#0 to f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tuple_assignment%21#0 msg File "simplish/contract.py", line 50 bury 1 // store result#0 to f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | result File "simplish/contract.py", line 50 b main_after_if_else@23 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | @@ -135,7 +135,7 @@ main_if_body@17: dig 4 // load sender#0 from f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | sender#0 sender File "simplish/contract.py", line 32 int 0 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | sender#0,0 0 File "simplish/contract.py", line 52 asset_holding_get AssetBalance // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {asset_holding_get}.0,{asset_holding_get}.1 AssetHoldingGet.asset_balance(sender, 0) File "simplish/contract.py", line 52 - cover 1 // store tuple_assignment%25#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tuple_assignment%25#0,{asset_holding_get}.0 AssetHoldingGet.asset_balance(sender, 0) File "simplish/contract.py", line 52 + swap // store tuple_assignment%25#0 to l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tuple_assignment%25#0,{asset_holding_get}.0 AssetHoldingGet.asset_balance(sender, 0) File "simplish/contract.py", line 52 bury 5 // store asset_balance#0 to f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tuple_assignment%25#0 asset_balance File "simplish/contract.py", line 52 bnz main_else_body@19 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | not asset_exists File "simplish/contract.py", line 53 // Implicit fall through to main_if_body@18 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | not asset_exists File "simplish/contract.py", line 53 @@ -149,7 +149,7 @@ main_else_body@19: dig 3 // load asset_balance#0 from f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | asset_balance#0 asset_balance File "simplish/contract.py", line 52 callsub itoa // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {itoa} itoa(asset_balance) File "simplish/contract.py", line 56 byte "You have asset balance: " // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | tmp%26#0,"You have asset balance: " b"You have asset balance: " File "simplish/contract.py", line 56 - uncover 1 // load tmp%26#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "You have asset balance: ",tmp%26#0 itoa(asset_balance) File "simplish/contract.py", line 56 + swap // load tmp%26#0 from l-stack (no copy) (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | "You have asset balance: ",tmp%26#0 itoa(asset_balance) File "simplish/contract.py", line 56 concat // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | {concat} Bytes(b"You have asset balance: ") + itoa(asset_balance) File "simplish/contract.py", line 56 bury 6 // store msg#0 to f-stack (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | msg File "simplish/contract.py", line 50 // Implicit fall through to main_after_if_else@20 // (𝕗) msg#0,sender#0,asset_balance#0,num_app_args#0,oca#0,result#0 | @@ -184,7 +184,7 @@ itoa: itoa_block@0: byte "0123456789" // (𝕡) i#0 | "0123456789" b"0123456789" File "simplish/contract.py", line 118 dup // store digits#0 to l-stack (copy) (𝕡) i#0 | digits#0,digits#0 digits File "simplish/contract.py", line 118 - cover 1 // store digits#0 to x-stack (no copy) (𝕡) i#0 | (𝕏) digits#0 | digits#0 digits File "simplish/contract.py", line 118 + swap // store digits#0 to x-stack (no copy) (𝕡) i#0 | (𝕏) digits#0 | digits#0 digits File "simplish/contract.py", line 118 len // (𝕡) i#0 | (𝕏) digits#0 | {len} digits.length File "simplish/contract.py", line 119 dup // store radix#0 to l-stack (copy) (𝕡) i#0 | (𝕏) digits#0 | radix#0,radix#0 radix File "simplish/contract.py", line 119 cover 2 // store radix#0 to f-stack (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0 radix File "simplish/contract.py", line 119 @@ -197,11 +197,11 @@ itoa_if_body@1: frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | i#0 digits#0 i: UInt64 File "simplish/contract.py", line 116 int 1 // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | i#0,1 digits[i] File "simplish/contract.py", line 121 + // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | {+} digits[i] File "simplish/contract.py", line 121 - uncover 1 // load digits#0 from x-stack (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0 digits File "simplish/contract.py", line 118 + swap // load digits#0 from x-stack (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0 digits File "simplish/contract.py", line 118 frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0,i#0 i: UInt64 File "simplish/contract.py", line 116 uncover 2 // load index_plus_1%1#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | digits#0,i#0,index_plus_1%1#0 digits[i] File "simplish/contract.py", line 121 substring3 // (𝕡) i#0 | (𝕗) radix#0 | {substring3} digits[i] File "simplish/contract.py", line 121 - uncover 1 + swap retsub // tmp%2#0 return digits[i] File "simplish/contract.py", line 121 itoa_after_if_else@2: @@ -211,9 +211,9 @@ itoa_after_if_else@2: cover 2 // store radix#0 to l-stack (copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,i#0,radix#0 radix File "simplish/contract.py", line 119 / // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,{/} i // radix File "simplish/contract.py", line 122 callsub itoa // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,{itoa} itoa(i // radix) File "simplish/contract.py", line 122 - cover 1 // store tmp%4#0 to l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0 itoa(i // radix) File "simplish/contract.py", line 122 + swap // store tmp%4#0 to l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0 itoa(i // radix) File "simplish/contract.py", line 122 frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0,i#0 i: UInt64 File "simplish/contract.py", line 116 - uncover 1 // load radix#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,i#0,radix#0 radix File "simplish/contract.py", line 119 + swap // load radix#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,i#0,radix#0 radix File "simplish/contract.py", line 119 % // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,{%} i % radix File "simplish/contract.py", line 122 dup // load tmp%5#0 from l-stack (copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,tmp%5#0,tmp%5#0 i % radix File "simplish/contract.py", line 122 int 1 // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,tmp%5#0,tmp%5#0,1 digits[i % radix] File "simplish/contract.py", line 122 @@ -222,11 +222,11 @@ itoa_after_if_else@2: cover 2 // virtual: 2 ops (𝕡) i#0 | (𝕗) radix#0 | tmp%4#0,digits#0,tmp%5#0,index_plus_1%6#0 digits[i % radix] File "simplish/contract.py", line 122 substring3 // (𝕡) i#0 | (𝕗) radix#0 | tmp%4#0,{substring3} digits[i % radix] File "simplish/contract.py", line 122 concat // (𝕡) i#0 | (𝕗) radix#0 | {concat} itoa(i // radix) + digits[i % radix] File "simplish/contract.py", line 122 - uncover 1 + swap retsub // tmp%8#0 return itoa(i // radix) + digits[i % radix] File "simplish/contract.py", line 122 -// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> : +// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> void: set_sender_nickname: proto 1 0 // (𝕡) nickname#0 | def set_sender_nickname(self, nickname: Bytes) -> None: File "simplish/base_class.py", line 16 @@ -247,7 +247,7 @@ call_block@0: frame_dig -1 // load num_app_args#0 from parameters (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | num_app_args#0 num_app_args: UInt64 File "simplish/contract.py", line 69 int 2 // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | num_app_args#0,2 2 File "simplish/contract.py", line 70 == // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | {==} num_app_args == 2, "insufficient arguments" File "simplish/contract.py", line 70 - assert // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | assert num_app_args == 2, "insufficient arguments" File "simplish/contract.py", line 70 + assert // insufficient arguments // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | assert num_app_args == 2, "insufficient arguments" File "simplish/contract.py", line 70 txna ApplicationArgs 1 // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | {txna} Transaction.application_args(1) File "simplish/contract.py", line 71 btoi // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0 | {btoi} btoi(Transaction.application_args(1)) File "simplish/contract.py", line 71 int 1 // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0 | 1 True File "simplish/contract.py", line 73 @@ -289,22 +289,22 @@ call_if_body@5: frame_dig 1 // load radius#0 from f-stack (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | radius#0 radius File "simplish/contract.py", line 71 dup // store radius#0 to l-stack (copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | radius#0,radius#0 radius File "simplish/contract.py", line 71 callsub circle_area // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | radius#0,{circle_area} circle_area(radius) File "simplish/contract.py", line 81 - cover 1 // store tmp%5#0 to l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%5#0,radius#0 circle_area(radius) File "simplish/contract.py", line 81 + swap // store tmp%5#0 to l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%5#0,radius#0 circle_area(radius) File "simplish/contract.py", line 81 dup // load radius#0 from l-stack (copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%5#0,radius#0,radius#0 radius File "simplish/contract.py", line 71 callsub circle_circumference // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%5#0,radius#0,{circle_circumference} circle_circumference(radius) File "simplish/contract.py", line 81 cover 2 // store circumference#0 to l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,radius#0 circumference File "simplish/contract.py", line 78 callsub itoa // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,{itoa} itoa(radius) File "simplish/contract.py", line 84 byte "Approximate area and circumference of circle with radius " // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,tmp%7#0,"Approximate area and circumference of circle with radius " b"Approximate area and circumference of circle with radius " File "simplish/contract.py", line 83 - uncover 1 // load tmp%7#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,"Approximate area and circumference of circle with radius ",tmp%7#0 itoa(radius) File "simplish/contract.py", line 84 + swap // load tmp%7#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,"Approximate area and circumference of circle with radius ",tmp%7#0 itoa(radius) File "simplish/contract.py", line 84 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 byte " = " // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,tmp%8#0," = " b" = " File "simplish/contract.py", line 85 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,area#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 - uncover 1 // load area#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%9#0,area#0 area File "simplish/contract.py", line 75 + swap // load area#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%9#0,area#0 area File "simplish/contract.py", line 75 callsub itoa // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%9#0,{itoa} itoa(area) File "simplish/contract.py", line 86 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 byte ", " // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,tmp%11#0,", " b", " File "simplish/contract.py", line 87 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | circumference#0,{concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 - uncover 1 // load circumference#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%12#0,circumference#0 circumference File "simplish/contract.py", line 78 + swap // load circumference#0 from l-stack (no copy) (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%12#0,circumference#0 circumference File "simplish/contract.py", line 78 callsub itoa // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | tmp%12#0,{itoa} itoa(circumference) File "simplish/contract.py", line 88 concat // (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | {concat} Bytes(b"Approximate area and circumference of circle with radius ") File "simplish/contract.py", line 83 frame_bury 0 // store result#0 to f-stack (𝕡) method_name#0,num_app_args#0 | (𝕗) result#0,radius#0,status#0 | result File "simplish/contract.py", line 76 @@ -361,7 +361,7 @@ circle_circumference_block@0: retsub // tmp%1#0 return radius * two_pi // SCALE File "simplish/contract.py", line 105 -// examples.simplish.contract.Simplish.increment_counter() -> : +// examples.simplish.contract.Simplish.increment_counter() -> void: increment_counter: proto 0 0 // def increment_counter(self) -> None: File "simplish/contract.py", line 96 @@ -372,7 +372,7 @@ increment_counter_block@0: retsub // -// examples.simplish.base_class.CallCounter.increment_counter() -> : +// examples.simplish.base_class.CallCounter.increment_counter() -> void: CallCounter.increment_counter: proto 0 0 // def increment_counter(self) -> None: File "simplish/base_class.py", line 12 @@ -380,16 +380,16 @@ CallCounter.increment_counter_block@0: int 0 // 0 self.counter File "simplish/base_class.py", line 13 byte "counter" // 0,"counter" self.counter File "simplish/base_class.py", line 13 app_global_get_ex // {app_global_get_ex}.0,{app_global_get_ex}.1 self.counter File "simplish/base_class.py", line 13 - assert // app_global_get_ex_value%0#0 self.counter File "simplish/base_class.py", line 13 + assert // check value exists // app_global_get_ex_value%0#0 self.counter File "simplish/base_class.py", line 13 int 1 // app_global_get_ex_value%0#0,1 1 File "simplish/base_class.py", line 13 + // {+} self.counter += 1 File "simplish/base_class.py", line 13 byte "counter" // new_state_value%2#0,"counter" self.counter File "simplish/base_class.py", line 13 - uncover 1 // load new_state_value%2#0 from l-stack (no copy) "counter",new_state_value%2#0 self.counter += 1 File "simplish/base_class.py", line 13 + swap // load new_state_value%2#0 from l-stack (no copy) "counter",new_state_value%2#0 self.counter += 1 File "simplish/base_class.py", line 13 app_global_put // self.counter += 1 File "simplish/base_class.py", line 13 retsub // -// examples.simplish.base_class.CallCounter.__init__() -> : +// examples.simplish.base_class.CallCounter.__init__() -> void: __init__: proto 0 0 // def __init__(self) -> None: File "simplish/base_class.py", line 7 diff --git a/examples/simplish/out/contract.approval_unoptimized.teal b/examples/simplish/out/contract.approval_unoptimized.teal index 9c1575695f..5162c0300a 100644 --- a/examples/simplish/out/contract.approval_unoptimized.teal +++ b/examples/simplish/out/contract.approval_unoptimized.teal @@ -33,7 +33,7 @@ main_after_if_else@4: dup int UpdateApplication == - cover 1 + swap int DeleteApplication == || @@ -49,10 +49,10 @@ main_if_body@6: int 0 byte "counter" app_global_get_ex - assert + assert // check value exists callsub itoa byte "I was used " - uncover 1 + swap concat byte " time(s) before I died" concat @@ -106,7 +106,7 @@ main_if_body@15: txna ApplicationArgs 0 dig 3 callsub call - cover 1 + swap bury 7 bury 1 b main_after_if_else@23 @@ -121,7 +121,7 @@ main_if_body@17: dig 4 int 0 asset_holding_get AssetBalance - cover 1 + swap bury 5 bnz main_else_body@19 @@ -134,7 +134,7 @@ main_else_body@19: dig 3 callsub itoa byte "You have asset balance: " - uncover 1 + swap concat bury 6 @@ -166,7 +166,7 @@ itoa: itoa_block@0: byte "0123456789" dup - cover 1 + swap len dup cover 2 @@ -178,11 +178,11 @@ itoa_if_body@1: frame_dig -1 int 1 + - uncover 1 + swap frame_dig -1 uncover 2 substring3 - uncover 1 + swap retsub itoa_after_if_else@2: @@ -192,9 +192,9 @@ itoa_after_if_else@2: cover 2 / callsub itoa - cover 1 + swap frame_dig -1 - uncover 1 + swap % dup int 1 @@ -203,11 +203,11 @@ itoa_after_if_else@2: cover 2 substring3 concat - uncover 1 + swap retsub -// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> : +// examples.simplish.base_class.CallCounter.set_sender_nickname(nickname#0: bytes) -> void: set_sender_nickname: proto 1 0 @@ -228,7 +228,7 @@ call_block@0: frame_dig -1 int 2 == - assert + assert // insufficient arguments txna ApplicationArgs 1 btoi int 1 @@ -267,22 +267,22 @@ call_if_body@5: frame_dig 1 dup callsub circle_area - cover 1 + swap dup callsub circle_circumference cover 2 callsub itoa byte "Approximate area and circumference of circle with radius " - uncover 1 + swap concat byte " = " concat - uncover 1 + swap callsub itoa concat byte ", " concat - uncover 1 + swap callsub itoa concat frame_bury 0 @@ -336,7 +336,7 @@ circle_circumference_block@0: retsub -// examples.simplish.contract.Simplish.increment_counter() -> : +// examples.simplish.contract.Simplish.increment_counter() -> void: increment_counter: proto 0 0 @@ -347,7 +347,7 @@ increment_counter_block@0: retsub -// examples.simplish.base_class.CallCounter.increment_counter() -> : +// examples.simplish.base_class.CallCounter.increment_counter() -> void: CallCounter.increment_counter: proto 0 0 @@ -355,16 +355,16 @@ CallCounter.increment_counter_block@0: int 0 byte "counter" app_global_get_ex - assert + assert // check value exists int 1 + byte "counter" - uncover 1 + swap app_global_put retsub -// examples.simplish.base_class.CallCounter.__init__() -> : +// examples.simplish.base_class.CallCounter.__init__() -> void: __init__: proto 0 0 diff --git a/examples/simplish/out/contract.awst b/examples/simplish/out/contract.awst index 8b2b46d43a..b5f18ba631 100644 --- a/examples/simplish/out/contract.awst +++ b/examples/simplish/out/contract.awst @@ -9,7 +9,7 @@ contract Simplish extends (examples.simplish.base_class::CallCounter) return true } oca: algopy.UInt64 = txn() - sender: algopy.Address = txn() + sender: algopy.Account = txn() if (oca IS IN (UpdateApplication, DeleteApplication)) { if (oca == DeleteApplication) { log('I was used ' + examples.simplish.contract::itoa(this.globals['counter']) + ' time(s) before I died') diff --git a/examples/sizes.txt b/examples/sizes.txt index 4cae9e7437..2f024b4889 100644 --- a/examples/sizes.txt +++ b/examples/sizes.txt @@ -1,33 +1,48 @@ Name Unoptimized size Optimized size -abi_types 273 232 +TEALScript/auction 562 547 +abi_routing 761 724 address_constant 43 43 -asset 138 138 -augmented_assignment 158 158 -biguint_binary_ops 251 213 -boolean_binary_ops 310 306 -byte_constants 98 88 -bytes_ops 139 135 -calculator 350 328 +amm 1151 1139 +application 163 163 +arc4_types/array 561 463 +arc4_types/bool 322 59 +arc4_types/dynamic_string_array 249 167 +arc4_types/numeric 353 214 +arc4_types/string 78 71 +arc4_types/structs 291 225 +arc4_types/tuples 806 204 +asset 255 254 +augmented_assignment 154 154 +biguint_binary_ops 248 212 +boolean_binary_ops 304 298 +byte_constants 94 88 +bytes_ops 138 135 +calculator 339 323 callsub 28 28 -chained_assignment 84 84 -conditional_expressions 230 185 -contains 159 154 -enumeration 542 516 +chained_assignment 83 83 +conditional_execution 380 380 +conditional_expressions 228 182 +contains 155 156 +edverify 33 33 +enumeration 536 507 +everything 424 421 koopman 12 5 less_simple 93 87 -local_storage/local_storage_contract 319 316 -local_storage/local_storage_with_offsets 334 332 -nested_loops 228 206 -simple 53 4 -simplish 755 734 -ssa 237 212 +local_storage/local_storage_contract 317 314 +local_storage/local_storage_with_offsets 330 328 +nested_loops 228 203 +simple 51 4 +simplish 739 725 +ssa 235 212 ssa2 49 46 -string_ops 150 150 -stubs/biguint 158 154 -stubs/bytes 455 289 -stubs/uint64 370 166 -tuple_support 392 279 -unary 130 124 +string_ops 148 148 +stubs/biguint 158 140 +stubs/bytes 645 4 +stubs/uint64 366 4 +transaction 690 682 +tuple_support 428 306 +unary 129 93 undefined_phi_args/baddie 346 346 -unssa 431 388 -with_reentrancy 264 245 \ No newline at end of file +unssa 425 379 +voting/voting 1597 1563 +with_reentrancy 253 240 \ No newline at end of file diff --git a/examples/ssa/algopy.log b/examples/ssa/algopy.log index 408ee0a686..aa97e34e6f 100644 --- a/examples/ssa/algopy.log +++ b/examples/ssa/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 ssa -info: Building AWST for __init__.py -info: Building AWST for ssa/__init__.py -info: Building AWST for ssa/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug ssa +debug: Building AWST for __init__.py +debug: Building AWST for ssa/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for ssa/contract.py debug: Sealing block@0: // L48 debug: Terminated block@0: // L48 debug: Sealing block@None: // if_body_L51 @@ -110,6 +111,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: range_item%1#1, i#0 debug: Replacing {range_item%1#1} with i#0 made 3 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable a#0 debug: Removing unused variable b#0 @@ -127,6 +129,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -139,6 +142,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: y#0, tmp2#0, x#1, tmp1#0, x#0, x#2 debug: Replacing {tmp2#0, x#1, tmp1#0, x#0, x#2} with y#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -150,6 +154,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -162,6 +167,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 3 * 20 to 60 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -171,6 +177,7 @@ debug: Optimizing subroutine examples.ssa.contract.one_hundred debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -180,6 +187,7 @@ debug: Optimizing subroutine examples.ssa.contract.phi_in_equiv_class debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -190,6 +198,7 @@ debug: Optimizing subroutine examples.ssa.contract.MyContract.clear_state_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -202,6 +211,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded 60 + 20 to 80 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -211,6 +221,7 @@ debug: Optimizing subroutine examples.ssa.contract.one_hundred debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -220,6 +231,7 @@ debug: Optimizing subroutine examples.ssa.contract.phi_in_equiv_class debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -230,6 +242,7 @@ debug: Optimizing subroutine examples.ssa.contract.MyContract.clear_state_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -241,6 +254,7 @@ debug: Optimizing subroutine examples.ssa.contract.MyContract.approval_program debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -250,6 +264,7 @@ debug: Optimizing subroutine examples.ssa.contract.one_hundred debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -259,6 +274,7 @@ debug: Optimizing subroutine examples.ssa.contract.phi_in_equiv_class debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -268,6 +284,7 @@ debug: Optimizing subroutine examples.ssa.contract.MyContract.clear_state_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -401,78 +418,78 @@ debug: Coalescing local variables in examples.ssa.contract.MyContract.clear_stat debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/ssa/out/contract_MyContract.final.ir debug: Inserted main_while_top@1.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_while_top@1.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_while_top@1.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_while_body@2.ops[2]: 'store a#1 to l-stack (copy)' -debug: Replaced main_while_body@2.ops[5]: 'load a#1 from scratch' with 'load a#1 from l-stack (no copy)' +debug: Replaced main_while_body@2.ops[5]: 'load a#1' with 'load a#1 from l-stack (no copy)' debug: Inserted main_after_while@3.ops[1]: 'store range_item%1#0 to l-stack (copy)' -debug: Replaced main_after_while@3.ops[3]: 'load range_item%1#0 from scratch' with 'load range_item%1#0 from l-stack (no copy)' +debug: Replaced main_after_while@3.ops[3]: 'load range_item%1#0' with 'load range_item%1#0 from l-stack (no copy)' debug: Inserted main_for_header@4.ops[3]: 'store continue_looping%2#0 to l-stack (copy)' -debug: Replaced main_for_header@4.ops[5]: 'load continue_looping%2#0 from scratch' with 'load continue_looping%2#0 from l-stack (no copy)' +debug: Replaced main_for_header@4.ops[5]: 'load continue_looping%2#0' with 'load continue_looping%2#0 from l-stack (no copy)' debug: Inserted main_for_body@5.ops[11]: 'store range_item%1#0 to l-stack (copy)' -debug: Replaced main_for_body@5.ops[13]: 'load range_item%1#0 from scratch' with 'load range_item%1#0 from l-stack (no copy)' +debug: Replaced main_for_body@5.ops[13]: 'load range_item%1#0' with 'load range_item%1#0 from l-stack (no copy)' debug: Inserted main_for_body@5.ops[2]: 'store a#1 to l-stack (copy)' -debug: Replaced main_for_body@5.ops[5]: 'load a#1 from scratch' with 'load a#1 from l-stack (no copy)' +debug: Replaced main_for_body@5.ops[5]: 'load a#1' with 'load a#1 from l-stack (no copy)' debug: Inserted main_for_body@5.ops[7]: 'store i#0 to l-stack (copy)' -debug: Replaced main_for_body@5.ops[10]: 'load i#0 from scratch' with 'load i#0 from l-stack (no copy)' +debug: Replaced main_for_body@5.ops[10]: 'load i#0' with 'load i#0 from l-stack (no copy)' debug: Inserted main_after_for@7.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_after_for@7.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_after_for@7.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_if_body@8.ops[3]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_if_body@8.ops[5]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_if_body@8.ops[5]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_else_body@10.ops[7]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_else_body@10.ops[9]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_else_body@10.ops[9]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_else_body@10.ops[3]: 'store b#1 to l-stack (copy)' -debug: Replaced main_else_body@10.ops[6]: 'load b#1 from scratch' with 'load b#1 from l-stack (no copy)' +debug: Replaced main_else_body@10.ops[6]: 'load b#1' with 'load b#1 from l-stack (no copy)' debug: Inserted main_else_body@15.ops[3]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_else_body@15.ops[5]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_else_body@15.ops[5]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[6]: 'store c#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[8]: 'load c#0 from scratch' with 'load c#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[8]: 'load c#0' with 'load c#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[10]: 'store c_bytes#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[12]: 'load c_bytes#0 from scratch' with 'load c_bytes#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[12]: 'load c_bytes#0' with 'load c_bytes#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[17]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[19]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[19]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[22]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[24]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[24]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[29]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[31]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[31]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[34]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[36]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[36]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[2]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[5]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[5]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[1]: 'store c#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[5]: 'load c#0 from scratch' with 'load c#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[5]: 'load c#0' with 'load c#0 from l-stack (no copy)' debug: Inserted main_after_if_else@19.ops[11]: 'store c#0 to l-stack (copy)' -debug: Replaced main_after_if_else@19.ops[41]: 'load c#0 from scratch' with 'load c#0 from l-stack (no copy)' +debug: Replaced main_after_if_else@19.ops[41]: 'load c#0' with 'load c#0 from l-stack (no copy)' debug: Found 11 edge set/s for examples.ssa.contract.MyContract.approval_program debug: examples.ssa.contract.MyContract.approval_program f-stack entry: ['c#0', 'i#0'] debug: examples.ssa.contract.MyContract.approval_program f-stack on first store: ['a#1', 'b#1'] debug: Inserted one_hundred_block@0.ops[7]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced one_hundred_block@0.ops[9]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced one_hundred_block@0.ops[9]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[1]: 'store b#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[2]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[2]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[4]: 'store b#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[7]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[7]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.ssa.contract.one_hundred debug: examples.ssa.contract.one_hundred f-stack entry: [] debug: examples.ssa.contract.one_hundred f-stack on first store: ['a#0', 'b#0'] debug: Inserted phi_in_equiv_class_block@0.ops[3]: 'store x#3 to l-stack (copy)' -debug: Replaced phi_in_equiv_class_block@0.ops[5]: 'load x#3 from scratch' with 'load x#3 from l-stack (no copy)' +debug: Replaced phi_in_equiv_class_block@0.ops[5]: 'load x#3' with 'load x#3 from l-stack (no copy)' debug: Inserted main_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[4]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted one_hundred_block@0.ops[7]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced one_hundred_block@0.ops[9]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced one_hundred_block@0.ops[9]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[1]: 'store b#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[2]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[2]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[4]: 'store b#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[7]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[7]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.ssa.contract.one_hundred debug: examples.ssa.contract.one_hundred f-stack entry: [] debug: examples.ssa.contract.one_hundred f-stack on first store: ['a#0', 'b#0'] -info: Writing /examples/ssa/out/contract.approval.teal -info: Writing /examples/ssa/out/contract.approval.debug.teal -info: Writing /examples/ssa/out/contract.clear.teal -info: Writing /examples/ssa/out/contract.clear.debug.teal +info: Writing ssa/out/contract.approval.teal +info: Writing ssa/out/contract.approval.debug.teal +info: Writing ssa/out/contract.clear.teal +info: Writing ssa/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/ssa/out/contract.approval_unoptimized.debug.teal b/examples/ssa/out/contract.approval_unoptimized.debug.teal index 4cae0e61c1..5a6873020a 100644 --- a/examples/ssa/out/contract.approval_unoptimized.debug.teal +++ b/examples/ssa/out/contract.approval_unoptimized.debug.teal @@ -173,9 +173,9 @@ one_hundred: one_hundred_block@0: int 25 // (𝕡) c#0 | 25 25 File "ssa/contract.py", line 49 dup // store a#0 to l-stack (copy) (𝕡) c#0 | a#0,a#0 a File "ssa/contract.py", line 49 - cover 1 // store a#0 to f-stack (𝕡) c#0 | (𝕗) a#0 | a#0 a File "ssa/contract.py", line 49 + swap // store a#0 to f-stack (𝕡) c#0 | (𝕗) a#0 | a#0 a File "ssa/contract.py", line 49 int 2 // (𝕡) c#0 | (𝕗) a#0 | a#0,2 2 File "ssa/contract.py", line 50 - cover 1 // store b#0 to f-stack (𝕡) c#0 | (𝕗) a#0,b#0 | a#0 b File "ssa/contract.py", line 50 + swap // store b#0 to f-stack (𝕡) c#0 | (𝕗) a#0,b#0 | a#0 b File "ssa/contract.py", line 50 frame_dig -1 // load c#0 from parameters (𝕡) c#0 | (𝕗) a#0,b#0 | a#0,c#0 c: UInt64 File "ssa/contract.py", line 48 < // (𝕡) c#0 | (𝕗) a#0,b#0 | {<} a < c: File "ssa/contract.py", line 51 bz one_hundred_after_if_else@2 // (𝕡) c#0 | (𝕗) a#0,b#0 | if a < c: File "ssa/contract.py", line 51 diff --git a/examples/ssa/out/contract.approval_unoptimized.teal b/examples/ssa/out/contract.approval_unoptimized.teal index ce78270daf..0fb5d4b7ce 100644 --- a/examples/ssa/out/contract.approval_unoptimized.teal +++ b/examples/ssa/out/contract.approval_unoptimized.teal @@ -159,9 +159,9 @@ one_hundred: one_hundred_block@0: int 25 dup - cover 1 + swap int 2 - cover 1 + swap frame_dig -1 < bz one_hundred_after_if_else@2 diff --git a/examples/ssa/out/contract.clear_unoptimized.debug.teal b/examples/ssa/out/contract.clear_unoptimized.debug.teal index 06f88974ac..18273a3f16 100644 --- a/examples/ssa/out/contract.clear_unoptimized.debug.teal +++ b/examples/ssa/out/contract.clear_unoptimized.debug.teal @@ -16,9 +16,9 @@ one_hundred: one_hundred_block@0: int 25 // (𝕡) c#0 | 25 25 File "ssa/contract.py", line 49 dup // store a#0 to l-stack (copy) (𝕡) c#0 | a#0,a#0 a File "ssa/contract.py", line 49 - cover 1 // store a#0 to f-stack (𝕡) c#0 | (𝕗) a#0 | a#0 a File "ssa/contract.py", line 49 + swap // store a#0 to f-stack (𝕡) c#0 | (𝕗) a#0 | a#0 a File "ssa/contract.py", line 49 int 2 // (𝕡) c#0 | (𝕗) a#0 | a#0,2 2 File "ssa/contract.py", line 50 - cover 1 // store b#0 to f-stack (𝕡) c#0 | (𝕗) a#0,b#0 | a#0 b File "ssa/contract.py", line 50 + swap // store b#0 to f-stack (𝕡) c#0 | (𝕗) a#0,b#0 | a#0 b File "ssa/contract.py", line 50 frame_dig -1 // load c#0 from parameters (𝕡) c#0 | (𝕗) a#0,b#0 | a#0,c#0 c: UInt64 File "ssa/contract.py", line 48 < // (𝕡) c#0 | (𝕗) a#0,b#0 | {<} a < c: File "ssa/contract.py", line 51 bz one_hundred_after_if_else@2 // (𝕡) c#0 | (𝕗) a#0,b#0 | if a < c: File "ssa/contract.py", line 51 diff --git a/examples/ssa/out/contract.clear_unoptimized.teal b/examples/ssa/out/contract.clear_unoptimized.teal index ae3a1b0283..5c4f2e323e 100644 --- a/examples/ssa/out/contract.clear_unoptimized.teal +++ b/examples/ssa/out/contract.clear_unoptimized.teal @@ -14,9 +14,9 @@ one_hundred: one_hundred_block@0: int 25 dup - cover 1 + swap int 2 - cover 1 + swap frame_dig -1 < bz one_hundred_after_if_else@2 diff --git a/examples/ssa/out/trace.O0.log b/examples/ssa/out/trace.O0.log index 11ed11a224..2be53515f5 100644 --- a/examples/ssa/out/trace.O0.log +++ b/examples/ssa/out/trace.O0.log @@ -1,134 +1,134 @@ PC Teal Stack 1 -9 byte "" -11 dup , -12 int 1 , , 1 -13 int 2 , , 1, 2 -14 + , , 3 -15 int 4 , , 3, 4 -16 int 5 , , 3, 4, 5 -18 * , , 3, 20 -19 dup , , 3, 20, 20 -20 cover 2 , , 20, 3, 20 -22 * , , 20, 60 -23 dup , , 20, 60, 60 -24 cover 2 , , 60, 20, 60 -26 + , , 60, 80 -27 dig 1 , , 60, 80, 60 -29 int 5 , , 60, 80, 60, 5 -31 < , , 60, 80, 0 -32 bz main_after_while@3 , , 60, 80 -51 int 0 , , 60, 80, 0 -53 bury 3 , 0, 60, 80 -55 dig 2 , 0, 60, 80, 0 -57 int 5 , 0, 60, 80, 0, 5 -59 < , 0, 60, 80, 1 -60 bz main_after_for@7 , 0, 60, 80 -63 dig 2 , 0, 60, 80, 0 -65 dig 1 , 0, 60, 80, 0, 80 -67 dig 3 , 0, 60, 80, 0, 80, 60 -69 dup , 0, 60, 80, 0, 80, 60, 60 -70 cover 2 , 0, 60, 80, 0, 60, 80, 60 -72 + , 0, 60, 80, 0, 60, 140 -73 bury 3 , 0, 60, 140, 0, 60 -75 + , 0, 60, 140, 60 -76 bury 2 , 0, 60, 140 -78 dig 2 , 0, 60, 140, 0 -80 int 1 , 0, 60, 140, 0, 1 -81 + , 0, 60, 140, 1 -82 bury 3 , 1, 60, 140 -84 b main_for_header@4 , 1, 60, 140 -55 dig 2 , 1, 60, 140, 1 -57 int 5 , 1, 60, 140, 1, 5 -59 < , 1, 60, 140, 1 -60 bz main_after_for@7 , 1, 60, 140 -63 dig 2 , 1, 60, 140, 1 -65 dig 1 , 1, 60, 140, 1, 140 -67 dig 3 , 1, 60, 140, 1, 140, 60 -69 dup , 1, 60, 140, 1, 140, 60, 60 -70 cover 2 , 1, 60, 140, 1, 60, 140, 60 -72 + , 1, 60, 140, 1, 60, 200 -73 bury 3 , 1, 60, 200, 1, 60 -75 + , 1, 60, 200, 61 -76 bury 2 , 1, 61, 200 -78 dig 2 , 1, 61, 200, 1 -80 int 1 , 1, 61, 200, 1, 1 -81 + , 1, 61, 200, 2 -82 bury 3 , 2, 61, 200 -84 b main_for_header@4 , 2, 61, 200 -55 dig 2 , 2, 61, 200, 2 -57 int 5 , 2, 61, 200, 2, 5 -59 < , 2, 61, 200, 1 -60 bz main_after_for@7 , 2, 61, 200 -63 dig 2 , 2, 61, 200, 2 -65 dig 1 , 2, 61, 200, 2, 200 -67 dig 3 , 2, 61, 200, 2, 200, 61 -69 dup , 2, 61, 200, 2, 200, 61, 61 -70 cover 2 , 2, 61, 200, 2, 61, 200, 61 -72 + , 2, 61, 200, 2, 61, 261 -73 bury 3 , 2, 61, 261, 2, 61 -75 + , 2, 61, 261, 63 -76 bury 2 , 2, 63, 261 -78 dig 2 , 2, 63, 261, 2 -80 int 1 , 2, 63, 261, 2, 1 -81 + , 2, 63, 261, 3 -82 bury 3 , 3, 63, 261 -84 b main_for_header@4 , 3, 63, 261 -55 dig 2 , 3, 63, 261, 3 -57 int 5 , 3, 63, 261, 3, 5 -59 < , 3, 63, 261, 1 -60 bz main_after_for@7 , 3, 63, 261 -63 dig 2 , 3, 63, 261, 3 -65 dig 1 , 3, 63, 261, 3, 261 -67 dig 3 , 3, 63, 261, 3, 261, 63 -69 dup , 3, 63, 261, 3, 261, 63, 63 -70 cover 2 , 3, 63, 261, 3, 63, 261, 63 -72 + , 3, 63, 261, 3, 63, 324 -73 bury 3 , 3, 63, 324, 3, 63 -75 + , 3, 63, 324, 66 -76 bury 2 , 3, 66, 324 -78 dig 2 , 3, 66, 324, 3 -80 int 1 , 3, 66, 324, 3, 1 -81 + , 3, 66, 324, 4 -82 bury 3 , 4, 66, 324 -84 b main_for_header@4 , 4, 66, 324 -55 dig 2 , 4, 66, 324, 4 -57 int 5 , 4, 66, 324, 4, 5 -59 < , 4, 66, 324, 1 -60 bz main_after_for@7 , 4, 66, 324 -63 dig 2 , 4, 66, 324, 4 -65 dig 1 , 4, 66, 324, 4, 324 -67 dig 3 , 4, 66, 324, 4, 324, 66 -69 dup , 4, 66, 324, 4, 324, 66, 66 -70 cover 2 , 4, 66, 324, 4, 66, 324, 66 -72 + , 4, 66, 324, 4, 66, 390 -73 bury 3 , 4, 66, 390, 4, 66 -75 + , 4, 66, 390, 70 -76 bury 2 , 4, 70, 390 -78 dig 2 , 4, 70, 390, 4 -80 int 1 , 4, 70, 390, 4, 1 -81 + , 4, 70, 390, 5 -82 bury 3 , 5, 70, 390 -84 b main_for_header@4 , 5, 70, 390 -55 dig 2 , 5, 70, 390, 5 -57 int 5 , 5, 70, 390, 5, 5 -59 < , 5, 70, 390, 0 -60 bz main_after_for@7 , 5, 70, 390 -87 dig 1 , 5, 70, 390, 70 -89 dig 1 , 5, 70, 390, 70, 390 -91 < , 5, 70, 390, 1 -92 bz main_else_body@15 , 5, 70, 390 -95 dup , 5, 70, 390, 390 -96 int 2 , 5, 70, 390, 390, 2 -97 < , 5, 70, 390, 0 -98 bz main_else_body@10 , 5, 70, 390 -112 int 2 , 5, 70, 390, 2 -113 dig 2 , 5, 70, 390, 2, 70 -115 * , 5, 70, 390, 140 -116 int 14 , 5, 70, 390, 140, 14 -118 * , 5, 70, 390, 1960 -119 bz main_else_body@12 , 5, 70, 390 -122 int 2 , 5, 70, 390, 2 +9 byte "" 0x +11 dup 0x, 0x +12 int 1 0x, 0x, 1 +13 int 2 0x, 0x, 1, 2 +14 + 0x, 0x, 3 +15 int 4 0x, 0x, 3, 4 +16 int 5 0x, 0x, 3, 4, 5 +18 * 0x, 0x, 3, 20 +19 dup 0x, 0x, 3, 20, 20 +20 cover 2 0x, 0x, 20, 3, 20 +22 * 0x, 0x, 20, 60 +23 dup 0x, 0x, 20, 60, 60 +24 cover 2 0x, 0x, 60, 20, 60 +26 + 0x, 0x, 60, 80 +27 dig 1 0x, 0x, 60, 80, 60 +29 int 5 0x, 0x, 60, 80, 60, 5 +31 < 0x, 0x, 60, 80, 0 +32 bz main_after_while@3 0x, 0x, 60, 80 +51 int 0 0x, 0x, 60, 80, 0 +53 bury 3 0x, 0, 60, 80 +55 dig 2 0x, 0, 60, 80, 0 +57 int 5 0x, 0, 60, 80, 0, 5 +59 < 0x, 0, 60, 80, 1 +60 bz main_after_for@7 0x, 0, 60, 80 +63 dig 2 0x, 0, 60, 80, 0 +65 dig 1 0x, 0, 60, 80, 0, 80 +67 dig 3 0x, 0, 60, 80, 0, 80, 60 +69 dup 0x, 0, 60, 80, 0, 80, 60, 60 +70 cover 2 0x, 0, 60, 80, 0, 60, 80, 60 +72 + 0x, 0, 60, 80, 0, 60, 140 +73 bury 3 0x, 0, 60, 140, 0, 60 +75 + 0x, 0, 60, 140, 60 +76 bury 2 0x, 0, 60, 140 +78 dig 2 0x, 0, 60, 140, 0 +80 int 1 0x, 0, 60, 140, 0, 1 +81 + 0x, 0, 60, 140, 1 +82 bury 3 0x, 1, 60, 140 +84 b main_for_header@4 0x, 1, 60, 140 +55 dig 2 0x, 1, 60, 140, 1 +57 int 5 0x, 1, 60, 140, 1, 5 +59 < 0x, 1, 60, 140, 1 +60 bz main_after_for@7 0x, 1, 60, 140 +63 dig 2 0x, 1, 60, 140, 1 +65 dig 1 0x, 1, 60, 140, 1, 140 +67 dig 3 0x, 1, 60, 140, 1, 140, 60 +69 dup 0x, 1, 60, 140, 1, 140, 60, 60 +70 cover 2 0x, 1, 60, 140, 1, 60, 140, 60 +72 + 0x, 1, 60, 140, 1, 60, 200 +73 bury 3 0x, 1, 60, 200, 1, 60 +75 + 0x, 1, 60, 200, 61 +76 bury 2 0x, 1, 61, 200 +78 dig 2 0x, 1, 61, 200, 1 +80 int 1 0x, 1, 61, 200, 1, 1 +81 + 0x, 1, 61, 200, 2 +82 bury 3 0x, 2, 61, 200 +84 b main_for_header@4 0x, 2, 61, 200 +55 dig 2 0x, 2, 61, 200, 2 +57 int 5 0x, 2, 61, 200, 2, 5 +59 < 0x, 2, 61, 200, 1 +60 bz main_after_for@7 0x, 2, 61, 200 +63 dig 2 0x, 2, 61, 200, 2 +65 dig 1 0x, 2, 61, 200, 2, 200 +67 dig 3 0x, 2, 61, 200, 2, 200, 61 +69 dup 0x, 2, 61, 200, 2, 200, 61, 61 +70 cover 2 0x, 2, 61, 200, 2, 61, 200, 61 +72 + 0x, 2, 61, 200, 2, 61, 261 +73 bury 3 0x, 2, 61, 261, 2, 61 +75 + 0x, 2, 61, 261, 63 +76 bury 2 0x, 2, 63, 261 +78 dig 2 0x, 2, 63, 261, 2 +80 int 1 0x, 2, 63, 261, 2, 1 +81 + 0x, 2, 63, 261, 3 +82 bury 3 0x, 3, 63, 261 +84 b main_for_header@4 0x, 3, 63, 261 +55 dig 2 0x, 3, 63, 261, 3 +57 int 5 0x, 3, 63, 261, 3, 5 +59 < 0x, 3, 63, 261, 1 +60 bz main_after_for@7 0x, 3, 63, 261 +63 dig 2 0x, 3, 63, 261, 3 +65 dig 1 0x, 3, 63, 261, 3, 261 +67 dig 3 0x, 3, 63, 261, 3, 261, 63 +69 dup 0x, 3, 63, 261, 3, 261, 63, 63 +70 cover 2 0x, 3, 63, 261, 3, 63, 261, 63 +72 + 0x, 3, 63, 261, 3, 63, 324 +73 bury 3 0x, 3, 63, 324, 3, 63 +75 + 0x, 3, 63, 324, 66 +76 bury 2 0x, 3, 66, 324 +78 dig 2 0x, 3, 66, 324, 3 +80 int 1 0x, 3, 66, 324, 3, 1 +81 + 0x, 3, 66, 324, 4 +82 bury 3 0x, 4, 66, 324 +84 b main_for_header@4 0x, 4, 66, 324 +55 dig 2 0x, 4, 66, 324, 4 +57 int 5 0x, 4, 66, 324, 4, 5 +59 < 0x, 4, 66, 324, 1 +60 bz main_after_for@7 0x, 4, 66, 324 +63 dig 2 0x, 4, 66, 324, 4 +65 dig 1 0x, 4, 66, 324, 4, 324 +67 dig 3 0x, 4, 66, 324, 4, 324, 66 +69 dup 0x, 4, 66, 324, 4, 324, 66, 66 +70 cover 2 0x, 4, 66, 324, 4, 66, 324, 66 +72 + 0x, 4, 66, 324, 4, 66, 390 +73 bury 3 0x, 4, 66, 390, 4, 66 +75 + 0x, 4, 66, 390, 70 +76 bury 2 0x, 4, 70, 390 +78 dig 2 0x, 4, 70, 390, 4 +80 int 1 0x, 4, 70, 390, 4, 1 +81 + 0x, 4, 70, 390, 5 +82 bury 3 0x, 5, 70, 390 +84 b main_for_header@4 0x, 5, 70, 390 +55 dig 2 0x, 5, 70, 390, 5 +57 int 5 0x, 5, 70, 390, 5, 5 +59 < 0x, 5, 70, 390, 0 +60 bz main_after_for@7 0x, 5, 70, 390 +87 dig 1 0x, 5, 70, 390, 70 +89 dig 1 0x, 5, 70, 390, 70, 390 +91 < 0x, 5, 70, 390, 1 +92 bz main_else_body@15 0x, 5, 70, 390 +95 dup 0x, 5, 70, 390, 390 +96 int 2 0x, 5, 70, 390, 390, 2 +97 < 0x, 5, 70, 390, 0 +98 bz main_else_body@10 0x, 5, 70, 390 +112 int 2 0x, 5, 70, 390, 2 +113 dig 2 0x, 5, 70, 390, 2, 70 +115 * 0x, 5, 70, 390, 140 +116 int 14 0x, 5, 70, 390, 140, 14 +118 * 0x, 5, 70, 390, 1960 +119 bz main_else_body@12 0x, 5, 70, 390 +122 int 2 0x, 5, 70, 390, 2 123 bury 4 2, 5, 70, 390 125 b main_after_if_else@13 2, 5, 70, 390 130 b main_after_if_else@19 2, 5, 70, 390 @@ -138,47 +138,47 @@ PC Teal Stack 185 proto 1 1 2, 5, 70, 390, 2, 2 188 int 25 2, 5, 70, 390, 2, 2, 25 190 dup 2, 5, 70, 390, 2, 2, 25, 25 -191 cover 1 2, 5, 70, 390, 2, 2, 25, 25 -193 int 2 2, 5, 70, 390, 2, 2, 25, 25, 2 -194 cover 1 2, 5, 70, 390, 2, 2, 25, 2, 25 -196 frame_dig -1 2, 5, 70, 390, 2, 2, 25, 2, 25, 2 -198 < 2, 5, 70, 390, 2, 2, 25, 2, 0 -199 bz one_hundred_after_if_else@2 2, 5, 70, 390, 2, 2, 25, 2 -209 frame_dig 1 2, 5, 70, 390, 2, 2, 25, 2, 2 -211 dup 2, 5, 70, 390, 2, 2, 25, 2, 2, 2 -212 * 2, 5, 70, 390, 2, 2, 25, 2, 4 -213 frame_dig 0 2, 5, 70, 390, 2, 2, 25, 2, 4, 25 -215 * 2, 5, 70, 390, 2, 2, 25, 2, 100 -216 frame_bury 0 2, 5, 70, 390, 2, 2, 100, 2 -218 retsub 2, 5, 70, 390, 2, 100 +191 swap 2, 5, 70, 390, 2, 2, 25, 25 +192 int 2 2, 5, 70, 390, 2, 2, 25, 25, 2 +193 swap 2, 5, 70, 390, 2, 2, 25, 2, 25 +194 frame_dig -1 2, 5, 70, 390, 2, 2, 25, 2, 25, 2 +196 < 2, 5, 70, 390, 2, 2, 25, 2, 0 +197 bz one_hundred_after_if_else@2 2, 5, 70, 390, 2, 2, 25, 2 +207 frame_dig 1 2, 5, 70, 390, 2, 2, 25, 2, 2 +209 dup 2, 5, 70, 390, 2, 2, 25, 2, 2, 2 +210 * 2, 5, 70, 390, 2, 2, 25, 2, 4 +211 frame_dig 0 2, 5, 70, 390, 2, 2, 25, 2, 4, 25 +213 * 2, 5, 70, 390, 2, 2, 25, 2, 100 +214 frame_bury 0 2, 5, 70, 390, 2, 2, 100, 2 +216 retsub 2, 5, 70, 390, 2, 100 163 + 2, 5, 70, 390, 102 164 dup 2, 5, 70, 390, 102, 102 -165 itob 2, 5, 70, 390, 102, AAAAAAAAAGY= +165 itob 2, 5, 70, 390, 102, 0x0000000000000066 166 log 2, 5, 70, 390, 102 167 int 3 2, 5, 70, 390, 102, 3 168 int 1 2, 5, 70, 390, 102, 3, 1 169 callsub phi_in_equiv_class 2, 5, 70, 390, 102, 3, 1 -219 proto 2 1 2, 5, 70, 390, 102, 3, 1 -222 frame_dig -1 2, 5, 70, 390, 102, 3, 1, 1 -224 bz phi_in_equiv_class_else_body@2 2, 5, 70, 390, 102, 3, 1 -227 frame_dig -2 2, 5, 70, 390, 102, 3, 1, 3 -229 b phi_in_equiv_class_after_if_else@3 2, 5, 70, 390, 102, 3, 1, 3 -234 int 1 2, 5, 70, 390, 102, 3, 1, 3, 1 -235 + 2, 5, 70, 390, 102, 3, 1, 4 -236 retsub 2, 5, 70, 390, 102, 4 +217 proto 2 1 2, 5, 70, 390, 102, 3, 1 +220 frame_dig -1 2, 5, 70, 390, 102, 3, 1, 1 +222 bz phi_in_equiv_class_else_body@2 2, 5, 70, 390, 102, 3, 1 +225 frame_dig -2 2, 5, 70, 390, 102, 3, 1, 3 +227 b phi_in_equiv_class_after_if_else@3 2, 5, 70, 390, 102, 3, 1, 3 +232 int 1 2, 5, 70, 390, 102, 3, 1, 3, 1 +233 + 2, 5, 70, 390, 102, 3, 1, 4 +234 retsub 2, 5, 70, 390, 102, 4 172 int 4 2, 5, 70, 390, 102, 4, 4 173 == 2, 5, 70, 390, 102, 1 174 assert 2, 5, 70, 390, 102 175 int 3 2, 5, 70, 390, 102, 3 176 int 0 2, 5, 70, 390, 102, 3, 0 178 callsub phi_in_equiv_class 2, 5, 70, 390, 102, 3, 0 -219 proto 2 1 2, 5, 70, 390, 102, 3, 0 -222 frame_dig -1 2, 5, 70, 390, 102, 3, 0, 0 -224 bz phi_in_equiv_class_else_body@2 2, 5, 70, 390, 102, 3, 0 -232 frame_dig -2 2, 5, 70, 390, 102, 3, 0, 3 -234 int 1 2, 5, 70, 390, 102, 3, 0, 3, 1 -235 + 2, 5, 70, 390, 102, 3, 0, 4 -236 retsub 2, 5, 70, 390, 102, 4 +217 proto 2 1 2, 5, 70, 390, 102, 3, 0 +220 frame_dig -1 2, 5, 70, 390, 102, 3, 0, 0 +222 bz phi_in_equiv_class_else_body@2 2, 5, 70, 390, 102, 3, 0 +230 frame_dig -2 2, 5, 70, 390, 102, 3, 0, 3 +232 int 1 2, 5, 70, 390, 102, 3, 0, 3, 1 +233 + 2, 5, 70, 390, 102, 3, 0, 4 +234 retsub 2, 5, 70, 390, 102, 4 181 int 4 2, 5, 70, 390, 102, 4, 4 182 == 2, 5, 70, 390, 102, 1 183 assert 2, 5, 70, 390, 102 diff --git a/examples/ssa/out/trace.O1.log b/examples/ssa/out/trace.O1.log index 495cc8eded..dbb2ff3142 100644 --- a/examples/ssa/out/trace.O1.log +++ b/examples/ssa/out/trace.O1.log @@ -1,129 +1,129 @@ PC Teal Stack 1 -10 byte "" -12 dup , -13 int 60 , , 60 -15 int 80 , , 60, 80 -17 dig 1 , , 60, 80, 60 -19 int 5 , , 60, 80, 60, 5 -20 < , , 60, 80, 0 -21 bz main_after_while@3 , , 60, 80 -40 int 0 , , 60, 80, 0 -42 bury 3 , 0, 60, 80 -44 dig 2 , 0, 60, 80, 0 -46 int 5 , 0, 60, 80, 0, 5 -47 < , 0, 60, 80, 1 -48 bz main_after_for@7 , 0, 60, 80 -51 dup , 0, 60, 80, 80 -52 dig 2 , 0, 60, 80, 80, 60 -54 dup , 0, 60, 80, 80, 60, 60 -55 cover 2 , 0, 60, 80, 60, 80, 60 -57 + , 0, 60, 80, 60, 140 -58 bury 2 , 0, 60, 140, 60 -60 dig 3 , 0, 60, 140, 60, 0 -62 dup , 0, 60, 140, 60, 0, 0 -63 cover 2 , 0, 60, 140, 0, 60, 0 -65 + , 0, 60, 140, 0, 60 -66 bury 3 , 0, 60, 140, 0 -68 int 1 , 0, 60, 140, 0, 1 -69 + , 0, 60, 140, 1 -70 bury 3 , 1, 60, 140 -72 b main_for_header@4 , 1, 60, 140 -44 dig 2 , 1, 60, 140, 1 -46 int 5 , 1, 60, 140, 1, 5 -47 < , 1, 60, 140, 1 -48 bz main_after_for@7 , 1, 60, 140 -51 dup , 1, 60, 140, 140 -52 dig 2 , 1, 60, 140, 140, 60 -54 dup , 1, 60, 140, 140, 60, 60 -55 cover 2 , 1, 60, 140, 60, 140, 60 -57 + , 1, 60, 140, 60, 200 -58 bury 2 , 1, 60, 200, 60 -60 dig 3 , 1, 60, 200, 60, 1 -62 dup , 1, 60, 200, 60, 1, 1 -63 cover 2 , 1, 60, 200, 1, 60, 1 -65 + , 1, 60, 200, 1, 61 -66 bury 3 , 1, 61, 200, 1 -68 int 1 , 1, 61, 200, 1, 1 -69 + , 1, 61, 200, 2 -70 bury 3 , 2, 61, 200 -72 b main_for_header@4 , 2, 61, 200 -44 dig 2 , 2, 61, 200, 2 -46 int 5 , 2, 61, 200, 2, 5 -47 < , 2, 61, 200, 1 -48 bz main_after_for@7 , 2, 61, 200 -51 dup , 2, 61, 200, 200 -52 dig 2 , 2, 61, 200, 200, 61 -54 dup , 2, 61, 200, 200, 61, 61 -55 cover 2 , 2, 61, 200, 61, 200, 61 -57 + , 2, 61, 200, 61, 261 -58 bury 2 , 2, 61, 261, 61 -60 dig 3 , 2, 61, 261, 61, 2 -62 dup , 2, 61, 261, 61, 2, 2 -63 cover 2 , 2, 61, 261, 2, 61, 2 -65 + , 2, 61, 261, 2, 63 -66 bury 3 , 2, 63, 261, 2 -68 int 1 , 2, 63, 261, 2, 1 -69 + , 2, 63, 261, 3 -70 bury 3 , 3, 63, 261 -72 b main_for_header@4 , 3, 63, 261 -44 dig 2 , 3, 63, 261, 3 -46 int 5 , 3, 63, 261, 3, 5 -47 < , 3, 63, 261, 1 -48 bz main_after_for@7 , 3, 63, 261 -51 dup , 3, 63, 261, 261 -52 dig 2 , 3, 63, 261, 261, 63 -54 dup , 3, 63, 261, 261, 63, 63 -55 cover 2 , 3, 63, 261, 63, 261, 63 -57 + , 3, 63, 261, 63, 324 -58 bury 2 , 3, 63, 324, 63 -60 dig 3 , 3, 63, 324, 63, 3 -62 dup , 3, 63, 324, 63, 3, 3 -63 cover 2 , 3, 63, 324, 3, 63, 3 -65 + , 3, 63, 324, 3, 66 -66 bury 3 , 3, 66, 324, 3 -68 int 1 , 3, 66, 324, 3, 1 -69 + , 3, 66, 324, 4 -70 bury 3 , 4, 66, 324 -72 b main_for_header@4 , 4, 66, 324 -44 dig 2 , 4, 66, 324, 4 -46 int 5 , 4, 66, 324, 4, 5 -47 < , 4, 66, 324, 1 -48 bz main_after_for@7 , 4, 66, 324 -51 dup , 4, 66, 324, 324 -52 dig 2 , 4, 66, 324, 324, 66 -54 dup , 4, 66, 324, 324, 66, 66 -55 cover 2 , 4, 66, 324, 66, 324, 66 -57 + , 4, 66, 324, 66, 390 -58 bury 2 , 4, 66, 390, 66 -60 dig 3 , 4, 66, 390, 66, 4 -62 dup , 4, 66, 390, 66, 4, 4 -63 cover 2 , 4, 66, 390, 4, 66, 4 -65 + , 4, 66, 390, 4, 70 -66 bury 3 , 4, 70, 390, 4 -68 int 1 , 4, 70, 390, 4, 1 -69 + , 4, 70, 390, 5 -70 bury 3 , 5, 70, 390 -72 b main_for_header@4 , 5, 70, 390 -44 dig 2 , 5, 70, 390, 5 -46 int 5 , 5, 70, 390, 5, 5 -47 < , 5, 70, 390, 0 -48 bz main_after_for@7 , 5, 70, 390 -75 dig 1 , 5, 70, 390, 70 -77 dig 1 , 5, 70, 390, 70, 390 -79 < , 5, 70, 390, 1 -80 bz main_else_body@15 , 5, 70, 390 -83 dup , 5, 70, 390, 390 -84 int 2 , 5, 70, 390, 390, 2 -85 < , 5, 70, 390, 0 -86 bz main_else_body@10 , 5, 70, 390 -98 int 2 , 5, 70, 390, 2 -99 dig 2 , 5, 70, 390, 2, 70 -101 * , 5, 70, 390, 140 -102 int 14 , 5, 70, 390, 140, 14 -104 * , 5, 70, 390, 1960 -105 bz main_else_body@12 , 5, 70, 390 -108 int 2 , 5, 70, 390, 2 +10 byte "" 0x +12 dup 0x, 0x +13 int 60 0x, 0x, 60 +15 int 80 0x, 0x, 60, 80 +17 dig 1 0x, 0x, 60, 80, 60 +19 int 5 0x, 0x, 60, 80, 60, 5 +20 < 0x, 0x, 60, 80, 0 +21 bz main_after_while@3 0x, 0x, 60, 80 +40 int 0 0x, 0x, 60, 80, 0 +42 bury 3 0x, 0, 60, 80 +44 dig 2 0x, 0, 60, 80, 0 +46 int 5 0x, 0, 60, 80, 0, 5 +47 < 0x, 0, 60, 80, 1 +48 bz main_after_for@7 0x, 0, 60, 80 +51 dup 0x, 0, 60, 80, 80 +52 dig 2 0x, 0, 60, 80, 80, 60 +54 dup 0x, 0, 60, 80, 80, 60, 60 +55 cover 2 0x, 0, 60, 80, 60, 80, 60 +57 + 0x, 0, 60, 80, 60, 140 +58 bury 2 0x, 0, 60, 140, 60 +60 dig 3 0x, 0, 60, 140, 60, 0 +62 dup 0x, 0, 60, 140, 60, 0, 0 +63 cover 2 0x, 0, 60, 140, 0, 60, 0 +65 + 0x, 0, 60, 140, 0, 60 +66 bury 3 0x, 0, 60, 140, 0 +68 int 1 0x, 0, 60, 140, 0, 1 +69 + 0x, 0, 60, 140, 1 +70 bury 3 0x, 1, 60, 140 +72 b main_for_header@4 0x, 1, 60, 140 +44 dig 2 0x, 1, 60, 140, 1 +46 int 5 0x, 1, 60, 140, 1, 5 +47 < 0x, 1, 60, 140, 1 +48 bz main_after_for@7 0x, 1, 60, 140 +51 dup 0x, 1, 60, 140, 140 +52 dig 2 0x, 1, 60, 140, 140, 60 +54 dup 0x, 1, 60, 140, 140, 60, 60 +55 cover 2 0x, 1, 60, 140, 60, 140, 60 +57 + 0x, 1, 60, 140, 60, 200 +58 bury 2 0x, 1, 60, 200, 60 +60 dig 3 0x, 1, 60, 200, 60, 1 +62 dup 0x, 1, 60, 200, 60, 1, 1 +63 cover 2 0x, 1, 60, 200, 1, 60, 1 +65 + 0x, 1, 60, 200, 1, 61 +66 bury 3 0x, 1, 61, 200, 1 +68 int 1 0x, 1, 61, 200, 1, 1 +69 + 0x, 1, 61, 200, 2 +70 bury 3 0x, 2, 61, 200 +72 b main_for_header@4 0x, 2, 61, 200 +44 dig 2 0x, 2, 61, 200, 2 +46 int 5 0x, 2, 61, 200, 2, 5 +47 < 0x, 2, 61, 200, 1 +48 bz main_after_for@7 0x, 2, 61, 200 +51 dup 0x, 2, 61, 200, 200 +52 dig 2 0x, 2, 61, 200, 200, 61 +54 dup 0x, 2, 61, 200, 200, 61, 61 +55 cover 2 0x, 2, 61, 200, 61, 200, 61 +57 + 0x, 2, 61, 200, 61, 261 +58 bury 2 0x, 2, 61, 261, 61 +60 dig 3 0x, 2, 61, 261, 61, 2 +62 dup 0x, 2, 61, 261, 61, 2, 2 +63 cover 2 0x, 2, 61, 261, 2, 61, 2 +65 + 0x, 2, 61, 261, 2, 63 +66 bury 3 0x, 2, 63, 261, 2 +68 int 1 0x, 2, 63, 261, 2, 1 +69 + 0x, 2, 63, 261, 3 +70 bury 3 0x, 3, 63, 261 +72 b main_for_header@4 0x, 3, 63, 261 +44 dig 2 0x, 3, 63, 261, 3 +46 int 5 0x, 3, 63, 261, 3, 5 +47 < 0x, 3, 63, 261, 1 +48 bz main_after_for@7 0x, 3, 63, 261 +51 dup 0x, 3, 63, 261, 261 +52 dig 2 0x, 3, 63, 261, 261, 63 +54 dup 0x, 3, 63, 261, 261, 63, 63 +55 cover 2 0x, 3, 63, 261, 63, 261, 63 +57 + 0x, 3, 63, 261, 63, 324 +58 bury 2 0x, 3, 63, 324, 63 +60 dig 3 0x, 3, 63, 324, 63, 3 +62 dup 0x, 3, 63, 324, 63, 3, 3 +63 cover 2 0x, 3, 63, 324, 3, 63, 3 +65 + 0x, 3, 63, 324, 3, 66 +66 bury 3 0x, 3, 66, 324, 3 +68 int 1 0x, 3, 66, 324, 3, 1 +69 + 0x, 3, 66, 324, 4 +70 bury 3 0x, 4, 66, 324 +72 b main_for_header@4 0x, 4, 66, 324 +44 dig 2 0x, 4, 66, 324, 4 +46 int 5 0x, 4, 66, 324, 4, 5 +47 < 0x, 4, 66, 324, 1 +48 bz main_after_for@7 0x, 4, 66, 324 +51 dup 0x, 4, 66, 324, 324 +52 dig 2 0x, 4, 66, 324, 324, 66 +54 dup 0x, 4, 66, 324, 324, 66, 66 +55 cover 2 0x, 4, 66, 324, 66, 324, 66 +57 + 0x, 4, 66, 324, 66, 390 +58 bury 2 0x, 4, 66, 390, 66 +60 dig 3 0x, 4, 66, 390, 66, 4 +62 dup 0x, 4, 66, 390, 66, 4, 4 +63 cover 2 0x, 4, 66, 390, 4, 66, 4 +65 + 0x, 4, 66, 390, 4, 70 +66 bury 3 0x, 4, 70, 390, 4 +68 int 1 0x, 4, 70, 390, 4, 1 +69 + 0x, 4, 70, 390, 5 +70 bury 3 0x, 5, 70, 390 +72 b main_for_header@4 0x, 5, 70, 390 +44 dig 2 0x, 5, 70, 390, 5 +46 int 5 0x, 5, 70, 390, 5, 5 +47 < 0x, 5, 70, 390, 0 +48 bz main_after_for@7 0x, 5, 70, 390 +75 dig 1 0x, 5, 70, 390, 70 +77 dig 1 0x, 5, 70, 390, 70, 390 +79 < 0x, 5, 70, 390, 1 +80 bz main_else_body@15 0x, 5, 70, 390 +83 dup 0x, 5, 70, 390, 390 +84 int 2 0x, 5, 70, 390, 390, 2 +85 < 0x, 5, 70, 390, 0 +86 bz main_else_body@10 0x, 5, 70, 390 +98 int 2 0x, 5, 70, 390, 2 +99 dig 2 0x, 5, 70, 390, 2, 70 +101 * 0x, 5, 70, 390, 140 +102 int 14 0x, 5, 70, 390, 140, 14 +104 * 0x, 5, 70, 390, 1960 +105 bz main_else_body@12 0x, 5, 70, 390 +108 int 2 0x, 5, 70, 390, 2 109 bury 4 2, 5, 70, 390 111 b main_after_if_else@14 2, 5, 70, 390 116 b main_after_if_else@19 2, 5, 70, 390 @@ -146,7 +146,7 @@ PC Teal Stack 203 retsub 2, 5, 70, 390, 2, 100 149 + 2, 5, 70, 390, 102 150 dup 2, 5, 70, 390, 102, 102 -151 itob 2, 5, 70, 390, 102, AAAAAAAAAGY= +151 itob 2, 5, 70, 390, 102, 0x0000000000000066 152 log 2, 5, 70, 390, 102 153 int 3 2, 5, 70, 390, 102, 3 154 int 1 2, 5, 70, 390, 102, 3, 1 diff --git a/examples/ssa/out/trace.O2.log b/examples/ssa/out/trace.O2.log index 4cedc55f1e..ec8a8e8461 100644 --- a/examples/ssa/out/trace.O2.log +++ b/examples/ssa/out/trace.O2.log @@ -1,13 +1,13 @@ PC Teal Stack 1 -10 byte "" -12 int 60 , 60 -14 int 80 , 60, 80 -16 dig 1 , 60, 80, 60 -18 int 5 , 60, 80, 60, 5 -19 < , 60, 80, 0 -20 bz main_after_while@3 , 60, 80 -39 int 0 , 60, 80, 0 +10 byte "" 0x +12 int 60 0x, 60 +14 int 80 0x, 60, 80 +16 dig 1 0x, 60, 80, 60 +18 int 5 0x, 60, 80, 60, 5 +19 < 0x, 60, 80, 0 +20 bz main_after_while@3 0x, 60, 80 +39 int 0 0x, 60, 80, 0 41 bury 3 0, 60, 80 43 dig 2 0, 60, 80, 0 45 int 5 0, 60, 80, 0, 5 @@ -136,36 +136,36 @@ PC Teal Stack 180 frame_dig -1 5, 2, 390, 2, 2, 25, 2, 25, 2 182 < 5, 2, 390, 2, 2, 25, 2, 0 183 bz one_hundred_after_if_else@2 5, 2, 390, 2, 2, 25, 2 -195 frame_dig 1 5, 2, 390, 2, 2, 25, 2, 2 -197 dup 5, 2, 390, 2, 2, 25, 2, 2, 2 -198 * 5, 2, 390, 2, 2, 25, 2, 4 -199 frame_dig 0 5, 2, 390, 2, 2, 25, 2, 4, 25 -201 * 5, 2, 390, 2, 2, 25, 2, 100 -202 frame_bury 0 5, 2, 390, 2, 2, 100, 2 -204 retsub 5, 2, 390, 2, 100 +194 frame_dig 1 5, 2, 390, 2, 2, 25, 2, 2 +196 dup 5, 2, 390, 2, 2, 25, 2, 2, 2 +197 * 5, 2, 390, 2, 2, 25, 2, 4 +198 frame_dig 0 5, 2, 390, 2, 2, 25, 2, 4, 25 +200 * 5, 2, 390, 2, 2, 25, 2, 100 +201 frame_bury 0 5, 2, 390, 2, 2, 100, 2 +203 retsub 5, 2, 390, 2, 100 148 + 5, 2, 390, 102 149 dup 5, 2, 390, 102, 102 -150 itob 5, 2, 390, 102, AAAAAAAAAGY= +150 itob 5, 2, 390, 102, 0x0000000000000066 151 log 5, 2, 390, 102 152 int 3 5, 2, 390, 102, 3 153 int 1 5, 2, 390, 102, 3, 1 154 callsub phi_in_equiv_class 5, 2, 390, 102, 3, 1 -205 proto 2 1 5, 2, 390, 102, 3, 1 -208 frame_dig -2 5, 2, 390, 102, 3, 1, 3 -210 int 1 5, 2, 390, 102, 3, 1, 3, 1 -211 + 5, 2, 390, 102, 3, 1, 4 -212 retsub 5, 2, 390, 102, 4 +204 proto 2 1 5, 2, 390, 102, 3, 1 +207 frame_dig -2 5, 2, 390, 102, 3, 1, 3 +209 int 1 5, 2, 390, 102, 3, 1, 3, 1 +210 + 5, 2, 390, 102, 3, 1, 4 +211 retsub 5, 2, 390, 102, 4 157 int 4 5, 2, 390, 102, 4, 4 159 == 5, 2, 390, 102, 1 160 assert 5, 2, 390, 102 161 int 3 5, 2, 390, 102, 3 162 int 0 5, 2, 390, 102, 3, 0 164 callsub phi_in_equiv_class 5, 2, 390, 102, 3, 0 -205 proto 2 1 5, 2, 390, 102, 3, 0 -208 frame_dig -2 5, 2, 390, 102, 3, 0, 3 -210 int 1 5, 2, 390, 102, 3, 0, 3, 1 -211 + 5, 2, 390, 102, 3, 0, 4 -212 retsub 5, 2, 390, 102, 4 +204 proto 2 1 5, 2, 390, 102, 3, 0 +207 frame_dig -2 5, 2, 390, 102, 3, 0, 3 +209 int 1 5, 2, 390, 102, 3, 0, 3, 1 +210 + 5, 2, 390, 102, 3, 0, 4 +211 retsub 5, 2, 390, 102, 4 167 int 4 5, 2, 390, 102, 4, 4 169 == 5, 2, 390, 102, 1 170 assert 5, 2, 390, 102 diff --git a/examples/ssa2/algopy.log b/examples/ssa2/algopy.log index d9ab30f960..3b91d3050a 100644 --- a/examples/ssa2/algopy.log +++ b/examples/ssa2/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 ssa2 -info: Building AWST for __init__.py -info: Building AWST for ssa2/__init__.py -info: Building AWST for ssa2/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug ssa2 +debug: Building AWST for __init__.py +debug: Building AWST for ssa2/__init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for ssa2/contract.py debug: Sealing block@0: // L42 debug: Terminated block@0: // L42 debug: Sealing block@None: // if_body_L45 @@ -51,6 +52,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: range_item%0#1, i#0 debug: Replacing {range_item%0#1} with i#0 made 3 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -63,6 +65,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -73,6 +76,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -84,6 +88,7 @@ debug: Optimizing subroutine examples.ssa2.contract.MyContract.approval_program debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -93,6 +98,7 @@ debug: Optimizing subroutine examples.ssa2.contract.MyContract.clear_state_progr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -102,6 +108,7 @@ debug: Optimizing subroutine examples.ssa2.contract.one_hundred debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -200,35 +207,35 @@ debug: Coalescing b#0 with [b#6, b#1, b#2, b#3] debug: Coalescing resulted in 17 replacement/s debug: Output IR to /examples/ssa2/out/contract_MyContract.final.ir debug: Inserted main_block@0.ops[5]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[7]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[7]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted main_for_header@1.ops[3]: 'store continue_looping%1#0 to l-stack (copy)' -debug: Replaced main_for_header@1.ops[5]: 'load continue_looping%1#0 from scratch' with 'load continue_looping%1#0 from l-stack (no copy)' +debug: Replaced main_for_header@1.ops[5]: 'load continue_looping%1#0' with 'load continue_looping%1#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[11]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[13]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[13]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[2]: 'store a#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[5]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[5]: 'load a#0' with 'load a#0 from l-stack (no copy)' debug: Inserted main_for_body@2.ops[7]: 'store i#0 to l-stack (copy)' -debug: Replaced main_for_body@2.ops[10]: 'load i#0 from scratch' with 'load i#0 from l-stack (no copy)' +debug: Replaced main_for_body@2.ops[10]: 'load i#0' with 'load i#0 from l-stack (no copy)' debug: Inserted main_after_for@4.ops[3]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_after_for@4.ops[5]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_after_for@4.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.ssa2.contract.MyContract.approval_program debug: examples.ssa2.contract.MyContract.approval_program f-stack entry: [] debug: examples.ssa2.contract.MyContract.approval_program f-stack on first store: ['a#0', 'b#0', 'i#0'] debug: Inserted main_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[4]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted one_hundred_block@0.ops[7]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced one_hundred_block@0.ops[9]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced one_hundred_block@0.ops[9]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[1]: 'store b#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[2]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[2]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted one_hundred_after_if_else@2.ops[4]: 'store b#0 to l-stack (copy)' -debug: Replaced one_hundred_after_if_else@2.ops[7]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced one_hundred_after_if_else@2.ops[7]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.ssa2.contract.one_hundred debug: examples.ssa2.contract.one_hundred f-stack entry: [] debug: examples.ssa2.contract.one_hundred f-stack on first store: ['a#0', 'b#0'] -info: Writing /examples/ssa2/out/contract.approval.teal -info: Writing /examples/ssa2/out/contract.approval.debug.teal -info: Writing /examples/ssa2/out/contract.clear.teal -info: Writing /examples/ssa2/out/contract.clear.debug.teal +info: Writing ssa2/out/contract.approval.teal +info: Writing ssa2/out/contract.approval.debug.teal +info: Writing ssa2/out/contract.clear.teal +info: Writing ssa2/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/ssa2/out/contract.clear_unoptimized.debug.teal b/examples/ssa2/out/contract.clear_unoptimized.debug.teal index 986bb86b85..f3bf816f88 100644 --- a/examples/ssa2/out/contract.clear_unoptimized.debug.teal +++ b/examples/ssa2/out/contract.clear_unoptimized.debug.teal @@ -16,9 +16,9 @@ one_hundred: one_hundred_block@0: int 25 // (𝕡) c#0 | 25 25 File "ssa2/contract.py", line 43 dup // store a#0 to l-stack (copy) (𝕡) c#0 | a#0,a#0 a File "ssa2/contract.py", line 43 - cover 1 // store a#0 to f-stack (𝕡) c#0 | (𝕗) a#0 | a#0 a File "ssa2/contract.py", line 43 + swap // store a#0 to f-stack (𝕡) c#0 | (𝕗) a#0 | a#0 a File "ssa2/contract.py", line 43 int 2 // (𝕡) c#0 | (𝕗) a#0 | a#0,2 2 File "ssa2/contract.py", line 44 - cover 1 // store b#0 to f-stack (𝕡) c#0 | (𝕗) a#0,b#0 | a#0 b File "ssa2/contract.py", line 44 + swap // store b#0 to f-stack (𝕡) c#0 | (𝕗) a#0,b#0 | a#0 b File "ssa2/contract.py", line 44 frame_dig -1 // load c#0 from parameters (𝕡) c#0 | (𝕗) a#0,b#0 | a#0,c#0 c: UInt64 File "ssa2/contract.py", line 42 < // (𝕡) c#0 | (𝕗) a#0,b#0 | {<} a < c: File "ssa2/contract.py", line 45 bz one_hundred_after_if_else@2 // (𝕡) c#0 | (𝕗) a#0,b#0 | if a < c: File "ssa2/contract.py", line 45 diff --git a/examples/ssa2/out/contract.clear_unoptimized.teal b/examples/ssa2/out/contract.clear_unoptimized.teal index 911e1cb75a..a87c3cb848 100644 --- a/examples/ssa2/out/contract.clear_unoptimized.teal +++ b/examples/ssa2/out/contract.clear_unoptimized.teal @@ -14,9 +14,9 @@ one_hundred: one_hundred_block@0: int 25 dup - cover 1 + swap int 2 - cover 1 + swap frame_dig -1 < bz one_hundred_after_if_else@2 diff --git a/examples/string_ops/algopy.log b/examples/string_ops/algopy.log index 279f0547ff..3d398d76d8 100644 --- a/examples/string_ops/algopy.log +++ b/examples/string_ops/algopy.log @@ -1,40 +1,41 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 string_ops -info: Building AWST for __init__.py -info: Building AWST for string_ops -info: Building AWST for string_ops/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug string_ops +debug: Building AWST for __init__.py +debug: Building AWST for string_ops +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for string_ops/contract.py debug: Sealing block@0: // L20 debug: Terminated block@0: // L20 -debug: Looking for 'search_start%3' in an unsealed block creating an incomplete Phi: block@1: // substr_header_L21 -debug: Created Phi assignment: let search_start%3#1: uint64 = undefined while trying to resolve 'search_start%3' in block@1: // substr_header_L21 -debug: Looking for 'len_item%2' in an unsealed block creating an incomplete Phi: block@1: // substr_header_L21 -debug: Created Phi assignment: let len_item%2#1: uint64 = undefined while trying to resolve 'len_item%2' in block@1: // substr_header_L21 -debug: Terminated block@1: // substr_header_L21 -debug: Sealing block@2: // substr_body_L21 -debug: Terminated block@2: // substr_body_L21 -debug: Looking for 'search_start%3' in an unsealed block creating an incomplete Phi: block@3: // substr_footer_L21 -debug: Created Phi assignment: let search_start%3#2: uint64 = undefined while trying to resolve 'search_start%3' in block@3: // substr_footer_L21 -debug: Terminated block@3: // substr_footer_L21 -debug: Sealing block@3: // substr_footer_L21 -debug: Added search_start%3#1 to Phi node: let search_start%3#2: uint64 = φ(search_start%3#1 <- block@2) in block@2: // substr_body_L21 -debug: Replacing trivial Phi node: let search_start%3#2: uint64 = φ(search_start%3#1 <- block@2) (search_start%3#2) with search_start%3#1 -debug: Deleting Phi assignment: let search_start%3#2: uint64 = φ(search_start%3#1 <- block@2) -debug: Replaced trivial Phi node: let search_start%3#2: uint64 = φ(search_start%3#1 <- block@2) (search_start%3#2) with search_start%3#1 in current definition for 0 blocks -debug: Sealing block@1: // substr_header_L21 -debug: Added search_start%3#0 to Phi node: let search_start%3#1: uint64 = φ(search_start%3#0 <- block@0) in block@0: // L20 -debug: Added search_start%3#3 to Phi node: let search_start%3#1: uint64 = φ(search_start%3#0 <- block@0, search_start%3#3 <- block@3) in block@3: // substr_footer_L21 -debug: Added len_item%2#0 to Phi node: let len_item%2#1: uint64 = φ(len_item%2#0 <- block@0) in block@0: // L20 -debug: Added len_item%2#1 to Phi node: let len_item%2#1: uint64 = φ(len_item%2#0 <- block@0, len_item%2#1 <- block@3) in block@3: // substr_footer_L21 -debug: Replacing trivial Phi node: let len_item%2#1: uint64 = φ(len_item%2#0 <- block@0, len_item%2#1 <- block@3) (len_item%2#1) with len_item%2#0 -debug: Deleting Phi assignment: let len_item%2#1: uint64 = φ(len_item%2#0 <- block@0, len_item%2#1 <- block@3) -debug: Replaced trivial Phi node: let len_item%2#1: uint64 = φ(len_item%2#0 <- block@0, len_item%2#1 <- block@3) (len_item%2#1) with len_item%2#0 in current definition for 3 blocks -debug: Sealing block@4: // substr_after_L21 -debug: Created Phi assignment: let found%0#2: uint64 = undefined while trying to resolve 'found%0' in block@4: // substr_after_L21 -debug: Created Phi assignment: let found%0#3: uint64 = undefined while trying to resolve 'found%0' in block@1: // substr_header_L21 -debug: Added found%0#0 to Phi node: let found%0#3: uint64 = φ(found%0#0 <- block@0) in block@0: // L20 -debug: Added found%0#1 to Phi node: let found%0#3: uint64 = φ(found%0#0 <- block@0, found%0#1 <- block@3) in block@3: // substr_footer_L21 -debug: Added found%0#3 to Phi node: let found%0#2: uint64 = φ(found%0#3 <- block@1) in block@1: // substr_header_L21 -debug: Added found%0#1 to Phi node: let found%0#2: uint64 = φ(found%0#3 <- block@1, found%0#1 <- block@2) in block@2: // substr_body_L21 -debug: Terminated block@4: // substr_after_L21 +debug: Sealing block@0: // L36 +debug: Terminated block@0: // L36 +debug: Looking for 'start' in an unsealed block creating an incomplete Phi: block@1: // while_top_L42 +debug: Created Phi assignment: let start#1: uint64 = undefined while trying to resolve 'start' in block@1: // while_top_L42 +debug: Looking for 'item' in an unsealed block creating an incomplete Phi: block@1: // while_top_L42 +debug: Created Phi assignment: let item#1: bytes = undefined while trying to resolve 'item' in block@1: // while_top_L42 +debug: Looking for 'sequence' in an unsealed block creating an incomplete Phi: block@1: // while_top_L42 +debug: Created Phi assignment: let sequence#1: bytes = undefined while trying to resolve 'sequence' in block@1: // while_top_L42 +debug: Terminated block@1: // while_top_L42 +debug: Sealing block@None: // while_body_L42 +debug: Terminated block@2: // while_body_L42 +debug: Sealing block@None: // if_body_L43 +debug: Sealing block@None: // else_body_L43 +debug: Terminated block@3: // if_body_L43 +debug: Sealing block@4: // after_if_else_L43 +debug: Terminated block@4: // after_if_else_L43 +debug: Sealing block@1: // while_top_L42 +debug: Added start#0 to Phi node: let start#1: uint64 = φ(start#0 <- block@0) in block@0: // L36 +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_L43 +debug: Added item#0 to Phi node: let item#1: bytes = φ(item#0 <- block@0) in block@0: // L36 +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_L43 +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: // L36 +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_L43 +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_L42 +debug: Terminated block@5: // after_while_L42 debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L15 @@ -47,6 +48,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -57,6 +59,18 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine algopy.is_substring +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -67,6 +81,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -76,72 +91,56 @@ debug: No optimizations performed in pass 1, ending loop debug: Output IR to /examples/string_ops/out/contract_MyContract.cssa.ir debug: Removing Phis from examples.string_ops.contract.MyContract.approval_program debug: Removing Phis from examples.string_ops.contract.is_in_str +debug: Removing Phis from algopy.is_substring debug: Removing Phis from examples.string_ops.contract.MyContract.clear_state_program debug: Output IR to /examples/string_ops/out/contract_MyContract.post_ssa.ir debug: Sequentializing parallel copies in examples.string_ops.contract.MyContract.approval_program debug: Sequentializing parallel copies in examples.string_ops.contract.is_in_str -debug: loc: {found%0#6=None, search_start%3#6=None, found%0#0=found%0#0, search_start%3#0=search_start%3#0} -debug: pred: {found%0#6=found%0#0, search_start%3#6=search_start%3#0} -debug: ready: found%0#6, search_start%3#6 -debug: to_do: found%0#6, search_start%3#6 -debug: * avail search_start%3#6 -debug: * avail search_start%3#0 -debug: * avail found%0#6 -debug: * avail found%0#0 -debug: * to_do search_start%3#6 -debug: * to_do found%0#6 -debug: loc: {found%0#3=None, search_start%3#1=None, found%0#6=found%0#6, search_start%3#6=search_start%3#6} -debug: pred: {found%0#3=found%0#6, search_start%3#1=search_start%3#6} -debug: ready: found%0#3, search_start%3#1 -debug: to_do: found%0#3, search_start%3#1 -debug: * avail search_start%3#1 -debug: * avail search_start%3#6 -debug: * avail found%0#3 -debug: * avail found%0#6 -debug: * to_do search_start%3#1 -debug: * to_do found%0#3 -debug: loc: {found%0#6=None, search_start%3#6=None, found%0#1=found%0#1, search_start%3#3=search_start%3#3} -debug: pred: {found%0#6=found%0#1, search_start%3#6=search_start%3#3} -debug: ready: found%0#6, search_start%3#6 -debug: to_do: found%0#6, search_start%3#6 -debug: * avail search_start%3#6 -debug: * avail search_start%3#3 -debug: * avail found%0#6 -debug: * avail found%0#1 -debug: * to_do search_start%3#6 -debug: * to_do found%0#6 +debug: Sequentializing parallel copies in algopy.is_substring debug: Sequentializing parallel copies in examples.string_ops.contract.MyContract.clear_state_program debug: Output IR to /examples/string_ops/out/contract_MyContract.parallel_copies.ir debug: Coalescing local variables in examples.string_ops.contract.MyContract.approval_program using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in examples.string_ops.contract.is_in_str using strategy RootOperandGrouping -debug: Coalescing found%0#0 with [found%0#6, found%0#3, found%0#9, found%0#2] -debug: Coalescing search_start%3#0 with [search_start%3#6, search_start%3#1, search_start%3#3] -debug: Coalescing resulted in 19 replacement/s +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in algopy.is_substring using strategy RootOperandGrouping +debug: Coalescing start#0 with [start#5, start#1, start#2] +debug: Coalescing resulted in 10 replacement/s debug: Coalescing local variables in examples.string_ops.contract.MyContract.clear_state_program using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/string_ops/out/contract_MyContract.final.ir debug: Inserted main_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[12]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[14]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[16]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -debug: Inserted is_in_str_substr_header@1.ops[3]: 'store search_end%4#0 to l-stack (copy)' -debug: Replaced is_in_str_substr_header@1.ops[5]: 'load search_end%4#0 from scratch' with 'load search_end%4#0 from l-stack (no copy)' -debug: Inserted is_in_str_substr_header@1.ops[8]: 'store cant_find%5#0 to l-stack (copy)' -debug: Replaced is_in_str_substr_header@1.ops[10]: 'load cant_find%5#0 from scratch' with 'load cant_find%5#0 from l-stack (no copy)' -debug: Inserted is_in_str_substr_body@2.ops[4]: 'store substr%6#0 to l-stack (copy)' -debug: Replaced is_in_str_substr_body@2.ops[6]: 'load substr%6#0 from scratch' with 'load substr%6#0 from l-stack (no copy)' -debug: Inserted is_in_str_substr_body@2.ops[9]: 'store found%0#1 to l-stack (copy)' -debug: Replaced is_in_str_substr_body@2.ops[11]: 'load found%0#1 from scratch' with 'load found%0#1 from l-stack (no copy)' -debug: Inserted is_in_str_substr_body@2.ops[12]: 'store found%0#1 to l-stack (copy)' -debug: Replaced is_in_str_substr_body@2.ops[14]: 'load found%0#1 from scratch' with 'load found%0#1 from l-stack (no copy)' -debug: Found 2 edge set/s for examples.string_ops.contract.is_in_str -debug: examples.string_ops.contract.is_in_str f-stack entry: ['found%0#1', 'search_end%4#0'] -debug: examples.string_ops.contract.is_in_str f-stack on first store: ['found%0#0', 'len_sequence%1#0', 'len_item%2#0', 'search_start%3#0'] -info: Writing /examples/string_ops/out/contract.approval.teal -info: Writing /examples/string_ops/out/contract.approval.debug.teal -info: Writing /examples/string_ops/out/contract.clear.teal -info: Writing /examples/string_ops/out/contract.clear.debug.teal +debug: Replaced main_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted is_in_str_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced is_in_str_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted is_substring_while_top@1.ops[13]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced is_substring_while_top@1.ops[15]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted is_substring_while_top@1.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced is_substring_while_top@1.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted is_substring_while_top@1.ops[10]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced is_substring_while_top@1.ops[13]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted is_substring_while_top@1.ops[7]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced is_substring_while_top@1.ops[13]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted is_substring_while_body@2.ops[15]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced is_substring_while_body@2.ops[17]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted is_substring_while_body@2.ops[2]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced is_substring_while_body@2.ops[5]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted is_substring_while_body@2.ops[12]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced is_substring_while_body@2.ops[15]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted is_substring_while_body@2.ops[7]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced is_substring_while_body@2.ops[11]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted is_substring_while_body@2.ops[5]: 'store start#0 to l-stack (copy)' +debug: Replaced is_substring_while_body@2.ops[11]: 'load start#0' with 'load start#0 from l-stack (no copy)' +debug: Found 3 edge set/s for algopy.is_substring +debug: algopy.is_substring f-stack entry: [] +debug: algopy.is_substring f-stack on first store: ['start#0'] +debug: Simplified uncover 2; uncover 2 to cover 2 +info: Writing string_ops/out/contract.approval.teal +info: Writing string_ops/out/contract.approval.debug.teal +info: Writing string_ops/out/contract.clear.teal +info: Writing string_ops/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/string_ops/out/contract.approval.debug.teal b/examples/string_ops/out/contract.approval.debug.teal index 48771228ca..4fc208d9ad 100644 --- a/examples/string_ops/out/contract.approval.debug.teal +++ b/examples/string_ops/out/contract.approval.debug.teal @@ -1,73 +1,81 @@ -// Op // Op Description Stack (out) Source code Source line +// Op // Op Description Stack (out) Source code Source line #pragma version 8 // examples.string_ops.contract.MyContract.approval_program() -> uint64: main_block@0: - byte "brown fox" // "brown fox" b"brown fox" File "string_ops/contract.py", line 7 - byte "The quick brown fox jumped over the lazy dog" // "brown fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 7 - callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 6 - assert // assert is_in_str( File "string_ops/contract.py", line 6 - byte "red fox" // "red fox" b"red fox" File "string_ops/contract.py", line 10 - byte "The quick brown fox jumped over the lazy dog" // "red fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 10 - callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 9 - ! // {!} not is_in_str( File "string_ops/contract.py", line 9 - assert // assert not is_in_str( File "string_ops/contract.py", line 9 - int 1 // 1 True File "string_ops/contract.py", line 13 - return // return True File "string_ops/contract.py", line 13 + byte "brown fox" // "brown fox" b"brown fox" File "string_ops/contract.py", line 7 + byte "The quick brown fox jumped over the lazy dog" // "brown fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 7 + callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 6 + assert // assert is_in_str( File "string_ops/contract.py", line 6 + byte "red fox" // "red fox" b"red fox" File "string_ops/contract.py", line 10 + byte "The quick brown fox jumped over the lazy dog" // "red fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 10 + callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 9 + ! // {!} not is_in_str( File "string_ops/contract.py", line 9 + assert // assert not is_in_str( File "string_ops/contract.py", line 9 + int 1 // 1 True File "string_ops/contract.py", line 13 + return // return True File "string_ops/contract.py", line 13 // examples.string_ops.contract.is_in_str(a#0: bytes, b#0: bytes) -> uint64: is_in_str: - proto 2 1 // (𝕡) a#0,b#0 | def is_in_str(a: Bytes, b: Bytes) -> bool: File "string_ops/contract.py", line 20 - byte "" - dup // allocate 2 to stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0 | + proto 2 1 // (𝕡) a#0,b#0 | def is_in_str(a: Bytes, b: Bytes) -> bool: File "string_ops/contract.py", line 20 is_in_str_block@0: - int 0 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0 | 0 a in b File "string_ops/contract.py", line 21 - frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0 | b#0 b: Bytes File "string_ops/contract.py", line 20 - len // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0 | {len} a in b File "string_ops/contract.py", line 21 - frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0 | a#0 a: Bytes File "string_ops/contract.py", line 20 - len // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0 | {len} a in b File "string_ops/contract.py", line 21 - int 0 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0 | 0 a in b File "string_ops/contract.py", line 21 - // Implicit fall through to is_in_str_substr_header@1 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | + frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | a#0 a: Bytes File "string_ops/contract.py", line 20 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | a#0,b#0 b: Bytes File "string_ops/contract.py", line 20 + callsub is_substring // (𝕡) a#0,b#0 | {is_substring} a in b File "string_ops/contract.py", line 21 + retsub // tmp%0#0 return a in b File "string_ops/contract.py", line 21 -is_in_str_substr_header@1: - frame_dig 5 // load search_start%3#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0 a in b File "string_ops/contract.py", line 21 - frame_dig 4 // load len_item%2#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0,len_item%2#0 a in b File "string_ops/contract.py", line 21 - + // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {+} a in b File "string_ops/contract.py", line 21 - dup // store search_end%4#0 to l-stack (copy) (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_end%4#0,search_end%4#0 a in b File "string_ops/contract.py", line 21 - frame_bury 1 // store search_end%4#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_end%4#0 a in b File "string_ops/contract.py", line 21 - frame_dig 3 // load len_sequence%1#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_end%4#0,len_sequence%1#0 a in b File "string_ops/contract.py", line 21 - > // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {>} a in b File "string_ops/contract.py", line 21 - bnz is_in_str_substr_after@4 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - // Implicit fall through to is_in_str_substr_body@2 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 -is_in_str_substr_body@2: - frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | b#0 b: Bytes File "string_ops/contract.py", line 20 - frame_dig 5 // load search_start%3#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | b#0,search_start%3#0 a in b File "string_ops/contract.py", line 21 - frame_dig 1 // load search_end%4#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | b#0,search_start%3#0,search_end%4#0 a in b File "string_ops/contract.py", line 21 - substring3 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {substring3} a in b File "string_ops/contract.py", line 21 - frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | substr%6#0,a#0 a: Bytes File "string_ops/contract.py", line 20 - == // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {==} a in b File "string_ops/contract.py", line 21 - dup // store found%0#1 to l-stack (copy) (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1,found%0#1 a in b File "string_ops/contract.py", line 21 - frame_bury 0 // store found%0#1 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1 a in b File "string_ops/contract.py", line 21 - dup // load found%0#1 from l-stack (copy) (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1,found%0#1 a in b File "string_ops/contract.py", line 21 - frame_bury 2 // store found%0#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1 a in b File "string_ops/contract.py", line 21 - bnz is_in_str_substr_after@4 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - // Implicit fall through to is_in_str_substr_footer@3 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 +// algopy.is_substring(item#0: bytes, sequence#0: bytes) -> uint64: +is_substring: + proto 2 1 // (𝕡) item#0,sequence#0 | File "/algopy.py", line 36 -is_in_str_substr_footer@3: - frame_dig 5 // load search_start%3#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0 a in b File "string_ops/contract.py", line 21 - int 1 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0,1 a in b File "string_ops/contract.py", line 21 - + // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {+} a in b File "string_ops/contract.py", line 21 - frame_bury 5 // store search_start%3#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - frame_dig 0 // load found%0#1 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1 a in b File "string_ops/contract.py", line 21 - frame_bury 2 // store found%0#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - b is_in_str_substr_header@1 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | +is_substring_block@0: + int 0 // (𝕡) item#0,sequence#0 | 0 File "/algopy.py", line 41 + // Implicit fall through to is_substring_while_top@1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | -is_in_str_substr_after@4: - frame_dig 2 // load found%0#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#0 a in b File "string_ops/contract.py", line 21 - frame_bury 0 - retsub // found%0#0 return a in b File "string_ops/contract.py", line 21 +is_substring_while_top@1: + frame_dig -2 // load item#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | item#0 File "/algopy.py", line 36 + len // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {len} File "/algopy.py", line 42 + frame_dig 0 // load start#0 from f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%0#0,start#0 File "/algopy.py", line 41 + + // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {+} File "/algopy.py", line 42 + frame_dig -1 // load sequence#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%1#0,sequence#0 File "/algopy.py", line 36 + len // (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%1#0,{len} File "/algopy.py", line 42 + <= // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {<=} File "/algopy.py", line 42 + bz is_substring_after_while@5 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 42 + // Implicit fall through to is_substring_while_body@2 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 42 + +is_substring_while_body@2: + frame_dig -2 // load item#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | item#0 File "/algopy.py", line 36 + len // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {len} File "/algopy.py", line 43 + frame_dig 0 // load start#0 from f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%4#0,start#0 File "/algopy.py", line 41 + dup + cover 2 // store start#0 to l-stack (copy) (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,tmp%4#0,start#0 File "/algopy.py", line 41 + + // (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,{+} File "/algopy.py", line 43 + frame_dig -1 // load sequence#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,tmp%5#0,sequence#0 File "/algopy.py", line 36 + cover 2 // virtual: 2 ops (𝕡) item#0,sequence#0 | (𝕗) start#0 | sequence#0,start#0,tmp%5#0 File "/algopy.py", line 41 + substring3 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {substring3} File "/algopy.py", line 43 + frame_dig -2 // load item#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%6#0,item#0 File "/algopy.py", line 36 + == // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {==} File "/algopy.py", line 43 + bz is_substring_after_if_else@4 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 43 + // Implicit fall through to is_substring_if_body@3 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 43 + +is_substring_if_body@3: + int 1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | 1 File "/algopy.py", line 44 + swap + retsub // 1 File "/algopy.py", line 44 + +is_substring_after_if_else@4: + frame_dig 0 // load start#0 from f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0 File "/algopy.py", line 41 + int 1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,1 File "/algopy.py", line 45 + + // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {+} File "/algopy.py", line 45 + frame_bury 0 // store start#0 to f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 41 + b is_substring_while_top@1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | + +is_substring_after_while@5: + int 0 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | 0 File "/algopy.py", line 46 + swap + retsub // 0 File "/algopy.py", line 46 diff --git a/examples/string_ops/out/contract.approval.teal b/examples/string_ops/out/contract.approval.teal index 5ff74e882b..96f78c25d0 100644 --- a/examples/string_ops/out/contract.approval.teal +++ b/examples/string_ops/out/contract.approval.teal @@ -18,51 +18,59 @@ main_block@0: // examples.string_ops.contract.is_in_str(a#0: bytes, b#0: bytes) -> uint64: is_in_str: proto 2 1 - byte "" - dup is_in_str_block@0: + frame_dig -2 + frame_dig -1 + callsub is_substring + retsub + + +// algopy.is_substring(item#0: bytes, sequence#0: bytes) -> uint64: +is_substring: + proto 2 1 + +is_substring_block@0: int 0 + +is_substring_while_top@1: + frame_dig -2 + len + frame_dig 0 + + frame_dig -1 len + <= + bz is_substring_after_while@5 + +is_substring_while_body@2: frame_dig -2 len - int 0 - -is_in_str_substr_header@1: - frame_dig 5 - frame_dig 4 - + + frame_dig 0 dup - frame_bury 1 - frame_dig 3 - > - bnz is_in_str_substr_after@4 - -is_in_str_substr_body@2: + cover 2 + + frame_dig -1 - frame_dig 5 - frame_dig 1 + cover 2 substring3 frame_dig -2 == - dup - frame_bury 0 - dup - frame_bury 2 - bnz is_in_str_substr_after@4 + bz is_substring_after_if_else@4 -is_in_str_substr_footer@3: - frame_dig 5 +is_substring_if_body@3: int 1 - + - frame_bury 5 - frame_dig 0 - frame_bury 2 - b is_in_str_substr_header@1 + swap + retsub -is_in_str_substr_after@4: - frame_dig 2 +is_substring_after_if_else@4: + frame_dig 0 + int 1 + + frame_bury 0 + b is_substring_while_top@1 + +is_substring_after_while@5: + int 0 + swap retsub diff --git a/examples/string_ops/out/contract.approval_unoptimized.debug.teal b/examples/string_ops/out/contract.approval_unoptimized.debug.teal index 48771228ca..4fc208d9ad 100644 --- a/examples/string_ops/out/contract.approval_unoptimized.debug.teal +++ b/examples/string_ops/out/contract.approval_unoptimized.debug.teal @@ -1,73 +1,81 @@ -// Op // Op Description Stack (out) Source code Source line +// Op // Op Description Stack (out) Source code Source line #pragma version 8 // examples.string_ops.contract.MyContract.approval_program() -> uint64: main_block@0: - byte "brown fox" // "brown fox" b"brown fox" File "string_ops/contract.py", line 7 - byte "The quick brown fox jumped over the lazy dog" // "brown fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 7 - callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 6 - assert // assert is_in_str( File "string_ops/contract.py", line 6 - byte "red fox" // "red fox" b"red fox" File "string_ops/contract.py", line 10 - byte "The quick brown fox jumped over the lazy dog" // "red fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 10 - callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 9 - ! // {!} not is_in_str( File "string_ops/contract.py", line 9 - assert // assert not is_in_str( File "string_ops/contract.py", line 9 - int 1 // 1 True File "string_ops/contract.py", line 13 - return // return True File "string_ops/contract.py", line 13 + byte "brown fox" // "brown fox" b"brown fox" File "string_ops/contract.py", line 7 + byte "The quick brown fox jumped over the lazy dog" // "brown fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 7 + callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 6 + assert // assert is_in_str( File "string_ops/contract.py", line 6 + byte "red fox" // "red fox" b"red fox" File "string_ops/contract.py", line 10 + byte "The quick brown fox jumped over the lazy dog" // "red fox","The quick brown fox jumped over the lazy dog" b"The quick brown fox jumped over the lazy dog" File "string_ops/contract.py", line 10 + callsub is_in_str // {is_in_str} is_in_str( File "string_ops/contract.py", line 9 + ! // {!} not is_in_str( File "string_ops/contract.py", line 9 + assert // assert not is_in_str( File "string_ops/contract.py", line 9 + int 1 // 1 True File "string_ops/contract.py", line 13 + return // return True File "string_ops/contract.py", line 13 // examples.string_ops.contract.is_in_str(a#0: bytes, b#0: bytes) -> uint64: is_in_str: - proto 2 1 // (𝕡) a#0,b#0 | def is_in_str(a: Bytes, b: Bytes) -> bool: File "string_ops/contract.py", line 20 - byte "" - dup // allocate 2 to stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0 | + proto 2 1 // (𝕡) a#0,b#0 | def is_in_str(a: Bytes, b: Bytes) -> bool: File "string_ops/contract.py", line 20 is_in_str_block@0: - int 0 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0 | 0 a in b File "string_ops/contract.py", line 21 - frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0 | b#0 b: Bytes File "string_ops/contract.py", line 20 - len // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0 | {len} a in b File "string_ops/contract.py", line 21 - frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0 | a#0 a: Bytes File "string_ops/contract.py", line 20 - len // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0 | {len} a in b File "string_ops/contract.py", line 21 - int 0 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0 | 0 a in b File "string_ops/contract.py", line 21 - // Implicit fall through to is_in_str_substr_header@1 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | + frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | a#0 a: Bytes File "string_ops/contract.py", line 20 + frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | a#0,b#0 b: Bytes File "string_ops/contract.py", line 20 + callsub is_substring // (𝕡) a#0,b#0 | {is_substring} a in b File "string_ops/contract.py", line 21 + retsub // tmp%0#0 return a in b File "string_ops/contract.py", line 21 -is_in_str_substr_header@1: - frame_dig 5 // load search_start%3#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0 a in b File "string_ops/contract.py", line 21 - frame_dig 4 // load len_item%2#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0,len_item%2#0 a in b File "string_ops/contract.py", line 21 - + // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {+} a in b File "string_ops/contract.py", line 21 - dup // store search_end%4#0 to l-stack (copy) (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_end%4#0,search_end%4#0 a in b File "string_ops/contract.py", line 21 - frame_bury 1 // store search_end%4#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_end%4#0 a in b File "string_ops/contract.py", line 21 - frame_dig 3 // load len_sequence%1#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_end%4#0,len_sequence%1#0 a in b File "string_ops/contract.py", line 21 - > // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {>} a in b File "string_ops/contract.py", line 21 - bnz is_in_str_substr_after@4 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - // Implicit fall through to is_in_str_substr_body@2 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 -is_in_str_substr_body@2: - frame_dig -1 // load b#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | b#0 b: Bytes File "string_ops/contract.py", line 20 - frame_dig 5 // load search_start%3#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | b#0,search_start%3#0 a in b File "string_ops/contract.py", line 21 - frame_dig 1 // load search_end%4#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | b#0,search_start%3#0,search_end%4#0 a in b File "string_ops/contract.py", line 21 - substring3 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {substring3} a in b File "string_ops/contract.py", line 21 - frame_dig -2 // load a#0 from parameters (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | substr%6#0,a#0 a: Bytes File "string_ops/contract.py", line 20 - == // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {==} a in b File "string_ops/contract.py", line 21 - dup // store found%0#1 to l-stack (copy) (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1,found%0#1 a in b File "string_ops/contract.py", line 21 - frame_bury 0 // store found%0#1 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1 a in b File "string_ops/contract.py", line 21 - dup // load found%0#1 from l-stack (copy) (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1,found%0#1 a in b File "string_ops/contract.py", line 21 - frame_bury 2 // store found%0#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1 a in b File "string_ops/contract.py", line 21 - bnz is_in_str_substr_after@4 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - // Implicit fall through to is_in_str_substr_footer@3 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 +// algopy.is_substring(item#0: bytes, sequence#0: bytes) -> uint64: +is_substring: + proto 2 1 // (𝕡) item#0,sequence#0 | File "/algopy.py", line 36 -is_in_str_substr_footer@3: - frame_dig 5 // load search_start%3#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0 a in b File "string_ops/contract.py", line 21 - int 1 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | search_start%3#0,1 a in b File "string_ops/contract.py", line 21 - + // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | {+} a in b File "string_ops/contract.py", line 21 - frame_bury 5 // store search_start%3#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - frame_dig 0 // load found%0#1 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#1 a in b File "string_ops/contract.py", line 21 - frame_bury 2 // store found%0#0 to f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | a in b File "string_ops/contract.py", line 21 - b is_in_str_substr_header@1 // (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | +is_substring_block@0: + int 0 // (𝕡) item#0,sequence#0 | 0 File "/algopy.py", line 41 + // Implicit fall through to is_substring_while_top@1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | -is_in_str_substr_after@4: - frame_dig 2 // load found%0#0 from f-stack (𝕡) a#0,b#0 | (𝕗) found%0#1,search_end%4#0,found%0#0,len_sequence%1#0,len_item%2#0,search_start%3#0 | found%0#0 a in b File "string_ops/contract.py", line 21 - frame_bury 0 - retsub // found%0#0 return a in b File "string_ops/contract.py", line 21 +is_substring_while_top@1: + frame_dig -2 // load item#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | item#0 File "/algopy.py", line 36 + len // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {len} File "/algopy.py", line 42 + frame_dig 0 // load start#0 from f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%0#0,start#0 File "/algopy.py", line 41 + + // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {+} File "/algopy.py", line 42 + frame_dig -1 // load sequence#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%1#0,sequence#0 File "/algopy.py", line 36 + len // (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%1#0,{len} File "/algopy.py", line 42 + <= // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {<=} File "/algopy.py", line 42 + bz is_substring_after_while@5 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 42 + // Implicit fall through to is_substring_while_body@2 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 42 + +is_substring_while_body@2: + frame_dig -2 // load item#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | item#0 File "/algopy.py", line 36 + len // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {len} File "/algopy.py", line 43 + frame_dig 0 // load start#0 from f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%4#0,start#0 File "/algopy.py", line 41 + dup + cover 2 // store start#0 to l-stack (copy) (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,tmp%4#0,start#0 File "/algopy.py", line 41 + + // (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,{+} File "/algopy.py", line 43 + frame_dig -1 // load sequence#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,tmp%5#0,sequence#0 File "/algopy.py", line 36 + cover 2 // virtual: 2 ops (𝕡) item#0,sequence#0 | (𝕗) start#0 | sequence#0,start#0,tmp%5#0 File "/algopy.py", line 41 + substring3 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {substring3} File "/algopy.py", line 43 + frame_dig -2 // load item#0 from parameters (𝕡) item#0,sequence#0 | (𝕗) start#0 | tmp%6#0,item#0 File "/algopy.py", line 36 + == // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {==} File "/algopy.py", line 43 + bz is_substring_after_if_else@4 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 43 + // Implicit fall through to is_substring_if_body@3 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 43 + +is_substring_if_body@3: + int 1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | 1 File "/algopy.py", line 44 + swap + retsub // 1 File "/algopy.py", line 44 + +is_substring_after_if_else@4: + frame_dig 0 // load start#0 from f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0 File "/algopy.py", line 41 + int 1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | start#0,1 File "/algopy.py", line 45 + + // (𝕡) item#0,sequence#0 | (𝕗) start#0 | {+} File "/algopy.py", line 45 + frame_bury 0 // store start#0 to f-stack (𝕡) item#0,sequence#0 | (𝕗) start#0 | File "/algopy.py", line 41 + b is_substring_while_top@1 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | + +is_substring_after_while@5: + int 0 // (𝕡) item#0,sequence#0 | (𝕗) start#0 | 0 File "/algopy.py", line 46 + swap + retsub // 0 File "/algopy.py", line 46 diff --git a/examples/string_ops/out/contract.approval_unoptimized.teal b/examples/string_ops/out/contract.approval_unoptimized.teal index 5ff74e882b..96f78c25d0 100644 --- a/examples/string_ops/out/contract.approval_unoptimized.teal +++ b/examples/string_ops/out/contract.approval_unoptimized.teal @@ -18,51 +18,59 @@ main_block@0: // examples.string_ops.contract.is_in_str(a#0: bytes, b#0: bytes) -> uint64: is_in_str: proto 2 1 - byte "" - dup is_in_str_block@0: + frame_dig -2 + frame_dig -1 + callsub is_substring + retsub + + +// algopy.is_substring(item#0: bytes, sequence#0: bytes) -> uint64: +is_substring: + proto 2 1 + +is_substring_block@0: int 0 + +is_substring_while_top@1: + frame_dig -2 + len + frame_dig 0 + + frame_dig -1 len + <= + bz is_substring_after_while@5 + +is_substring_while_body@2: frame_dig -2 len - int 0 - -is_in_str_substr_header@1: - frame_dig 5 - frame_dig 4 - + + frame_dig 0 dup - frame_bury 1 - frame_dig 3 - > - bnz is_in_str_substr_after@4 - -is_in_str_substr_body@2: + cover 2 + + frame_dig -1 - frame_dig 5 - frame_dig 1 + cover 2 substring3 frame_dig -2 == - dup - frame_bury 0 - dup - frame_bury 2 - bnz is_in_str_substr_after@4 + bz is_substring_after_if_else@4 -is_in_str_substr_footer@3: - frame_dig 5 +is_substring_if_body@3: int 1 - + - frame_bury 5 - frame_dig 0 - frame_bury 2 - b is_in_str_substr_header@1 + swap + retsub -is_in_str_substr_after@4: - frame_dig 2 +is_substring_after_if_else@4: + frame_dig 0 + int 1 + + frame_bury 0 + b is_substring_while_top@1 + +is_substring_after_while@5: + int 0 + swap retsub diff --git a/examples/string_ops/out/contract.awst b/examples/string_ops/out/contract.awst index 2ebed562e9..0d8c834dd6 100644 --- a/examples/string_ops/out/contract.awst +++ b/examples/string_ops/out/contract.awst @@ -15,5 +15,5 @@ contract MyContract subroutine is_in_str(a: algopy.Bytes, b: algopy.Bytes): bool { - return a in b + return algopy::is_substring(a, b) } \ No newline at end of file diff --git a/examples/string_ops/out/contract_MyContract.cssa.ir b/examples/string_ops/out/contract_MyContract.cssa.ir index 8cc9d04a40..3f1cb90a1d 100644 --- a/examples/string_ops/out/contract_MyContract.cssa.ir +++ b/examples/string_ops/out/contract_MyContract.cssa.ir @@ -11,33 +11,36 @@ contract examples.string_ops.contract.MyContract: subroutine examples.string_ops.contract.is_in_str(a: bytes, b: bytes) -> uint64: block@0: // L20 - let found%0#0: uint64 = 0u - let len_sequence%1#0: uint64 = (len b#0) - let len_item%2#0: uint64 = (len a#0) - let search_start%3#0: uint64 = 0u - let (found%0#4: uint64, search_start%3#4: uint64) = (found%0#0, search_start%3#0) + let tmp%0#0: uint64 = algopy.is_substring(a#0, b#0) + return tmp%0#0 + + subroutine algopy.is_substring(item: bytes, sequence: bytes) -> uint64: + block@0: // L36 + let start#0: uint64 = 0u + let start#3: uint64 = start#0 goto block@1 - block@1: // substr_header_L21 - let search_start%3#6: uint64 = φ(search_start%3#4 <- block@0, search_start%3#5 <- block@3) - let found%0#6: uint64 = φ(found%0#4 <- block@0, found%0#5 <- block@3) - let (found%0#3: uint64, search_start%3#1: uint64) = (found%0#6, search_start%3#6) - let search_end%4#0: uint64 = (+ search_start%3#1 len_item%2#0) - let cant_find%5#0: uint64 = (> search_end%4#0 len_sequence%1#0) - let found%0#7: uint64 = found%0#3 - goto cant_find%5#0 ? block@4 : block@2 - block@2: // substr_body_L21 - let substr%6#0: bytes = (substring3 b#0 search_start%3#1 search_end%4#0) - let found%0#1: uint64 = (== substr%6#0 a#0) - let found%0#8: uint64 = found%0#1 - goto found%0#1 ? block@4 : block@3 - block@3: // substr_footer_L21 - let search_start%3#3: uint64 = (+ search_start%3#1 1u) - let (found%0#5: uint64, search_start%3#5: uint64) = (found%0#1, search_start%3#3) + block@1: // while_top_L42 + let start#5: uint64 = φ(start#3 <- block@0, start#4 <- block@4) + let start#1: uint64 = start#5 + let tmp%0#0: uint64 = (len item#0) + let tmp%1#0: uint64 = (+ start#1 tmp%0#0) + let tmp%2#0: uint64 = (len sequence#0) + let tmp%3#0: uint64 = (<= tmp%1#0 tmp%2#0) + goto tmp%3#0 ? block@2 : block@5 + block@2: // while_body_L42 + let tmp%4#0: uint64 = (len item#0) + let tmp%5#0: uint64 = (+ start#1 tmp%4#0) + let tmp%6#0: bytes = (substring3 sequence#0 start#1 tmp%5#0) + let tmp%7#0: uint64 = (== item#0 tmp%6#0) + goto tmp%7#0 ? block@3 : block@4 + block@3: // if_body_L43 + return 1u + block@4: // after_if_else_L43 + let start#2: uint64 = (+ start#1 1u) + let start#4: uint64 = start#2 goto block@1 - block@4: // substr_after_L21 - let found%0#9: uint64 = φ(found%0#7 <- block@1, found%0#8 <- block@2) - let found%0#2: uint64 = found%0#9 - return found%0#2 + block@5: // after_while_L42 + return 0u program clear-state: subroutine examples.string_ops.contract.MyContract.clear_state_program() -> uint64: diff --git a/examples/string_ops/out/contract_MyContract.final.ir b/examples/string_ops/out/contract_MyContract.final.ir index 949ade2712..bbb563410f 100644 --- a/examples/string_ops/out/contract_MyContract.final.ir +++ b/examples/string_ops/out/contract_MyContract.final.ir @@ -11,26 +11,32 @@ contract examples.string_ops.contract.MyContract: subroutine examples.string_ops.contract.is_in_str(a: bytes, b: bytes) -> uint64: block@0: // L20 - let found%0#0: uint64 = 0u - let len_sequence%1#0: uint64 = (len b#0) - let len_item%2#0: uint64 = (len a#0) - let search_start%3#0: uint64 = 0u + let tmp%0#0: uint64 = algopy.is_substring(a#0, b#0) + return tmp%0#0 + + subroutine algopy.is_substring(item: bytes, sequence: bytes) -> uint64: + block@0: // L36 + let start#0: uint64 = 0u goto block@1 - block@1: // substr_header_L21 - let search_end%4#0: uint64 = (+ search_start%3#0 len_item%2#0) - let cant_find%5#0: uint64 = (> search_end%4#0 len_sequence%1#0) - goto cant_find%5#0 ? block@4 : block@2 - block@2: // substr_body_L21 - let substr%6#0: bytes = (substring3 b#0 search_start%3#0 search_end%4#0) - let found%0#1: uint64 = (== substr%6#0 a#0) - let found%0#0: uint64 = found%0#1 - goto found%0#1 ? block@4 : block@3 - block@3: // substr_footer_L21 - let search_start%3#0: uint64 = (+ search_start%3#0 1u) - let found%0#0: uint64 = found%0#1 + block@1: // while_top_L42 + let tmp%0#0: uint64 = (len item#0) + let tmp%1#0: uint64 = (+ start#0 tmp%0#0) + let tmp%2#0: uint64 = (len sequence#0) + let tmp%3#0: uint64 = (<= tmp%1#0 tmp%2#0) + goto tmp%3#0 ? block@2 : block@5 + block@2: // while_body_L42 + let tmp%4#0: uint64 = (len item#0) + let tmp%5#0: uint64 = (+ start#0 tmp%4#0) + let tmp%6#0: bytes = (substring3 sequence#0 start#0 tmp%5#0) + let tmp%7#0: uint64 = (== item#0 tmp%6#0) + goto tmp%7#0 ? block@3 : block@4 + block@3: // if_body_L43 + return 1u + block@4: // after_if_else_L43 + let start#0: uint64 = (+ start#0 1u) goto block@1 - block@4: // substr_after_L21 - return found%0#0 + block@5: // after_while_L42 + return 0u program clear-state: subroutine examples.string_ops.contract.MyContract.clear_state_program() -> uint64: diff --git a/examples/string_ops/out/contract_MyContract.final_unoptimized.ir b/examples/string_ops/out/contract_MyContract.final_unoptimized.ir index 949ade2712..bbb563410f 100644 --- a/examples/string_ops/out/contract_MyContract.final_unoptimized.ir +++ b/examples/string_ops/out/contract_MyContract.final_unoptimized.ir @@ -11,26 +11,32 @@ contract examples.string_ops.contract.MyContract: subroutine examples.string_ops.contract.is_in_str(a: bytes, b: bytes) -> uint64: block@0: // L20 - let found%0#0: uint64 = 0u - let len_sequence%1#0: uint64 = (len b#0) - let len_item%2#0: uint64 = (len a#0) - let search_start%3#0: uint64 = 0u + let tmp%0#0: uint64 = algopy.is_substring(a#0, b#0) + return tmp%0#0 + + subroutine algopy.is_substring(item: bytes, sequence: bytes) -> uint64: + block@0: // L36 + let start#0: uint64 = 0u goto block@1 - block@1: // substr_header_L21 - let search_end%4#0: uint64 = (+ search_start%3#0 len_item%2#0) - let cant_find%5#0: uint64 = (> search_end%4#0 len_sequence%1#0) - goto cant_find%5#0 ? block@4 : block@2 - block@2: // substr_body_L21 - let substr%6#0: bytes = (substring3 b#0 search_start%3#0 search_end%4#0) - let found%0#1: uint64 = (== substr%6#0 a#0) - let found%0#0: uint64 = found%0#1 - goto found%0#1 ? block@4 : block@3 - block@3: // substr_footer_L21 - let search_start%3#0: uint64 = (+ search_start%3#0 1u) - let found%0#0: uint64 = found%0#1 + block@1: // while_top_L42 + let tmp%0#0: uint64 = (len item#0) + let tmp%1#0: uint64 = (+ start#0 tmp%0#0) + let tmp%2#0: uint64 = (len sequence#0) + let tmp%3#0: uint64 = (<= tmp%1#0 tmp%2#0) + goto tmp%3#0 ? block@2 : block@5 + block@2: // while_body_L42 + let tmp%4#0: uint64 = (len item#0) + let tmp%5#0: uint64 = (+ start#0 tmp%4#0) + let tmp%6#0: bytes = (substring3 sequence#0 start#0 tmp%5#0) + let tmp%7#0: uint64 = (== item#0 tmp%6#0) + goto tmp%7#0 ? block@3 : block@4 + block@3: // if_body_L43 + return 1u + block@4: // after_if_else_L43 + let start#0: uint64 = (+ start#0 1u) goto block@1 - block@4: // substr_after_L21 - return found%0#0 + block@5: // after_while_L42 + return 0u program clear-state: subroutine examples.string_ops.contract.MyContract.clear_state_program() -> uint64: diff --git a/examples/string_ops/out/contract_MyContract.parallel_copies.ir b/examples/string_ops/out/contract_MyContract.parallel_copies.ir index a497fda4df..df5640b4c1 100644 --- a/examples/string_ops/out/contract_MyContract.parallel_copies.ir +++ b/examples/string_ops/out/contract_MyContract.parallel_copies.ir @@ -11,33 +11,35 @@ contract examples.string_ops.contract.MyContract: subroutine examples.string_ops.contract.is_in_str(a: bytes, b: bytes) -> uint64: block@0: // L20 - let found%0#0: uint64 = 0u - let len_sequence%1#0: uint64 = (len b#0) - let len_item%2#0: uint64 = (len a#0) - let search_start%3#0: uint64 = 0u - let search_start%3#6: uint64 = search_start%3#0 - let found%0#6: uint64 = found%0#0 + let tmp%0#0: uint64 = algopy.is_substring(a#0, b#0) + return tmp%0#0 + + subroutine algopy.is_substring(item: bytes, sequence: bytes) -> uint64: + block@0: // L36 + let start#0: uint64 = 0u + let start#5: uint64 = start#0 goto block@1 - block@1: // substr_header_L21 - let search_start%3#1: uint64 = search_start%3#6 - let found%0#3: uint64 = found%0#6 - let search_end%4#0: uint64 = (+ search_start%3#1 len_item%2#0) - let cant_find%5#0: uint64 = (> search_end%4#0 len_sequence%1#0) - let found%0#9: uint64 = found%0#3 - goto cant_find%5#0 ? block@4 : block@2 - block@2: // substr_body_L21 - let substr%6#0: bytes = (substring3 b#0 search_start%3#1 search_end%4#0) - let found%0#1: uint64 = (== substr%6#0 a#0) - let found%0#9: uint64 = found%0#1 - goto found%0#1 ? block@4 : block@3 - block@3: // substr_footer_L21 - let search_start%3#3: uint64 = (+ search_start%3#1 1u) - let search_start%3#6: uint64 = search_start%3#3 - let found%0#6: uint64 = found%0#1 + block@1: // while_top_L42 + let start#1: uint64 = start#5 + let tmp%0#0: uint64 = (len item#0) + let tmp%1#0: uint64 = (+ start#1 tmp%0#0) + let tmp%2#0: uint64 = (len sequence#0) + let tmp%3#0: uint64 = (<= tmp%1#0 tmp%2#0) + goto tmp%3#0 ? block@2 : block@5 + block@2: // while_body_L42 + let tmp%4#0: uint64 = (len item#0) + let tmp%5#0: uint64 = (+ start#1 tmp%4#0) + let tmp%6#0: bytes = (substring3 sequence#0 start#1 tmp%5#0) + let tmp%7#0: uint64 = (== item#0 tmp%6#0) + goto tmp%7#0 ? block@3 : block@4 + block@3: // if_body_L43 + return 1u + block@4: // after_if_else_L43 + let start#2: uint64 = (+ start#1 1u) + let start#5: uint64 = start#2 goto block@1 - block@4: // substr_after_L21 - let found%0#2: uint64 = found%0#9 - return found%0#2 + block@5: // after_while_L42 + return 0u program clear-state: subroutine examples.string_ops.contract.MyContract.clear_state_program() -> uint64: diff --git a/examples/string_ops/out/contract_MyContract.post_ssa.ir b/examples/string_ops/out/contract_MyContract.post_ssa.ir index 74caa55c2e..df5640b4c1 100644 --- a/examples/string_ops/out/contract_MyContract.post_ssa.ir +++ b/examples/string_ops/out/contract_MyContract.post_ssa.ir @@ -11,30 +11,35 @@ contract examples.string_ops.contract.MyContract: subroutine examples.string_ops.contract.is_in_str(a: bytes, b: bytes) -> uint64: block@0: // L20 - let found%0#0: uint64 = 0u - let len_sequence%1#0: uint64 = (len b#0) - let len_item%2#0: uint64 = (len a#0) - let search_start%3#0: uint64 = 0u - let (found%0#6: uint64, search_start%3#6: uint64) = (found%0#0, search_start%3#0) + let tmp%0#0: uint64 = algopy.is_substring(a#0, b#0) + return tmp%0#0 + + subroutine algopy.is_substring(item: bytes, sequence: bytes) -> uint64: + block@0: // L36 + let start#0: uint64 = 0u + let start#5: uint64 = start#0 goto block@1 - block@1: // substr_header_L21 - let (found%0#3: uint64, search_start%3#1: uint64) = (found%0#6, search_start%3#6) - let search_end%4#0: uint64 = (+ search_start%3#1 len_item%2#0) - let cant_find%5#0: uint64 = (> search_end%4#0 len_sequence%1#0) - let found%0#9: uint64 = found%0#3 - goto cant_find%5#0 ? block@4 : block@2 - block@2: // substr_body_L21 - let substr%6#0: bytes = (substring3 b#0 search_start%3#1 search_end%4#0) - let found%0#1: uint64 = (== substr%6#0 a#0) - let found%0#9: uint64 = found%0#1 - goto found%0#1 ? block@4 : block@3 - block@3: // substr_footer_L21 - let search_start%3#3: uint64 = (+ search_start%3#1 1u) - let (found%0#6: uint64, search_start%3#6: uint64) = (found%0#1, search_start%3#3) + block@1: // while_top_L42 + let start#1: uint64 = start#5 + let tmp%0#0: uint64 = (len item#0) + let tmp%1#0: uint64 = (+ start#1 tmp%0#0) + let tmp%2#0: uint64 = (len sequence#0) + let tmp%3#0: uint64 = (<= tmp%1#0 tmp%2#0) + goto tmp%3#0 ? block@2 : block@5 + block@2: // while_body_L42 + let tmp%4#0: uint64 = (len item#0) + let tmp%5#0: uint64 = (+ start#1 tmp%4#0) + let tmp%6#0: bytes = (substring3 sequence#0 start#1 tmp%5#0) + let tmp%7#0: uint64 = (== item#0 tmp%6#0) + goto tmp%7#0 ? block@3 : block@4 + block@3: // if_body_L43 + return 1u + block@4: // after_if_else_L43 + let start#2: uint64 = (+ start#1 1u) + let start#5: uint64 = start#2 goto block@1 - block@4: // substr_after_L21 - let found%0#2: uint64 = found%0#9 - return found%0#2 + block@5: // after_while_L42 + return 0u program clear-state: subroutine examples.string_ops.contract.MyContract.clear_state_program() -> uint64: diff --git a/examples/string_ops/out/contract_MyContract.ssa.ir b/examples/string_ops/out/contract_MyContract.ssa.ir index 67e537530a..6a698582fd 100644 --- a/examples/string_ops/out/contract_MyContract.ssa.ir +++ b/examples/string_ops/out/contract_MyContract.ssa.ir @@ -11,27 +11,33 @@ contract examples.string_ops.contract.MyContract: subroutine examples.string_ops.contract.is_in_str(a: bytes, b: bytes) -> uint64: block@0: // L20 - let found%0#0: uint64 = 0u - let len_sequence%1#0: uint64 = (len b#0) - let len_item%2#0: uint64 = (len a#0) - let search_start%3#0: uint64 = 0u + let tmp%0#0: uint64 = algopy.is_substring(a#0, b#0) + return tmp%0#0 + + subroutine algopy.is_substring(item: bytes, sequence: bytes) -> uint64: + block@0: // L36 + let start#0: uint64 = 0u goto block@1 - block@1: // substr_header_L21 - let search_start%3#1: uint64 = φ(search_start%3#0 <- block@0, search_start%3#3 <- block@3) - let found%0#3: uint64 = φ(found%0#0 <- block@0, found%0#1 <- block@3) - let search_end%4#0: uint64 = (+ search_start%3#1 len_item%2#0) - let cant_find%5#0: uint64 = (> search_end%4#0 len_sequence%1#0) - goto cant_find%5#0 ? block@4 : block@2 - block@2: // substr_body_L21 - let substr%6#0: bytes = (substring3 b#0 search_start%3#1 search_end%4#0) - let found%0#1: uint64 = (== substr%6#0 a#0) - goto found%0#1 ? block@4 : block@3 - block@3: // substr_footer_L21 - let search_start%3#3: uint64 = (+ search_start%3#1 1u) + block@1: // while_top_L42 + let start#1: uint64 = φ(start#0 <- block@0, start#2 <- block@4) + let tmp%0#0: uint64 = (len item#0) + let tmp%1#0: uint64 = (+ start#1 tmp%0#0) + let tmp%2#0: uint64 = (len sequence#0) + let tmp%3#0: uint64 = (<= tmp%1#0 tmp%2#0) + goto tmp%3#0 ? block@2 : block@5 + block@2: // while_body_L42 + let tmp%4#0: uint64 = (len item#0) + let tmp%5#0: uint64 = (+ start#1 tmp%4#0) + let tmp%6#0: bytes = (substring3 sequence#0 start#1 tmp%5#0) + let tmp%7#0: uint64 = (== item#0 tmp%6#0) + goto tmp%7#0 ? block@3 : block@4 + block@3: // if_body_L43 + return 1u + block@4: // after_if_else_L43 + let start#2: uint64 = (+ start#1 1u) goto block@1 - block@4: // substr_after_L21 - let found%0#2: uint64 = φ(found%0#3 <- block@1, found%0#1 <- block@2) - return found%0#2 + block@5: // after_while_L42 + return 0u program clear-state: subroutine examples.string_ops.contract.MyContract.clear_state_program() -> uint64: diff --git a/examples/stubs/algopy.log b/examples/stubs/algopy.log index 9ed30f9e01..dcd23cf000 100644 --- a/examples/stubs/algopy.log +++ b/examples/stubs/algopy.log @@ -1,9 +1,10 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 stubs -info: Building AWST for __init__.py -info: Building AWST for stubs -info: Building AWST for stubs/uint64.py -info: Building AWST for stubs/bytes.py -info: Building AWST for stubs/biguint.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug stubs +debug: Building AWST for __init__.py +debug: Building AWST for stubs +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for stubs/uint64.py +debug: Building AWST for stubs/bytes.py +debug: Building AWST for stubs/biguint.py debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@None: // ternary_true_L55 @@ -316,191 +317,335 @@ debug: Sealing block@0: // L78 debug: Terminated block@0: // L78 debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 +debug: Sealing block@None: // ternary_true_L26 +debug: Sealing block@None: // ternary_false_L26 +debug: Terminated block@1: // ternary_true_L26 +debug: Terminated block@2: // ternary_false_L26 +debug: Sealing block@3: // ternary_merge_L26 +debug: Created Phi assignment: let ternary_result%13#2: uint64 = undefined while trying to resolve 'ternary_result%13' in block@3: // ternary_merge_L26 +debug: Added ternary_result%13#0 to Phi node: let ternary_result%13#2: uint64 = φ(ternary_result%13#0 <- block@1) in block@1: // ternary_true_L26 +debug: Added ternary_result%13#1 to Phi node: let ternary_result%13#2: uint64 = φ(ternary_result%13#0 <- block@1, ternary_result%13#1 <- block@2) in block@2: // ternary_false_L26 +debug: Created Phi assignment: let abc#1: bytes = undefined while trying to resolve 'abc' in block@3: // ternary_merge_L26 +debug: Added abc#0 to Phi node: let abc#1: bytes = φ(abc#0 <- block@1) in block@1: // ternary_true_L26 +debug: Added abc#0 to Phi node: let abc#1: bytes = φ(abc#0 <- block@1, abc#0 <- block@2) in block@2: // ternary_false_L26 +debug: Replacing trivial Phi node: let abc#1: bytes = φ(abc#0 <- block@1, abc#0 <- block@2) (abc#1) with abc#0 +debug: Deleting Phi assignment: let abc#1: bytes = φ(abc#0 <- block@1, abc#0 <- block@2) +debug: Replaced trivial Phi node: let abc#1: bytes = φ(abc#0 <- block@1, abc#0 <- block@2) (abc#1) with abc#0 in current definition for 1 blocks +debug: Terminated block@3: // ternary_merge_L26 +debug: Sealing block@None: // ternary_true_L27 +debug: Sealing block@None: // ternary_false_L27 +debug: Terminated block@4: // ternary_true_L27 +debug: Terminated block@5: // ternary_false_L27 +debug: Sealing block@6: // ternary_merge_L27 +debug: Created Phi assignment: let ternary_result%19#2: uint64 = undefined while trying to resolve 'ternary_result%19' in block@6: // ternary_merge_L27 +debug: Added ternary_result%19#0 to Phi node: let ternary_result%19#2: uint64 = φ(ternary_result%19#0 <- block@4) in block@4: // ternary_true_L27 +debug: Added ternary_result%19#1 to Phi node: let ternary_result%19#2: uint64 = φ(ternary_result%19#0 <- block@4, ternary_result%19#1 <- block@5) in block@5: // ternary_false_L27 +debug: Created Phi assignment: let abc#2: bytes = undefined while trying to resolve 'abc' in block@6: // ternary_merge_L27 +debug: Added abc#0 to Phi node: let abc#2: bytes = φ(abc#0 <- block@4) in block@4: // ternary_true_L27 +debug: Added abc#0 to Phi node: let abc#2: bytes = φ(abc#0 <- block@4, abc#0 <- block@5) in block@5: // ternary_false_L27 +debug: Replacing trivial Phi node: let abc#2: bytes = φ(abc#0 <- block@4, abc#0 <- block@5) (abc#2) with abc#0 +debug: Deleting Phi assignment: let abc#2: bytes = φ(abc#0 <- block@4, abc#0 <- block@5) +debug: Replaced trivial Phi node: let abc#2: bytes = φ(abc#0 <- block@4, abc#0 <- block@5) (abc#2) with abc#0 in current definition for 1 blocks +debug: Terminated block@6: // ternary_merge_L27 +debug: Sealing block@None: // ternary_true_L27 +debug: Sealing block@None: // ternary_false_L27 +debug: Terminated block@7: // ternary_true_L27 +debug: Terminated block@8: // ternary_false_L27 +debug: Sealing block@9: // ternary_merge_L27 +debug: Created Phi assignment: let ternary_result%21#2: uint64 = undefined while trying to resolve 'ternary_result%21' in block@9: // ternary_merge_L27 +debug: Added ternary_result%21#0 to Phi node: let ternary_result%21#2: uint64 = φ(ternary_result%21#0 <- block@7) in block@7: // ternary_true_L27 +debug: Added ternary_result%21#1 to Phi node: let ternary_result%21#2: uint64 = φ(ternary_result%21#0 <- block@7, ternary_result%21#1 <- block@8) in block@8: // ternary_false_L27 +debug: Created Phi assignment: let abc#3: bytes = undefined while trying to resolve 'abc' in block@9: // ternary_merge_L27 +debug: Added abc#0 to Phi node: let abc#3: bytes = φ(abc#0 <- block@7) in block@7: // ternary_true_L27 +debug: Added abc#0 to Phi node: let abc#3: bytes = φ(abc#0 <- block@7, abc#0 <- block@8) in block@8: // ternary_false_L27 +debug: Replacing trivial Phi node: let abc#3: bytes = φ(abc#0 <- block@7, abc#0 <- block@8) (abc#3) with abc#0 +debug: Deleting Phi assignment: let abc#3: bytes = φ(abc#0 <- block@7, abc#0 <- block@8) +debug: Replaced trivial Phi node: let abc#3: bytes = φ(abc#0 <- block@7, abc#0 <- block@8) (abc#3) with abc#0 in current definition for 1 blocks +debug: Terminated block@9: // ternary_merge_L27 +debug: Sealing block@None: // ternary_true_L28 +debug: Sealing block@None: // ternary_false_L28 +debug: Terminated block@10: // ternary_true_L28 +debug: Terminated block@11: // ternary_false_L28 +debug: Sealing block@12: // ternary_merge_L28 +debug: Created Phi assignment: let ternary_result%26#2: uint64 = undefined while trying to resolve 'ternary_result%26' in block@12: // ternary_merge_L28 +debug: Added ternary_result%26#0 to Phi node: let ternary_result%26#2: uint64 = φ(ternary_result%26#0 <- block@10) in block@10: // ternary_true_L28 +debug: Added ternary_result%26#1 to Phi node: let ternary_result%26#2: uint64 = φ(ternary_result%26#0 <- block@10, ternary_result%26#1 <- block@11) in block@11: // ternary_false_L28 +debug: Created Phi assignment: let abc#4: bytes = undefined while trying to resolve 'abc' in block@12: // ternary_merge_L28 +debug: Added abc#0 to Phi node: let abc#4: bytes = φ(abc#0 <- block@10) in block@10: // ternary_true_L28 +debug: Added abc#0 to Phi node: let abc#4: bytes = φ(abc#0 <- block@10, abc#0 <- block@11) in block@11: // ternary_false_L28 +debug: Replacing trivial Phi node: let abc#4: bytes = φ(abc#0 <- block@10, abc#0 <- block@11) (abc#4) with abc#0 +debug: Deleting Phi assignment: let abc#4: bytes = φ(abc#0 <- block@10, abc#0 <- block@11) +debug: Replaced trivial Phi node: let abc#4: bytes = φ(abc#0 <- block@10, abc#0 <- block@11) (abc#4) with abc#0 in current definition for 1 blocks +debug: Terminated block@12: // ternary_merge_L28 +debug: Sealing block@None: // ternary_true_L29 +debug: Sealing block@None: // ternary_false_L29 +debug: Terminated block@13: // ternary_true_L29 +debug: Terminated block@14: // ternary_false_L29 +debug: Sealing block@15: // ternary_merge_L29 +debug: Created Phi assignment: let ternary_result%31#2: uint64 = undefined while trying to resolve 'ternary_result%31' in block@15: // ternary_merge_L29 +debug: Added ternary_result%31#0 to Phi node: let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@13) in block@13: // ternary_true_L29 +debug: Added ternary_result%31#1 to Phi node: let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@13, ternary_result%31#1 <- block@14) in block@14: // ternary_false_L29 +debug: Created Phi assignment: let abc#5: bytes = undefined while trying to resolve 'abc' in block@15: // ternary_merge_L29 +debug: Added abc#0 to Phi node: let abc#5: bytes = φ(abc#0 <- block@13) in block@13: // ternary_true_L29 +debug: Added abc#0 to Phi node: let abc#5: bytes = φ(abc#0 <- block@13, abc#0 <- block@14) in block@14: // ternary_false_L29 +debug: Replacing trivial Phi node: let abc#5: bytes = φ(abc#0 <- block@13, abc#0 <- block@14) (abc#5) with abc#0 +debug: Deleting Phi assignment: let abc#5: bytes = φ(abc#0 <- block@13, abc#0 <- block@14) +debug: Replaced trivial Phi node: let abc#5: bytes = φ(abc#0 <- block@13, abc#0 <- block@14) (abc#5) with abc#0 in current definition for 1 blocks +debug: Terminated block@15: // ternary_merge_L29 +debug: Sealing block@None: // ternary_true_L30 +debug: Sealing block@None: // ternary_false_L30 +debug: Terminated block@16: // ternary_true_L30 +debug: Terminated block@17: // ternary_false_L30 +debug: Sealing block@18: // ternary_merge_L30 +debug: Created Phi assignment: let ternary_result%36#2: uint64 = undefined while trying to resolve 'ternary_result%36' in block@18: // ternary_merge_L30 +debug: Added ternary_result%36#0 to Phi node: let ternary_result%36#2: uint64 = φ(ternary_result%36#0 <- block@16) in block@16: // ternary_true_L30 +debug: Added ternary_result%36#1 to Phi node: let ternary_result%36#2: uint64 = φ(ternary_result%36#0 <- block@16, ternary_result%36#1 <- block@17) in block@17: // ternary_false_L30 +debug: Created Phi assignment: let abc#6: bytes = undefined while trying to resolve 'abc' in block@18: // ternary_merge_L30 +debug: Added abc#0 to Phi node: let abc#6: bytes = φ(abc#0 <- block@16) in block@16: // ternary_true_L30 +debug: Added abc#0 to Phi node: let abc#6: bytes = φ(abc#0 <- block@16, abc#0 <- block@17) in block@17: // ternary_false_L30 +debug: Replacing trivial Phi node: let abc#6: bytes = φ(abc#0 <- block@16, abc#0 <- block@17) (abc#6) with abc#0 +debug: Deleting Phi assignment: let abc#6: bytes = φ(abc#0 <- block@16, abc#0 <- block@17) +debug: Replaced trivial Phi node: let abc#6: bytes = φ(abc#0 <- block@16, abc#0 <- block@17) (abc#6) with abc#0 in current definition for 1 blocks +debug: Terminated block@18: // ternary_merge_L30 +debug: Sealing block@None: // ternary_true_L31 +debug: Sealing block@None: // ternary_false_L31 +debug: Terminated block@19: // ternary_true_L31 +debug: Terminated block@20: // ternary_false_L31 +debug: Sealing block@21: // ternary_merge_L31 +debug: Created Phi assignment: let ternary_result%42#2: uint64 = undefined while trying to resolve 'ternary_result%42' in block@21: // ternary_merge_L31 +debug: Added ternary_result%42#0 to Phi node: let ternary_result%42#2: uint64 = φ(ternary_result%42#0 <- block@19) in block@19: // ternary_true_L31 +debug: Added ternary_result%42#1 to Phi node: let ternary_result%42#2: uint64 = φ(ternary_result%42#0 <- block@19, ternary_result%42#1 <- block@20) in block@20: // ternary_false_L31 +debug: Created Phi assignment: let abc#7: bytes = undefined while trying to resolve 'abc' in block@21: // ternary_merge_L31 +debug: Added abc#0 to Phi node: let abc#7: bytes = φ(abc#0 <- block@19) in block@19: // ternary_true_L31 +debug: Added abc#0 to Phi node: let abc#7: bytes = φ(abc#0 <- block@19, abc#0 <- block@20) in block@20: // ternary_false_L31 +debug: Replacing trivial Phi node: let abc#7: bytes = φ(abc#0 <- block@19, abc#0 <- block@20) (abc#7) with abc#0 +debug: Deleting Phi assignment: let abc#7: bytes = φ(abc#0 <- block@19, abc#0 <- block@20) +debug: Replaced trivial Phi node: let abc#7: bytes = φ(abc#0 <- block@19, abc#0 <- block@20) (abc#7) with abc#0 in current definition for 1 blocks +debug: Terminated block@21: // ternary_merge_L31 +debug: Sealing block@None: // ternary_true_L31 +debug: Sealing block@None: // ternary_false_L31 +debug: Terminated block@22: // ternary_true_L31 +debug: Terminated block@23: // ternary_false_L31 +debug: Sealing block@24: // ternary_merge_L31 +debug: Created Phi assignment: let ternary_result%44#2: uint64 = undefined while trying to resolve 'ternary_result%44' in block@24: // ternary_merge_L31 +debug: Added ternary_result%44#0 to Phi node: let ternary_result%44#2: uint64 = φ(ternary_result%44#0 <- block@22) in block@22: // ternary_true_L31 +debug: Added ternary_result%44#1 to Phi node: let ternary_result%44#2: uint64 = φ(ternary_result%44#0 <- block@22, ternary_result%44#1 <- block@23) in block@23: // ternary_false_L31 +debug: Created Phi assignment: let abc#8: bytes = undefined while trying to resolve 'abc' in block@24: // ternary_merge_L31 +debug: Added abc#0 to Phi node: let abc#8: bytes = φ(abc#0 <- block@22) in block@22: // ternary_true_L31 +debug: Added abc#0 to Phi node: let abc#8: bytes = φ(abc#0 <- block@22, abc#0 <- block@23) in block@23: // ternary_false_L31 +debug: Replacing trivial Phi node: let abc#8: bytes = φ(abc#0 <- block@22, abc#0 <- block@23) (abc#8) with abc#0 +debug: Deleting Phi assignment: let abc#8: bytes = φ(abc#0 <- block@22, abc#0 <- block@23) +debug: Replaced trivial Phi node: let abc#8: bytes = φ(abc#0 <- block@22, abc#0 <- block@23) (abc#8) with abc#0 in current definition for 1 blocks +debug: Terminated block@24: // ternary_merge_L31 +debug: Sealing block@None: // ternary_true_L33 +debug: Sealing block@None: // ternary_false_L33 +debug: Terminated block@25: // ternary_true_L33 +debug: Terminated block@26: // ternary_false_L33 +debug: Sealing block@27: // ternary_merge_L33 +debug: Created Phi assignment: let ternary_result%51#2: uint64 = undefined while trying to resolve 'ternary_result%51' in block@27: // ternary_merge_L33 +debug: Added ternary_result%51#0 to Phi node: let ternary_result%51#2: uint64 = φ(ternary_result%51#0 <- block@25) in block@25: // ternary_true_L33 +debug: Added ternary_result%51#1 to Phi node: let ternary_result%51#2: uint64 = φ(ternary_result%51#0 <- block@25, ternary_result%51#1 <- block@26) in block@26: // ternary_false_L33 +debug: Created Phi assignment: let abc#9: bytes = undefined while trying to resolve 'abc' in block@27: // ternary_merge_L33 +debug: Added abc#0 to Phi node: let abc#9: bytes = φ(abc#0 <- block@25) in block@25: // ternary_true_L33 +debug: Added abc#0 to Phi node: let abc#9: bytes = φ(abc#0 <- block@25, abc#0 <- block@26) in block@26: // ternary_false_L33 +debug: Replacing trivial Phi node: let abc#9: bytes = φ(abc#0 <- block@25, abc#0 <- block@26) (abc#9) with abc#0 +debug: Deleting Phi assignment: let abc#9: bytes = φ(abc#0 <- block@25, abc#0 <- block@26) +debug: Replaced trivial Phi node: let abc#9: bytes = φ(abc#0 <- block@25, abc#0 <- block@26) (abc#9) with abc#0 in current definition for 1 blocks +debug: Terminated block@27: // ternary_merge_L33 +debug: Sealing block@None: // ternary_true_L33 +debug: Sealing block@None: // ternary_false_L33 +debug: Terminated block@28: // ternary_true_L33 +debug: Terminated block@29: // ternary_false_L33 +debug: Sealing block@30: // ternary_merge_L33 +debug: Created Phi assignment: let ternary_result%53#2: uint64 = undefined while trying to resolve 'ternary_result%53' in block@30: // ternary_merge_L33 +debug: Added ternary_result%53#0 to Phi node: let ternary_result%53#2: uint64 = φ(ternary_result%53#0 <- block@28) in block@28: // ternary_true_L33 +debug: Added ternary_result%53#1 to Phi node: let ternary_result%53#2: uint64 = φ(ternary_result%53#0 <- block@28, ternary_result%53#1 <- block@29) in block@29: // ternary_false_L33 +debug: Terminated block@30: // ternary_merge_L33 debug: Sealing block@None: // ternary_true_L38 debug: Sealing block@None: // ternary_false_L38 -debug: Terminated block@1: // ternary_true_L38 -debug: Terminated block@2: // ternary_false_L38 -debug: Sealing block@3: // ternary_merge_L38 -debug: Created Phi assignment: let ternary_result%40#2: bytes = undefined while trying to resolve 'ternary_result%40' in block@3: // ternary_merge_L38 -debug: Added ternary_result%40#0 to Phi node: let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@1) in block@1: // ternary_true_L38 -debug: Added ternary_result%40#1 to Phi node: let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@1, ternary_result%40#1 <- block@2) in block@2: // ternary_false_L38 -debug: Created Phi assignment: let true#1: bytes = undefined while trying to resolve 'true' in block@3: // ternary_merge_L38 -debug: Added true#0 to Phi node: let true#1: bytes = φ(true#0 <- block@1) in block@1: // ternary_true_L38 -debug: Added true#0 to Phi node: let true#1: bytes = φ(true#0 <- block@1, true#0 <- block@2) in block@2: // ternary_false_L38 -debug: Replacing trivial Phi node: let true#1: bytes = φ(true#0 <- block@1, true#0 <- block@2) (true#1) with true#0 -debug: Deleting Phi assignment: let true#1: bytes = φ(true#0 <- block@1, true#0 <- block@2) -debug: Replaced trivial Phi node: let true#1: bytes = φ(true#0 <- block@1, true#0 <- block@2) (true#1) with true#0 in current definition for 1 blocks -debug: Terminated block@3: // ternary_merge_L38 +debug: Terminated block@31: // ternary_true_L38 +debug: Terminated block@32: // ternary_false_L38 +debug: Sealing block@33: // ternary_merge_L38 +debug: Created Phi assignment: let ternary_result%57#2: bytes = undefined while trying to resolve 'ternary_result%57' in block@33: // ternary_merge_L38 +debug: Added ternary_result%57#0 to Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@31) in block@31: // ternary_true_L38 +debug: Added ternary_result%57#1 to Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@31, ternary_result%57#1 <- block@32) in block@32: // ternary_false_L38 +debug: Created Phi assignment: let true#1: bytes = undefined while trying to resolve 'true' in block@33: // ternary_merge_L38 +debug: Added true#0 to Phi node: let true#1: bytes = φ(true#0 <- block@31) in block@31: // ternary_true_L38 +debug: Added true#0 to Phi node: let true#1: bytes = φ(true#0 <- block@31, true#0 <- block@32) in block@32: // ternary_false_L38 +debug: Replacing trivial Phi node: let true#1: bytes = φ(true#0 <- block@31, true#0 <- block@32) (true#1) with true#0 +debug: Deleting Phi assignment: let true#1: bytes = φ(true#0 <- block@31, true#0 <- block@32) +debug: Replaced trivial Phi node: let true#1: bytes = φ(true#0 <- block@31, true#0 <- block@32) (true#1) with true#0 in current definition for 1 blocks +debug: Terminated block@33: // ternary_merge_L38 +debug: Sealing block@None: // ternary_true_L40 +debug: Sealing block@None: // ternary_false_L40 +debug: Terminated block@34: // ternary_true_L40 +debug: Terminated block@35: // ternary_false_L40 +debug: Sealing block@36: // ternary_merge_L40 +debug: Created Phi assignment: let ternary_result%59#2: bytes = undefined while trying to resolve 'ternary_result%59' in block@36: // ternary_merge_L40 +debug: Added ternary_result%59#0 to Phi node: let ternary_result%59#2: bytes = φ(ternary_result%59#0 <- block@34) in block@34: // ternary_true_L40 +debug: Added ternary_result%59#1 to Phi node: let ternary_result%59#2: bytes = φ(ternary_result%59#0 <- block@34, ternary_result%59#1 <- block@35) in block@35: // ternary_false_L40 +debug: Created Phi assignment: let true#2: bytes = undefined while trying to resolve 'true' in block@36: // ternary_merge_L40 +debug: Added true#0 to Phi node: let true#2: bytes = φ(true#0 <- block@34) in block@34: // ternary_true_L40 +debug: Added true#0 to Phi node: let true#2: bytes = φ(true#0 <- block@34, true#0 <- block@35) in block@35: // ternary_false_L40 +debug: Replacing trivial Phi node: let true#2: bytes = φ(true#0 <- block@34, true#0 <- block@35) (true#2) with true#0 +debug: Deleting Phi assignment: let true#2: bytes = φ(true#0 <- block@34, true#0 <- block@35) +debug: Replaced trivial Phi node: let true#2: bytes = φ(true#0 <- block@34, true#0 <- block@35) (true#2) with true#0 in current definition for 1 blocks +debug: Terminated block@36: // ternary_merge_L40 debug: Sealing block@None: // ternary_true_L41 debug: Sealing block@None: // ternary_false_L41 -debug: Terminated block@4: // ternary_true_L41 -debug: Terminated block@5: // ternary_false_L41 -debug: Sealing block@6: // ternary_merge_L41 -debug: Created Phi assignment: let ternary_result%42#2: bytes = undefined while trying to resolve 'ternary_result%42' in block@6: // ternary_merge_L41 -debug: Added ternary_result%42#0 to Phi node: let ternary_result%42#2: bytes = φ(ternary_result%42#0 <- block@4) in block@4: // ternary_true_L41 -debug: Added ternary_result%42#1 to Phi node: let ternary_result%42#2: bytes = φ(ternary_result%42#0 <- block@4, ternary_result%42#1 <- block@5) in block@5: // ternary_false_L41 -debug: Created Phi assignment: let true#2: bytes = undefined while trying to resolve 'true' in block@6: // ternary_merge_L41 -debug: Added true#0 to Phi node: let true#2: bytes = φ(true#0 <- block@4) in block@4: // ternary_true_L41 -debug: Added true#0 to Phi node: let true#2: bytes = φ(true#0 <- block@4, true#0 <- block@5) in block@5: // ternary_false_L41 -debug: Replacing trivial Phi node: let true#2: bytes = φ(true#0 <- block@4, true#0 <- block@5) (true#2) with true#0 -debug: Deleting Phi assignment: let true#2: bytes = φ(true#0 <- block@4, true#0 <- block@5) -debug: Replaced trivial Phi node: let true#2: bytes = φ(true#0 <- block@4, true#0 <- block@5) (true#2) with true#0 in current definition for 1 blocks -debug: Terminated block@6: // ternary_merge_L41 +debug: Terminated block@37: // ternary_true_L41 +debug: Created Phi assignment: let false#1: bytes = undefined while trying to resolve 'false' in block@36: // ternary_merge_L40 +debug: Created Phi assignment: let false#2: bytes = undefined while trying to resolve 'false' in block@33: // ternary_merge_L38 +debug: Added false#0 to Phi node: let false#2: bytes = φ(false#0 <- block@31) in block@31: // ternary_true_L38 +debug: Added false#0 to Phi node: let false#2: bytes = φ(false#0 <- block@31, false#0 <- block@32) in block@32: // ternary_false_L38 +debug: Replacing trivial Phi node: let false#2: bytes = φ(false#0 <- block@31, false#0 <- block@32) (false#2) with false#0 +debug: Deleting Phi assignment: let false#2: bytes = φ(false#0 <- block@31, false#0 <- block@32) +debug: Replaced trivial Phi node: let false#2: bytes = φ(false#0 <- block@31, false#0 <- block@32) (false#2) with false#0 in current definition for 1 blocks +debug: Added false#0 to Phi node: let false#1: bytes = φ(false#0 <- block@34) in block@34: // ternary_true_L40 +debug: Added false#0 to Phi node: let false#1: bytes = φ(false#0 <- block@34, false#0 <- block@35) in block@35: // ternary_false_L40 +debug: Replacing trivial Phi node: let false#1: bytes = φ(false#0 <- block@34, false#0 <- block@35) (false#1) with false#0 +debug: Deleting Phi assignment: let false#1: bytes = φ(false#0 <- block@34, false#0 <- block@35) +debug: Replaced trivial Phi node: let false#1: bytes = φ(false#0 <- block@34, false#0 <- block@35) (false#1) with false#0 in current definition for 1 blocks +debug: Terminated block@38: // ternary_false_L41 +debug: Sealing block@39: // ternary_merge_L41 +debug: Created Phi assignment: let ternary_result%62#2: bytes = undefined while trying to resolve 'ternary_result%62' in block@39: // ternary_merge_L41 +debug: Added ternary_result%62#0 to Phi node: let ternary_result%62#2: bytes = φ(ternary_result%62#0 <- block@37) in block@37: // ternary_true_L41 +debug: Added ternary_result%62#1 to Phi node: let ternary_result%62#2: bytes = φ(ternary_result%62#0 <- block@37, ternary_result%62#1 <- block@38) in block@38: // ternary_false_L41 +debug: Created Phi assignment: let false#3: bytes = undefined while trying to resolve 'false' in block@39: // ternary_merge_L41 +debug: Added false#0 to Phi node: let false#3: bytes = φ(false#0 <- block@37) in block@37: // ternary_true_L41 +debug: Added false#0 to Phi node: let false#3: bytes = φ(false#0 <- block@37, false#0 <- block@38) in block@38: // ternary_false_L41 +debug: Replacing trivial Phi node: let false#3: bytes = φ(false#0 <- block@37, false#0 <- block@38) (false#3) with false#0 +debug: Deleting Phi assignment: let false#3: bytes = φ(false#0 <- block@37, false#0 <- block@38) +debug: Replaced trivial Phi node: let false#3: bytes = φ(false#0 <- block@37, false#0 <- block@38) (false#3) with false#0 in current definition for 1 blocks +debug: Terminated block@39: // ternary_merge_L41 debug: Sealing block@None: // ternary_true_L42 debug: Sealing block@None: // ternary_false_L42 -debug: Terminated block@7: // ternary_true_L42 -debug: Created Phi assignment: let false#1: bytes = undefined while trying to resolve 'false' in block@6: // ternary_merge_L41 -debug: Created Phi assignment: let false#2: bytes = undefined while trying to resolve 'false' in block@3: // ternary_merge_L38 -debug: Added false#0 to Phi node: let false#2: bytes = φ(false#0 <- block@1) in block@1: // ternary_true_L38 -debug: Added false#0 to Phi node: let false#2: bytes = φ(false#0 <- block@1, false#0 <- block@2) in block@2: // ternary_false_L38 -debug: Replacing trivial Phi node: let false#2: bytes = φ(false#0 <- block@1, false#0 <- block@2) (false#2) with false#0 -debug: Deleting Phi assignment: let false#2: bytes = φ(false#0 <- block@1, false#0 <- block@2) -debug: Replaced trivial Phi node: let false#2: bytes = φ(false#0 <- block@1, false#0 <- block@2) (false#2) with false#0 in current definition for 1 blocks -debug: Added false#0 to Phi node: let false#1: bytes = φ(false#0 <- block@4) in block@4: // ternary_true_L41 -debug: Added false#0 to Phi node: let false#1: bytes = φ(false#0 <- block@4, false#0 <- block@5) in block@5: // ternary_false_L41 -debug: Replacing trivial Phi node: let false#1: bytes = φ(false#0 <- block@4, false#0 <- block@5) (false#1) with false#0 -debug: Deleting Phi assignment: let false#1: bytes = φ(false#0 <- block@4, false#0 <- block@5) -debug: Replaced trivial Phi node: let false#1: bytes = φ(false#0 <- block@4, false#0 <- block@5) (false#1) with false#0 in current definition for 1 blocks -debug: Terminated block@8: // ternary_false_L42 -debug: Sealing block@9: // ternary_merge_L42 -debug: Created Phi assignment: let ternary_result%45#2: bytes = undefined while trying to resolve 'ternary_result%45' in block@9: // ternary_merge_L42 -debug: Added ternary_result%45#0 to Phi node: let ternary_result%45#2: bytes = φ(ternary_result%45#0 <- block@7) in block@7: // ternary_true_L42 -debug: Added ternary_result%45#1 to Phi node: let ternary_result%45#2: bytes = φ(ternary_result%45#0 <- block@7, ternary_result%45#1 <- block@8) in block@8: // ternary_false_L42 -debug: Created Phi assignment: let false#3: bytes = undefined while trying to resolve 'false' in block@9: // ternary_merge_L42 -debug: Added false#0 to Phi node: let false#3: bytes = φ(false#0 <- block@7) in block@7: // ternary_true_L42 -debug: Added false#0 to Phi node: let false#3: bytes = φ(false#0 <- block@7, false#0 <- block@8) in block@8: // ternary_false_L42 -debug: Replacing trivial Phi node: let false#3: bytes = φ(false#0 <- block@7, false#0 <- block@8) (false#3) with false#0 -debug: Deleting Phi assignment: let false#3: bytes = φ(false#0 <- block@7, false#0 <- block@8) -debug: Replaced trivial Phi node: let false#3: bytes = φ(false#0 <- block@7, false#0 <- block@8) (false#3) with false#0 in current definition for 1 blocks -debug: Terminated block@9: // ternary_merge_L42 +debug: Terminated block@40: // ternary_true_L42 +debug: Created Phi assignment: let true#3: bytes = undefined while trying to resolve 'true' in block@39: // ternary_merge_L41 +debug: Added true#0 to Phi node: let true#3: bytes = φ(true#0 <- block@37) in block@37: // ternary_true_L41 +debug: Added true#0 to Phi node: let true#3: bytes = φ(true#0 <- block@37, true#0 <- block@38) in block@38: // ternary_false_L41 +debug: Replacing trivial Phi node: let true#3: bytes = φ(true#0 <- block@37, true#0 <- block@38) (true#3) with true#0 +debug: Deleting Phi assignment: let true#3: bytes = φ(true#0 <- block@37, true#0 <- block@38) +debug: Replaced trivial Phi node: let true#3: bytes = φ(true#0 <- block@37, true#0 <- block@38) (true#3) with true#0 in current definition for 1 blocks +debug: Terminated block@41: // ternary_false_L42 +debug: Sealing block@42: // ternary_merge_L42 +debug: Created Phi assignment: let ternary_result%65#2: bytes = undefined while trying to resolve 'ternary_result%65' in block@42: // ternary_merge_L42 +debug: Added ternary_result%65#0 to Phi node: let ternary_result%65#2: bytes = φ(ternary_result%65#0 <- block@40) in block@40: // ternary_true_L42 +debug: Added ternary_result%65#1 to Phi node: let ternary_result%65#2: bytes = φ(ternary_result%65#0 <- block@40, ternary_result%65#1 <- block@41) in block@41: // ternary_false_L42 +debug: Created Phi assignment: let false#4: bytes = undefined while trying to resolve 'false' in block@42: // ternary_merge_L42 +debug: Added false#0 to Phi node: let false#4: bytes = φ(false#0 <- block@40) in block@40: // ternary_true_L42 +debug: Added false#0 to Phi node: let false#4: bytes = φ(false#0 <- block@40, false#0 <- block@41) in block@41: // ternary_false_L42 +debug: Replacing trivial Phi node: let false#4: bytes = φ(false#0 <- block@40, false#0 <- block@41) (false#4) with false#0 +debug: Deleting Phi assignment: let false#4: bytes = φ(false#0 <- block@40, false#0 <- block@41) +debug: Replaced trivial Phi node: let false#4: bytes = φ(false#0 <- block@40, false#0 <- block@41) (false#4) with false#0 in current definition for 1 blocks +debug: Terminated block@42: // ternary_merge_L42 debug: Sealing block@None: // ternary_true_L43 debug: Sealing block@None: // ternary_false_L43 -debug: Terminated block@10: // ternary_true_L43 -debug: Created Phi assignment: let true#3: bytes = undefined while trying to resolve 'true' in block@9: // ternary_merge_L42 -debug: Added true#0 to Phi node: let true#3: bytes = φ(true#0 <- block@7) in block@7: // ternary_true_L42 -debug: Added true#0 to Phi node: let true#3: bytes = φ(true#0 <- block@7, true#0 <- block@8) in block@8: // ternary_false_L42 -debug: Replacing trivial Phi node: let true#3: bytes = φ(true#0 <- block@7, true#0 <- block@8) (true#3) with true#0 -debug: Deleting Phi assignment: let true#3: bytes = φ(true#0 <- block@7, true#0 <- block@8) -debug: Replaced trivial Phi node: let true#3: bytes = φ(true#0 <- block@7, true#0 <- block@8) (true#3) with true#0 in current definition for 1 blocks -debug: Terminated block@11: // ternary_false_L43 -debug: Sealing block@12: // ternary_merge_L43 -debug: Created Phi assignment: let ternary_result%48#2: bytes = undefined while trying to resolve 'ternary_result%48' in block@12: // ternary_merge_L43 -debug: Added ternary_result%48#0 to Phi node: let ternary_result%48#2: bytes = φ(ternary_result%48#0 <- block@10) in block@10: // ternary_true_L43 -debug: Added ternary_result%48#1 to Phi node: let ternary_result%48#2: bytes = φ(ternary_result%48#0 <- block@10, ternary_result%48#1 <- block@11) in block@11: // ternary_false_L43 -debug: Created Phi assignment: let false#4: bytes = undefined while trying to resolve 'false' in block@12: // ternary_merge_L43 -debug: Added false#0 to Phi node: let false#4: bytes = φ(false#0 <- block@10) in block@10: // ternary_true_L43 -debug: Added false#0 to Phi node: let false#4: bytes = φ(false#0 <- block@10, false#0 <- block@11) in block@11: // ternary_false_L43 -debug: Replacing trivial Phi node: let false#4: bytes = φ(false#0 <- block@10, false#0 <- block@11) (false#4) with false#0 -debug: Deleting Phi assignment: let false#4: bytes = φ(false#0 <- block@10, false#0 <- block@11) -debug: Replaced trivial Phi node: let false#4: bytes = φ(false#0 <- block@10, false#0 <- block@11) (false#4) with false#0 in current definition for 1 blocks -debug: Terminated block@12: // ternary_merge_L43 +debug: Terminated block@43: // ternary_true_L43 +debug: Terminated block@44: // ternary_false_L43 +debug: Sealing block@45: // ternary_merge_L43 +debug: Created Phi assignment: let ternary_result%68#2: bytes = undefined while trying to resolve 'ternary_result%68' in block@45: // ternary_merge_L43 +debug: Added ternary_result%68#0 to Phi node: let ternary_result%68#2: bytes = φ(ternary_result%68#0 <- block@43) in block@43: // ternary_true_L43 +debug: Added ternary_result%68#1 to Phi node: let ternary_result%68#2: bytes = φ(ternary_result%68#0 <- block@43, ternary_result%68#1 <- block@44) in block@44: // ternary_false_L43 +debug: Created Phi assignment: let false#5: bytes = undefined while trying to resolve 'false' in block@45: // ternary_merge_L43 +debug: Added false#0 to Phi node: let false#5: bytes = φ(false#0 <- block@43) in block@43: // ternary_true_L43 +debug: Added false#0 to Phi node: let false#5: bytes = φ(false#0 <- block@43, false#0 <- block@44) in block@44: // ternary_false_L43 +debug: Replacing trivial Phi node: let false#5: bytes = φ(false#0 <- block@43, false#0 <- block@44) (false#5) with false#0 +debug: Deleting Phi assignment: let false#5: bytes = φ(false#0 <- block@43, false#0 <- block@44) +debug: Replaced trivial Phi node: let false#5: bytes = φ(false#0 <- block@43, false#0 <- block@44) (false#5) with false#0 in current definition for 1 blocks +debug: Created Phi assignment: let true#4: bytes = undefined while trying to resolve 'true' in block@45: // ternary_merge_L43 +debug: Created Phi assignment: let true#5: bytes = undefined while trying to resolve 'true' in block@42: // ternary_merge_L42 +debug: Added true#0 to Phi node: let true#5: bytes = φ(true#0 <- block@40) in block@40: // ternary_true_L42 +debug: Added true#0 to Phi node: let true#5: bytes = φ(true#0 <- block@40, true#0 <- block@41) in block@41: // ternary_false_L42 +debug: Replacing trivial Phi node: let true#5: bytes = φ(true#0 <- block@40, true#0 <- block@41) (true#5) with true#0 +debug: Deleting Phi assignment: let true#5: bytes = φ(true#0 <- block@40, true#0 <- block@41) +debug: Replaced trivial Phi node: let true#5: bytes = φ(true#0 <- block@40, true#0 <- block@41) (true#5) with true#0 in current definition for 1 blocks +debug: Added true#0 to Phi node: let true#4: bytes = φ(true#0 <- block@43) in block@43: // ternary_true_L43 +debug: Added true#0 to Phi node: let true#4: bytes = φ(true#0 <- block@43, true#0 <- block@44) in block@44: // ternary_false_L43 +debug: Replacing trivial Phi node: let true#4: bytes = φ(true#0 <- block@43, true#0 <- block@44) (true#4) with true#0 +debug: Deleting Phi assignment: let true#4: bytes = φ(true#0 <- block@43, true#0 <- block@44) +debug: Replaced trivial Phi node: let true#4: bytes = φ(true#0 <- block@43, true#0 <- block@44) (true#4) with true#0 in current definition for 1 blocks +debug: Terminated block@45: // ternary_merge_L43 debug: Sealing block@None: // ternary_true_L44 debug: Sealing block@None: // ternary_false_L44 -debug: Terminated block@13: // ternary_true_L44 -debug: Terminated block@14: // ternary_false_L44 -debug: Sealing block@15: // ternary_merge_L44 -debug: Created Phi assignment: let ternary_result%51#2: bytes = undefined while trying to resolve 'ternary_result%51' in block@15: // ternary_merge_L44 -debug: Added ternary_result%51#0 to Phi node: let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@13) in block@13: // ternary_true_L44 -debug: Added ternary_result%51#1 to Phi node: let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@13, ternary_result%51#1 <- block@14) in block@14: // ternary_false_L44 -debug: Created Phi assignment: let false#5: bytes = undefined while trying to resolve 'false' in block@15: // ternary_merge_L44 -debug: Added false#0 to Phi node: let false#5: bytes = φ(false#0 <- block@13) in block@13: // ternary_true_L44 -debug: Added false#0 to Phi node: let false#5: bytes = φ(false#0 <- block@13, false#0 <- block@14) in block@14: // ternary_false_L44 -debug: Replacing trivial Phi node: let false#5: bytes = φ(false#0 <- block@13, false#0 <- block@14) (false#5) with false#0 -debug: Deleting Phi assignment: let false#5: bytes = φ(false#0 <- block@13, false#0 <- block@14) -debug: Replaced trivial Phi node: let false#5: bytes = φ(false#0 <- block@13, false#0 <- block@14) (false#5) with false#0 in current definition for 1 blocks -debug: Created Phi assignment: let true#4: bytes = undefined while trying to resolve 'true' in block@15: // ternary_merge_L44 -debug: Created Phi assignment: let true#5: bytes = undefined while trying to resolve 'true' in block@12: // ternary_merge_L43 -debug: Added true#0 to Phi node: let true#5: bytes = φ(true#0 <- block@10) in block@10: // ternary_true_L43 -debug: Added true#0 to Phi node: let true#5: bytes = φ(true#0 <- block@10, true#0 <- block@11) in block@11: // ternary_false_L43 -debug: Replacing trivial Phi node: let true#5: bytes = φ(true#0 <- block@10, true#0 <- block@11) (true#5) with true#0 -debug: Deleting Phi assignment: let true#5: bytes = φ(true#0 <- block@10, true#0 <- block@11) -debug: Replaced trivial Phi node: let true#5: bytes = φ(true#0 <- block@10, true#0 <- block@11) (true#5) with true#0 in current definition for 1 blocks -debug: Added true#0 to Phi node: let true#4: bytes = φ(true#0 <- block@13) in block@13: // ternary_true_L44 -debug: Added true#0 to Phi node: let true#4: bytes = φ(true#0 <- block@13, true#0 <- block@14) in block@14: // ternary_false_L44 -debug: Replacing trivial Phi node: let true#4: bytes = φ(true#0 <- block@13, true#0 <- block@14) (true#4) with true#0 -debug: Deleting Phi assignment: let true#4: bytes = φ(true#0 <- block@13, true#0 <- block@14) -debug: Replaced trivial Phi node: let true#4: bytes = φ(true#0 <- block@13, true#0 <- block@14) (true#4) with true#0 in current definition for 1 blocks -debug: Terminated block@15: // ternary_merge_L44 +debug: Terminated block@46: // ternary_true_L44 +debug: Terminated block@47: // ternary_false_L44 +debug: Sealing block@48: // ternary_merge_L44 +debug: Created Phi assignment: let ternary_result%71#2: bytes = undefined while trying to resolve 'ternary_result%71' in block@48: // ternary_merge_L44 +debug: Added ternary_result%71#0 to Phi node: let ternary_result%71#2: bytes = φ(ternary_result%71#0 <- block@46) in block@46: // ternary_true_L44 +debug: Added ternary_result%71#1 to Phi node: let ternary_result%71#2: bytes = φ(ternary_result%71#0 <- block@46, ternary_result%71#1 <- block@47) in block@47: // ternary_false_L44 +debug: Created Phi assignment: let true#6: bytes = undefined while trying to resolve 'true' in block@48: // ternary_merge_L44 +debug: Added true#0 to Phi node: let true#6: bytes = φ(true#0 <- block@46) in block@46: // ternary_true_L44 +debug: Added true#0 to Phi node: let true#6: bytes = φ(true#0 <- block@46, true#0 <- block@47) in block@47: // ternary_false_L44 +debug: Replacing trivial Phi node: let true#6: bytes = φ(true#0 <- block@46, true#0 <- block@47) (true#6) with true#0 +debug: Deleting Phi assignment: let true#6: bytes = φ(true#0 <- block@46, true#0 <- block@47) +debug: Replaced trivial Phi node: let true#6: bytes = φ(true#0 <- block@46, true#0 <- block@47) (true#6) with true#0 in current definition for 1 blocks +debug: Terminated block@48: // ternary_merge_L44 debug: Sealing block@None: // ternary_true_L45 debug: Sealing block@None: // ternary_false_L45 -debug: Terminated block@16: // ternary_true_L45 -debug: Terminated block@17: // ternary_false_L45 -debug: Sealing block@18: // ternary_merge_L45 -debug: Created Phi assignment: let ternary_result%54#2: bytes = undefined while trying to resolve 'ternary_result%54' in block@18: // ternary_merge_L45 -debug: Added ternary_result%54#0 to Phi node: let ternary_result%54#2: bytes = φ(ternary_result%54#0 <- block@16) in block@16: // ternary_true_L45 -debug: Added ternary_result%54#1 to Phi node: let ternary_result%54#2: bytes = φ(ternary_result%54#0 <- block@16, ternary_result%54#1 <- block@17) in block@17: // ternary_false_L45 -debug: Created Phi assignment: let true#6: bytes = undefined while trying to resolve 'true' in block@18: // ternary_merge_L45 -debug: Added true#0 to Phi node: let true#6: bytes = φ(true#0 <- block@16) in block@16: // ternary_true_L45 -debug: Added true#0 to Phi node: let true#6: bytes = φ(true#0 <- block@16, true#0 <- block@17) in block@17: // ternary_false_L45 -debug: Replacing trivial Phi node: let true#6: bytes = φ(true#0 <- block@16, true#0 <- block@17) (true#6) with true#0 -debug: Deleting Phi assignment: let true#6: bytes = φ(true#0 <- block@16, true#0 <- block@17) -debug: Replaced trivial Phi node: let true#6: bytes = φ(true#0 <- block@16, true#0 <- block@17) (true#6) with true#0 in current definition for 1 blocks -debug: Terminated block@18: // ternary_merge_L45 +debug: Terminated block@49: // ternary_true_L45 +debug: Created Phi assignment: let false#6: bytes = undefined while trying to resolve 'false' in block@48: // ternary_merge_L44 +debug: Added false#0 to Phi node: let false#6: bytes = φ(false#0 <- block@46) in block@46: // ternary_true_L44 +debug: Added false#0 to Phi node: let false#6: bytes = φ(false#0 <- block@46, false#0 <- block@47) in block@47: // ternary_false_L44 +debug: Replacing trivial Phi node: let false#6: bytes = φ(false#0 <- block@46, false#0 <- block@47) (false#6) with false#0 +debug: Deleting Phi assignment: let false#6: bytes = φ(false#0 <- block@46, false#0 <- block@47) +debug: Replaced trivial Phi node: let false#6: bytes = φ(false#0 <- block@46, false#0 <- block@47) (false#6) with false#0 in current definition for 1 blocks +debug: Terminated block@50: // ternary_false_L45 +debug: Sealing block@51: // ternary_merge_L45 +debug: Created Phi assignment: let ternary_result%74#2: bytes = undefined while trying to resolve 'ternary_result%74' in block@51: // ternary_merge_L45 +debug: Added ternary_result%74#0 to Phi node: let ternary_result%74#2: bytes = φ(ternary_result%74#0 <- block@49) in block@49: // ternary_true_L45 +debug: Added ternary_result%74#1 to Phi node: let ternary_result%74#2: bytes = φ(ternary_result%74#0 <- block@49, ternary_result%74#1 <- block@50) in block@50: // ternary_false_L45 +debug: Created Phi assignment: let true#7: bytes = undefined while trying to resolve 'true' in block@51: // ternary_merge_L45 +debug: Added true#0 to Phi node: let true#7: bytes = φ(true#0 <- block@49) in block@49: // ternary_true_L45 +debug: Added true#0 to Phi node: let true#7: bytes = φ(true#0 <- block@49, true#0 <- block@50) in block@50: // ternary_false_L45 +debug: Replacing trivial Phi node: let true#7: bytes = φ(true#0 <- block@49, true#0 <- block@50) (true#7) with true#0 +debug: Deleting Phi assignment: let true#7: bytes = φ(true#0 <- block@49, true#0 <- block@50) +debug: Replaced trivial Phi node: let true#7: bytes = φ(true#0 <- block@49, true#0 <- block@50) (true#7) with true#0 in current definition for 1 blocks +debug: Created Phi assignment: let false#7: bytes = undefined while trying to resolve 'false' in block@51: // ternary_merge_L45 +debug: Added false#0 to Phi node: let false#7: bytes = φ(false#0 <- block@49) in block@49: // ternary_true_L45 +debug: Added false#0 to Phi node: let false#7: bytes = φ(false#0 <- block@49, false#0 <- block@50) in block@50: // ternary_false_L45 +debug: Replacing trivial Phi node: let false#7: bytes = φ(false#0 <- block@49, false#0 <- block@50) (false#7) with false#0 +debug: Deleting Phi assignment: let false#7: bytes = φ(false#0 <- block@49, false#0 <- block@50) +debug: Replaced trivial Phi node: let false#7: bytes = φ(false#0 <- block@49, false#0 <- block@50) (false#7) with false#0 in current definition for 1 blocks +debug: Terminated block@51: // ternary_merge_L45 debug: Sealing block@None: // ternary_true_L46 debug: Sealing block@None: // ternary_false_L46 -debug: Terminated block@19: // ternary_true_L46 -debug: Created Phi assignment: let false#6: bytes = undefined while trying to resolve 'false' in block@18: // ternary_merge_L45 -debug: Added false#0 to Phi node: let false#6: bytes = φ(false#0 <- block@16) in block@16: // ternary_true_L45 -debug: Added false#0 to Phi node: let false#6: bytes = φ(false#0 <- block@16, false#0 <- block@17) in block@17: // ternary_false_L45 -debug: Replacing trivial Phi node: let false#6: bytes = φ(false#0 <- block@16, false#0 <- block@17) (false#6) with false#0 -debug: Deleting Phi assignment: let false#6: bytes = φ(false#0 <- block@16, false#0 <- block@17) -debug: Replaced trivial Phi node: let false#6: bytes = φ(false#0 <- block@16, false#0 <- block@17) (false#6) with false#0 in current definition for 1 blocks -debug: Terminated block@20: // ternary_false_L46 -debug: Sealing block@21: // ternary_merge_L46 -debug: Created Phi assignment: let ternary_result%57#2: bytes = undefined while trying to resolve 'ternary_result%57' in block@21: // ternary_merge_L46 -debug: Added ternary_result%57#0 to Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@19) in block@19: // ternary_true_L46 -debug: Added ternary_result%57#1 to Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@19, ternary_result%57#1 <- block@20) in block@20: // ternary_false_L46 -debug: Created Phi assignment: let true#7: bytes = undefined while trying to resolve 'true' in block@21: // ternary_merge_L46 -debug: Added true#0 to Phi node: let true#7: bytes = φ(true#0 <- block@19) in block@19: // ternary_true_L46 -debug: Added true#0 to Phi node: let true#7: bytes = φ(true#0 <- block@19, true#0 <- block@20) in block@20: // ternary_false_L46 -debug: Replacing trivial Phi node: let true#7: bytes = φ(true#0 <- block@19, true#0 <- block@20) (true#7) with true#0 -debug: Deleting Phi assignment: let true#7: bytes = φ(true#0 <- block@19, true#0 <- block@20) -debug: Replaced trivial Phi node: let true#7: bytes = φ(true#0 <- block@19, true#0 <- block@20) (true#7) with true#0 in current definition for 1 blocks -debug: Created Phi assignment: let false#7: bytes = undefined while trying to resolve 'false' in block@21: // ternary_merge_L46 -debug: Added false#0 to Phi node: let false#7: bytes = φ(false#0 <- block@19) in block@19: // ternary_true_L46 -debug: Added false#0 to Phi node: let false#7: bytes = φ(false#0 <- block@19, false#0 <- block@20) in block@20: // ternary_false_L46 -debug: Replacing trivial Phi node: let false#7: bytes = φ(false#0 <- block@19, false#0 <- block@20) (false#7) with false#0 -debug: Deleting Phi assignment: let false#7: bytes = φ(false#0 <- block@19, false#0 <- block@20) -debug: Replaced trivial Phi node: let false#7: bytes = φ(false#0 <- block@19, false#0 <- block@20) (false#7) with false#0 in current definition for 1 blocks -debug: Terminated block@21: // ternary_merge_L46 +debug: Terminated block@52: // ternary_true_L46 +debug: Terminated block@53: // ternary_false_L46 +debug: Sealing block@54: // ternary_merge_L46 +debug: Created Phi assignment: let ternary_result%77#2: bytes = undefined while trying to resolve 'ternary_result%77' in block@54: // ternary_merge_L46 +debug: Added ternary_result%77#0 to Phi node: let ternary_result%77#2: bytes = φ(ternary_result%77#0 <- block@52) in block@52: // ternary_true_L46 +debug: Added ternary_result%77#1 to Phi node: let ternary_result%77#2: bytes = φ(ternary_result%77#0 <- block@52, ternary_result%77#1 <- block@53) in block@53: // ternary_false_L46 +debug: Created Phi assignment: let true#8: bytes = undefined while trying to resolve 'true' in block@54: // ternary_merge_L46 +debug: Added true#0 to Phi node: let true#8: bytes = φ(true#0 <- block@52) in block@52: // ternary_true_L46 +debug: Added true#0 to Phi node: let true#8: bytes = φ(true#0 <- block@52, true#0 <- block@53) in block@53: // ternary_false_L46 +debug: Replacing trivial Phi node: let true#8: bytes = φ(true#0 <- block@52, true#0 <- block@53) (true#8) with true#0 +debug: Deleting Phi assignment: let true#8: bytes = φ(true#0 <- block@52, true#0 <- block@53) +debug: Replaced trivial Phi node: let true#8: bytes = φ(true#0 <- block@52, true#0 <- block@53) (true#8) with true#0 in current definition for 1 blocks +debug: Created Phi assignment: let false#8: bytes = undefined while trying to resolve 'false' in block@54: // ternary_merge_L46 +debug: Added false#0 to Phi node: let false#8: bytes = φ(false#0 <- block@52) in block@52: // ternary_true_L46 +debug: Added false#0 to Phi node: let false#8: bytes = φ(false#0 <- block@52, false#0 <- block@53) in block@53: // ternary_false_L46 +debug: Replacing trivial Phi node: let false#8: bytes = φ(false#0 <- block@52, false#0 <- block@53) (false#8) with false#0 +debug: Deleting Phi assignment: let false#8: bytes = φ(false#0 <- block@52, false#0 <- block@53) +debug: Replaced trivial Phi node: let false#8: bytes = φ(false#0 <- block@52, false#0 <- block@53) (false#8) with false#0 in current definition for 1 blocks +debug: Terminated block@54: // ternary_merge_L46 debug: Sealing block@None: // ternary_true_L47 debug: Sealing block@None: // ternary_false_L47 -debug: Terminated block@22: // ternary_true_L47 -debug: Terminated block@23: // ternary_false_L47 -debug: Sealing block@24: // ternary_merge_L47 -debug: Created Phi assignment: let ternary_result%60#2: bytes = undefined while trying to resolve 'ternary_result%60' in block@24: // ternary_merge_L47 -debug: Added ternary_result%60#0 to Phi node: let ternary_result%60#2: bytes = φ(ternary_result%60#0 <- block@22) in block@22: // ternary_true_L47 -debug: Added ternary_result%60#1 to Phi node: let ternary_result%60#2: bytes = φ(ternary_result%60#0 <- block@22, ternary_result%60#1 <- block@23) in block@23: // ternary_false_L47 -debug: Created Phi assignment: let true#8: bytes = undefined while trying to resolve 'true' in block@24: // ternary_merge_L47 -debug: Added true#0 to Phi node: let true#8: bytes = φ(true#0 <- block@22) in block@22: // ternary_true_L47 -debug: Added true#0 to Phi node: let true#8: bytes = φ(true#0 <- block@22, true#0 <- block@23) in block@23: // ternary_false_L47 -debug: Replacing trivial Phi node: let true#8: bytes = φ(true#0 <- block@22, true#0 <- block@23) (true#8) with true#0 -debug: Deleting Phi assignment: let true#8: bytes = φ(true#0 <- block@22, true#0 <- block@23) -debug: Replaced trivial Phi node: let true#8: bytes = φ(true#0 <- block@22, true#0 <- block@23) (true#8) with true#0 in current definition for 1 blocks -debug: Created Phi assignment: let false#8: bytes = undefined while trying to resolve 'false' in block@24: // ternary_merge_L47 -debug: Added false#0 to Phi node: let false#8: bytes = φ(false#0 <- block@22) in block@22: // ternary_true_L47 -debug: Added false#0 to Phi node: let false#8: bytes = φ(false#0 <- block@22, false#0 <- block@23) in block@23: // ternary_false_L47 -debug: Replacing trivial Phi node: let false#8: bytes = φ(false#0 <- block@22, false#0 <- block@23) (false#8) with false#0 -debug: Deleting Phi assignment: let false#8: bytes = φ(false#0 <- block@22, false#0 <- block@23) -debug: Replaced trivial Phi node: let false#8: bytes = φ(false#0 <- block@22, false#0 <- block@23) (false#8) with false#0 in current definition for 1 blocks -debug: Terminated block@24: // ternary_merge_L47 -debug: Sealing block@None: // ternary_true_L48 -debug: Sealing block@None: // ternary_false_L48 -debug: Terminated block@25: // ternary_true_L48 -debug: Terminated block@26: // ternary_false_L48 -debug: Sealing block@27: // ternary_merge_L48 -debug: Created Phi assignment: let ternary_result%63#2: bytes = undefined while trying to resolve 'ternary_result%63' in block@27: // ternary_merge_L48 -debug: Added ternary_result%63#0 to Phi node: let ternary_result%63#2: bytes = φ(ternary_result%63#0 <- block@25) in block@25: // ternary_true_L48 -debug: Added ternary_result%63#1 to Phi node: let ternary_result%63#2: bytes = φ(ternary_result%63#0 <- block@25, ternary_result%63#1 <- block@26) in block@26: // ternary_false_L48 -debug: Created Phi assignment: let false#9: bytes = undefined while trying to resolve 'false' in block@27: // ternary_merge_L48 -debug: Added false#0 to Phi node: let false#9: bytes = φ(false#0 <- block@25) in block@25: // ternary_true_L48 -debug: Added false#0 to Phi node: let false#9: bytes = φ(false#0 <- block@25, false#0 <- block@26) in block@26: // ternary_false_L48 -debug: Replacing trivial Phi node: let false#9: bytes = φ(false#0 <- block@25, false#0 <- block@26) (false#9) with false#0 -debug: Deleting Phi assignment: let false#9: bytes = φ(false#0 <- block@25, false#0 <- block@26) -debug: Replaced trivial Phi node: let false#9: bytes = φ(false#0 <- block@25, false#0 <- block@26) (false#9) with false#0 in current definition for 1 blocks -debug: Terminated block@27: // ternary_merge_L48 -debug: Sealing block@0: // L71 -debug: Terminated block@0: // L71 +debug: Terminated block@55: // ternary_true_L47 +debug: Terminated block@56: // ternary_false_L47 +debug: Sealing block@57: // ternary_merge_L47 +debug: Created Phi assignment: let ternary_result%80#2: bytes = undefined while trying to resolve 'ternary_result%80' in block@57: // ternary_merge_L47 +debug: Added ternary_result%80#0 to Phi node: let ternary_result%80#2: bytes = φ(ternary_result%80#0 <- block@55) in block@55: // ternary_true_L47 +debug: Added ternary_result%80#1 to Phi node: let ternary_result%80#2: bytes = φ(ternary_result%80#0 <- block@55, ternary_result%80#1 <- block@56) in block@56: // ternary_false_L47 +debug: Created Phi assignment: let false#9: bytes = undefined while trying to resolve 'false' in block@57: // ternary_merge_L47 +debug: Added false#0 to Phi node: let false#9: bytes = φ(false#0 <- block@55) in block@55: // ternary_true_L47 +debug: Added false#0 to Phi node: let false#9: bytes = φ(false#0 <- block@55, false#0 <- block@56) in block@56: // ternary_false_L47 +debug: Replacing trivial Phi node: let false#9: bytes = φ(false#0 <- block@55, false#0 <- block@56) (false#9) with false#0 +debug: Deleting Phi assignment: let false#9: bytes = φ(false#0 <- block@55, false#0 <- block@56) +debug: Replaced trivial Phi node: let false#9: bytes = φ(false#0 <- block@55, false#0 <- block@56) (false#9) with false#0 in current definition for 1 blocks +debug: Terminated block@57: // ternary_merge_L47 +debug: Sealing block@0: // L70 +debug: Terminated block@0: // L70 debug: Sealing block@0: // L16 debug: Terminated block@0: // L16 debug: Sealing block@0: // L26 @@ -519,6 +664,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -527,9 +673,12 @@ debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.stubs.biguint.compare_biguints debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification +debug: Folded None b== None to 1 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%2#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -537,9 +686,12 @@ debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.stubs.biguint.compare_biguint_vs_uint64 debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification +debug: Folded None b== None to 1 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%4#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -550,6 +702,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded None == None to 1 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%4#0 debug: Optimizer: Simplify Conditional Branches @@ -561,6 +714,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -572,6 +726,7 @@ debug: Optimizing subroutine examples.stubs.biguint.BigUIntContract.approval_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -581,6 +736,7 @@ debug: Optimizing subroutine examples.stubs.biguint.compare_biguints debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -590,6 +746,7 @@ debug: Optimizing subroutine examples.stubs.biguint.compare_biguint_vs_uint64 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -599,6 +756,7 @@ debug: Optimizing subroutine examples.stubs.biguint.compare_uint64_vs_biguint debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -608,6 +766,7 @@ debug: Optimizing subroutine examples.stubs.biguint.BigUIntContract.clear_state_ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -639,78 +798,84 @@ debug: Coalescing local variables in examples.stubs.biguint.BigUIntContract.clea debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/stubs/out/biguint_BigUIntContract.final.ir debug: Inserted compare_biguints_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced compare_biguints_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced compare_biguints_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted compare_biguints_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced compare_biguints_block@0.ops[12]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' -debug: Inserted compare_biguints_block@0.ops[17]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced compare_biguints_block@0.ops[19]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -debug: Inserted compare_biguints_block@0.ops[24]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced compare_biguints_block@0.ops[26]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' -debug: Inserted compare_biguints_block@0.ops[31]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced compare_biguints_block@0.ops[33]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' -debug: Inserted compare_biguints_block@0.ops[38]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced compare_biguints_block@0.ops[40]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced compare_biguints_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted compare_biguints_block@0.ops[17]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced compare_biguints_block@0.ops[19]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted compare_biguints_block@0.ops[24]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced compare_biguints_block@0.ops[26]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted compare_biguints_block@0.ops[31]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced compare_biguints_block@0.ops[33]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted compare_biguint_vs_uint64_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[8]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[8]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted compare_biguint_vs_uint64_block@0.ops[16]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[18]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' -debug: Inserted compare_biguint_vs_uint64_block@0.ops[23]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[25]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' -debug: Inserted compare_biguint_vs_uint64_block@0.ops[33]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[35]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' -debug: Inserted compare_biguint_vs_uint64_block@0.ops[43]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[45]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' -debug: Inserted compare_biguint_vs_uint64_block@0.ops[53]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[55]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[18]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted compare_biguint_vs_uint64_block@0.ops[26]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[28]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted compare_biguint_vs_uint64_block@0.ops[36]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[38]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted compare_biguint_vs_uint64_block@0.ops[46]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[48]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted compare_biguint_vs_uint64_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted compare_biguint_vs_uint64_block@0.ops[13]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[16]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -debug: Inserted compare_biguint_vs_uint64_block@0.ops[31]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[34]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' -debug: Inserted compare_biguint_vs_uint64_block@0.ops[42]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[45]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' -debug: Inserted compare_biguint_vs_uint64_block@0.ops[53]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced compare_biguint_vs_uint64_block@0.ops[56]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted compare_biguint_vs_uint64_block@0.ops[24]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[27]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted compare_biguint_vs_uint64_block@0.ops[35]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[38]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted compare_biguint_vs_uint64_block@0.ops[46]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced compare_biguint_vs_uint64_block@0.ops[49]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted compare_uint64_vs_biguint_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[8]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[8]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted compare_uint64_vs_biguint_block@0.ops[16]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[18]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' -debug: Inserted compare_uint64_vs_biguint_block@0.ops[28]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[30]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' -debug: Inserted compare_uint64_vs_biguint_block@0.ops[38]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[40]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' -debug: Inserted compare_uint64_vs_biguint_block@0.ops[48]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[50]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[18]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted compare_uint64_vs_biguint_block@0.ops[26]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[28]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted compare_uint64_vs_biguint_block@0.ops[36]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[38]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted compare_uint64_vs_biguint_block@0.ops[46]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[48]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted compare_uint64_vs_biguint_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted compare_uint64_vs_biguint_block@0.ops[13]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[16]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -debug: Inserted compare_uint64_vs_biguint_block@0.ops[26]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[29]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' -debug: Inserted compare_uint64_vs_biguint_block@0.ops[37]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[40]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' -debug: Inserted compare_uint64_vs_biguint_block@0.ops[48]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced compare_uint64_vs_biguint_block@0.ops[51]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted compare_uint64_vs_biguint_block@0.ops[24]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[27]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted compare_uint64_vs_biguint_block@0.ops[35]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[38]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted compare_uint64_vs_biguint_block@0.ops[46]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced compare_uint64_vs_biguint_block@0.ops[49]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Output IR to /examples/stubs/out/bytes_BytesContract.ssa.ir info: Optimizing examples.stubs.bytes.BytesContract at level 1 debug: Begin optimization pass 1/100 debug: Optimizing subroutine examples.stubs.bytes.BytesContract.approval_program debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification -debug: Folded len("1234567") to 7 -debug: Folded len("1234567") to 7 +debug: Folded concat("a", "b") to b'ab' debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%11#0, ternary_result%13#1 +debug: Replacing {ternary_result%13#1} with awst_tmp%11#0 made 1 modifications +debug: Found equivalence set: awst_tmp%17#0, ternary_result%19#1 +debug: Replacing {ternary_result%19#1} with awst_tmp%17#0 made 1 modifications +debug: Found equivalence set: awst_tmp%17#1, ternary_result%21#1 +debug: Replacing {ternary_result%21#1} with awst_tmp%17#1 made 1 modifications +debug: Found equivalence set: awst_tmp%24#0, ternary_result%26#1 +debug: Replacing {ternary_result%26#1} with awst_tmp%24#0 made 1 modifications +debug: Found equivalence set: awst_tmp%49#1, ternary_result%53#1 +debug: Replacing {ternary_result%53#1} with awst_tmp%49#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable base_64#0 debug: Removing unused variable base_32#0 debug: Removing unused variable base_16#0 debug: Removing unused variable empty#0 +debug: Removing unused variable tmp%6#0 debug: Removing unused variable c#0 debug: Removing unused variable abc#0 -debug: Removing unused variable base_length%34#0 -debug: Removing unused variable tmp%35#0 +debug: Removing unused variable tmp%47#0 debug: Removing unused variable true#0 debug: Removing unused variable false#0 debug: Removing unused variable a#0 @@ -721,12 +886,18 @@ debug: Removing unused variable y#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L26 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_false_L27 because it's used by phi nodes +info: Not removing empty block block@8: // ternary_false_L27 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_false_L28 because it's used by phi nodes +info: Not removing empty block block@29: // ternary_false_L33 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.stubs.bytes.BytesContract.clear_state_program debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -738,6 +909,12 @@ debug: Optimizing subroutine examples.stubs.bytes.BytesContract.approval_program debug: Optimizer: Arithmetic Simplification debug: Folded len(QmFzZSA2NCBlbmNvZGVk) to 15 debug: Folded len("") to 0 +debug: Folded concat("c", "d") to b'cd' +debug: Folded len("abc") to 3 +debug: Folded len("abc") to 3 +debug: Folded len("abc") to 3 +debug: Folded len("abc") to 3 +debug: Folded len("abc") to 3 debug: Folded len("abc") to 3 debug: Folded len("abc") to 3 debug: Folded len("abc") to 3 @@ -745,7 +922,6 @@ debug: Folded len("abc") to 3 debug: Folded len("abc") to 3 debug: Folded len("abc") to 3 debug: Folded len("abc") to 3 -debug: Folded 7 - 1 to 6 debug: Folded len("1") to 1 debug: Folded len("1") to 1 debug: Folded len("1") to 1 @@ -757,90 +933,115 @@ debug: Folded len("") to 0 debug: Folded len("") to 0 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%0#0 +debug: Removing unused variable tmp%1#0 +debug: Removing unused variable tmp%2#0 debug: Removing unused variable tmp%3#0 debug: Removing unused variable tmp%4#0 -debug: Removing unused variable base_length%17#0 -debug: Removing unused variable tmp%18#0 -debug: Removing unused variable base_length%22#0 -debug: Removing unused variable tmp%23#0 -debug: Removing unused variable base_length%27#0 -debug: Removing unused variable tmp%28#0 -debug: Removing unused variable tmp%30#0 -debug: Removing unused variable tmp%36#0 -debug: Removing unused variable tmp%39#0 -debug: Removing unused variable tmp%41#0 -debug: Removing unused variable tmp%44#0 -debug: Removing unused variable tmp%47#0 -debug: Removing unused variable tmp%50#0 -debug: Removing unused variable tmp%53#0 +debug: Removing unused variable tmp%7#0 +debug: Removing unused variable c#1 +debug: Removing unused variable tmp%9#0 +debug: Removing unused variable base_length%14#0 +debug: Removing unused variable awst_tmp%29#0 +debug: Removing unused variable awst_tmp%34#0 +debug: Removing unused variable base_length%37#0 +debug: Removing unused variable awst_tmp%40#0 +debug: Removing unused variable awst_tmp%40#1 +debug: Removing unused variable tmp%48#0 +debug: Removing unused variable awst_tmp%49#0 debug: Removing unused variable tmp%56#0 -debug: Removing unused variable tmp%59#0 -debug: Removing unused variable tmp%62#0 +debug: Removing unused variable tmp%58#0 +debug: Removing unused variable tmp%61#0 +debug: Removing unused variable tmp%64#0 +debug: Removing unused variable tmp%67#0 +debug: Removing unused variable tmp%70#0 +debug: Removing unused variable tmp%73#0 +debug: Removing unused variable tmp%76#0 +debug: Removing unused variable tmp%79#0 +debug: Removing unused variable tmp%82#0 +debug: Removing unused variable tmp%84#0 +debug: Removing unused variable tmp%86#0 +debug: Removing unused variable y#1 debug: Optimizer: Simplify Conditional Branches -debug: ConditionalBranch goto 1u ? block@2 : block@1 simplified to goto block@2 -debug: ConditionalBranch goto 1u ? block@5 : block@4 simplified to goto block@5 -debug: ConditionalBranch goto 1u ? block@8 : block@7 simplified to goto block@8 -debug: ConditionalBranch goto 0u ? block@11 : block@10 simplified to goto block@10 -debug: ConditionalBranch goto 0u ? block@14 : block@13 simplified to goto block@13 -debug: ConditionalBranch goto 1u ? block@16 : block@17 simplified to goto block@16 -debug: ConditionalBranch goto 1u ? block@19 : block@20 simplified to goto block@19 -debug: ConditionalBranch goto 0u ? block@22 : block@23 simplified to goto block@23 -debug: ConditionalBranch goto 0u ? block@25 : block@26 simplified to goto block@26 +debug: ConditionalBranch goto 1u ? block@32 : block@31 simplified to goto block@32 +debug: ConditionalBranch goto 1u ? block@35 : block@34 simplified to goto block@35 +debug: ConditionalBranch goto 1u ? block@38 : block@37 simplified to goto block@38 +debug: ConditionalBranch goto 0u ? block@41 : block@40 simplified to goto block@40 +debug: ConditionalBranch goto 0u ? block@44 : block@43 simplified to goto block@43 +debug: ConditionalBranch goto 1u ? block@46 : block@47 simplified to goto block@46 +debug: ConditionalBranch goto 1u ? block@49 : block@50 simplified to goto block@49 +debug: ConditionalBranch goto 0u ? block@52 : block@53 simplified to goto block@53 +debug: ConditionalBranch goto 0u ? block@55 : block@56 simplified to goto block@56 debug: Optimizer: Remove Linear Jump -debug: Replaced predecessor block@2: // ternary_false_L38 with block@0: // L5 in block@3: // ternary_merge_L38 -debug: Merged linear block@2: // ternary_false_L38 into block@0: // L5 -debug: Replaced predecessor block@5: // ternary_false_L41 with block@3: // ternary_merge_L38 in block@6: // ternary_merge_L41 -debug: Merged linear block@5: // ternary_false_L41 into block@3: // ternary_merge_L38 -debug: Replaced predecessor block@8: // ternary_false_L42 with block@6: // ternary_merge_L41 in block@9: // ternary_merge_L42 -debug: Merged linear block@8: // ternary_false_L42 into block@6: // ternary_merge_L41 -debug: Replaced predecessor block@10: // ternary_true_L43 with block@9: // ternary_merge_L42 in block@12: // ternary_merge_L43 -debug: Merged linear block@10: // ternary_true_L43 into block@9: // ternary_merge_L42 -debug: Replaced predecessor block@13: // ternary_true_L44 with block@12: // ternary_merge_L43 in block@15: // ternary_merge_L44 -debug: Merged linear block@13: // ternary_true_L44 into block@12: // ternary_merge_L43 -debug: Replaced predecessor block@16: // ternary_true_L45 with block@15: // ternary_merge_L44 in block@18: // ternary_merge_L45 -debug: Merged linear block@16: // ternary_true_L45 into block@15: // ternary_merge_L44 -debug: Replaced predecessor block@19: // ternary_true_L46 with block@18: // ternary_merge_L45 in block@21: // ternary_merge_L46 -debug: Merged linear block@19: // ternary_true_L46 into block@18: // ternary_merge_L45 -debug: Replaced predecessor block@23: // ternary_false_L47 with block@21: // ternary_merge_L46 in block@24: // ternary_merge_L47 -debug: Merged linear block@23: // ternary_false_L47 into block@21: // ternary_merge_L46 -debug: Replaced predecessor block@26: // ternary_false_L48 with block@24: // ternary_merge_L47 in block@27: // ternary_merge_L48 -debug: Merged linear block@26: // ternary_false_L48 into block@24: // ternary_merge_L47 +debug: Replaced predecessor block@32: // ternary_false_L38 with block@30: // ternary_merge_L33 in block@33: // ternary_merge_L38 +debug: Merged linear block@32: // ternary_false_L38 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@35: // ternary_false_L40 with block@33: // ternary_merge_L38 in block@36: // ternary_merge_L40 +debug: Merged linear block@35: // ternary_false_L40 into block@33: // ternary_merge_L38 +debug: Replaced predecessor block@38: // ternary_false_L41 with block@36: // ternary_merge_L40 in block@39: // ternary_merge_L41 +debug: Merged linear block@38: // ternary_false_L41 into block@36: // ternary_merge_L40 +debug: Replaced predecessor block@40: // ternary_true_L42 with block@39: // ternary_merge_L41 in block@42: // ternary_merge_L42 +debug: Merged linear block@40: // ternary_true_L42 into block@39: // ternary_merge_L41 +debug: Replaced predecessor block@43: // ternary_true_L43 with block@42: // ternary_merge_L42 in block@45: // ternary_merge_L43 +debug: Merged linear block@43: // ternary_true_L43 into block@42: // ternary_merge_L42 +debug: Replaced predecessor block@46: // ternary_true_L44 with block@45: // ternary_merge_L43 in block@48: // ternary_merge_L44 +debug: Merged linear block@46: // ternary_true_L44 into block@45: // ternary_merge_L43 +debug: Replaced predecessor block@49: // ternary_true_L45 with block@48: // ternary_merge_L44 in block@51: // ternary_merge_L45 +debug: Merged linear block@49: // ternary_true_L45 into block@48: // ternary_merge_L44 +debug: Replaced predecessor block@53: // ternary_false_L46 with block@51: // ternary_merge_L45 in block@54: // ternary_merge_L46 +debug: Merged linear block@53: // ternary_false_L46 into block@51: // ternary_merge_L45 +debug: Replaced predecessor block@56: // ternary_false_L47 with block@54: // ternary_merge_L46 in block@57: // ternary_merge_L47 +debug: Merged linear block@56: // ternary_false_L47 into block@54: // ternary_merge_L46 debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L26 because it's used by phi nodes +info: Not removing empty block block@5: // ternary_false_L27 because it's used by phi nodes +info: Not removing empty block block@8: // ternary_false_L27 because it's used by phi nodes +info: Not removing empty block block@11: // ternary_false_L28 because it's used by phi nodes +info: Not removing empty block block@29: // ternary_false_L33 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks -debug: Removing unreachable blocks: block@1: // ternary_true_L38, block@4: // ternary_true_L41, block@7: // ternary_true_L42, block@11: // ternary_false_L43, block@14: // ternary_false_L44, block@17: // ternary_false_L45, block@20: // ternary_false_L46, block@22: // ternary_true_L47, block@25: // ternary_true_L48 -debug: Removed unreachable predecessors from block@3: // ternary_merge_L38 -debug: Removed unreachable predecessors from block@6: // ternary_merge_L41 -debug: Removed unreachable predecessors from block@9: // ternary_merge_L42 -debug: Removed unreachable predecessors from block@12: // ternary_merge_L43 -debug: Removed unreachable predecessors from block@15: // ternary_merge_L44 -debug: Removed unreachable predecessors from block@18: // ternary_merge_L45 -debug: Removed unreachable predecessors from block@21: // ternary_merge_L46 -debug: Removed unreachable predecessors from block@24: // ternary_merge_L47 -debug: Removed unreachable predecessors from block@27: // ternary_merge_L48 -debug: Found ternary_result%40#0, ternary_result%42#0, ternary_result%45#0, ternary_result%48#1, ternary_result%51#1, ternary_result%54#1, ternary_result%57#1, ternary_result%60#0, ternary_result%63#0 to remove from Phi nodes -debug: Replacing trivial Phi node: let ternary_result%40#2: bytes = φ(ternary_result%40#1 <- block@0) (ternary_result%40#2) with ternary_result%40#1 -debug: Deleting Phi assignment: let ternary_result%40#2: bytes = φ(ternary_result%40#1 <- block@0) -debug: Replacing trivial Phi node: let ternary_result%42#2: bytes = φ(ternary_result%42#1 <- block@3) (ternary_result%42#2) with ternary_result%42#1 -debug: Deleting Phi assignment: let ternary_result%42#2: bytes = φ(ternary_result%42#1 <- block@3) -debug: Replacing trivial Phi node: let ternary_result%45#2: bytes = φ(ternary_result%45#1 <- block@6) (ternary_result%45#2) with ternary_result%45#1 -debug: Deleting Phi assignment: let ternary_result%45#2: bytes = φ(ternary_result%45#1 <- block@6) -debug: Replacing trivial Phi node: let ternary_result%48#2: bytes = φ(ternary_result%48#0 <- block@9) (ternary_result%48#2) with ternary_result%48#0 -debug: Deleting Phi assignment: let ternary_result%48#2: bytes = φ(ternary_result%48#0 <- block@9) -debug: Replacing trivial Phi node: let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@12) (ternary_result%51#2) with ternary_result%51#0 -debug: Deleting Phi assignment: let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@12) -debug: Replacing trivial Phi node: let ternary_result%54#2: bytes = φ(ternary_result%54#0 <- block@15) (ternary_result%54#2) with ternary_result%54#0 -debug: Deleting Phi assignment: let ternary_result%54#2: bytes = φ(ternary_result%54#0 <- block@15) -debug: Replacing trivial Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@18) (ternary_result%57#2) with ternary_result%57#0 -debug: Deleting Phi assignment: let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@18) -debug: Replacing trivial Phi node: let ternary_result%60#2: bytes = φ(ternary_result%60#1 <- block@21) (ternary_result%60#2) with ternary_result%60#1 -debug: Deleting Phi assignment: let ternary_result%60#2: bytes = φ(ternary_result%60#1 <- block@21) -debug: Replacing trivial Phi node: let ternary_result%63#2: bytes = φ(ternary_result%63#1 <- block@24) (ternary_result%63#2) with ternary_result%63#1 -debug: Deleting Phi assignment: let ternary_result%63#2: bytes = φ(ternary_result%63#1 <- block@24) +debug: Removing unreachable blocks: block@31: // ternary_true_L38, block@34: // ternary_true_L40, block@37: // ternary_true_L41, block@41: // ternary_false_L42, block@44: // ternary_false_L43, block@47: // ternary_false_L44, block@50: // ternary_false_L45, block@52: // ternary_true_L46, block@55: // ternary_true_L47 +debug: Removed unreachable predecessors from block@33: // ternary_merge_L38 +debug: Removed unreachable predecessors from block@36: // ternary_merge_L40 +debug: Removed unreachable predecessors from block@39: // ternary_merge_L41 +debug: Removed unreachable predecessors from block@42: // ternary_merge_L42 +debug: Removed unreachable predecessors from block@45: // ternary_merge_L43 +debug: Removed unreachable predecessors from block@48: // ternary_merge_L44 +debug: Removed unreachable predecessors from block@51: // ternary_merge_L45 +debug: Removed unreachable predecessors from block@54: // ternary_merge_L46 +debug: Removed unreachable predecessors from block@57: // ternary_merge_L47 +debug: Removing unreachable phi arguments: ternary_result%57#0 <- block@31 +debug: Replacing trivial Phi node: let ternary_result%57#2: bytes = φ(ternary_result%57#1 <- block@30) (ternary_result%57#2) with ternary_result%57#1 +debug: Deleting Phi assignment: let ternary_result%57#2: bytes = φ(ternary_result%57#1 <- block@30) +debug: Removing unreachable phi arguments: ternary_result%59#0 <- block@34 +debug: Replacing trivial Phi node: let ternary_result%59#2: bytes = φ(ternary_result%59#1 <- block@33) (ternary_result%59#2) with ternary_result%59#1 +debug: Deleting Phi assignment: let ternary_result%59#2: bytes = φ(ternary_result%59#1 <- block@33) +debug: Removing unreachable phi arguments: ternary_result%62#0 <- block@37 +debug: Replacing trivial Phi node: let ternary_result%62#2: bytes = φ(ternary_result%62#1 <- block@36) (ternary_result%62#2) with ternary_result%62#1 +debug: Deleting Phi assignment: let ternary_result%62#2: bytes = φ(ternary_result%62#1 <- block@36) +debug: Removing unreachable phi arguments: ternary_result%65#1 <- block@41 +debug: Replacing trivial Phi node: let ternary_result%65#2: bytes = φ(ternary_result%65#0 <- block@39) (ternary_result%65#2) with ternary_result%65#0 +debug: Deleting Phi assignment: let ternary_result%65#2: bytes = φ(ternary_result%65#0 <- block@39) +debug: Removing unreachable phi arguments: ternary_result%68#1 <- block@44 +debug: Replacing trivial Phi node: let ternary_result%68#2: bytes = φ(ternary_result%68#0 <- block@42) (ternary_result%68#2) with ternary_result%68#0 +debug: Deleting Phi assignment: let ternary_result%68#2: bytes = φ(ternary_result%68#0 <- block@42) +debug: Removing unreachable phi arguments: ternary_result%71#1 <- block@47 +debug: Replacing trivial Phi node: let ternary_result%71#2: bytes = φ(ternary_result%71#0 <- block@45) (ternary_result%71#2) with ternary_result%71#0 +debug: Deleting Phi assignment: let ternary_result%71#2: bytes = φ(ternary_result%71#0 <- block@45) +debug: Removing unreachable phi arguments: ternary_result%74#1 <- block@50 +debug: Replacing trivial Phi node: let ternary_result%74#2: bytes = φ(ternary_result%74#0 <- block@48) (ternary_result%74#2) with ternary_result%74#0 +debug: Deleting Phi assignment: let ternary_result%74#2: bytes = φ(ternary_result%74#0 <- block@48) +debug: Removing unreachable phi arguments: ternary_result%77#0 <- block@52 +debug: Replacing trivial Phi node: let ternary_result%77#2: bytes = φ(ternary_result%77#1 <- block@51) (ternary_result%77#2) with ternary_result%77#1 +debug: Deleting Phi assignment: let ternary_result%77#2: bytes = φ(ternary_result%77#1 <- block@51) +debug: Removing unreachable phi arguments: ternary_result%80#0 <- block@55 +debug: Replacing trivial Phi node: let ternary_result%80#2: bytes = φ(ternary_result%80#1 <- block@54) (ternary_result%80#2) with ternary_result%80#1 +debug: Deleting Phi assignment: let ternary_result%80#2: bytes = φ(ternary_result%80#1 <- block@54) debug: Optimizing subroutine examples.stubs.bytes.BytesContract.clear_state_program debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -851,52 +1052,152 @@ debug: Begin optimization pass 3/100 debug: Optimizing subroutine examples.stubs.bytes.BytesContract.approval_program debug: Optimizer: Arithmetic Simplification debug: Folded !0 to 1u +debug: Folded 1 < 3 to 1 +debug: Folded 1 < 3 to 1 +debug: Folded 1 < 3 to 1 +debug: Folded 1 < 3 to 1 +debug: Folded 1 < 3 to 1 debug: Folded 3 - 1 to 2 +debug: Folded 2 < 3 to 1 debug: Folded 3 - 2 to 1 +debug: Folded 2 < 3 to 1 debug: Folded 3 - 2 to 1 +debug: Folded 1 < 3 to 1 debug: Folded 3 - 1 to 2 +debug: Folded 10 < 3 to 0 +debug: Folded 10 < 3 to 0 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%5#0 -debug: Removing unused variable tmp%19#0 -debug: Removing unused variable tmp%24#0 -debug: Removing unused variable tmp%29#0 -debug: Removing unused variable tmp%31#0 -debug: Removing unused variable ternary_result%40#1 -debug: Removing unused variable ternary_result%42#1 -debug: Removing unused variable ternary_result%45#1 -debug: Removing unused variable ternary_result%48#0 -debug: Removing unused variable ternary_result%51#0 -debug: Removing unused variable ternary_result%54#0 -debug: Removing unused variable ternary_result%57#0 -debug: Removing unused variable ternary_result%60#1 -debug: Removing unused variable ternary_result%63#1 +debug: Removing unused variable tmp%8#0 +debug: Removing unused variable tmp%10#0 +debug: Removing unused variable tmp%12#0 +debug: Removing unused variable tmp%18#0 +debug: Removing unused variable tmp%20#0 +debug: Removing unused variable tmp%25#0 +debug: Removing unused variable tmp%30#0 +debug: Removing unused variable tmp%35#0 +debug: Removing unused variable tmp%41#0 +debug: Removing unused variable tmp%43#0 +debug: Removing unused variable tmp%50#0 +debug: Removing unused variable tmp%52#0 +debug: Removing unused variable ternary_result%57#1 +debug: Removing unused variable ternary_result%59#1 +debug: Removing unused variable ternary_result%62#1 +debug: Removing unused variable ternary_result%65#0 +debug: Removing unused variable ternary_result%68#0 +debug: Removing unused variable ternary_result%71#0 +debug: Removing unused variable ternary_result%74#0 +debug: Removing unused variable ternary_result%77#1 +debug: Removing unused variable ternary_result%80#1 +debug: Removing unused variable tmp%83#0 +debug: Removing unused variable tmp%85#0 +debug: Removing unused variable tmp%87#0 +debug: Removing unused variable tmp%88#0 +debug: Removing unused variable y#2 debug: Optimizer: Simplify Conditional Branches +debug: ConditionalBranch goto 1u ? block@1 : block@2 simplified to goto block@1 +debug: ConditionalBranch goto 1u ? block@4 : block@5 simplified to goto block@4 +debug: ConditionalBranch goto 1u ? block@7 : block@8 simplified to goto block@7 +debug: ConditionalBranch goto 1u ? block@10 : block@11 simplified to goto block@10 +debug: ConditionalBranch goto 1u ? block@13 : block@14 simplified to goto block@13 +debug: ConditionalBranch goto 1u ? block@16 : block@17 simplified to goto block@16 +debug: ConditionalBranch goto 1u ? block@19 : block@20 simplified to goto block@19 +debug: ConditionalBranch goto 1u ? block@22 : block@23 simplified to goto block@22 +debug: ConditionalBranch goto 0u ? block@25 : block@26 simplified to goto block@26 +debug: ConditionalBranch goto 0u ? block@28 : block@29 simplified to goto block@29 debug: Optimizer: Remove Linear Jump -debug: Replaced predecessor block@3: // ternary_merge_L38 with block@0: // L5 in block@6: // ternary_merge_L41 -debug: Merged linear block@3: // ternary_merge_L38 into block@0: // L5 -debug: Replaced predecessor block@6: // ternary_merge_L41 with block@0: // L5 in block@9: // ternary_merge_L42 -debug: Merged linear block@6: // ternary_merge_L41 into block@0: // L5 -debug: Replaced predecessor block@9: // ternary_merge_L42 with block@0: // L5 in block@12: // ternary_merge_L43 -debug: Merged linear block@9: // ternary_merge_L42 into block@0: // L5 -debug: Replaced predecessor block@12: // ternary_merge_L43 with block@0: // L5 in block@15: // ternary_merge_L44 -debug: Merged linear block@12: // ternary_merge_L43 into block@0: // L5 -debug: Replaced predecessor block@15: // ternary_merge_L44 with block@0: // L5 in block@18: // ternary_merge_L45 -debug: Merged linear block@15: // ternary_merge_L44 into block@0: // L5 -debug: Replaced predecessor block@18: // ternary_merge_L45 with block@0: // L5 in block@21: // ternary_merge_L46 -debug: Merged linear block@18: // ternary_merge_L45 into block@0: // L5 -debug: Replaced predecessor block@21: // ternary_merge_L46 with block@0: // L5 in block@24: // ternary_merge_L47 -debug: Merged linear block@21: // ternary_merge_L46 into block@0: // L5 -debug: Replaced predecessor block@24: // ternary_merge_L47 with block@0: // L5 in block@27: // ternary_merge_L48 -debug: Merged linear block@24: // ternary_merge_L47 into block@0: // L5 -debug: Merged linear block@27: // ternary_merge_L48 into block@0: // L5 +debug: Replaced predecessor block@1: // ternary_true_L26 with block@0: // L5 in block@3: // ternary_merge_L26 +debug: Merged linear block@1: // ternary_true_L26 into block@0: // L5 +debug: Replaced predecessor block@4: // ternary_true_L27 with block@3: // ternary_merge_L26 in block@6: // ternary_merge_L27 +debug: Merged linear block@4: // ternary_true_L27 into block@3: // ternary_merge_L26 +debug: Replaced predecessor block@7: // ternary_true_L27 with block@6: // ternary_merge_L27 in block@9: // ternary_merge_L27 +debug: Merged linear block@7: // ternary_true_L27 into block@6: // ternary_merge_L27 +debug: Replaced predecessor block@10: // ternary_true_L28 with block@9: // ternary_merge_L27 in block@12: // ternary_merge_L28 +debug: Merged linear block@10: // ternary_true_L28 into block@9: // ternary_merge_L27 +debug: Replaced predecessor block@13: // ternary_true_L29 with block@12: // ternary_merge_L28 in block@15: // ternary_merge_L29 +debug: Merged linear block@13: // ternary_true_L29 into block@12: // ternary_merge_L28 +debug: Replaced predecessor block@16: // ternary_true_L30 with block@15: // ternary_merge_L29 in block@18: // ternary_merge_L30 +debug: Merged linear block@16: // ternary_true_L30 into block@15: // ternary_merge_L29 +debug: Replaced predecessor block@19: // ternary_true_L31 with block@18: // ternary_merge_L30 in block@21: // ternary_merge_L31 +debug: Merged linear block@19: // ternary_true_L31 into block@18: // ternary_merge_L30 +debug: Replaced predecessor block@22: // ternary_true_L31 with block@21: // ternary_merge_L31 in block@24: // ternary_merge_L31 +debug: Merged linear block@22: // ternary_true_L31 into block@21: // ternary_merge_L31 +debug: Replaced predecessor block@26: // ternary_false_L33 with block@24: // ternary_merge_L31 in block@27: // ternary_merge_L33 +debug: Merged linear block@26: // ternary_false_L33 into block@24: // ternary_merge_L31 +debug: Replaced predecessor block@29: // ternary_false_L33 with block@27: // ternary_merge_L33 in block@30: // ternary_merge_L33 +debug: Merged linear block@29: // ternary_false_L33 into block@27: // ternary_merge_L33 +debug: Replaced predecessor block@33: // ternary_merge_L38 with block@30: // ternary_merge_L33 in block@36: // ternary_merge_L40 +debug: Merged linear block@33: // ternary_merge_L38 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@36: // ternary_merge_L40 with block@30: // ternary_merge_L33 in block@39: // ternary_merge_L41 +debug: Merged linear block@36: // ternary_merge_L40 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@39: // ternary_merge_L41 with block@30: // ternary_merge_L33 in block@42: // ternary_merge_L42 +debug: Merged linear block@39: // ternary_merge_L41 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@42: // ternary_merge_L42 with block@30: // ternary_merge_L33 in block@45: // ternary_merge_L43 +debug: Merged linear block@42: // ternary_merge_L42 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@45: // ternary_merge_L43 with block@30: // ternary_merge_L33 in block@48: // ternary_merge_L44 +debug: Merged linear block@45: // ternary_merge_L43 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@48: // ternary_merge_L44 with block@30: // ternary_merge_L33 in block@51: // ternary_merge_L45 +debug: Merged linear block@48: // ternary_merge_L44 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@51: // ternary_merge_L45 with block@30: // ternary_merge_L33 in block@54: // ternary_merge_L46 +debug: Merged linear block@51: // ternary_merge_L45 into block@30: // ternary_merge_L33 +debug: Replaced predecessor block@54: // ternary_merge_L46 with block@30: // ternary_merge_L33 in block@57: // ternary_merge_L47 +debug: Merged linear block@54: // ternary_merge_L46 into block@30: // ternary_merge_L33 +debug: Merged linear block@57: // ternary_merge_L47 into block@30: // ternary_merge_L33 debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L26 because it's currently unreachable +info: Not removing empty block block@5: // ternary_false_L27 because it's currently unreachable +info: Not removing empty block block@8: // ternary_false_L27 because it's currently unreachable +info: Not removing empty block block@11: // ternary_false_L28 because it's currently unreachable debug: Optimizer: Remove Unreachable Blocks +debug: Removing unreachable blocks: block@2: // ternary_false_L26, block@5: // ternary_false_L27, block@8: // ternary_false_L27, block@11: // ternary_false_L28, block@14: // ternary_false_L29, block@17: // ternary_false_L30, block@20: // ternary_false_L31, block@23: // ternary_false_L31, block@25: // ternary_true_L33, block@28: // ternary_true_L33 +debug: Removed unreachable predecessors from block@3: // ternary_merge_L26 +debug: Removed unreachable predecessors from block@6: // ternary_merge_L27 +debug: Removed unreachable predecessors from block@9: // ternary_merge_L27 +debug: Removed unreachable predecessors from block@12: // ternary_merge_L28 +debug: Removed unreachable predecessors from block@15: // ternary_merge_L29 +debug: Removed unreachable predecessors from block@18: // ternary_merge_L30 +debug: Removed unreachable predecessors from block@21: // ternary_merge_L31 +debug: Removed unreachable predecessors from block@24: // ternary_merge_L31 +debug: Removed unreachable predecessors from block@27: // ternary_merge_L33 +debug: Removed unreachable predecessors from block@30: // ternary_merge_L33 +debug: Removing unreachable phi arguments: awst_tmp%11#0 <- block@2 +debug: Replacing trivial Phi node: let ternary_result%13#2: uint64 = φ(ternary_result%13#0 <- block@0) (ternary_result%13#2) with ternary_result%13#0 +debug: Deleting Phi assignment: let ternary_result%13#2: uint64 = φ(ternary_result%13#0 <- block@0) +debug: Removing unreachable phi arguments: awst_tmp%17#0 <- block@5 +debug: Replacing trivial Phi node: let ternary_result%19#2: uint64 = φ(ternary_result%19#0 <- block@3) (ternary_result%19#2) with ternary_result%19#0 +debug: Deleting Phi assignment: let ternary_result%19#2: uint64 = φ(ternary_result%19#0 <- block@3) +debug: Removing unreachable phi arguments: awst_tmp%17#1 <- block@8 +debug: Replacing trivial Phi node: let ternary_result%21#2: uint64 = φ(ternary_result%21#0 <- block@6) (ternary_result%21#2) with ternary_result%21#0 +debug: Deleting Phi assignment: let ternary_result%21#2: uint64 = φ(ternary_result%21#0 <- block@6) +debug: Removing unreachable phi arguments: awst_tmp%24#0 <- block@11 +debug: Replacing trivial Phi node: let ternary_result%26#2: uint64 = φ(ternary_result%26#0 <- block@9) (ternary_result%26#2) with ternary_result%26#0 +debug: Deleting Phi assignment: let ternary_result%26#2: uint64 = φ(ternary_result%26#0 <- block@9) +debug: Removing unreachable phi arguments: ternary_result%31#1 <- block@14 +debug: Replacing trivial Phi node: let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@12) (ternary_result%31#2) with ternary_result%31#0 +debug: Deleting Phi assignment: let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@12) +debug: Removing unreachable phi arguments: ternary_result%36#1 <- block@17 +debug: Replacing trivial Phi node: let ternary_result%36#2: uint64 = φ(ternary_result%36#0 <- block@15) (ternary_result%36#2) with ternary_result%36#0 +debug: Deleting Phi assignment: let ternary_result%36#2: uint64 = φ(ternary_result%36#0 <- block@15) +debug: Removing unreachable phi arguments: ternary_result%42#1 <- block@20 +debug: Replacing trivial Phi node: let ternary_result%42#2: uint64 = φ(ternary_result%42#0 <- block@18) (ternary_result%42#2) with ternary_result%42#0 +debug: Deleting Phi assignment: let ternary_result%42#2: uint64 = φ(ternary_result%42#0 <- block@18) +debug: Removing unreachable phi arguments: ternary_result%44#1 <- block@23 +debug: Replacing trivial Phi node: let ternary_result%44#2: uint64 = φ(ternary_result%44#0 <- block@21) (ternary_result%44#2) with ternary_result%44#0 +debug: Deleting Phi assignment: let ternary_result%44#2: uint64 = φ(ternary_result%44#0 <- block@21) +debug: Removing unreachable phi arguments: ternary_result%51#0 <- block@25 +debug: Replacing trivial Phi node: let ternary_result%51#2: uint64 = φ(ternary_result%51#1 <- block@24) (ternary_result%51#2) with ternary_result%51#1 +debug: Deleting Phi assignment: let ternary_result%51#2: uint64 = φ(ternary_result%51#1 <- block@24) +debug: Removing unreachable phi arguments: ternary_result%53#0 <- block@28 +debug: Replacing trivial Phi node: let ternary_result%53#2: uint64 = φ(awst_tmp%49#1 <- block@27) (ternary_result%53#2) with awst_tmp%49#1 +debug: Deleting Phi assignment: let ternary_result%53#2: uint64 = φ(awst_tmp%49#1 <- block@27) debug: Optimizing subroutine examples.stubs.bytes.BytesContract.clear_state_program debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -908,7 +1209,82 @@ debug: Optimizing subroutine examples.stubs.bytes.BytesContract.approval_program debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable awst_tmp%11#0 +debug: Removing unused variable ternary_result%13#0 +debug: Removing unused variable awst_tmp%17#0 +debug: Removing unused variable ternary_result%19#0 +debug: Removing unused variable awst_tmp%17#1 +debug: Removing unused variable ternary_result%21#0 +debug: Removing unused variable awst_tmp%24#0 +debug: Removing unused variable ternary_result%26#0 +debug: Removing unused variable ternary_result%31#0 +debug: Removing unused variable ternary_result%36#0 +debug: Removing unused variable ternary_result%42#0 +debug: Removing unused variable ternary_result%44#0 +debug: Removing unused variable ternary_result%51#1 +debug: Removing unused variable awst_tmp%49#1 +debug: Removing unused variable x#0 +debug: Removing unused variable tmp%60#0 +debug: Removing unused variable tmp%63#0 +debug: Removing unused variable tmp%66#0 +debug: Removing unused variable tmp%69#0 +debug: Removing unused variable tmp%72#0 +debug: Removing unused variable tmp%75#0 +debug: Removing unused variable tmp%78#0 +debug: Removing unused variable tmp%81#0 +debug: Removing unused variable tmp%89#0 +debug: Removing unused variable y#3 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@3: // ternary_merge_L26 with block@0: // L5 in block@6: // ternary_merge_L27 +debug: Merged linear block@3: // ternary_merge_L26 into block@0: // L5 +debug: Replaced predecessor block@6: // ternary_merge_L27 with block@0: // L5 in block@9: // ternary_merge_L27 +debug: Merged linear block@6: // ternary_merge_L27 into block@0: // L5 +debug: Replaced predecessor block@9: // ternary_merge_L27 with block@0: // L5 in block@12: // ternary_merge_L28 +debug: Merged linear block@9: // ternary_merge_L27 into block@0: // L5 +debug: Replaced predecessor block@12: // ternary_merge_L28 with block@0: // L5 in block@15: // ternary_merge_L29 +debug: Merged linear block@12: // ternary_merge_L28 into block@0: // L5 +debug: Replaced predecessor block@15: // ternary_merge_L29 with block@0: // L5 in block@18: // ternary_merge_L30 +debug: Merged linear block@15: // ternary_merge_L29 into block@0: // L5 +debug: Replaced predecessor block@18: // ternary_merge_L30 with block@0: // L5 in block@21: // ternary_merge_L31 +debug: Merged linear block@18: // ternary_merge_L30 into block@0: // L5 +debug: Replaced predecessor block@21: // ternary_merge_L31 with block@0: // L5 in block@24: // ternary_merge_L31 +debug: Merged linear block@21: // ternary_merge_L31 into block@0: // L5 +debug: Replaced predecessor block@24: // ternary_merge_L31 with block@0: // L5 in block@27: // ternary_merge_L33 +debug: Merged linear block@24: // ternary_merge_L31 into block@0: // L5 +debug: Replaced predecessor block@27: // ternary_merge_L33 with block@0: // L5 in block@30: // ternary_merge_L33 +debug: Merged linear block@27: // ternary_merge_L33 into block@0: // L5 +debug: Merged linear block@30: // ternary_merge_L33 into block@0: // L5 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.stubs.bytes.BytesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/stubs/out/bytes_BytesContract.ssa.opt_pass_4.ir +debug: Begin optimization pass 5/100 +debug: Optimizing subroutine examples.stubs.bytes.BytesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%15#0 +debug: Removing unused variable tmp%22#0 +debug: Removing unused variable tmp%27#0 +debug: Removing unused variable tmp%32#0 +debug: Removing unused variable tmp%38#0 +debug: Removing unused variable tmp%45#0 +debug: Removing unused variable tmp%54#0 +debug: Removing unused variable tmp%90#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -917,12 +1293,64 @@ debug: Optimizing subroutine examples.stubs.bytes.BytesContract.clear_state_prog debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/stubs/out/bytes_BytesContract.ssa.opt_pass_5.ir +debug: Begin optimization pass 6/100 +debug: Optimizing subroutine examples.stubs.bytes.BytesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%16#0 +debug: Removing unused variable tmp%23#0 +debug: Removing unused variable tmp%28#0 +debug: Removing unused variable tmp%33#0 +debug: Removing unused variable tmp%39#0 +debug: Removing unused variable tmp%46#0 +debug: Removing unused variable tmp%55#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks -debug: No optimizations performed in pass 4, ending loop +debug: Optimizing subroutine examples.stubs.bytes.BytesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/stubs/out/bytes_BytesContract.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine examples.stubs.bytes.BytesContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.stubs.bytes.BytesContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 7, ending loop debug: Output IR to /examples/stubs/out/bytes_BytesContract.cssa.ir debug: Removing Phis from examples.stubs.bytes.BytesContract.approval_program debug: Removing Phis from examples.stubs.bytes.BytesContract.clear_state_program @@ -931,111 +1359,21 @@ debug: Sequentializing parallel copies in examples.stubs.bytes.BytesContract.app debug: Sequentializing parallel copies in examples.stubs.bytes.BytesContract.clear_state_program debug: Output IR to /examples/stubs/out/bytes_BytesContract.parallel_copies.ir debug: Coalescing local variables in examples.stubs.bytes.BytesContract.approval_program using strategy RootOperandGrouping -debug: Coalescing y#1 with [y#2, y#3] -debug: Coalescing resulted in 5 replacement/s +debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in examples.stubs.bytes.BytesContract.clear_state_program using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/stubs/out/bytes_BytesContract.final.ir -debug: Inserted main_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[12]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[17]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[19]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[28]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[30]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[33]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[35]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[40]: 'store c#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[42]: 'load c#1 from scratch' with 'load c#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[45]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[47]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[51]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[53]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[56]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[58]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[62]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[64]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[67]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[69]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[73]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[75]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[78]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[80]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[84]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[86]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[89]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[91]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[97]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[99]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[102]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[104]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[110]: 'store tmp%25#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[112]: 'load tmp%25#0 from scratch' with 'load tmp%25#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[115]: 'store tmp%26#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[117]: 'load tmp%26#0 from scratch' with 'load tmp%26#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[123]: 'store tmp%32#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[125]: 'load tmp%32#0 from scratch' with 'load tmp%32#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[128]: 'store tmp%33#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[130]: 'load tmp%33#0 from scratch' with 'load tmp%33#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[136]: 'store tmp%37#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[138]: 'load tmp%37#0 from scratch' with 'load tmp%37#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[141]: 'store tmp%38#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[143]: 'load tmp%38#0 from scratch' with 'load tmp%38#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[148]: 'store x#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[150]: 'load x#0 from scratch' with 'load x#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[155]: 'store tmp%43#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[157]: 'load tmp%43#0 from scratch' with 'load tmp%43#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[162]: 'store tmp%46#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[164]: 'load tmp%46#0 from scratch' with 'load tmp%46#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[169]: 'store tmp%49#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[171]: 'load tmp%49#0 from scratch' with 'load tmp%49#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[176]: 'store tmp%52#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[178]: 'load tmp%52#0 from scratch' with 'load tmp%52#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[183]: 'store tmp%55#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[185]: 'load tmp%55#0 from scratch' with 'load tmp%55#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[190]: 'store tmp%58#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[192]: 'load tmp%58#0 from scratch' with 'load tmp%58#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[197]: 'store tmp%61#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[199]: 'load tmp%61#0 from scratch' with 'load tmp%61#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[204]: 'store tmp%64#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[206]: 'load tmp%64#0 from scratch' with 'load tmp%64#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[211]: 'store tmp%65#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[213]: 'load tmp%65#0 from scratch' with 'load tmp%65#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[216]: 'store tmp%66#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[218]: 'load tmp%66#0 from scratch' with 'load tmp%66#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[223]: 'store tmp%67#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[225]: 'load tmp%67#0 from scratch' with 'load tmp%67#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[228]: 'store tmp%68#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[230]: 'load tmp%68#0 from scratch' with 'load tmp%68#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[235]: 'store tmp%69#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[237]: 'load tmp%69#0 from scratch' with 'load tmp%69#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[240]: 'store tmp%70#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[242]: 'load tmp%70#0 from scratch' with 'load tmp%70#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[247]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[249]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[252]: 'store tmp%71#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[254]: 'load tmp%71#0 from scratch' with 'load tmp%71#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[259]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[261]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[264]: 'store tmp%72#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[266]: 'load tmp%72#0 from scratch' with 'load tmp%72#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[271]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[273]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[276]: 'store tmp%73#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[278]: 'load tmp%73#0 from scratch' with 'load tmp%73#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[250]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[257]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[263]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[270]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.ssa.ir info: Optimizing examples.stubs.uint64.Uint64Contract at level 1 debug: Begin optimization pass 1/100 debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.approval_program debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification +debug: Folded None <= None to 1 +debug: Folded None >= None to 1 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable zero#0 debug: Removing unused variable one#0 @@ -1043,6 +1381,8 @@ debug: Removing unused variable two#0 debug: Removing unused variable five#0 debug: Removing unused variable three#0 debug: Removing unused variable sixty#0 +debug: Removing unused variable tmp%3#0 +debug: Removing unused variable tmp%4#0 debug: Removing unused variable c#0 debug: Removing unused variable true#0 debug: Removing unused variable false#0 @@ -1084,21 +1424,28 @@ debug: Removed unreachable predecessors from block@15: // ternary_merge_L59 debug: Removed unreachable predecessors from block@18: // ternary_merge_L60 debug: Removed unreachable predecessors from block@21: // ternary_merge_L61 debug: Removed unreachable predecessors from block@24: // ternary_merge_L62 -debug: Found ternary_result%27#0, ternary_result%29#0, ternary_result%31#1, ternary_result%33#1, ternary_result%35#1, ternary_result%37#1, ternary_result%39#0, ternary_result%41#0 to remove from Phi nodes +debug: Removing unreachable phi arguments: ternary_result%27#0 <- block@1 debug: Replacing trivial Phi node: let ternary_result%27#2: uint64 = φ(ternary_result%27#1 <- block@0) (ternary_result%27#2) with ternary_result%27#1 debug: Deleting Phi assignment: let ternary_result%27#2: uint64 = φ(ternary_result%27#1 <- block@0) +debug: Removing unreachable phi arguments: ternary_result%29#0 <- block@4 debug: Replacing trivial Phi node: let ternary_result%29#2: uint64 = φ(ternary_result%29#1 <- block@3) (ternary_result%29#2) with ternary_result%29#1 debug: Deleting Phi assignment: let ternary_result%29#2: uint64 = φ(ternary_result%29#1 <- block@3) +debug: Removing unreachable phi arguments: ternary_result%31#1 <- block@8 debug: Replacing trivial Phi node: let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@6) (ternary_result%31#2) with ternary_result%31#0 debug: Deleting Phi assignment: let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@6) +debug: Removing unreachable phi arguments: ternary_result%33#1 <- block@11 debug: Replacing trivial Phi node: let ternary_result%33#2: uint64 = φ(ternary_result%33#0 <- block@9) (ternary_result%33#2) with ternary_result%33#0 debug: Deleting Phi assignment: let ternary_result%33#2: uint64 = φ(ternary_result%33#0 <- block@9) +debug: Removing unreachable phi arguments: ternary_result%35#1 <- block@14 debug: Replacing trivial Phi node: let ternary_result%35#2: uint64 = φ(ternary_result%35#0 <- block@12) (ternary_result%35#2) with ternary_result%35#0 debug: Deleting Phi assignment: let ternary_result%35#2: uint64 = φ(ternary_result%35#0 <- block@12) +debug: Removing unreachable phi arguments: ternary_result%37#1 <- block@17 debug: Replacing trivial Phi node: let ternary_result%37#2: uint64 = φ(ternary_result%37#0 <- block@15) (ternary_result%37#2) with ternary_result%37#0 debug: Deleting Phi assignment: let ternary_result%37#2: uint64 = φ(ternary_result%37#0 <- block@15) +debug: Removing unreachable phi arguments: ternary_result%39#0 <- block@19 debug: Replacing trivial Phi node: let ternary_result%39#2: uint64 = φ(ternary_result%39#1 <- block@18) (ternary_result%39#2) with ternary_result%39#1 debug: Deleting Phi assignment: let ternary_result%39#2: uint64 = φ(ternary_result%39#1 <- block@18) +debug: Removing unreachable phi arguments: ternary_result%41#0 <- block@22 debug: Replacing trivial Phi node: let ternary_result%41#2: uint64 = φ(ternary_result%41#1 <- block@21) (ternary_result%41#2) with ternary_result%41#1 debug: Deleting Phi assignment: let ternary_result%41#2: uint64 = φ(ternary_result%41#1 <- block@21) debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_program @@ -1106,6 +1453,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -1123,8 +1471,17 @@ debug: Folded 5 + 60 to 65 debug: Folded 60 - 5 to 55 debug: Folded 60 / 5 to 12 debug: Folded 5 * 60 to 300 +debug: Folded 5 exp 3 to 125 +debug: Folded 1 shl 2 to 4 +debug: Folded 5 shr 3 to 0 +debug: Folded ~1 to 18446744073709551614u +debug: Folded 1 & 5 to 1 +debug: Folded 60 | 5 to 61 +debug: Folded 60 ^ 5 to 57 +debug: Folded 254 & 31 to 30 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%0#0 debug: Removing unused variable tmp%1#0 @@ -1134,6 +1491,10 @@ debug: Removing unused variable c#1 debug: Removing unused variable tmp%8#0 debug: Removing unused variable tmp%11#0 debug: Removing unused variable tmp%14#0 +debug: Removing unused variable tmp%16#0 +debug: Removing unused variable tmp%19#0 +debug: Removing unused variable tmp%23#0 +debug: Removing unused variable tmp%25#0 debug: Removing unused variable ternary_result%27#1 debug: Removing unused variable ternary_result%29#1 debug: Removing unused variable ternary_result%31#0 @@ -1142,6 +1503,10 @@ debug: Removing unused variable ternary_result%35#0 debug: Removing unused variable ternary_result%37#0 debug: Removing unused variable ternary_result%39#1 debug: Removing unused variable ternary_result%41#1 +debug: Removing unused variable tmp%43#0 +debug: Removing unused variable tmp%45#0 +debug: Removing unused variable tmp%47#0 +debug: Removing unused variable y#1 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Replaced predecessor block@3: // ternary_merge_L55 with block@0: // L5 in block@6: // ternary_merge_L56 @@ -1165,6 +1530,7 @@ debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -1180,6 +1546,10 @@ debug: Folded 55 == 55 to 1 debug: Folded 65 - 5 to 60 debug: Folded 12 == 12 to 1 debug: Folded 300 == 300 to 1 +debug: Folded 125 == 125 to 1 +debug: Folded 4 == 4 to 1 +debug: Folded !0 to 1u +debug: Folded 18446744073709551614 == 18446744073709551614 to 1 debug: Folded 1 == 1 to 1 debug: Folded !0 to 1u debug: Folded !0 to 1u @@ -1188,8 +1558,14 @@ debug: Folded 1 == 1 to 1 debug: Folded 1 == 1 to 1 debug: Folded 1 == 1 to 1 debug: Folded !0 to 1u +debug: Folded 1 == 1 to 1 +debug: Folded 61 == 61 to 1 +debug: Folded 57 == 57 to 1 +debug: Folded 30 == 30 to 1 +debug: Folded 30 | 54 to 62 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%6#0 debug: Removing unused variable tmp%7#0 @@ -1197,6 +1573,10 @@ debug: Removing unused variable tmp%9#0 debug: Removing unused variable c#2 debug: Removing unused variable tmp%12#0 debug: Removing unused variable tmp%15#0 +debug: Removing unused variable tmp%17#0 +debug: Removing unused variable tmp%20#0 +debug: Removing unused variable tmp%24#0 +debug: Removing unused variable tmp%26#0 debug: Removing unused variable tmp%28#0 debug: Removing unused variable tmp%30#0 debug: Removing unused variable tmp%32#0 @@ -1205,6 +1585,11 @@ debug: Removing unused variable tmp%36#0 debug: Removing unused variable tmp%38#0 debug: Removing unused variable tmp%40#0 debug: Removing unused variable tmp%42#0 +debug: Removing unused variable tmp%44#0 +debug: Removing unused variable tmp%46#0 +debug: Removing unused variable tmp%48#0 +debug: Removing unused variable tmp%49#0 +debug: Removing unused variable y#2 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -1213,6 +1598,7 @@ debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -1224,11 +1610,16 @@ debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.approval_progr debug: Optimizer: Arithmetic Simplification debug: Folded 60 == 60 to 1 debug: Folded 60 / 5 to 12 +debug: Folded 62 == 62 to 1 +debug: Folded 62 ^ 255 to 193 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%10#0 debug: Removing unused variable c#3 +debug: Removing unused variable tmp%50#0 +debug: Removing unused variable y#3 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -1237,6 +1628,7 @@ debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -1247,10 +1639,15 @@ debug: Begin optimization pass 5/100 debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.approval_program debug: Optimizer: Arithmetic Simplification debug: Folded 12 == 12 to 1 +debug: Folded 12 exp 2 to 144 +debug: Folded 193 == 193 to 1 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%13#0 +debug: Removing unused variable c#4 +debug: Removing unused variable tmp%51#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -1259,6 +1656,7 @@ debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -1268,8 +1666,85 @@ debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.ssa.opt_ debug: Begin optimization pass 6/100 debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.approval_program debug: Optimizer: Arithmetic Simplification +debug: Folded 144 == 144 to 1 +debug: Folded 144 shr 6 to 2 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%18#0 +debug: Removing unused variable c#5 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_6.ir +debug: Begin optimization pass 7/100 +debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded 2 == 2 to 1 +debug: Folded 2 shl 6 to 128 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%21#0 +debug: Removing unused variable c#6 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_7.ir +debug: Begin optimization pass 8/100 +debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Folded 128 == 128 to 1 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%22#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_8.ir +debug: Begin optimization pass 9/100 +debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.approval_program +debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -1279,12 +1754,13 @@ debug: Optimizing subroutine examples.stubs.uint64.Uint64Contract.clear_state_pr debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks -debug: No optimizations performed in pass 6, ending loop +debug: No optimizations performed in pass 9, ending loop debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.cssa.ir debug: Removing Phis from examples.stubs.uint64.Uint64Contract.approval_program debug: Removing Phis from examples.stubs.uint64.Uint64Contract.clear_state_program @@ -1293,86 +1769,20 @@ debug: Sequentializing parallel copies in examples.stubs.uint64.Uint64Contract.a debug: Sequentializing parallel copies in examples.stubs.uint64.Uint64Contract.clear_state_program debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.parallel_copies.ir debug: Coalescing local variables in examples.stubs.uint64.Uint64Contract.approval_program using strategy RootOperandGrouping -debug: Coalescing c#4 with [c#5, c#6] -debug: Coalescing y#1 with [y#2, y#3] -debug: Coalescing resulted in 10 replacement/s +debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in examples.stubs.uint64.Uint64Contract.clear_state_program using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/stubs/out/uint64_Uint64Contract.final.ir -debug: Inserted main_block@0.ops[11]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[13]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[18]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[20]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[39]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[41]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[44]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[46]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[51]: 'store c#4 to l-stack (copy)' -debug: Replaced main_block@0.ops[53]: 'load c#4 from scratch' with 'load c#4 from l-stack (no copy)' -debug: Inserted main_block@0.ops[56]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[58]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[63]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[65]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[68]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[70]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[75]: 'store c#4 to l-stack (copy)' -debug: Replaced main_block@0.ops[77]: 'load c#4 from scratch' with 'load c#4 from l-stack (no copy)' -debug: Inserted main_block@0.ops[80]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[82]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[87]: 'store c#4 to l-stack (copy)' -debug: Replaced main_block@0.ops[89]: 'load c#4 from scratch' with 'load c#4 from l-stack (no copy)' -debug: Inserted main_block@0.ops[92]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[94]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[99]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[101]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[103]: 'store tmp%24#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[105]: 'load tmp%24#0 from scratch' with 'load tmp%24#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[109]: 'store tmp%25#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[111]: 'load tmp%25#0 from scratch' with 'load tmp%25#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[114]: 'store tmp%26#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[116]: 'load tmp%26#0 from scratch' with 'load tmp%26#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[137]: 'store tmp%43#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[139]: 'load tmp%43#0 from scratch' with 'load tmp%43#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[142]: 'store tmp%44#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[144]: 'load tmp%44#0 from scratch' with 'load tmp%44#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[149]: 'store tmp%45#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[151]: 'load tmp%45#0 from scratch' with 'load tmp%45#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[154]: 'store tmp%46#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[156]: 'load tmp%46#0 from scratch' with 'load tmp%46#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[161]: 'store tmp%47#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[163]: 'load tmp%47#0 from scratch' with 'load tmp%47#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[166]: 'store tmp%48#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[168]: 'load tmp%48#0 from scratch' with 'load tmp%48#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[173]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[175]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[178]: 'store tmp%49#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[180]: 'load tmp%49#0 from scratch' with 'load tmp%49#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[185]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[187]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[190]: 'store tmp%50#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[192]: 'load tmp%50#0 from scratch' with 'load tmp%50#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[197]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[199]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[202]: 'store tmp%51#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[204]: 'load tmp%51#0 from scratch' with 'load tmp%51#0 from l-stack (no copy)' -debug: Inserted main_block@0.ops[78]: 'store c#4 to l-stack (copy)' -debug: Replaced main_block@0.ops[85]: 'load c#4 from scratch' with 'load c#4 from l-stack (no copy)' -debug: Inserted main_block@0.ops[177]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[184]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[190]: 'store y#1 to l-stack (copy)' -debug: Replaced main_block@0.ops[197]: 'load y#1 from scratch' with 'load y#1 from l-stack (no copy)' -debug: Inserted main_block@0.ops[54]: 'store c#4 to l-stack (copy)' -debug: Replaced main_block@0.ops[73]: 'load c#4 from scratch' with 'load c#4 from l-stack (no copy)' -info: Writing /examples/stubs/out/biguint.approval.teal -info: Writing /examples/stubs/out/biguint.approval.debug.teal -info: Writing /examples/stubs/out/biguint.clear.teal -info: Writing /examples/stubs/out/biguint.clear.debug.teal -info: Writing /examples/stubs/out/bytes.approval.teal -info: Writing /examples/stubs/out/bytes.approval.debug.teal -info: Writing /examples/stubs/out/bytes.clear.teal -info: Writing /examples/stubs/out/bytes.clear.debug.teal -info: Writing /examples/stubs/out/uint64.approval.teal -info: Writing /examples/stubs/out/uint64.approval.debug.teal -info: Writing /examples/stubs/out/uint64.clear.teal -info: Writing /examples/stubs/out/uint64.clear.debug.teal +info: Writing stubs/out/biguint.approval.teal +info: Writing stubs/out/biguint.approval.debug.teal +info: Writing stubs/out/biguint.clear.teal +info: Writing stubs/out/biguint.clear.debug.teal +info: Writing stubs/out/bytes.approval.teal +info: Writing stubs/out/bytes.approval.debug.teal +info: Writing stubs/out/bytes.clear.teal +info: Writing stubs/out/bytes.clear.debug.teal +info: Writing stubs/out/uint64.approval.teal +info: Writing stubs/out/uint64.approval.debug.teal +info: Writing stubs/out/uint64.clear.teal +info: Writing stubs/out/uint64.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/stubs/bytes.approval.teal b/examples/stubs/bytes.approval.teal new file mode 100644 index 0000000000..1f8d6239e8 --- /dev/null +++ b/examples/stubs/bytes.approval.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.stubs.bytes.BytesContract.approval_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/stubs/bytes.clear.teal b/examples/stubs/bytes.clear.teal new file mode 100644 index 0000000000..c1c332fb7a --- /dev/null +++ b/examples/stubs/bytes.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/stubs/bytes.py b/examples/stubs/bytes.py index 1931173b77..ce99efd0c0 100644 --- a/examples/stubs/bytes.py +++ b/examples/stubs/bytes.py @@ -30,14 +30,13 @@ def approval_program(self) -> UInt64: assert abc[-2:] == b"bc" assert abc[-2:-1] == b"b" assert Bytes(b"1234567")[1:-1] == b"23456" + assert abc[-10:10] == b"abc" true = Bytes(b"1") false = Bytes(b"") - # This works x = (true and true) == true assert x - # TODO: The following do not compile assert (true and true) == true assert (true and false) == false assert (false and true) == false diff --git a/examples/stubs/out/biguint.approval.debug.teal b/examples/stubs/out/biguint.approval.debug.teal index 60965460f9..aeb89f4de6 100644 --- a/examples/stubs/out/biguint.approval.debug.teal +++ b/examples/stubs/out/biguint.approval.debug.teal @@ -17,7 +17,7 @@ main_block@0: return // return True File "stubs/biguint.py", line 9 -// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> : +// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> void: compare_biguints: proto 2 0 // (𝕡) one#0,two#0 | def compare_biguints(one: BigUInt, two: BigUInt) -> None: File "stubs/biguint.py", line 16 @@ -30,10 +30,6 @@ compare_biguints_block@0: frame_dig -1 // load two#0 from parameters (𝕡) one#0,two#0 | one#0,two#0 two: BigUInt File "stubs/biguint.py", line 16 b<= // (𝕡) one#0,two#0 | {b<=} one <= two File "stubs/biguint.py", line 18 assert // (𝕡) one#0,two#0 | assert one <= two File "stubs/biguint.py", line 18 - frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | one#0 one: BigUInt File "stubs/biguint.py", line 16 - frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | one#0,one#0 one: BigUInt File "stubs/biguint.py", line 16 - b== // (𝕡) one#0,two#0 | {b==} one == one File "stubs/biguint.py", line 19 - assert // (𝕡) one#0,two#0 | assert one == one File "stubs/biguint.py", line 19 frame_dig -1 // load two#0 from parameters (𝕡) one#0,two#0 | two#0 two: BigUInt File "stubs/biguint.py", line 16 frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | two#0,one#0 one: BigUInt File "stubs/biguint.py", line 16 b> // (𝕡) one#0,two#0 | {b>} two > one File "stubs/biguint.py", line 20 @@ -49,7 +45,7 @@ compare_biguints_block@0: retsub // -// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> : +// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> void: compare_biguint_vs_uint64: proto 2 0 // (𝕡) one#0,two#0 | def compare_biguint_vs_uint64(one: BigUInt, two: UInt64) -> None: File "stubs/biguint.py", line 26 @@ -64,10 +60,6 @@ compare_biguint_vs_uint64_block@0: frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | tmp%2#0,one#0 one: BigUInt File "stubs/biguint.py", line 26 b>= // (𝕡) one#0,two#0 | {b>=} one <= two File "stubs/biguint.py", line 28 assert // (𝕡) one#0,two#0 | assert one <= two File "stubs/biguint.py", line 28 - frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | one#0 one: BigUInt File "stubs/biguint.py", line 26 - frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | one#0,one#0 one: BigUInt File "stubs/biguint.py", line 26 - b== // (𝕡) one#0,two#0 | {b==} one == one File "stubs/biguint.py", line 29 - assert // (𝕡) one#0,two#0 | assert one == one File "stubs/biguint.py", line 29 frame_dig -1 // load two#0 from parameters (𝕡) one#0,two#0 | two#0 two: UInt64 File "stubs/biguint.py", line 26 itob // (𝕡) one#0,two#0 | {itob} two > one File "stubs/biguint.py", line 30 frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | tmp%5#0,one#0 one: BigUInt File "stubs/biguint.py", line 26 @@ -86,7 +78,7 @@ compare_biguint_vs_uint64_block@0: retsub // -// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> : +// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> void: compare_uint64_vs_biguint: proto 2 0 // (𝕡) one#0,two#0 | def compare_uint64_vs_biguint(one: UInt64, two: BigUInt) -> None: File "stubs/biguint.py", line 36 @@ -101,8 +93,6 @@ compare_uint64_vs_biguint_block@0: frame_dig -1 // load two#0 from parameters (𝕡) one#0,two#0 | tmp%2#0,two#0 two: BigUInt File "stubs/biguint.py", line 36 b<= // (𝕡) one#0,two#0 | {b<=} one <= two File "stubs/biguint.py", line 38 assert // (𝕡) one#0,two#0 | assert one <= two File "stubs/biguint.py", line 38 - int 1 // (𝕡) one#0,two#0 | 1 one == one File "stubs/biguint.py", line 39 - assert // (𝕡) one#0,two#0 | assert one == one File "stubs/biguint.py", line 39 frame_dig -2 // load one#0 from parameters (𝕡) one#0,two#0 | one#0 one: UInt64 File "stubs/biguint.py", line 36 itob // (𝕡) one#0,two#0 | {itob} two > one File "stubs/biguint.py", line 40 frame_dig -1 // load two#0 from parameters (𝕡) one#0,two#0 | tmp%5#0,two#0 two: BigUInt File "stubs/biguint.py", line 36 diff --git a/examples/stubs/out/biguint.approval.teal b/examples/stubs/out/biguint.approval.teal index dd17de5647..7aecc3e4bd 100644 --- a/examples/stubs/out/biguint.approval.teal +++ b/examples/stubs/out/biguint.approval.teal @@ -15,7 +15,7 @@ main_block@0: return -// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> : +// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> void: compare_biguints: proto 2 0 @@ -28,10 +28,6 @@ compare_biguints_block@0: frame_dig -1 b<= assert - frame_dig -2 - frame_dig -2 - b== - assert frame_dig -1 frame_dig -2 b> @@ -47,7 +43,7 @@ compare_biguints_block@0: retsub -// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> : +// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> void: compare_biguint_vs_uint64: proto 2 0 @@ -62,10 +58,6 @@ compare_biguint_vs_uint64_block@0: frame_dig -2 b>= assert - frame_dig -2 - frame_dig -2 - b== - assert frame_dig -1 itob frame_dig -2 @@ -84,7 +76,7 @@ compare_biguint_vs_uint64_block@0: retsub -// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> : +// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> void: compare_uint64_vs_biguint: proto 2 0 @@ -99,8 +91,6 @@ compare_uint64_vs_biguint_block@0: frame_dig -1 b<= assert - int 1 - assert frame_dig -2 itob frame_dig -1 diff --git a/examples/stubs/out/biguint.approval_unoptimized.debug.teal b/examples/stubs/out/biguint.approval_unoptimized.debug.teal index 07e7edf1ec..049ab20d02 100644 --- a/examples/stubs/out/biguint.approval_unoptimized.debug.teal +++ b/examples/stubs/out/biguint.approval_unoptimized.debug.teal @@ -17,7 +17,7 @@ main_block@0: return // return True File "stubs/biguint.py", line 9 -// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> : +// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> void: compare_biguints: proto 2 0 // (𝕡) one#0,two#0 | def compare_biguints(one: BigUInt, two: BigUInt) -> None: File "stubs/biguint.py", line 16 @@ -49,7 +49,7 @@ compare_biguints_block@0: retsub // -// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> : +// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> void: compare_biguint_vs_uint64: proto 2 0 // (𝕡) one#0,two#0 | def compare_biguint_vs_uint64(one: BigUInt, two: UInt64) -> None: File "stubs/biguint.py", line 26 @@ -86,7 +86,7 @@ compare_biguint_vs_uint64_block@0: retsub // -// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> : +// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> void: compare_uint64_vs_biguint: proto 2 0 // (𝕡) one#0,two#0 | def compare_uint64_vs_biguint(one: UInt64, two: BigUInt) -> None: File "stubs/biguint.py", line 36 diff --git a/examples/stubs/out/biguint.approval_unoptimized.teal b/examples/stubs/out/biguint.approval_unoptimized.teal index 0d20389ce4..7431a9a23c 100644 --- a/examples/stubs/out/biguint.approval_unoptimized.teal +++ b/examples/stubs/out/biguint.approval_unoptimized.teal @@ -15,7 +15,7 @@ main_block@0: return -// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> : +// examples.stubs.biguint.compare_biguints(one#0: bytes, two#0: bytes) -> void: compare_biguints: proto 2 0 @@ -47,7 +47,7 @@ compare_biguints_block@0: retsub -// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> : +// examples.stubs.biguint.compare_biguint_vs_uint64(one#0: bytes, two#0: uint64) -> void: compare_biguint_vs_uint64: proto 2 0 @@ -84,7 +84,7 @@ compare_biguint_vs_uint64_block@0: retsub -// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> : +// examples.stubs.biguint.compare_uint64_vs_biguint(one#0: uint64, two#0: bytes) -> void: compare_uint64_vs_biguint: proto 2 0 diff --git a/examples/stubs/out/biguint_BigUIntContract.cssa.ir b/examples/stubs/out/biguint_BigUIntContract.cssa.ir index ddfd961c52..00898e4af1 100644 --- a/examples/stubs/out/biguint_BigUIntContract.cssa.ir +++ b/examples/stubs/out/biguint_BigUIntContract.cssa.ir @@ -13,8 +13,6 @@ contract examples.stubs.biguint.BigUIntContract: (assert tmp%0#0) let tmp%1#0: uint64 = (b<= one#0 two#0) (assert tmp%1#0) - let tmp%2#0: uint64 = (b== one#0 one#0) - (assert tmp%2#0) let tmp%3#0: uint64 = (b> two#0 one#0) (assert tmp%3#0) let tmp%4#0: uint64 = (b>= two#0 one#0) @@ -31,8 +29,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob two#0) let tmp%3#0: uint64 = (b<= one#0 tmp%2#0) (assert tmp%3#0) - let tmp%4#0: uint64 = (b== one#0 one#0) - (assert tmp%4#0) let tmp%5#0: bytes = (itob two#0) let tmp%6#0: uint64 = (b< one#0 tmp%5#0) (assert tmp%6#0) @@ -52,7 +48,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob one#0) let tmp%3#0: uint64 = (b>= two#0 tmp%2#0) (assert tmp%3#0) - (assert 1u) let tmp%5#0: bytes = (itob one#0) let tmp%6#0: uint64 = (b> two#0 tmp%5#0) (assert tmp%6#0) diff --git a/examples/stubs/out/biguint_BigUIntContract.final.ir b/examples/stubs/out/biguint_BigUIntContract.final.ir index ddfd961c52..00898e4af1 100644 --- a/examples/stubs/out/biguint_BigUIntContract.final.ir +++ b/examples/stubs/out/biguint_BigUIntContract.final.ir @@ -13,8 +13,6 @@ contract examples.stubs.biguint.BigUIntContract: (assert tmp%0#0) let tmp%1#0: uint64 = (b<= one#0 two#0) (assert tmp%1#0) - let tmp%2#0: uint64 = (b== one#0 one#0) - (assert tmp%2#0) let tmp%3#0: uint64 = (b> two#0 one#0) (assert tmp%3#0) let tmp%4#0: uint64 = (b>= two#0 one#0) @@ -31,8 +29,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob two#0) let tmp%3#0: uint64 = (b<= one#0 tmp%2#0) (assert tmp%3#0) - let tmp%4#0: uint64 = (b== one#0 one#0) - (assert tmp%4#0) let tmp%5#0: bytes = (itob two#0) let tmp%6#0: uint64 = (b< one#0 tmp%5#0) (assert tmp%6#0) @@ -52,7 +48,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob one#0) let tmp%3#0: uint64 = (b>= two#0 tmp%2#0) (assert tmp%3#0) - (assert 1u) let tmp%5#0: bytes = (itob one#0) let tmp%6#0: uint64 = (b> two#0 tmp%5#0) (assert tmp%6#0) diff --git a/examples/stubs/out/biguint_BigUIntContract.parallel_copies.ir b/examples/stubs/out/biguint_BigUIntContract.parallel_copies.ir index ddfd961c52..00898e4af1 100644 --- a/examples/stubs/out/biguint_BigUIntContract.parallel_copies.ir +++ b/examples/stubs/out/biguint_BigUIntContract.parallel_copies.ir @@ -13,8 +13,6 @@ contract examples.stubs.biguint.BigUIntContract: (assert tmp%0#0) let tmp%1#0: uint64 = (b<= one#0 two#0) (assert tmp%1#0) - let tmp%2#0: uint64 = (b== one#0 one#0) - (assert tmp%2#0) let tmp%3#0: uint64 = (b> two#0 one#0) (assert tmp%3#0) let tmp%4#0: uint64 = (b>= two#0 one#0) @@ -31,8 +29,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob two#0) let tmp%3#0: uint64 = (b<= one#0 tmp%2#0) (assert tmp%3#0) - let tmp%4#0: uint64 = (b== one#0 one#0) - (assert tmp%4#0) let tmp%5#0: bytes = (itob two#0) let tmp%6#0: uint64 = (b< one#0 tmp%5#0) (assert tmp%6#0) @@ -52,7 +48,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob one#0) let tmp%3#0: uint64 = (b>= two#0 tmp%2#0) (assert tmp%3#0) - (assert 1u) let tmp%5#0: bytes = (itob one#0) let tmp%6#0: uint64 = (b> two#0 tmp%5#0) (assert tmp%6#0) diff --git a/examples/stubs/out/biguint_BigUIntContract.post_ssa.ir b/examples/stubs/out/biguint_BigUIntContract.post_ssa.ir index ddfd961c52..00898e4af1 100644 --- a/examples/stubs/out/biguint_BigUIntContract.post_ssa.ir +++ b/examples/stubs/out/biguint_BigUIntContract.post_ssa.ir @@ -13,8 +13,6 @@ contract examples.stubs.biguint.BigUIntContract: (assert tmp%0#0) let tmp%1#0: uint64 = (b<= one#0 two#0) (assert tmp%1#0) - let tmp%2#0: uint64 = (b== one#0 one#0) - (assert tmp%2#0) let tmp%3#0: uint64 = (b> two#0 one#0) (assert tmp%3#0) let tmp%4#0: uint64 = (b>= two#0 one#0) @@ -31,8 +29,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob two#0) let tmp%3#0: uint64 = (b<= one#0 tmp%2#0) (assert tmp%3#0) - let tmp%4#0: uint64 = (b== one#0 one#0) - (assert tmp%4#0) let tmp%5#0: bytes = (itob two#0) let tmp%6#0: uint64 = (b< one#0 tmp%5#0) (assert tmp%6#0) @@ -52,7 +48,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob one#0) let tmp%3#0: uint64 = (b>= two#0 tmp%2#0) (assert tmp%3#0) - (assert 1u) let tmp%5#0: bytes = (itob one#0) let tmp%6#0: uint64 = (b> two#0 tmp%5#0) (assert tmp%6#0) diff --git a/examples/stubs/out/biguint_BigUIntContract.ssa.opt_pass_1.ir b/examples/stubs/out/biguint_BigUIntContract.ssa.opt_pass_1.ir index ddfd961c52..00898e4af1 100644 --- a/examples/stubs/out/biguint_BigUIntContract.ssa.opt_pass_1.ir +++ b/examples/stubs/out/biguint_BigUIntContract.ssa.opt_pass_1.ir @@ -13,8 +13,6 @@ contract examples.stubs.biguint.BigUIntContract: (assert tmp%0#0) let tmp%1#0: uint64 = (b<= one#0 two#0) (assert tmp%1#0) - let tmp%2#0: uint64 = (b== one#0 one#0) - (assert tmp%2#0) let tmp%3#0: uint64 = (b> two#0 one#0) (assert tmp%3#0) let tmp%4#0: uint64 = (b>= two#0 one#0) @@ -31,8 +29,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob two#0) let tmp%3#0: uint64 = (b<= one#0 tmp%2#0) (assert tmp%3#0) - let tmp%4#0: uint64 = (b== one#0 one#0) - (assert tmp%4#0) let tmp%5#0: bytes = (itob two#0) let tmp%6#0: uint64 = (b< one#0 tmp%5#0) (assert tmp%6#0) @@ -52,7 +48,6 @@ contract examples.stubs.biguint.BigUIntContract: let tmp%2#0: bytes = (itob one#0) let tmp%3#0: uint64 = (b>= two#0 tmp%2#0) (assert tmp%3#0) - (assert 1u) let tmp%5#0: bytes = (itob one#0) let tmp%6#0: uint64 = (b> two#0 tmp%5#0) (assert tmp%6#0) diff --git a/examples/stubs/out/bytes.O0.log b/examples/stubs/out/bytes.O0.log index 08678fc096..fe471de683 100644 --- a/examples/stubs/out/bytes.O0.log +++ b/examples/stubs/out/bytes.O0.log @@ -1,235 +1,326 @@ PC Teal Stack 1 -5 -74 byte base64 QmFzZSA2NCBlbmNvZGVk QmFzZSA2NCBlbmNvZGVk -75 dup QmFzZSA2NCBlbmNvZGVk, QmFzZSA2NCBlbmNvZGVk -76 byte "Base 64 encoded" QmFzZSA2NCBlbmNvZGVk, QmFzZSA2NCBlbmNvZGVk, QmFzZSA2NCBlbmNvZGVk -77 == QmFzZSA2NCBlbmNvZGVk, 1 -78 assert QmFzZSA2NCBlbmNvZGVk -79 byte base32 IJQXGZJAGMZCAZLOMNXWIZLE QmFzZSA2NCBlbmNvZGVk, QmFzZSAzMiBlbmNvZGVk -81 byte "Base 32 encoded" QmFzZSA2NCBlbmNvZGVk, QmFzZSAzMiBlbmNvZGVk, QmFzZSAzMiBlbmNvZGVk -83 == QmFzZSA2NCBlbmNvZGVk, 1 -84 assert QmFzZSA2NCBlbmNvZGVk -85 byte 0x4261736520313620656e636f646564 QmFzZSA2NCBlbmNvZGVk, QmFzZSAxNiBlbmNvZGVk -87 byte "Base 16 encoded" QmFzZSA2NCBlbmNvZGVk, QmFzZSAxNiBlbmNvZGVk, QmFzZSAxNiBlbmNvZGVk -89 == QmFzZSA2NCBlbmNvZGVk, 1 -90 assert QmFzZSA2NCBlbmNvZGVk -91 byte "" QmFzZSA2NCBlbmNvZGVk, -92 uncover 1 , QmFzZSA2NCBlbmNvZGVk -94 len , 15 -95 assert -96 len 0 -97 ! 1 -98 assert -99 byte "a" YQ== -100 byte "b" YQ==, Yg== -102 concat YWI= -103 byte "ab" YWI=, YWI= -105 == 1 -106 assert -107 byte "c" Yw== -110 byte "d" Yw==, ZA== -113 concat Y2Q= -114 byte "cd" Y2Q=, Y2Q= -118 == 1 -119 assert -120 byte "abc" YWJj -125 dup YWJj, YWJj -126 extract 0 1 YWJj, YQ== -129 byte "a" YWJj, YQ==, YQ== -130 == YWJj, 1 -131 assert YWJj -132 dup YWJj, YWJj -133 extract 1 0 YWJj, YmM= -136 byte "bc" YWJj, YmM=, YmM= -138 == YWJj, 1 -139 assert YWJj -140 dup YWJj, YWJj -141 substring 1 1 YWJj, -144 byte "" YWJj, , -145 == YWJj, 1 -146 assert YWJj -147 dup YWJj, YWJj -148 extract 0 1 YWJj, YQ== -151 byte "a" YWJj, YQ==, YQ== -152 == YWJj, 1 -153 assert YWJj -154 dup YWJj, YWJj -155 len YWJj, 3 -156 pop YWJj -157 dup YWJj, YWJj -158 len YWJj, 3 -159 int 1 YWJj, 3, 1 -160 - YWJj, 2 -161 dig 1 YWJj, 2, YWJj -163 int 0 YWJj, 2, YWJj, 0 -165 uncover 2 YWJj, YWJj, 0, 2 -167 substring3 YWJj, YWI= -168 byte "ab" YWJj, YWI=, YWI= -170 == YWJj, 1 -171 assert YWJj -172 dup YWJj, YWJj -173 len YWJj, 3 -174 cover 1 3, YWJj -176 dup 3, YWJj, YWJj -177 len 3, YWJj, 3 -178 int 2 3, YWJj, 3, 2 -179 - 3, YWJj, 1 -180 dig 1 3, YWJj, 1, YWJj -182 uncover 1 3, YWJj, YWJj, 1 -184 uncover 3 YWJj, YWJj, 1, 3 -186 substring3 YWJj, YmM= -187 byte "bc" YWJj, YmM=, YmM= -189 == YWJj, 1 -190 assert YWJj -191 dup YWJj, YWJj -192 len YWJj, 3 -193 pop YWJj -194 dup YWJj, YWJj -195 len YWJj, 3 -196 int 2 YWJj, 3, 2 -197 - YWJj, 1 -198 cover 1 1, YWJj -200 dup 1, YWJj, YWJj -201 len 1, YWJj, 3 -202 int 1 1, YWJj, 3, 1 -203 - 1, YWJj, 2 -204 uncover 1 1, 2, YWJj -206 cover 2 YWJj, 1, 2 -208 substring3 Yg== -209 byte "b" Yg==, Yg== -211 == 1 -212 assert -213 byte "1234567" MTIzNDU2Nw== -214 len 7 -215 pop -216 byte "1234567" MTIzNDU2Nw== -217 len 7 -218 int 1 7, 1 -219 - 6 -220 byte "1234567" 6, MTIzNDU2Nw== -221 int 1 6, MTIzNDU2Nw==, 1 -222 uncover 2 MTIzNDU2Nw==, 1, 6 -224 substring3 MjM0NTY= -225 byte "23456" MjM0NTY=, MjM0NTY= -232 == 1 -233 assert -234 byte "1" MQ== -237 dup MQ==, MQ== -238 cover 1 MQ==, MQ== -240 byte "" MQ==, MQ==, -241 cover 1 MQ==, , MQ== -243 len MQ==, , 1 -244 bnz main_ternary_false@2 MQ==, -252 dig 1 MQ==, , MQ== -254 dig 2 MQ==, , MQ==, MQ== -256 dup MQ==, , MQ==, MQ==, MQ== -257 cover 2 MQ==, , MQ==, MQ==, MQ== -259 == MQ==, , MQ==, 1 -260 assert MQ==, , MQ== -261 len MQ==, , 1 -262 bnz main_ternary_false@5 MQ==, -270 dig 1 MQ==, , MQ== -272 dig 2 MQ==, , MQ==, MQ== -274 dup MQ==, , MQ==, MQ==, MQ== -275 cover 2 MQ==, , MQ==, MQ==, MQ== -277 == MQ==, , MQ==, 1 -278 assert MQ==, , MQ== -279 len MQ==, , 1 -280 bnz main_ternary_false@8 MQ==, -288 dup MQ==, , -289 dig 1 MQ==, , , -291 dup MQ==, , , , -292 cover 2 MQ==, , , , -294 == MQ==, , , 1 -295 assert MQ==, , -296 len MQ==, , 0 -297 bnz main_ternary_false@11 MQ==, -300 dup MQ==, , -301 b main_ternary_merge@12 MQ==, , -306 dig 1 MQ==, , , -308 dup MQ==, , , , -309 cover 2 MQ==, , , , -311 == MQ==, , , 1 -312 assert MQ==, , -313 len MQ==, , 0 -314 bnz main_ternary_false@14 MQ==, -317 dup MQ==, , -318 b main_ternary_merge@15 MQ==, , -322 dig 1 MQ==, , , -324 == MQ==, , 1 -325 assert MQ==, -326 dig 1 MQ==, , MQ== -328 len MQ==, , 1 -329 bz main_ternary_false@17 MQ==, -332 dig 1 MQ==, , MQ== -334 b main_ternary_merge@18 MQ==, , MQ== -339 dig 2 MQ==, , MQ==, MQ== -341 dup MQ==, , MQ==, MQ==, MQ== -342 cover 2 MQ==, , MQ==, MQ==, MQ== -344 == MQ==, , MQ==, 1 -345 assert MQ==, , MQ== -346 len MQ==, , 1 -347 bz main_ternary_false@20 MQ==, -350 dig 1 MQ==, , MQ== -352 b main_ternary_merge@21 MQ==, , MQ== -356 dig 2 MQ==, , MQ==, MQ== -358 == MQ==, , 1 -359 assert MQ==, -360 dup MQ==, , -361 len MQ==, , 0 -362 bz main_ternary_false@23 MQ==, -369 dig 1 MQ==, , MQ== -371 dig 2 MQ==, , MQ==, MQ== -373 == MQ==, , 1 -374 assert MQ==, -375 dup MQ==, , -376 len MQ==, , 0 -377 bz main_ternary_false@26 MQ==, -384 dup MQ==, , -385 dig 1 MQ==, , , -387 == MQ==, , 1 -388 assert MQ==, -389 byte 0x00 MQ==, , AA== -392 byte 0x0f MQ==, , AA==, Dw== -395 byte 0xf0 MQ==, , AA==, Dw==, 8A== -398 cover 2 MQ==, , 8A==, AA==, Dw== -400 byte 0xff MQ==, , 8A==, AA==, Dw==, /w== -403 cover 3 MQ==, , /w==, 8A==, AA==, Dw== -405 dig 1 MQ==, , /w==, 8A==, AA==, Dw==, AA== -407 dig 1 MQ==, , /w==, 8A==, AA==, Dw==, AA==, Dw== -409 b& MQ==, , /w==, 8A==, AA==, Dw==, AA== -410 dig 2 MQ==, , /w==, 8A==, AA==, Dw==, AA==, AA== -412 == MQ==, , /w==, 8A==, AA==, Dw==, 1 -413 assert MQ==, , /w==, 8A==, AA==, Dw== -414 dup MQ==, , /w==, 8A==, AA==, Dw==, Dw== -415 dig 3 MQ==, , /w==, 8A==, AA==, Dw==, Dw==, 8A== -417 b| MQ==, , /w==, 8A==, AA==, Dw==, /w== -418 dig 4 MQ==, , /w==, 8A==, AA==, Dw==, /w==, /w== -420 == MQ==, , /w==, 8A==, AA==, Dw==, 1 -421 assert MQ==, , /w==, 8A==, AA==, Dw== -422 dup MQ==, , /w==, 8A==, AA==, Dw==, Dw== -423 dig 4 MQ==, , /w==, 8A==, AA==, Dw==, Dw==, /w== -425 b^ MQ==, , /w==, 8A==, AA==, Dw==, 8A== -426 dig 3 MQ==, , /w==, 8A==, AA==, Dw==, 8A==, 8A== -428 == MQ==, , /w==, 8A==, AA==, Dw==, 1 -429 assert MQ==, , /w==, 8A==, AA==, Dw== -430 dig 1 MQ==, , /w==, 8A==, AA==, Dw==, AA== -432 dig 4 MQ==, , /w==, 8A==, AA==, Dw==, AA==, /w== -434 b& MQ==, , /w==, 8A==, AA==, Dw==, AA== -435 dup MQ==, , /w==, 8A==, AA==, Dw==, AA==, AA== -436 uncover 3 MQ==, , /w==, 8A==, Dw==, AA==, AA==, AA== -438 == MQ==, , /w==, 8A==, Dw==, AA==, 1 -439 assert MQ==, , /w==, 8A==, Dw==, AA== -440 dig 3 MQ==, , /w==, 8A==, Dw==, AA==, /w== -442 b| MQ==, , /w==, 8A==, Dw==, /w== -443 dup MQ==, , /w==, 8A==, Dw==, /w==, /w== -444 uncover 4 MQ==, , 8A==, Dw==, /w==, /w==, /w== -446 == MQ==, , 8A==, Dw==, /w==, 1 -447 assert MQ==, , 8A==, Dw==, /w== -448 uncover 2 MQ==, , Dw==, /w==, 8A== -450 b^ MQ==, , Dw==, Dw== -451 == MQ==, , 1 -452 assert MQ==, -453 int 1 MQ==, , 1 -454 return 1 \ No newline at end of file +7 +72 int 0 0 +73 dup 0, 0 +74 byte "" 0, 0, 0x +75 dupn 8 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +77 byte base64 QmFzZSA2NCBlbmNvZGVk 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded" +78 dup 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", "Base 64 encoded" +79 byte "Base 64 encoded" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", "Base 64 encoded", "Base 64 encoded" +80 == 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", 1 +81 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded" +82 byte base32 IJQXGZJAGMZCAZLOMNXWIZLE 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", "Base 32 encoded" +83 byte "Base 32 encoded" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", "Base 32 encoded", "Base 32 encoded" +84 == 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", 1 +85 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded" +86 byte 0x4261736520313620656e636f646564 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", "Base 16 encoded" +88 byte "Base 16 encoded" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", "Base 16 encoded", "Base 16 encoded" +90 == 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", 1 +91 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded" +92 byte "" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded", 0x +93 swap 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "Base 64 encoded" +94 len 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 15 +95 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +96 len 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0 +97 ! 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 1 +98 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +99 byte "a" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "a" +100 byte "b" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "a", "b" +102 concat 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "ab" +103 byte "ab" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "ab", "ab" +105 == 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 1 +106 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +107 byte "c" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "c" +110 byte "d" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "c", "d" +113 concat 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "cd" +114 byte "cd" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "cd", "cd" +118 == 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 1 +119 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +120 byte "abc" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc" +122 dup 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", "abc" +123 swap 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", "abc" +124 dup 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", "abc", "abc" +125 extract 0 1 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", "abc", "a" +128 byte "a" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", "abc", "a", "a" +129 == 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", "abc", 1 +130 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", "abc" +131 len 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3 +132 dup 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3 +133 swap 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3 +134 int 1 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3, 1 +135 > 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1 +136 bz main_ternary_false@2 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3 +139 int 1 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1 +140 b main_ternary_merge@3 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1 +144 dig 2 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1, "abc" +146 dup 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1, "abc", "abc" +147 len 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1, "abc", 3 +148 swap 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1, 3, "abc" +149 dup 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1, 3, "abc", "abc" +150 uncover 3 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3, "abc", "abc", 1 +152 uncover 3 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, "abc", "abc", 1, 3 +154 substring3 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, "abc", "bc" +155 byte "bc" 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, "abc", "bc", "bc" +157 == 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, "abc", 1 +158 assert 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, "abc" +159 len 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3 +160 dup 0, 0, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3, 3 +161 bury 12 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3 +163 int 1 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 3, 1 +164 > 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1 +165 bz main_ternary_false@5 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3 +168 int 1 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, "abc", 3, 1 +169 bury 5 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3 +171 b main_ternary_merge@6 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3 +178 dig 1 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc" +180 len 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +181 dup 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 3 +182 bury 12 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +184 int 1 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 1 +185 > 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +186 bz main_ternary_false@8 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3 +189 int 1 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +190 b main_ternary_merge@9 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +195 dig 2 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc" +197 dup 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc", "abc" +198 dig 7 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc", "abc", 1 +200 uncover 3 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "abc", 1, 1 +202 substring3 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", 0x +203 byte "" 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", 0x, 0x +204 == 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", 1 +205 assert 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc" +206 len 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +207 dup 0, 0, 3, 0x, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 3 +208 bury 11 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +210 int 1 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 1 +211 > 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +212 bz main_ternary_false@11 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3 +215 int 1 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +216 b main_ternary_merge@12 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +221 dig 2 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc" +223 dup 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc", "abc" +224 int 0 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc", "abc", 0 +225 uncover 3 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "abc", 0, 1 +227 substring3 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "a" +228 byte "a" 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "a", "a" +229 == 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", 1 +230 assert 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc" +231 len 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +232 dup 0, 0, 3, 3, 0x, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 3 +233 bury 10 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +235 int 1 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 1 +236 > 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +237 bz main_ternary_false@14 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3 +240 dig 8 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +242 int 1 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 1 +243 - 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 2 +244 b main_ternary_merge@15 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 2 +248 dig 2 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 2, "abc" +250 dup 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 2, "abc", "abc" +251 int 0 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 2, "abc", "abc", 0 +252 uncover 3 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "abc", 0, 2 +254 substring3 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "ab" +255 byte "ab" 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "ab", "ab" +257 == 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", 1 +258 assert 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc" +259 len 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +260 dup 0, 0, 3, 3, 3, 0x, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 3 +261 bury 9 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +263 int 2 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 2 +264 > 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +265 bz main_ternary_false@17 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3 +268 dig 7 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +270 int 2 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 2 +271 - 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +272 b main_ternary_merge@18 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1 +276 dig 2 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc" +278 dup 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc", "abc" +279 len 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, "abc", 3 +280 swap 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, 3, "abc" +281 dup 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 1, 3, "abc", "abc" +282 uncover 3 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, "abc", "abc", 1 +284 uncover 3 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "abc", 1, 3 +286 substring3 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "bc" +287 byte "bc" 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", "bc", "bc" +289 == 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc", 1 +290 assert 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, "abc" +291 len 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 3 +292 dup 0, 0, 3, 3, 3, 3, 0x, 0x, 1, 0x, 0x, "abc", 3, 3, 3 +293 bury 8 0, 0, 3, 3, 3, 3, 3, 0x, 1, 0x, 0x, "abc", 3, 3 +295 int 2 0, 0, 3, 3, 3, 3, 3, 0x, 1, 0x, 0x, "abc", 3, 3, 2 +296 > 0, 0, 3, 3, 3, 3, 3, 0x, 1, 0x, 0x, "abc", 3, 1 +297 bz main_ternary_false@20 0, 0, 3, 3, 3, 3, 3, 0x, 1, 0x, 0x, "abc", 3 +300 dig 6 0, 0, 3, 3, 3, 3, 3, 0x, 1, 0x, 0x, "abc", 3, 3 +302 int 2 0, 0, 3, 3, 3, 3, 3, 0x, 1, 0x, 0x, "abc", 3, 3, 2 +303 - 0, 0, 3, 3, 3, 3, 3, 0x, 1, 0x, 0x, "abc", 3, 1 +304 bury 4 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3 +306 b main_ternary_merge@21 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3 +312 dig 1 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc" +314 len 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3 +315 dup 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3, 3 +316 bury 8 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3 +318 int 1 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3, 1 +319 > 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 1 +320 bz main_ternary_false@23 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3 +323 dig 6 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3 +325 int 1 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3, 1 +326 - 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 2 +327 b main_ternary_merge@24 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 2 +331 dig 2 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 2, "abc" +333 dup 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 2, "abc", "abc" +334 dig 6 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 2, "abc", "abc", 1 +336 uncover 3 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "abc", 1, 2 +338 substring3 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "b" +339 byte "b" 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "b", "b" +341 == 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", 1 +342 assert 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc" +343 byte "1234567" 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "1234567" +352 int 1 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "1234567", 1 +353 int 6 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "1234567", 1, 6 +355 substring3 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "23456" +356 byte "23456" 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", "23456", "23456" +363 == 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc", 1 +364 assert 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, "abc" +365 len 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3 +366 dup 0, 0, 3, 3, 3, 3, 3, 0x, 1, 1, 0x, "abc", 3, 3, 3 +367 bury 7 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0x, "abc", 3, 3 +369 int 10 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0x, "abc", 3, 3, 10 +370 > 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0x, "abc", 3, 0 +371 bz main_ternary_false@26 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0x, "abc", 3 +383 int 0 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0x, "abc", 3, 0 +384 bury 3 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +386 dig 1 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "abc" +388 len 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 3 +389 dup 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 3, 3 +390 bury 7 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 3 +392 int 10 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 3, 10 +393 > 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0 +394 bz main_ternary_false@29 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +401 dig 5 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 3 +403 dig 2 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 3, "abc" +405 dig 4 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 3, "abc", 0 +407 uncover 2 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "abc", 0, 3 +409 substring3 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "abc" +410 byte "abc" 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "abc", "abc" +412 == 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +413 assert 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +414 byte "1" 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +417 dup 0, 0, 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1" +418 bury 13 0, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +420 byte "" 0, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", 0x +421 bury 14 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +423 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +424 bnz main_ternary_false@32 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +432 dig 11 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +434 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1" +436 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1", "1" +437 cover 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1", "1" +439 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", 1 +440 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +441 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +442 bnz main_ternary_false@35 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +450 dig 11 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +452 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1" +454 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1", "1" +455 cover 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1", "1" +457 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", 1 +458 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +459 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +460 bnz main_ternary_false@38 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +468 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +470 dig 13 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x +472 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x, 0x +473 cover 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x, 0x +475 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 1 +476 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +477 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0 +478 bnz main_ternary_false@41 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +481 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +483 b main_ternary_merge@42 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +488 dig 13 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x +490 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x, 0x +491 cover 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x, 0x +493 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 1 +494 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +495 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0 +496 bnz main_ternary_false@44 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +499 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +501 b main_ternary_merge@45 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +506 dig 13 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x +508 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +509 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +510 dig 11 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +512 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +513 bz main_ternary_false@47 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +516 dig 11 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +518 b main_ternary_merge@48 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +523 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1" +525 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1", "1" +526 cover 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1", "1" +528 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", 1 +529 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +530 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +531 bz main_ternary_false@50 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +534 dig 11 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +536 b main_ternary_merge@51 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +541 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1" +543 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +544 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +545 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +547 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0 +548 bz main_ternary_false@53 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +556 dig 11 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1" +558 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, "1", "1" +560 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +561 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +562 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +564 len 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0 +565 bz main_ternary_false@56 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +573 dig 12 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x +575 dig 13 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x, 0x +577 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +578 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +579 byte 0x00 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x00 +582 byte 0x0f 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x00, 0x0F +585 byte 0xf0 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x00, 0x0F, 0xF0 +588 cover 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xF0, 0x00, 0x0F +590 byte 0xff 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xF0, 0x00, 0x0F, 0xFF +593 cover 3 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F +595 dig 1 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00 +597 dig 1 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00, 0x0F +599 b& 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00 +600 dig 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00, 0x00 +602 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 1 +603 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F +604 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x0F +605 dig 3 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x0F, 0xF0 +607 b| 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0xFF +608 dig 4 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0xFF, 0xFF +610 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 1 +611 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F +612 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x0F +613 dig 4 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x0F, 0xFF +615 b^ 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0xF0 +616 dig 3 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0xF0, 0xF0 +618 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 1 +619 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F +620 dig 1 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00 +622 dig 4 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00, 0xFF +624 b& 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00 +625 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x00, 0x0F, 0x00, 0x00 +626 uncover 3 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x0F, 0x00, 0x00, 0x00 +628 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x0F, 0x00, 1 +629 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x0F, 0x00 +630 dig 3 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x0F, 0x00, 0xFF +632 b| 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x0F, 0xFF +633 dup 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xFF, 0xF0, 0x0F, 0xFF, 0xFF +634 uncover 4 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xF0, 0x0F, 0xFF, 0xFF, 0xFF +636 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xF0, 0x0F, 0xFF, 1 +637 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0xF0, 0x0F, 0xFF +638 uncover 2 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x0F, 0xFF, 0xF0 +640 b^ 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 0x0F, 0x0F +641 == 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +642 assert 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3 +643 int 1 0x, "1", 3, 3, 3, 3, 3, 3, 1, 1, 0, "abc", 3, 1 +644 return 1 \ No newline at end of file diff --git a/examples/stubs/out/bytes.O1.log b/examples/stubs/out/bytes.O1.log index f88bafeb19..7dfa349cbf 100644 --- a/examples/stubs/out/bytes.O1.log +++ b/examples/stubs/out/bytes.O1.log @@ -1,153 +1,3 @@ -PC Teal Stack -1 -5 -80 byte base64 QmFzZSA2NCBlbmNvZGVk QmFzZSA2NCBlbmNvZGVk -82 byte "Base 64 encoded" QmFzZSA2NCBlbmNvZGVk, QmFzZSA2NCBlbmNvZGVk -84 == 1 -85 assert -86 byte base32 IJQXGZJAGMZCAZLOMNXWIZLE QmFzZSAzMiBlbmNvZGVk -88 byte "Base 32 encoded" QmFzZSAzMiBlbmNvZGVk, QmFzZSAzMiBlbmNvZGVk -90 == 1 -91 assert -92 byte 0x4261736520313620656e636f646564 QmFzZSAxNiBlbmNvZGVk -94 byte "Base 16 encoded" QmFzZSAxNiBlbmNvZGVk, QmFzZSAxNiBlbmNvZGVk -96 == 1 -97 assert -98 int 15 15 -100 assert -101 int 1 1 -102 assert -103 byte "a" YQ== -105 byte "b" YQ==, Yg== -107 concat YWI= -108 byte "ab" YWI=, YWI= -110 == 1 -111 assert -112 byte "c" Yw== -115 byte "d" Yw==, ZA== -118 concat Y2Q= -119 byte "cd" Y2Q=, Y2Q= -123 == 1 -124 assert -125 byte "abc" YWJj -126 extract 0 1 YQ== -129 byte "a" YQ==, YQ== -131 == 1 -132 assert -133 byte "abc" YWJj -134 extract 1 0 YmM= -137 byte "bc" YmM=, YmM= -139 == 1 -140 assert -141 byte "abc" YWJj -142 substring 1 1 -145 byte "" , -146 == 1 -147 assert -148 byte "abc" YWJj -149 extract 0 1 YQ== -152 byte "a" YQ==, YQ== -154 == 1 -155 assert -156 byte "abc" YWJj -157 int 0 YWJj, 0 -159 int 2 YWJj, 0, 2 -160 substring3 YWI= -161 byte "ab" YWI=, YWI= -163 == 1 -164 assert -165 byte "abc" YWJj -166 int 1 YWJj, 1 -167 int 3 YWJj, 1, 3 -169 substring3 YmM= -170 byte "bc" YmM=, YmM= -172 == 1 -173 assert -174 byte "abc" YWJj -175 int 1 YWJj, 1 -176 int 2 YWJj, 1, 2 -177 substring3 Yg== -178 byte "b" Yg==, Yg== -180 == 1 -181 assert -182 byte "1234567" MTIzNDU2Nw== -191 int 1 MTIzNDU2Nw==, 1 -192 int 6 MTIzNDU2Nw==, 1, 6 -194 substring3 MjM0NTY= -195 byte "23456" MjM0NTY=, MjM0NTY= -202 == 1 -203 assert -204 byte "1" MQ== -205 byte "1" MQ==, MQ== -206 == 1 -207 assert -208 byte "1" MQ== -209 byte "1" MQ==, MQ== -210 == 1 -211 assert -212 byte "" -213 byte "" , -214 == 1 -215 assert -216 byte "" -217 byte "" , -218 == 1 -219 assert -220 byte "" -221 byte "" , -222 == 1 -223 assert -224 byte "1" MQ== -225 byte "1" MQ==, MQ== -226 == 1 -227 assert -228 byte "1" MQ== -229 byte "1" MQ==, MQ== -230 == 1 -231 assert -232 byte "1" MQ== -233 byte "1" MQ==, MQ== -234 == 1 -235 assert -236 byte "" -237 byte "" , -238 == 1 -239 assert -240 byte 0x00 AA== -242 byte 0x0f AA==, Dw== -244 b& AA== -245 byte 0x00 AA==, AA== -247 == 1 -248 assert -249 byte 0x0f Dw== -251 byte 0xf0 Dw==, 8A== -253 b| /w== -254 byte 0xff /w==, /w== -255 == 1 -256 assert -257 byte 0x0f Dw== -259 byte 0xff Dw==, /w== -260 b^ 8A== -261 byte 0xf0 8A==, 8A== -263 == 1 -264 assert -265 byte 0x00 AA== -267 byte 0xff AA==, /w== -268 b& AA== -269 dup AA==, AA== -270 byte 0x00 AA==, AA==, AA== -272 == AA==, 1 -273 assert AA== -274 byte 0xff AA==, /w== -275 b| /w== -276 dup /w==, /w== -277 byte 0xff /w==, /w==, /w== -278 == /w==, 1 -279 assert /w== -280 byte 0xf0 /w==, 8A== -282 b^ Dw== -283 byte 0x0f Dw==, Dw== -285 == 1 -286 assert -287 int 1 1 -288 return 1 \ No newline at end of file +PC Teal Stack +1 int 1 1 +3 return 1 \ No newline at end of file diff --git a/examples/stubs/out/bytes.O2.log b/examples/stubs/out/bytes.O2.log index f88bafeb19..7dfa349cbf 100644 --- a/examples/stubs/out/bytes.O2.log +++ b/examples/stubs/out/bytes.O2.log @@ -1,153 +1,3 @@ -PC Teal Stack -1 -5 -80 byte base64 QmFzZSA2NCBlbmNvZGVk QmFzZSA2NCBlbmNvZGVk -82 byte "Base 64 encoded" QmFzZSA2NCBlbmNvZGVk, QmFzZSA2NCBlbmNvZGVk -84 == 1 -85 assert -86 byte base32 IJQXGZJAGMZCAZLOMNXWIZLE QmFzZSAzMiBlbmNvZGVk -88 byte "Base 32 encoded" QmFzZSAzMiBlbmNvZGVk, QmFzZSAzMiBlbmNvZGVk -90 == 1 -91 assert -92 byte 0x4261736520313620656e636f646564 QmFzZSAxNiBlbmNvZGVk -94 byte "Base 16 encoded" QmFzZSAxNiBlbmNvZGVk, QmFzZSAxNiBlbmNvZGVk -96 == 1 -97 assert -98 int 15 15 -100 assert -101 int 1 1 -102 assert -103 byte "a" YQ== -105 byte "b" YQ==, Yg== -107 concat YWI= -108 byte "ab" YWI=, YWI= -110 == 1 -111 assert -112 byte "c" Yw== -115 byte "d" Yw==, ZA== -118 concat Y2Q= -119 byte "cd" Y2Q=, Y2Q= -123 == 1 -124 assert -125 byte "abc" YWJj -126 extract 0 1 YQ== -129 byte "a" YQ==, YQ== -131 == 1 -132 assert -133 byte "abc" YWJj -134 extract 1 0 YmM= -137 byte "bc" YmM=, YmM= -139 == 1 -140 assert -141 byte "abc" YWJj -142 substring 1 1 -145 byte "" , -146 == 1 -147 assert -148 byte "abc" YWJj -149 extract 0 1 YQ== -152 byte "a" YQ==, YQ== -154 == 1 -155 assert -156 byte "abc" YWJj -157 int 0 YWJj, 0 -159 int 2 YWJj, 0, 2 -160 substring3 YWI= -161 byte "ab" YWI=, YWI= -163 == 1 -164 assert -165 byte "abc" YWJj -166 int 1 YWJj, 1 -167 int 3 YWJj, 1, 3 -169 substring3 YmM= -170 byte "bc" YmM=, YmM= -172 == 1 -173 assert -174 byte "abc" YWJj -175 int 1 YWJj, 1 -176 int 2 YWJj, 1, 2 -177 substring3 Yg== -178 byte "b" Yg==, Yg== -180 == 1 -181 assert -182 byte "1234567" MTIzNDU2Nw== -191 int 1 MTIzNDU2Nw==, 1 -192 int 6 MTIzNDU2Nw==, 1, 6 -194 substring3 MjM0NTY= -195 byte "23456" MjM0NTY=, MjM0NTY= -202 == 1 -203 assert -204 byte "1" MQ== -205 byte "1" MQ==, MQ== -206 == 1 -207 assert -208 byte "1" MQ== -209 byte "1" MQ==, MQ== -210 == 1 -211 assert -212 byte "" -213 byte "" , -214 == 1 -215 assert -216 byte "" -217 byte "" , -218 == 1 -219 assert -220 byte "" -221 byte "" , -222 == 1 -223 assert -224 byte "1" MQ== -225 byte "1" MQ==, MQ== -226 == 1 -227 assert -228 byte "1" MQ== -229 byte "1" MQ==, MQ== -230 == 1 -231 assert -232 byte "1" MQ== -233 byte "1" MQ==, MQ== -234 == 1 -235 assert -236 byte "" -237 byte "" , -238 == 1 -239 assert -240 byte 0x00 AA== -242 byte 0x0f AA==, Dw== -244 b& AA== -245 byte 0x00 AA==, AA== -247 == 1 -248 assert -249 byte 0x0f Dw== -251 byte 0xf0 Dw==, 8A== -253 b| /w== -254 byte 0xff /w==, /w== -255 == 1 -256 assert -257 byte 0x0f Dw== -259 byte 0xff Dw==, /w== -260 b^ 8A== -261 byte 0xf0 8A==, 8A== -263 == 1 -264 assert -265 byte 0x00 AA== -267 byte 0xff AA==, /w== -268 b& AA== -269 dup AA==, AA== -270 byte 0x00 AA==, AA==, AA== -272 == AA==, 1 -273 assert AA== -274 byte 0xff AA==, /w== -275 b| /w== -276 dup /w==, /w== -277 byte 0xff /w==, /w==, /w== -278 == /w==, 1 -279 assert /w== -280 byte 0xf0 /w==, 8A== -282 b^ Dw== -283 byte 0x0f Dw==, Dw== -285 == 1 -286 assert -287 int 1 1 -288 return 1 \ No newline at end of file +PC Teal Stack +1 int 1 1 +3 return 1 \ No newline at end of file diff --git a/examples/stubs/out/bytes.approval.debug.teal b/examples/stubs/out/bytes.approval.debug.teal index 41785f9c79..9771bff407 100644 --- a/examples/stubs/out/bytes.approval.debug.teal +++ b/examples/stubs/out/bytes.approval.debug.teal @@ -1,157 +1,9 @@ -// Op // Op Description Stack (out) Source code Source line +// Op // Stack (out) Source code Source line #pragma version 8 // examples.stubs.bytes.BytesContract.approval_program() -> uint64: main_block@0: - byte base64 QmFzZSA2NCBlbmNvZGVk // QmFzZSA2NCBlbmNvZGVk Bytes.from_base64("QmFzZSA2NCBlbmNvZGVk") File "stubs/bytes.py", line 6 - byte "Base 64 encoded" // QmFzZSA2NCBlbmNvZGVk,"Base 64 encoded" b"Base 64 encoded" File "stubs/bytes.py", line 7 - == // {==} base_64 == Bytes(b"Base 64 encoded") File "stubs/bytes.py", line 7 - assert // assert base_64 == Bytes(b"Base 64 encoded") File "stubs/bytes.py", line 7 - byte base32 IJQXGZJAGMZCAZLOMNXWIZLE // IJQXGZJAGMZCAZLOMNXWIZLE Bytes.from_base32("IJQXGZJAGMZCAZLOMNXWIZLE") File "stubs/bytes.py", line 8 - byte "Base 32 encoded" // IJQXGZJAGMZCAZLOMNXWIZLE,"Base 32 encoded" b"Base 32 encoded" File "stubs/bytes.py", line 9 - == // {==} base_32 == Bytes(b"Base 32 encoded") File "stubs/bytes.py", line 9 - assert // assert base_32 == Bytes(b"Base 32 encoded") File "stubs/bytes.py", line 9 - byte 0x4261736520313620656e636f646564 // 0x4261736520313620656e636f646564 Bytes.from_hex("4261736520313620656E636F646564") File "stubs/bytes.py", line 10 - byte "Base 16 encoded" // 0x4261736520313620656e636f646564,"Base 16 encoded" b"Base 16 encoded" File "stubs/bytes.py", line 11 - == // {==} base_16 == Bytes(b"Base 16 encoded") File "stubs/bytes.py", line 11 - assert // assert base_16 == Bytes(b"Base 16 encoded") File "stubs/bytes.py", line 11 - int 15 // 15 base_64 File "stubs/bytes.py", line 14 - assert // assert base_64, "Non empty bytes should be Truthy" File "stubs/bytes.py", line 14 - int 1 // 1 not empty File "stubs/bytes.py", line 15 - assert // assert not empty, "Empty bytes should be Falsy" File "stubs/bytes.py", line 15 - byte "a" // "a" b"a" File "stubs/bytes.py", line 17 - byte "b" // "a","b" b"b" File "stubs/bytes.py", line 17 - concat // {concat} Bytes(b"a") + Bytes(b"b") File "stubs/bytes.py", line 17 - byte "ab" // tmp%6#0,"ab" b"ab" File "stubs/bytes.py", line 17 - == // {==} Bytes(b"a") + Bytes(b"b") == Bytes(b"ab") File "stubs/bytes.py", line 17 - assert // assert Bytes(b"a") + Bytes(b"b") == Bytes(b"ab") File "stubs/bytes.py", line 17 - byte "c" // "c" b"c" File "stubs/bytes.py", line 19 - byte "d" // "c","d" b"d" File "stubs/bytes.py", line 20 - concat // {concat} c += b"d" File "stubs/bytes.py", line 20 - byte "cd" // c#1,"cd" b"cd" File "stubs/bytes.py", line 21 - == // {==} c == Bytes(b"cd") File "stubs/bytes.py", line 21 - assert // assert c == Bytes(b"cd") File "stubs/bytes.py", line 21 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - extract 0 1 // {extract} abc[0] File "stubs/bytes.py", line 24 - byte "a" // tmp%9#0,"a" b"a" File "stubs/bytes.py", line 24 - == // {==} abc[0] == b"a" File "stubs/bytes.py", line 24 - assert // assert abc[0] == b"a" File "stubs/bytes.py", line 24 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - extract 1 0 // {extract} abc[1:] File "stubs/bytes.py", line 26 - byte "bc" // tmp%11#0,"bc" b"bc" File "stubs/bytes.py", line 26 - == // {==} abc[1:] == b"bc" File "stubs/bytes.py", line 26 - assert // assert abc[1:] == b"bc" File "stubs/bytes.py", line 26 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - substring 1 1 // {substring} abc[1:1] File "stubs/bytes.py", line 27 - byte "" // tmp%13#0,"" b"" File "stubs/bytes.py", line 27 - == // {==} abc[1:1] == b"" File "stubs/bytes.py", line 27 - assert // assert abc[1:1] == b"" File "stubs/bytes.py", line 27 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - extract 0 1 // {extract} abc[:1] File "stubs/bytes.py", line 28 - byte "a" // tmp%15#0,"a" b"a" File "stubs/bytes.py", line 28 - == // {==} abc[:1] == b"a" File "stubs/bytes.py", line 28 - assert // assert abc[:1] == b"a" File "stubs/bytes.py", line 28 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - int 0 // "abc",0 abc[:-1] File "stubs/bytes.py", line 29 - int 2 // "abc",0,2 -1 File "stubs/bytes.py", line 29 - substring3 // {substring3} abc[:-1] File "stubs/bytes.py", line 29 - byte "ab" // tmp%20#0,"ab" b"ab" File "stubs/bytes.py", line 29 - == // {==} abc[:-1] == b"ab" File "stubs/bytes.py", line 29 - assert // assert abc[:-1] == b"ab" File "stubs/bytes.py", line 29 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - int 1 // "abc",1 -2 File "stubs/bytes.py", line 30 - int 3 // "abc",1,3 abc[-2:] File "stubs/bytes.py", line 30 - substring3 // {substring3} abc[-2:] File "stubs/bytes.py", line 30 - byte "bc" // tmp%25#0,"bc" b"bc" File "stubs/bytes.py", line 30 - == // {==} abc[-2:] == b"bc" File "stubs/bytes.py", line 30 - assert // assert abc[-2:] == b"bc" File "stubs/bytes.py", line 30 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - int 1 // "abc",1 -2 File "stubs/bytes.py", line 31 - int 2 // "abc",1,2 -1 File "stubs/bytes.py", line 31 - substring3 // {substring3} abc[-2:-1] File "stubs/bytes.py", line 31 - byte "b" // tmp%32#0,"b" b"b" File "stubs/bytes.py", line 31 - == // {==} abc[-2:-1] == b"b" File "stubs/bytes.py", line 31 - assert // assert abc[-2:-1] == b"b" File "stubs/bytes.py", line 31 - byte "1234567" // "1234567" b"1234567" File "stubs/bytes.py", line 32 - int 1 // "1234567",1 1 File "stubs/bytes.py", line 32 - int 6 // "1234567",1,6 -1 File "stubs/bytes.py", line 32 - substring3 // {substring3} Bytes(b"1234567")[1:-1] File "stubs/bytes.py", line 32 - byte "23456" // tmp%37#0,"23456" b"23456" File "stubs/bytes.py", line 32 - == // {==} Bytes(b"1234567")[1:-1] == b"23456" File "stubs/bytes.py", line 32 - assert // assert Bytes(b"1234567")[1:-1] == b"23456" File "stubs/bytes.py", line 32 - byte "1" // "1" b"1" File "stubs/bytes.py", line 34 - byte "1" // "1","1" b"1" File "stubs/bytes.py", line 34 - == // {==} true and true) == true File "stubs/bytes.py", line 38 - assert // assert x File "stubs/bytes.py", line 39 - byte "1" // "1" b"1" File "stubs/bytes.py", line 34 - byte "1" // "1","1" b"1" File "stubs/bytes.py", line 34 - == // {==} true and true) == true File "stubs/bytes.py", line 41 - assert // assert (true and true) == true File "stubs/bytes.py", line 41 - byte "" // "" b"" File "stubs/bytes.py", line 35 - byte "" // "","" b"" File "stubs/bytes.py", line 35 - == // {==} true and false) == false File "stubs/bytes.py", line 42 - assert // assert (true and false) == false File "stubs/bytes.py", line 42 - byte "" // "" b"" File "stubs/bytes.py", line 35 - byte "" // "","" b"" File "stubs/bytes.py", line 35 - == // {==} false and true) == false File "stubs/bytes.py", line 43 - assert // assert (false and true) == false File "stubs/bytes.py", line 43 - byte "" // "" b"" File "stubs/bytes.py", line 35 - byte "" // "","" b"" File "stubs/bytes.py", line 35 - == // {==} false and false) == false File "stubs/bytes.py", line 44 - assert // assert (false and false) == false File "stubs/bytes.py", line 44 - byte "1" // "1" b"1" File "stubs/bytes.py", line 34 - byte "1" // "1","1" b"1" File "stubs/bytes.py", line 34 - == // {==} true or true) == true File "stubs/bytes.py", line 45 - assert // assert (true or true) == true File "stubs/bytes.py", line 45 - byte "1" // "1" b"1" File "stubs/bytes.py", line 34 - byte "1" // "1","1" b"1" File "stubs/bytes.py", line 34 - == // {==} true or false) == true File "stubs/bytes.py", line 46 - assert // assert (true or false) == true File "stubs/bytes.py", line 46 - byte "1" // "1" b"1" File "stubs/bytes.py", line 34 - byte "1" // "1","1" b"1" File "stubs/bytes.py", line 34 - == // {==} false or true) == true File "stubs/bytes.py", line 47 - assert // assert (false or true) == true File "stubs/bytes.py", line 47 - byte "" // "" b"" File "stubs/bytes.py", line 35 - byte "" // "","" b"" File "stubs/bytes.py", line 35 - == // {==} false or false) == false File "stubs/bytes.py", line 48 - assert // assert (false or false) == false File "stubs/bytes.py", line 48 - byte 0x00 // 0x00 Bytes.from_hex("00") File "stubs/bytes.py", line 51 - byte 0x0f // 0x00,0x0f Bytes.from_hex("0F") File "stubs/bytes.py", line 52 - b& // {b&} a & b File "stubs/bytes.py", line 57 - byte 0x00 // tmp%65#0,0x00 Bytes.from_hex("00") File "stubs/bytes.py", line 51 - == // {==} a & b == a File "stubs/bytes.py", line 57 - assert // assert a & b == a File "stubs/bytes.py", line 57 - byte 0x0f // 0x0f Bytes.from_hex("0F") File "stubs/bytes.py", line 52 - byte 0xf0 // 0x0f,0xf0 Bytes.from_hex("F0") File "stubs/bytes.py", line 53 - b| // {b|} b | c File "stubs/bytes.py", line 58 - byte 0xff // tmp%67#0,0xff Bytes.from_hex("FF") File "stubs/bytes.py", line 54 - == // {==} b | c == d File "stubs/bytes.py", line 58 - assert // assert b | c == d File "stubs/bytes.py", line 58 - byte 0x0f // 0x0f Bytes.from_hex("0F") File "stubs/bytes.py", line 52 - byte 0xff // 0x0f,0xff Bytes.from_hex("FF") File "stubs/bytes.py", line 54 - b^ // {b^} b ^ d File "stubs/bytes.py", line 59 - byte 0xf0 // tmp%69#0,0xf0 Bytes.from_hex("F0") File "stubs/bytes.py", line 53 - == // {==} b ^ d == c File "stubs/bytes.py", line 59 - assert // assert b ^ d == c File "stubs/bytes.py", line 59 - byte 0x00 // 0x00 Bytes.from_hex("00") File "stubs/bytes.py", line 51 - byte 0xff // 0x00,0xff Bytes.from_hex("FF") File "stubs/bytes.py", line 54 - b& // {b&} y &= d File "stubs/bytes.py", line 62 - dup // load y#1 from l-stack (copy) y#1,y#1 y File "stubs/bytes.py", line 62 - byte 0x00 // y#1,y#1,0x00 Bytes.from_hex("00") File "stubs/bytes.py", line 51 - == // y#1,{==} y == a File "stubs/bytes.py", line 63 - assert // y#1 assert y == a File "stubs/bytes.py", line 63 - byte 0xff // y#1,0xff Bytes.from_hex("FF") File "stubs/bytes.py", line 54 - b| // {b|} y |= d File "stubs/bytes.py", line 64 - dup // load y#1 from l-stack (copy) y#1,y#1 y File "stubs/bytes.py", line 62 - byte 0xff // y#1,y#1,0xff Bytes.from_hex("FF") File "stubs/bytes.py", line 54 - == // y#1,{==} y == d File "stubs/bytes.py", line 65 - assert // y#1 assert y == d File "stubs/bytes.py", line 65 - byte 0xf0 // y#1,0xf0 Bytes.from_hex("F0") File "stubs/bytes.py", line 53 - b^ // {b^} y ^= c File "stubs/bytes.py", line 66 - byte 0x0f // y#1,0x0f Bytes.from_hex("0F") File "stubs/bytes.py", line 52 - == // {==} y == b File "stubs/bytes.py", line 67 - assert // assert y == b File "stubs/bytes.py", line 67 - int 1 // 1 1 File "stubs/bytes.py", line 69 - return // return UInt64(1) File "stubs/bytes.py", line 69 + int 1 // 1 1 File "stubs/bytes.py", line 68 + return // return UInt64(1) File "stubs/bytes.py", line 68 diff --git a/examples/stubs/out/bytes.approval.teal b/examples/stubs/out/bytes.approval.teal index 01b8ec2479..1f8d6239e8 100644 --- a/examples/stubs/out/bytes.approval.teal +++ b/examples/stubs/out/bytes.approval.teal @@ -2,154 +2,6 @@ // examples.stubs.bytes.BytesContract.approval_program() -> uint64: main_block@0: - byte base64 QmFzZSA2NCBlbmNvZGVk - byte "Base 64 encoded" - == - assert - byte base32 IJQXGZJAGMZCAZLOMNXWIZLE - byte "Base 32 encoded" - == - assert - byte 0x4261736520313620656e636f646564 - byte "Base 16 encoded" - == - assert - int 15 - assert - int 1 - assert - byte "a" - byte "b" - concat - byte "ab" - == - assert - byte "c" - byte "d" - concat - byte "cd" - == - assert - byte "abc" - extract 0 1 - byte "a" - == - assert - byte "abc" - extract 1 0 - byte "bc" - == - assert - byte "abc" - substring 1 1 - byte "" - == - assert - byte "abc" - extract 0 1 - byte "a" - == - assert - byte "abc" - int 0 - int 2 - substring3 - byte "ab" - == - assert - byte "abc" - int 1 - int 3 - substring3 - byte "bc" - == - assert - byte "abc" - int 1 - int 2 - substring3 - byte "b" - == - assert - byte "1234567" - int 1 - int 6 - substring3 - byte "23456" - == - assert - byte "1" - byte "1" - == - assert - byte "1" - byte "1" - == - assert - byte "" - byte "" - == - assert - byte "" - byte "" - == - assert - byte "" - byte "" - == - assert - byte "1" - byte "1" - == - assert - byte "1" - byte "1" - == - assert - byte "1" - byte "1" - == - assert - byte "" - byte "" - == - assert - byte 0x00 - byte 0x0f - b& - byte 0x00 - == - assert - byte 0x0f - byte 0xf0 - b| - byte 0xff - == - assert - byte 0x0f - byte 0xff - b^ - byte 0xf0 - == - assert - byte 0x00 - byte 0xff - b& - dup - byte 0x00 - == - assert - byte 0xff - b| - dup - byte 0xff - == - assert - byte 0xf0 - b^ - byte 0x0f - == - assert int 1 return diff --git a/examples/stubs/out/bytes.approval_unoptimized.debug.teal b/examples/stubs/out/bytes.approval_unoptimized.debug.teal index 837317ef13..705905c2a4 100644 --- a/examples/stubs/out/bytes.approval_unoptimized.debug.teal +++ b/examples/stubs/out/bytes.approval_unoptimized.debug.teal @@ -1,325 +1,515 @@ -// Op // Op Description Stack (out) X stack Source code Source line +// Op // Op Description Stack (out) X stack Source code Source line #pragma version 8 // examples.stubs.bytes.BytesContract.approval_program() -> uint64: +main: + int 0 + dup + byte "" + dupn 8 // allocate 11 to stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | + main_block@0: - byte base64 QmFzZSA2NCBlbmNvZGVk // QmFzZSA2NCBlbmNvZGVk Bytes.from_base64("QmFzZSA2NCBlbmNvZGVk") File "stubs/bytes.py", line 6 - dup // load base_64#0 from l-stack (copy) base_64#0,base_64#0 base_64 File "stubs/bytes.py", line 6 - byte "Base 64 encoded" // base_64#0,base_64#0,"Base 64 encoded" b"Base 64 encoded" File "stubs/bytes.py", line 7 - == // base_64#0,{==} base_64 == Bytes(b"Base 64 encoded") File "stubs/bytes.py", line 7 - assert // base_64#0 assert base_64 == Bytes(b"Base 64 encoded") File "stubs/bytes.py", line 7 - byte base32 IJQXGZJAGMZCAZLOMNXWIZLE // base_64#0,IJQXGZJAGMZCAZLOMNXWIZLE Bytes.from_base32("IJQXGZJAGMZCAZLOMNXWIZLE") File "stubs/bytes.py", line 8 - byte "Base 32 encoded" // base_64#0,base_32#0,"Base 32 encoded" b"Base 32 encoded" File "stubs/bytes.py", line 9 - == // base_64#0,{==} base_32 == Bytes(b"Base 32 encoded") File "stubs/bytes.py", line 9 - assert // base_64#0 assert base_32 == Bytes(b"Base 32 encoded") File "stubs/bytes.py", line 9 - byte 0x4261736520313620656e636f646564 // base_64#0,0x4261736520313620656e636f646564 Bytes.from_hex("4261736520313620656E636F646564") File "stubs/bytes.py", line 10 - byte "Base 16 encoded" // base_64#0,base_16#0,"Base 16 encoded" b"Base 16 encoded" File "stubs/bytes.py", line 11 - == // base_64#0,{==} base_16 == Bytes(b"Base 16 encoded") File "stubs/bytes.py", line 11 - assert // base_64#0 assert base_16 == Bytes(b"Base 16 encoded") File "stubs/bytes.py", line 11 - byte "" // base_64#0,"" b"" File "stubs/bytes.py", line 13 - uncover 1 // load base_64#0 from l-stack (no copy) empty#0,base_64#0 base_64 File "stubs/bytes.py", line 6 - len // empty#0,{len} base_64 File "stubs/bytes.py", line 14 - assert // empty#0 assert base_64, "Non empty bytes should be Truthy" File "stubs/bytes.py", line 14 - len // {len} not empty File "stubs/bytes.py", line 15 - ! // {!} not empty File "stubs/bytes.py", line 15 - assert // assert not empty, "Empty bytes should be Falsy" File "stubs/bytes.py", line 15 - byte "a" // "a" b"a" File "stubs/bytes.py", line 17 - byte "b" // "a","b" b"b" File "stubs/bytes.py", line 17 - concat // {concat} Bytes(b"a") + Bytes(b"b") File "stubs/bytes.py", line 17 - byte "ab" // tmp%6#0,"ab" b"ab" File "stubs/bytes.py", line 17 - == // {==} Bytes(b"a") + Bytes(b"b") == Bytes(b"ab") File "stubs/bytes.py", line 17 - assert // assert Bytes(b"a") + Bytes(b"b") == Bytes(b"ab") File "stubs/bytes.py", line 17 - byte "c" // "c" b"c" File "stubs/bytes.py", line 19 - byte "d" // c#0,"d" b"d" File "stubs/bytes.py", line 20 - concat // {concat} c += b"d" File "stubs/bytes.py", line 20 - byte "cd" // c#0,"cd" b"cd" File "stubs/bytes.py", line 21 - == // {==} c == Bytes(b"cd") File "stubs/bytes.py", line 21 - assert // assert c == Bytes(b"cd") File "stubs/bytes.py", line 21 - byte "abc" // "abc" b"abc" File "stubs/bytes.py", line 23 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - extract 0 1 // abc#0,{extract} abc[0] File "stubs/bytes.py", line 24 - byte "a" // abc#0,tmp%9#0,"a" b"a" File "stubs/bytes.py", line 24 - == // abc#0,{==} abc[0] == b"a" File "stubs/bytes.py", line 24 - assert // abc#0 assert abc[0] == b"a" File "stubs/bytes.py", line 24 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - extract 1 0 // abc#0,{extract} abc[1:] File "stubs/bytes.py", line 26 - byte "bc" // abc#0,tmp%11#0,"bc" b"bc" File "stubs/bytes.py", line 26 - == // abc#0,{==} abc[1:] == b"bc" File "stubs/bytes.py", line 26 - assert // abc#0 assert abc[1:] == b"bc" File "stubs/bytes.py", line 26 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - substring 1 1 // abc#0,{substring} abc[1:1] File "stubs/bytes.py", line 27 - byte "" // abc#0,tmp%13#0,"" b"" File "stubs/bytes.py", line 27 - == // abc#0,{==} abc[1:1] == b"" File "stubs/bytes.py", line 27 - assert // abc#0 assert abc[1:1] == b"" File "stubs/bytes.py", line 27 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - extract 0 1 // abc#0,{extract} abc[:1] File "stubs/bytes.py", line 28 - byte "a" // abc#0,tmp%15#0,"a" b"a" File "stubs/bytes.py", line 28 - == // abc#0,{==} abc[:1] == b"a" File "stubs/bytes.py", line 28 - assert // abc#0 assert abc[:1] == b"a" File "stubs/bytes.py", line 28 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - len // abc#0,{len} abc[:-1] File "stubs/bytes.py", line 29 - pop // abc#0 abc[:-1] File "stubs/bytes.py", line 29 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - len // abc#0,{len} -1 File "stubs/bytes.py", line 29 - int 1 // abc#0,tmp%18#0,1 -1 File "stubs/bytes.py", line 29 - - // abc#0,{-} -1 File "stubs/bytes.py", line 29 - dig 1 // load abc#0 from l-stack (copy) abc#0,tmp%19#0,abc#0 abc File "stubs/bytes.py", line 23 - int 0 // abc#0,tmp%19#0,abc#0,0 abc[:-1] File "stubs/bytes.py", line 29 - uncover 2 // load tmp%19#0 from l-stack (no copy) abc#0,abc#0,0,tmp%19#0 -1 File "stubs/bytes.py", line 29 - substring3 // abc#0,{substring3} abc[:-1] File "stubs/bytes.py", line 29 - byte "ab" // abc#0,tmp%20#0,"ab" b"ab" File "stubs/bytes.py", line 29 - == // abc#0,{==} abc[:-1] == b"ab" File "stubs/bytes.py", line 29 - assert // abc#0 assert abc[:-1] == b"ab" File "stubs/bytes.py", line 29 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - len // abc#0,{len} abc[-2:] File "stubs/bytes.py", line 30 - cover 1 // store base_length%22#0 to l-stack (no copy) base_length%22#0,abc#0 abc[-2:] File "stubs/bytes.py", line 30 - dup // load abc#0 from l-stack (copy) base_length%22#0,abc#0,abc#0 abc File "stubs/bytes.py", line 23 - len // base_length%22#0,abc#0,{len} -2 File "stubs/bytes.py", line 30 - int 2 // base_length%22#0,abc#0,tmp%23#0,2 -2 File "stubs/bytes.py", line 30 - - // base_length%22#0,abc#0,{-} -2 File "stubs/bytes.py", line 30 - dig 1 // load abc#0 from l-stack (copy) base_length%22#0,abc#0,tmp%24#0,abc#0 abc File "stubs/bytes.py", line 23 - uncover 1 // load tmp%24#0 from l-stack (no copy) base_length%22#0,abc#0,abc#0,tmp%24#0 -2 File "stubs/bytes.py", line 30 - uncover 3 // load base_length%22#0 from l-stack (no copy) abc#0,abc#0,tmp%24#0,base_length%22#0 abc[-2:] File "stubs/bytes.py", line 30 - substring3 // abc#0,{substring3} abc[-2:] File "stubs/bytes.py", line 30 - byte "bc" // abc#0,tmp%25#0,"bc" b"bc" File "stubs/bytes.py", line 30 - == // abc#0,{==} abc[-2:] == b"bc" File "stubs/bytes.py", line 30 - assert // abc#0 assert abc[-2:] == b"bc" File "stubs/bytes.py", line 30 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - len // abc#0,{len} abc[-2:-1] File "stubs/bytes.py", line 31 - pop // abc#0 abc[-2:-1] File "stubs/bytes.py", line 31 - dup // load abc#0 from l-stack (copy) abc#0,abc#0 abc File "stubs/bytes.py", line 23 - len // abc#0,{len} -2 File "stubs/bytes.py", line 31 - int 2 // abc#0,tmp%28#0,2 -2 File "stubs/bytes.py", line 31 - - // abc#0,{-} -2 File "stubs/bytes.py", line 31 - cover 1 // store tmp%29#0 to l-stack (no copy) tmp%29#0,abc#0 -2 File "stubs/bytes.py", line 31 - dup // load abc#0 from l-stack (copy) tmp%29#0,abc#0,abc#0 abc File "stubs/bytes.py", line 23 - len // tmp%29#0,abc#0,{len} -1 File "stubs/bytes.py", line 31 - int 1 // tmp%29#0,abc#0,tmp%30#0,1 -1 File "stubs/bytes.py", line 31 - - // tmp%29#0,abc#0,{-} -1 File "stubs/bytes.py", line 31 - uncover 1 // load abc#0 from l-stack (no copy) tmp%29#0,tmp%31#0,abc#0 abc File "stubs/bytes.py", line 23 - cover 2 // virtual: 2 ops abc#0,tmp%29#0,tmp%31#0 -2:-1] == b"b" File "stubs/bytes.py", line 31 - substring3 // {substring3} abc[-2:-1] File "stubs/bytes.py", line 31 - byte "b" // tmp%32#0,"b" b"b" File "stubs/bytes.py", line 31 - == // {==} abc[-2:-1] == b"b" File "stubs/bytes.py", line 31 - assert // assert abc[-2:-1] == b"b" File "stubs/bytes.py", line 31 - byte "1234567" // "1234567" b"1234567" File "stubs/bytes.py", line 32 - len // {len} Bytes(b"1234567")[1:-1] File "stubs/bytes.py", line 32 - pop // Bytes(b"1234567")[1:-1] File "stubs/bytes.py", line 32 - byte "1234567" // "1234567" b"1234567" File "stubs/bytes.py", line 32 - len // {len} -1 File "stubs/bytes.py", line 32 - int 1 // tmp%35#0,1 -1 File "stubs/bytes.py", line 32 - - // {-} -1 File "stubs/bytes.py", line 32 - byte "1234567" // tmp%36#0,"1234567" b"1234567" File "stubs/bytes.py", line 32 - int 1 // tmp%36#0,"1234567",1 1 File "stubs/bytes.py", line 32 - uncover 2 // load tmp%36#0 from l-stack (no copy) "1234567",1,tmp%36#0 -1 File "stubs/bytes.py", line 32 - substring3 // {substring3} Bytes(b"1234567")[1:-1] File "stubs/bytes.py", line 32 - byte "23456" // tmp%37#0,"23456" b"23456" File "stubs/bytes.py", line 32 - == // {==} Bytes(b"1234567")[1:-1] == b"23456" File "stubs/bytes.py", line 32 - assert // assert Bytes(b"1234567")[1:-1] == b"23456" File "stubs/bytes.py", line 32 - byte "1" // "1" b"1" File "stubs/bytes.py", line 34 - dup // store true#0 to l-stack (copy) true#0,true#0 true File "stubs/bytes.py", line 34 - cover 1 // store true#0 to f-stack (𝕗) true#0 | true#0 true File "stubs/bytes.py", line 34 - byte "" // (𝕗) true#0 | true#0,"" b"" File "stubs/bytes.py", line 35 - cover 1 // store false#0 to f-stack (𝕗) true#0,false#0 | true#0 false File "stubs/bytes.py", line 35 - len // (𝕗) true#0,false#0 | {len} true and true File "stubs/bytes.py", line 38 - bnz main_ternary_false@2 // (𝕗) true#0,false#0 | true and true File "stubs/bytes.py", line 38 - // Implicit fall through to main_ternary_true@1 // (𝕗) true#0,false#0 | true and true File "stubs/bytes.py", line 38 + byte base64 QmFzZSA2NCBlbmNvZGVk // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | QmFzZSA2NCBlbmNvZGVk Bytes.from_base64("QmFzZSA2NCBlbmNvZGVk") File "stubs/bytes.py", line 6 + dup // load base_64#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,base_64#0 base_64 File "stubs/bytes.py", line 6 + byte "Base 64 encoded" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,base_64#0,"Base 64 encoded" b"Base 64 encoded" File "stubs/bytes.py", line 7 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,{==} base_64 == Bytes(b"Base 64 encoded") File "stubs/bytes.py", line 7 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0 assert base_64 == Bytes(b"Base 64 encoded") File "stubs/bytes.py", line 7 + byte base32 IJQXGZJAGMZCAZLOMNXWIZLE // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,IJQXGZJAGMZCAZLOMNXWIZLE Bytes.from_base32("IJQXGZJAGMZCAZLOMNXWIZLE") File "stubs/bytes.py", line 8 + byte "Base 32 encoded" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,base_32#0,"Base 32 encoded" b"Base 32 encoded" File "stubs/bytes.py", line 9 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,{==} base_32 == Bytes(b"Base 32 encoded") File "stubs/bytes.py", line 9 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0 assert base_32 == Bytes(b"Base 32 encoded") File "stubs/bytes.py", line 9 + byte 0x4261736520313620656e636f646564 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,0x4261736520313620656e636f646564 Bytes.from_hex("4261736520313620656E636F646564") File "stubs/bytes.py", line 10 + byte "Base 16 encoded" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,base_16#0,"Base 16 encoded" b"Base 16 encoded" File "stubs/bytes.py", line 11 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,{==} base_16 == Bytes(b"Base 16 encoded") File "stubs/bytes.py", line 11 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0 assert base_16 == Bytes(b"Base 16 encoded") File "stubs/bytes.py", line 11 + byte "" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | base_64#0,"" b"" File "stubs/bytes.py", line 13 + swap // load base_64#0 from l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | empty#0,base_64#0 base_64 File "stubs/bytes.py", line 6 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | empty#0,{len} base_64 File "stubs/bytes.py", line 14 + assert // Non empty bytes should be Truthy // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | empty#0 assert base_64, "Non empty bytes should be Truthy" File "stubs/bytes.py", line 14 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | {len} not empty File "stubs/bytes.py", line 15 + ! // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | {!} not empty File "stubs/bytes.py", line 15 + assert // Empty bytes should be Falsy // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | assert not empty, "Empty bytes should be Falsy" File "stubs/bytes.py", line 15 + byte "a" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | "a" b"a" File "stubs/bytes.py", line 17 + byte "b" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | "a","b" b"b" File "stubs/bytes.py", line 17 + concat // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | {concat} Bytes(b"a") + Bytes(b"b") File "stubs/bytes.py", line 17 + byte "ab" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | tmp%6#0,"ab" b"ab" File "stubs/bytes.py", line 17 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | {==} Bytes(b"a") + Bytes(b"b") == Bytes(b"ab") File "stubs/bytes.py", line 17 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | assert Bytes(b"a") + Bytes(b"b") == Bytes(b"ab") File "stubs/bytes.py", line 17 + byte "c" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | "c" b"c" File "stubs/bytes.py", line 19 + byte "d" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | c#0,"d" b"d" File "stubs/bytes.py", line 20 + concat // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | {concat} c += b"d" File "stubs/bytes.py", line 20 + byte "cd" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | c#0,"cd" b"cd" File "stubs/bytes.py", line 21 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | {==} c == Bytes(b"cd") File "stubs/bytes.py", line 21 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | assert c == Bytes(b"cd") File "stubs/bytes.py", line 21 + byte "abc" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | "abc" b"abc" File "stubs/bytes.py", line 23 + dup // store abc#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + swap // store abc#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | abc#0 abc File "stubs/bytes.py", line 23 + dup // load abc#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + extract 0 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | abc#0,{extract} abc[0] File "stubs/bytes.py", line 24 + byte "a" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | abc#0,tmp%9#0,"a" b"a" File "stubs/bytes.py", line 24 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | abc#0,{==} abc[0] == b"a" File "stubs/bytes.py", line 24 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | abc#0 assert abc[0] == b"a" File "stubs/bytes.py", line 24 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | {len} abc[1:] File "stubs/bytes.py", line 26 + dup // store awst_tmp%11#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0 | awst_tmp%11#0,awst_tmp%11#0 abc[1:] File "stubs/bytes.py", line 26 + swap // store awst_tmp%11#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%11#0 abc[1:] File "stubs/bytes.py", line 26 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%11#0,1 1 File "stubs/bytes.py", line 26 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} abc[1:] File "stubs/bytes.py", line 26 + bz main_ternary_false@2 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[1:] File "stubs/bytes.py", line 26 + // Implicit fall through to main_ternary_true@1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[1:] File "stubs/bytes.py", line 26 main_ternary_true@1: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - b main_ternary_merge@3 // (𝕗) true#0,false#0 | (𝕏) ternary_result%40#0 | ternary_result%40#0 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 1 1 File "stubs/bytes.py", line 26 + b main_ternary_merge@3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%13#0 | ternary_result%13#0 main_ternary_false@2: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - // Implicit fall through to main_ternary_merge@3 // (𝕗) true#0,false#0 | (𝕏) ternary_result%40#0 | ternary_result%40#0 + dup // load awst_tmp%11#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%11#0 abc[1:] File "stubs/bytes.py", line 26 + // Implicit fall through to main_ternary_merge@3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%13#0 | ternary_result%13#0 main_ternary_merge@3: - dig 2 // load true#0 from f-stack (𝕗) true#0,false#0 | ternary_result%40#0,true#0 ternary_result%40#0 true File "stubs/bytes.py", line 34 - dup - cover 2 // store true#0 to l-stack (copy) (𝕗) true#0,false#0 | true#0,ternary_result%40#0,true#0 true File "stubs/bytes.py", line 34 - == // (𝕗) true#0,false#0 | true#0,{==} true and true) == true File "stubs/bytes.py", line 38 - assert // (𝕗) true#0,false#0 | true#0 assert x File "stubs/bytes.py", line 39 - len // (𝕗) true#0,false#0 | {len} true and true File "stubs/bytes.py", line 41 - bnz main_ternary_false@5 // (𝕗) true#0,false#0 | true and true File "stubs/bytes.py", line 41 - // Implicit fall through to main_ternary_true@4 // (𝕗) true#0,false#0 | true and true File "stubs/bytes.py", line 41 + dig 2 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%13#0 | abc#0 ternary_result%13#0 abc File "stubs/bytes.py", line 23 + dup // store abc#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%13#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%13#0 | abc#0,{len} abc[1:] File "stubs/bytes.py", line 26 + swap // store base_length%14#0 to l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%13#0 | base_length%14#0,abc#0 abc[1:] File "stubs/bytes.py", line 26 + dup // load abc#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%13#0 | base_length%14#0,abc#0,abc#0 abc File "stubs/bytes.py", line 23 + uncover 3 // load ternary_result%13#0 from x-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | base_length%14#0,abc#0,abc#0,ternary_result%13#0 1 File "stubs/bytes.py", line 26 + uncover 3 // load base_length%14#0 from l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,abc#0,ternary_result%13#0,base_length%14#0 abc[1:] File "stubs/bytes.py", line 26 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{substring3} abc[1:] File "stubs/bytes.py", line 26 + byte "bc" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,tmp%15#0,"bc" b"bc" File "stubs/bytes.py", line 26 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{==} abc[1:] == b"bc" File "stubs/bytes.py", line 26 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 assert abc[1:] == b"bc" File "stubs/bytes.py", line 26 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[1:1] File "stubs/bytes.py", line 27 + dup // store awst_tmp%17#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0,awst_tmp%17#0 abc[1:1] File "stubs/bytes.py", line 27 + bury 12 // store awst_tmp%17#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0 abc[1:1] File "stubs/bytes.py", line 27 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0,1 1 File "stubs/bytes.py", line 27 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} abc[1:1] File "stubs/bytes.py", line 27 + bz main_ternary_false@5 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[1:1] File "stubs/bytes.py", line 27 + // Implicit fall through to main_ternary_true@4 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[1:1] File "stubs/bytes.py", line 27 main_ternary_true@4: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - b main_ternary_merge@6 // (𝕗) true#0,false#0 | (𝕏) ternary_result%42#0 | ternary_result%42#0 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 1 1 File "stubs/bytes.py", line 27 + bury 5 // store ternary_result%19#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 1 File "stubs/bytes.py", line 27 + b main_ternary_merge@6 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | main_ternary_false@5: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - // Implicit fall through to main_ternary_merge@6 // (𝕗) true#0,false#0 | (𝕏) ternary_result%42#0 | ternary_result%42#0 + dig 10 // load awst_tmp%17#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0 abc[1:1] File "stubs/bytes.py", line 27 + bury 5 // store ternary_result%19#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 1 File "stubs/bytes.py", line 27 + // Implicit fall through to main_ternary_merge@6 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | main_ternary_merge@6: - dig 2 // load true#0 from f-stack (𝕗) true#0,false#0 | ternary_result%42#0,true#0 ternary_result%42#0 true File "stubs/bytes.py", line 34 - dup - cover 2 // store true#0 to l-stack (copy) (𝕗) true#0,false#0 | true#0,ternary_result%42#0,true#0 true File "stubs/bytes.py", line 34 - == // (𝕗) true#0,false#0 | true#0,{==} true and true) == true File "stubs/bytes.py", line 41 - assert // (𝕗) true#0,false#0 | true#0 assert (true and true) == true File "stubs/bytes.py", line 41 - len // (𝕗) true#0,false#0 | {len} true and false File "stubs/bytes.py", line 42 - bnz main_ternary_false@8 // (𝕗) true#0,false#0 | true and false File "stubs/bytes.py", line 42 - // Implicit fall through to main_ternary_true@7 // (𝕗) true#0,false#0 | true and false File "stubs/bytes.py", line 42 + dig 1 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 abc File "stubs/bytes.py", line 23 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[1:1] File "stubs/bytes.py", line 27 + dup // store awst_tmp%17#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0,awst_tmp%17#0 abc[1:1] File "stubs/bytes.py", line 27 + bury 12 // store awst_tmp%17#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0 abc[1:1] File "stubs/bytes.py", line 27 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0,1 1 File "stubs/bytes.py", line 27 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} abc[1:1] File "stubs/bytes.py", line 27 + bz main_ternary_false@8 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[1:1] File "stubs/bytes.py", line 27 + // Implicit fall through to main_ternary_true@7 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[1:1] File "stubs/bytes.py", line 27 main_ternary_true@7: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - b main_ternary_merge@9 // (𝕗) true#0,false#0 | (𝕏) ternary_result%45#0 | ternary_result%45#0 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 1 1 File "stubs/bytes.py", line 27 + b main_ternary_merge@9 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%21#0 | ternary_result%21#0 main_ternary_false@8: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - // Implicit fall through to main_ternary_merge@9 // (𝕗) true#0,false#0 | (𝕏) ternary_result%45#0 | ternary_result%45#0 + dig 10 // load awst_tmp%17#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%17#0 abc[1:1] File "stubs/bytes.py", line 27 + // Implicit fall through to main_ternary_merge@9 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%21#0 | ternary_result%21#0 main_ternary_merge@9: - dig 1 // load false#0 from f-stack (𝕗) true#0,false#0 | ternary_result%45#0,false#0 ternary_result%45#0 false File "stubs/bytes.py", line 35 - dup - cover 2 // store false#0 to l-stack (copy) (𝕗) true#0,false#0 | false#0,ternary_result%45#0,false#0 false File "stubs/bytes.py", line 35 - == // (𝕗) true#0,false#0 | false#0,{==} true and false) == false File "stubs/bytes.py", line 42 - assert // (𝕗) true#0,false#0 | false#0 assert (true and false) == false File "stubs/bytes.py", line 42 - len // (𝕗) true#0,false#0 | {len} false and true File "stubs/bytes.py", line 43 - bnz main_ternary_false@11 // (𝕗) true#0,false#0 | false and true File "stubs/bytes.py", line 43 - // Implicit fall through to main_ternary_true@10 // (𝕗) true#0,false#0 | false and true File "stubs/bytes.py", line 43 + dig 2 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%21#0 | abc#0 ternary_result%21#0 abc File "stubs/bytes.py", line 23 + dup // store abc#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%21#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + dig 7 // load ternary_result%19#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%21#0 | abc#0,abc#0,ternary_result%19#0 1 File "stubs/bytes.py", line 27 + uncover 3 // load ternary_result%21#0 from x-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,abc#0,ternary_result%19#0,ternary_result%21#0 1 File "stubs/bytes.py", line 27 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{substring3} abc[1:1] File "stubs/bytes.py", line 27 + byte "" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,tmp%22#0,"" b"" File "stubs/bytes.py", line 27 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{==} abc[1:1] == b"" File "stubs/bytes.py", line 27 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 assert abc[1:1] == b"" File "stubs/bytes.py", line 27 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[:1] File "stubs/bytes.py", line 28 + dup // store awst_tmp%24#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%24#0,awst_tmp%24#0 abc[:1] File "stubs/bytes.py", line 28 + bury 11 // store awst_tmp%24#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%24#0 abc[:1] File "stubs/bytes.py", line 28 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%24#0,1 1 File "stubs/bytes.py", line 28 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} abc[:1] File "stubs/bytes.py", line 28 + bz main_ternary_false@11 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[:1] File "stubs/bytes.py", line 28 + // Implicit fall through to main_ternary_true@10 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[:1] File "stubs/bytes.py", line 28 main_ternary_true@10: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - b main_ternary_merge@12 // (𝕗) true#0,false#0 | (𝕏) ternary_result%48#0 | ternary_result%48#0 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 1 1 File "stubs/bytes.py", line 28 + b main_ternary_merge@12 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%26#0 | ternary_result%26#0 main_ternary_false@11: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - // Implicit fall through to main_ternary_merge@12 // (𝕗) true#0,false#0 | (𝕏) ternary_result%48#0 | ternary_result%48#0 + dig 9 // load awst_tmp%24#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%24#0 abc[:1] File "stubs/bytes.py", line 28 + // Implicit fall through to main_ternary_merge@12 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%26#0 | ternary_result%26#0 main_ternary_merge@12: - dig 1 // load false#0 from f-stack (𝕗) true#0,false#0 | ternary_result%48#0,false#0 ternary_result%48#0 false File "stubs/bytes.py", line 35 - dup - cover 2 // store false#0 to l-stack (copy) (𝕗) true#0,false#0 | false#0,ternary_result%48#0,false#0 false File "stubs/bytes.py", line 35 - == // (𝕗) true#0,false#0 | false#0,{==} false and true) == false File "stubs/bytes.py", line 43 - assert // (𝕗) true#0,false#0 | false#0 assert (false and true) == false File "stubs/bytes.py", line 43 - len // (𝕗) true#0,false#0 | {len} false and false File "stubs/bytes.py", line 44 - bnz main_ternary_false@14 // (𝕗) true#0,false#0 | false and false File "stubs/bytes.py", line 44 - // Implicit fall through to main_ternary_true@13 // (𝕗) true#0,false#0 | false and false File "stubs/bytes.py", line 44 + dig 2 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%26#0 | abc#0 ternary_result%26#0 abc File "stubs/bytes.py", line 23 + dup // store abc#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%26#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + int 0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%26#0 | abc#0,abc#0,0 abc[:1] File "stubs/bytes.py", line 28 + uncover 3 // load ternary_result%26#0 from x-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,abc#0,0,ternary_result%26#0 1 File "stubs/bytes.py", line 28 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{substring3} abc[:1] File "stubs/bytes.py", line 28 + byte "a" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,tmp%27#0,"a" b"a" File "stubs/bytes.py", line 28 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{==} abc[:1] == b"a" File "stubs/bytes.py", line 28 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 assert abc[:1] == b"a" File "stubs/bytes.py", line 28 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[:-1] File "stubs/bytes.py", line 29 + dup // store awst_tmp%29#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%29#0,awst_tmp%29#0 abc[:-1] File "stubs/bytes.py", line 29 + bury 10 // store awst_tmp%29#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%29#0 abc[:-1] File "stubs/bytes.py", line 29 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%29#0,1 -1 File "stubs/bytes.py", line 29 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} -1 File "stubs/bytes.py", line 29 + bz main_ternary_false@14 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[:-1] File "stubs/bytes.py", line 29 + // Implicit fall through to main_ternary_true@13 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[:-1] File "stubs/bytes.py", line 29 main_ternary_true@13: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - b main_ternary_merge@15 // (𝕗) true#0,false#0 | (𝕏) ternary_result%51#0 | ternary_result%51#0 + dig 8 // load awst_tmp%29#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%29#0 abc[:-1] File "stubs/bytes.py", line 29 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%29#0,1 -1 File "stubs/bytes.py", line 29 + - // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {-} -1 File "stubs/bytes.py", line 29 + b main_ternary_merge@15 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%31#0 | ternary_result%31#0 main_ternary_false@14: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - // Implicit fall through to main_ternary_merge@15 // (𝕗) true#0,false#0 | (𝕏) ternary_result%51#0 | ternary_result%51#0 + int 0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 0 -1 File "stubs/bytes.py", line 29 + // Implicit fall through to main_ternary_merge@15 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%31#0 | ternary_result%31#0 main_ternary_merge@15: - dig 1 // load false#0 from f-stack (𝕗) true#0,false#0 | ternary_result%51#0,false#0 ternary_result%51#0 false File "stubs/bytes.py", line 35 - == // (𝕗) true#0,false#0 | {==} false and false) == false File "stubs/bytes.py", line 44 - assert // (𝕗) true#0,false#0 | assert (false and false) == false File "stubs/bytes.py", line 44 - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - len // (𝕗) true#0,false#0 | {len} true or true File "stubs/bytes.py", line 45 - bz main_ternary_false@17 // (𝕗) true#0,false#0 | true or true File "stubs/bytes.py", line 45 - // Implicit fall through to main_ternary_true@16 // (𝕗) true#0,false#0 | true or true File "stubs/bytes.py", line 45 + dig 2 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%31#0 | abc#0 ternary_result%31#0 abc File "stubs/bytes.py", line 23 + dup // store abc#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%31#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + int 0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%31#0 | abc#0,abc#0,0 abc[:-1] File "stubs/bytes.py", line 29 + uncover 3 // load ternary_result%31#0 from x-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,abc#0,0,ternary_result%31#0 -1 File "stubs/bytes.py", line 29 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{substring3} abc[:-1] File "stubs/bytes.py", line 29 + byte "ab" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,tmp%32#0,"ab" b"ab" File "stubs/bytes.py", line 29 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{==} abc[:-1] == b"ab" File "stubs/bytes.py", line 29 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 assert abc[:-1] == b"ab" File "stubs/bytes.py", line 29 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[-2:] File "stubs/bytes.py", line 30 + dup // store awst_tmp%34#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%34#0,awst_tmp%34#0 abc[-2:] File "stubs/bytes.py", line 30 + bury 9 // store awst_tmp%34#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%34#0 abc[-2:] File "stubs/bytes.py", line 30 + int 2 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%34#0,2 -2 File "stubs/bytes.py", line 30 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} -2 File "stubs/bytes.py", line 30 + bz main_ternary_false@17 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-2:] File "stubs/bytes.py", line 30 + // Implicit fall through to main_ternary_true@16 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-2:] File "stubs/bytes.py", line 30 main_ternary_true@16: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - b main_ternary_merge@18 // (𝕗) true#0,false#0 | (𝕏) ternary_result%54#0 | ternary_result%54#0 + dig 7 // load awst_tmp%34#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%34#0 abc[-2:] File "stubs/bytes.py", line 30 + int 2 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%34#0,2 -2 File "stubs/bytes.py", line 30 + - // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {-} -2 File "stubs/bytes.py", line 30 + b main_ternary_merge@18 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%36#0 | ternary_result%36#0 main_ternary_false@17: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - // Implicit fall through to main_ternary_merge@18 // (𝕗) true#0,false#0 | (𝕏) ternary_result%54#0 | ternary_result%54#0 + int 0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 0 -2 File "stubs/bytes.py", line 30 + // Implicit fall through to main_ternary_merge@18 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%36#0 | ternary_result%36#0 main_ternary_merge@18: - dig 2 // load true#0 from f-stack (𝕗) true#0,false#0 | ternary_result%54#0,true#0 ternary_result%54#0 true File "stubs/bytes.py", line 34 - dup - cover 2 // store true#0 to l-stack (copy) (𝕗) true#0,false#0 | true#0,ternary_result%54#0,true#0 true File "stubs/bytes.py", line 34 - == // (𝕗) true#0,false#0 | true#0,{==} true or true) == true File "stubs/bytes.py", line 45 - assert // (𝕗) true#0,false#0 | true#0 assert (true or true) == true File "stubs/bytes.py", line 45 - len // (𝕗) true#0,false#0 | {len} true or false File "stubs/bytes.py", line 46 - bz main_ternary_false@20 // (𝕗) true#0,false#0 | true or false File "stubs/bytes.py", line 46 - // Implicit fall through to main_ternary_true@19 // (𝕗) true#0,false#0 | true or false File "stubs/bytes.py", line 46 + dig 2 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%36#0 | abc#0 ternary_result%36#0 abc File "stubs/bytes.py", line 23 + dup // store abc#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%36#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%36#0 | abc#0,{len} abc[-2:] File "stubs/bytes.py", line 30 + swap // store base_length%37#0 to l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%36#0 | base_length%37#0,abc#0 abc[-2:] File "stubs/bytes.py", line 30 + dup // load abc#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%36#0 | base_length%37#0,abc#0,abc#0 abc File "stubs/bytes.py", line 23 + uncover 3 // load ternary_result%36#0 from x-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | base_length%37#0,abc#0,abc#0,ternary_result%36#0 -2 File "stubs/bytes.py", line 30 + uncover 3 // load base_length%37#0 from l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,abc#0,ternary_result%36#0,base_length%37#0 abc[-2:] File "stubs/bytes.py", line 30 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{substring3} abc[-2:] File "stubs/bytes.py", line 30 + byte "bc" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,tmp%38#0,"bc" b"bc" File "stubs/bytes.py", line 30 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{==} abc[-2:] == b"bc" File "stubs/bytes.py", line 30 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 assert abc[-2:] == b"bc" File "stubs/bytes.py", line 30 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[-2:-1] File "stubs/bytes.py", line 31 + dup // store awst_tmp%40#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0,awst_tmp%40#0 abc[-2:-1] File "stubs/bytes.py", line 31 + bury 8 // store awst_tmp%40#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0 abc[-2:-1] File "stubs/bytes.py", line 31 + int 2 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0,2 -2 File "stubs/bytes.py", line 31 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} -2 File "stubs/bytes.py", line 31 + bz main_ternary_false@20 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-2:-1] File "stubs/bytes.py", line 31 + // Implicit fall through to main_ternary_true@19 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-2:-1] File "stubs/bytes.py", line 31 main_ternary_true@19: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - b main_ternary_merge@21 // (𝕗) true#0,false#0 | (𝕏) ternary_result%57#0 | ternary_result%57#0 + dig 6 // load awst_tmp%40#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0 abc[-2:-1] File "stubs/bytes.py", line 31 + int 2 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0,2 -2 File "stubs/bytes.py", line 31 + - // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {-} -2 File "stubs/bytes.py", line 31 + bury 4 // store ternary_result%42#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | -2 File "stubs/bytes.py", line 31 + b main_ternary_merge@21 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | main_ternary_false@20: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - // Implicit fall through to main_ternary_merge@21 // (𝕗) true#0,false#0 | (𝕏) ternary_result%57#0 | ternary_result%57#0 + int 0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 0 -2 File "stubs/bytes.py", line 31 + bury 4 // store ternary_result%42#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | -2 File "stubs/bytes.py", line 31 + // Implicit fall through to main_ternary_merge@21 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | main_ternary_merge@21: - dig 2 // load true#0 from f-stack (𝕗) true#0,false#0 | ternary_result%57#0,true#0 ternary_result%57#0 true File "stubs/bytes.py", line 34 - == // (𝕗) true#0,false#0 | {==} true or false) == true File "stubs/bytes.py", line 46 - assert // (𝕗) true#0,false#0 | assert (true or false) == true File "stubs/bytes.py", line 46 - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - len // (𝕗) true#0,false#0 | {len} false or true File "stubs/bytes.py", line 47 - bz main_ternary_false@23 // (𝕗) true#0,false#0 | false or true File "stubs/bytes.py", line 47 - // Implicit fall through to main_ternary_true@22 // (𝕗) true#0,false#0 | false or true File "stubs/bytes.py", line 47 + dig 1 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 abc File "stubs/bytes.py", line 23 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[-2:-1] File "stubs/bytes.py", line 31 + dup // store awst_tmp%40#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0,awst_tmp%40#0 abc[-2:-1] File "stubs/bytes.py", line 31 + bury 8 // store awst_tmp%40#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0 abc[-2:-1] File "stubs/bytes.py", line 31 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0,1 -1 File "stubs/bytes.py", line 31 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} -1 File "stubs/bytes.py", line 31 + bz main_ternary_false@23 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-2:-1] File "stubs/bytes.py", line 31 + // Implicit fall through to main_ternary_true@22 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-2:-1] File "stubs/bytes.py", line 31 main_ternary_true@22: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - b main_ternary_merge@24 // (𝕗) true#0,false#0 | (𝕏) ternary_result%60#0 | ternary_result%60#0 + dig 6 // load awst_tmp%40#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0 abc[-2:-1] File "stubs/bytes.py", line 31 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%40#0,1 -1 File "stubs/bytes.py", line 31 + - // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {-} -1 File "stubs/bytes.py", line 31 + b main_ternary_merge@24 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%44#0 | ternary_result%44#0 main_ternary_false@23: - dig 1 // load true#0 from f-stack (𝕗) true#0,false#0 | true#0 true File "stubs/bytes.py", line 34 - // Implicit fall through to main_ternary_merge@24 // (𝕗) true#0,false#0 | (𝕏) ternary_result%60#0 | ternary_result%60#0 + int 0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 0 -1 File "stubs/bytes.py", line 31 + // Implicit fall through to main_ternary_merge@24 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%44#0 | ternary_result%44#0 main_ternary_merge@24: - dig 2 // load true#0 from f-stack (𝕗) true#0,false#0 | ternary_result%60#0,true#0 ternary_result%60#0 true File "stubs/bytes.py", line 34 - == // (𝕗) true#0,false#0 | {==} false or true) == true File "stubs/bytes.py", line 47 - assert // (𝕗) true#0,false#0 | assert (false or true) == true File "stubs/bytes.py", line 47 - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - len // (𝕗) true#0,false#0 | {len} false or false File "stubs/bytes.py", line 48 - bz main_ternary_false@26 // (𝕗) true#0,false#0 | false or false File "stubs/bytes.py", line 48 - // Implicit fall through to main_ternary_true@25 // (𝕗) true#0,false#0 | false or false File "stubs/bytes.py", line 48 + dig 2 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%44#0 | abc#0 ternary_result%44#0 abc File "stubs/bytes.py", line 23 + dup // store abc#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%44#0 | abc#0,abc#0 abc File "stubs/bytes.py", line 23 + dig 6 // load ternary_result%42#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%44#0 | abc#0,abc#0,ternary_result%42#0 -2 File "stubs/bytes.py", line 31 + uncover 3 // load ternary_result%44#0 from x-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,abc#0,ternary_result%42#0,ternary_result%44#0 -1 File "stubs/bytes.py", line 31 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{substring3} abc[-2:-1] File "stubs/bytes.py", line 31 + byte "b" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,tmp%45#0,"b" b"b" File "stubs/bytes.py", line 31 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{==} abc[-2:-1] == b"b" File "stubs/bytes.py", line 31 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 assert abc[-2:-1] == b"b" File "stubs/bytes.py", line 31 + byte "1234567" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,"1234567" b"1234567" File "stubs/bytes.py", line 32 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,"1234567",1 1 File "stubs/bytes.py", line 32 + int 6 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,"1234567",1,6 -1 File "stubs/bytes.py", line 32 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{substring3} Bytes(b"1234567")[1:-1] File "stubs/bytes.py", line 32 + byte "23456" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,tmp%47#0,"23456" b"23456" File "stubs/bytes.py", line 32 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,{==} Bytes(b"1234567")[1:-1] == b"23456" File "stubs/bytes.py", line 32 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 assert Bytes(b"1234567")[1:-1] == b"23456" File "stubs/bytes.py", line 32 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[-10:10] File "stubs/bytes.py", line 33 + dup // store awst_tmp%49#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0,awst_tmp%49#0 abc[-10:10] File "stubs/bytes.py", line 33 + bury 7 // store awst_tmp%49#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0 abc[-10:10] File "stubs/bytes.py", line 33 + int 10 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0,10 -10 File "stubs/bytes.py", line 33 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} -10 File "stubs/bytes.py", line 33 + bz main_ternary_false@26 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-10:10] File "stubs/bytes.py", line 33 + // Implicit fall through to main_ternary_true@25 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-10:10] File "stubs/bytes.py", line 33 main_ternary_true@25: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - b main_ternary_merge@27 // (𝕗) true#0,false#0 | (𝕏) ternary_result%63#0 | ternary_result%63#0 + dig 5 // load awst_tmp%49#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0 abc[-10:10] File "stubs/bytes.py", line 33 + int 10 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0,10 -10 File "stubs/bytes.py", line 33 + - // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {-} -10 File "stubs/bytes.py", line 33 + bury 3 // store ternary_result%51#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | -10 File "stubs/bytes.py", line 33 + b main_ternary_merge@27 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | main_ternary_false@26: - dup // load false#0 from f-stack (𝕗) true#0,false#0 | false#0 false File "stubs/bytes.py", line 35 - // Implicit fall through to main_ternary_merge@27 // (𝕗) true#0,false#0 | (𝕏) ternary_result%63#0 | ternary_result%63#0 + int 0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 0 -10 File "stubs/bytes.py", line 33 + bury 3 // store ternary_result%51#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | -10 File "stubs/bytes.py", line 33 + // Implicit fall through to main_ternary_merge@27 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | main_ternary_merge@27: - dig 1 // load false#0 from f-stack (𝕗) true#0,false#0 | ternary_result%63#0,false#0 ternary_result%63#0 false File "stubs/bytes.py", line 35 - == // (𝕗) true#0,false#0 | {==} false or false) == false File "stubs/bytes.py", line 48 - assert // (𝕗) true#0,false#0 | assert (false or false) == false File "stubs/bytes.py", line 48 - byte 0x00 // (𝕗) true#0,false#0 | 0x00 Bytes.from_hex("00") File "stubs/bytes.py", line 51 - byte 0x0f // (𝕗) true#0,false#0 | a#0,0x0f Bytes.from_hex("0F") File "stubs/bytes.py", line 52 - byte 0xf0 // (𝕗) true#0,false#0 | a#0,b#0,0xf0 Bytes.from_hex("F0") File "stubs/bytes.py", line 53 - cover 2 // store c#0 to l-stack (no copy) (𝕗) true#0,false#0 | c#0,a#0,b#0 c File "stubs/bytes.py", line 19 - byte 0xff // (𝕗) true#0,false#0 | c#0,a#0,b#0,0xff Bytes.from_hex("FF") File "stubs/bytes.py", line 54 - cover 3 // store d#0 to l-stack (no copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0 d File "stubs/bytes.py", line 50 - dig 1 // load a#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,a#0 a File "stubs/bytes.py", line 50 - dig 1 // load b#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,a#0,b#0 b File "stubs/bytes.py", line 50 - b& // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,{b&} a & b File "stubs/bytes.py", line 57 - dig 2 // load a#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,tmp%65#0,a#0 a File "stubs/bytes.py", line 50 - == // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,{==} a & b == a File "stubs/bytes.py", line 57 - assert // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0 assert a & b == a File "stubs/bytes.py", line 57 - dup // load b#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,b#0 b File "stubs/bytes.py", line 50 - dig 3 // load c#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,b#0,c#0 c File "stubs/bytes.py", line 19 - b| // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,{b|} b | c File "stubs/bytes.py", line 58 - dig 4 // load d#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,tmp%67#0,d#0 d File "stubs/bytes.py", line 50 - == // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,{==} b | c == d File "stubs/bytes.py", line 58 - assert // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0 assert b | c == d File "stubs/bytes.py", line 58 - dup // load b#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,b#0 b File "stubs/bytes.py", line 50 - dig 4 // load d#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,b#0,d#0 d File "stubs/bytes.py", line 50 - b^ // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,{b^} b ^ d File "stubs/bytes.py", line 59 - dig 3 // load c#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,tmp%69#0,c#0 c File "stubs/bytes.py", line 19 - == // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,{==} b ^ d == c File "stubs/bytes.py", line 59 - assert // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0 assert b ^ d == c File "stubs/bytes.py", line 59 - dig 1 // load a#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,a#0 a File "stubs/bytes.py", line 50 - dig 4 // load d#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,y#0,d#0 d File "stubs/bytes.py", line 50 - b& // (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,{b&} y &= d File "stubs/bytes.py", line 62 - dup // load y#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,a#0,b#0,y#0,y#0 y File "stubs/bytes.py", line 61 - uncover 3 // load a#0 from l-stack (no copy) (𝕗) true#0,false#0 | d#0,c#0,b#0,y#0,y#0,a#0 a File "stubs/bytes.py", line 50 - == // (𝕗) true#0,false#0 | d#0,c#0,b#0,y#0,{==} y == a File "stubs/bytes.py", line 63 - assert // (𝕗) true#0,false#0 | d#0,c#0,b#0,y#0 assert y == a File "stubs/bytes.py", line 63 - dig 3 // load d#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,b#0,y#0,d#0 d File "stubs/bytes.py", line 50 - b| // (𝕗) true#0,false#0 | d#0,c#0,b#0,{b|} y |= d File "stubs/bytes.py", line 64 - dup // load y#0 from l-stack (copy) (𝕗) true#0,false#0 | d#0,c#0,b#0,y#0,y#0 y File "stubs/bytes.py", line 61 - uncover 4 // load d#0 from l-stack (no copy) (𝕗) true#0,false#0 | c#0,b#0,y#0,y#0,d#0 d File "stubs/bytes.py", line 50 - == // (𝕗) true#0,false#0 | c#0,b#0,y#0,{==} y == d File "stubs/bytes.py", line 65 - assert // (𝕗) true#0,false#0 | c#0,b#0,y#0 assert y == d File "stubs/bytes.py", line 65 - uncover 2 // load c#0 from l-stack (no copy) (𝕗) true#0,false#0 | b#0,y#0,c#0 c File "stubs/bytes.py", line 19 - b^ // (𝕗) true#0,false#0 | b#0,{b^} y ^= c File "stubs/bytes.py", line 66 - == // (𝕗) true#0,false#0 | {==} y == b File "stubs/bytes.py", line 67 - assert // (𝕗) true#0,false#0 | assert y == b File "stubs/bytes.py", line 67 - int 1 // (𝕗) true#0,false#0 | 1 1 File "stubs/bytes.py", line 69 - return // (𝕗) true#0,false#0 | return UInt64(1) File "stubs/bytes.py", line 69 + dig 1 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0 abc File "stubs/bytes.py", line 23 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} abc[-10:10] File "stubs/bytes.py", line 33 + dup // store awst_tmp%49#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0,awst_tmp%49#0 abc[-10:10] File "stubs/bytes.py", line 33 + bury 7 // store awst_tmp%49#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0 abc[-10:10] File "stubs/bytes.py", line 33 + int 10 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0,10 10 File "stubs/bytes.py", line 33 + > // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {>} abc[-10:10] File "stubs/bytes.py", line 33 + bz main_ternary_false@29 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-10:10] File "stubs/bytes.py", line 33 + // Implicit fall through to main_ternary_true@28 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc[-10:10] File "stubs/bytes.py", line 33 + +main_ternary_true@28: + int 10 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 10 10 File "stubs/bytes.py", line 33 + b main_ternary_merge@30 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%53#0 | ternary_result%53#0 + +main_ternary_false@29: + dig 5 // load awst_tmp%49#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | awst_tmp%49#0 abc[-10:10] File "stubs/bytes.py", line 33 + // Implicit fall through to main_ternary_merge@30 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%53#0 | ternary_result%53#0 + +main_ternary_merge@30: + dig 2 // load abc#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%53#0 | abc#0 ternary_result%53#0 abc File "stubs/bytes.py", line 23 + dig 4 // load ternary_result%51#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%53#0 | abc#0,ternary_result%51#0 -10 File "stubs/bytes.py", line 33 + uncover 2 // load ternary_result%53#0 from x-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | abc#0,ternary_result%51#0,ternary_result%53#0 10 File "stubs/bytes.py", line 33 + substring3 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {substring3} abc[-10:10] File "stubs/bytes.py", line 33 + byte "abc" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | tmp%54#0,"abc" b"abc" File "stubs/bytes.py", line 33 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {==} abc[-10:10] == b"abc" File "stubs/bytes.py", line 33 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | assert abc[-10:10] == b"abc" File "stubs/bytes.py", line 33 + byte "1" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | "1" b"1" File "stubs/bytes.py", line 35 + dup // store true#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,true#0 true File "stubs/bytes.py", line 35 + bury 13 // store true#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + byte "" // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,"" b"" File "stubs/bytes.py", line 36 + bury 14 // store false#0 to f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 false File "stubs/bytes.py", line 36 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} true and true File "stubs/bytes.py", line 38 + bnz main_ternary_false@32 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true and true File "stubs/bytes.py", line 38 + // Implicit fall through to main_ternary_true@31 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true and true File "stubs/bytes.py", line 38 + +main_ternary_true@31: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + b main_ternary_merge@33 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%57#0 | ternary_result%57#0 + +main_ternary_false@32: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + // Implicit fall through to main_ternary_merge@33 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%57#0 | ternary_result%57#0 + +main_ternary_merge@33: + dig 12 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%57#0,true#0 ternary_result%57#0 true File "stubs/bytes.py", line 35 + dup + cover 2 // store true#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,ternary_result%57#0,true#0 true File "stubs/bytes.py", line 35 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,{==} true and true) == true File "stubs/bytes.py", line 38 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 assert x File "stubs/bytes.py", line 39 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} true and true File "stubs/bytes.py", line 40 + bnz main_ternary_false@35 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true and true File "stubs/bytes.py", line 40 + // Implicit fall through to main_ternary_true@34 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true and true File "stubs/bytes.py", line 40 + +main_ternary_true@34: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + b main_ternary_merge@36 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%59#0 | ternary_result%59#0 + +main_ternary_false@35: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + // Implicit fall through to main_ternary_merge@36 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%59#0 | ternary_result%59#0 + +main_ternary_merge@36: + dig 12 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%59#0,true#0 ternary_result%59#0 true File "stubs/bytes.py", line 35 + dup + cover 2 // store true#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,ternary_result%59#0,true#0 true File "stubs/bytes.py", line 35 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,{==} true and true) == true File "stubs/bytes.py", line 40 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 assert (true and true) == true File "stubs/bytes.py", line 40 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} true and false File "stubs/bytes.py", line 41 + bnz main_ternary_false@38 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true and false File "stubs/bytes.py", line 41 + // Implicit fall through to main_ternary_true@37 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true and false File "stubs/bytes.py", line 41 + +main_ternary_true@37: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + b main_ternary_merge@39 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%62#0 | ternary_result%62#0 + +main_ternary_false@38: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + // Implicit fall through to main_ternary_merge@39 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%62#0 | ternary_result%62#0 + +main_ternary_merge@39: + dig 13 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%62#0,false#0 ternary_result%62#0 false File "stubs/bytes.py", line 36 + dup + cover 2 // store false#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0,ternary_result%62#0,false#0 false File "stubs/bytes.py", line 36 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0,{==} true and false) == false File "stubs/bytes.py", line 41 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 assert (true and false) == false File "stubs/bytes.py", line 41 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} false and true File "stubs/bytes.py", line 42 + bnz main_ternary_false@41 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false and true File "stubs/bytes.py", line 42 + // Implicit fall through to main_ternary_true@40 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false and true File "stubs/bytes.py", line 42 + +main_ternary_true@40: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + b main_ternary_merge@42 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%65#0 | ternary_result%65#0 + +main_ternary_false@41: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + // Implicit fall through to main_ternary_merge@42 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%65#0 | ternary_result%65#0 + +main_ternary_merge@42: + dig 13 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%65#0,false#0 ternary_result%65#0 false File "stubs/bytes.py", line 36 + dup + cover 2 // store false#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0,ternary_result%65#0,false#0 false File "stubs/bytes.py", line 36 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0,{==} false and true) == false File "stubs/bytes.py", line 42 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 assert (false and true) == false File "stubs/bytes.py", line 42 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} false and false File "stubs/bytes.py", line 43 + bnz main_ternary_false@44 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false and false File "stubs/bytes.py", line 43 + // Implicit fall through to main_ternary_true@43 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false and false File "stubs/bytes.py", line 43 + +main_ternary_true@43: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + b main_ternary_merge@45 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%68#0 | ternary_result%68#0 + +main_ternary_false@44: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + // Implicit fall through to main_ternary_merge@45 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%68#0 | ternary_result%68#0 + +main_ternary_merge@45: + dig 13 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%68#0,false#0 ternary_result%68#0 false File "stubs/bytes.py", line 36 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {==} false and false) == false File "stubs/bytes.py", line 43 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | assert (false and false) == false File "stubs/bytes.py", line 43 + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} true or true File "stubs/bytes.py", line 44 + bz main_ternary_false@47 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true or true File "stubs/bytes.py", line 44 + // Implicit fall through to main_ternary_true@46 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true or true File "stubs/bytes.py", line 44 + +main_ternary_true@46: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + b main_ternary_merge@48 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%71#0 | ternary_result%71#0 + +main_ternary_false@47: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + // Implicit fall through to main_ternary_merge@48 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%71#0 | ternary_result%71#0 + +main_ternary_merge@48: + dig 12 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%71#0,true#0 ternary_result%71#0 true File "stubs/bytes.py", line 35 + dup + cover 2 // store true#0 to l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,ternary_result%71#0,true#0 true File "stubs/bytes.py", line 35 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0,{==} true or true) == true File "stubs/bytes.py", line 44 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 assert (true or true) == true File "stubs/bytes.py", line 44 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} true or false File "stubs/bytes.py", line 45 + bz main_ternary_false@50 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true or false File "stubs/bytes.py", line 45 + // Implicit fall through to main_ternary_true@49 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true or false File "stubs/bytes.py", line 45 + +main_ternary_true@49: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + b main_ternary_merge@51 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%74#0 | ternary_result%74#0 + +main_ternary_false@50: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + // Implicit fall through to main_ternary_merge@51 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%74#0 | ternary_result%74#0 + +main_ternary_merge@51: + dig 12 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%74#0,true#0 ternary_result%74#0 true File "stubs/bytes.py", line 35 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {==} true or false) == true File "stubs/bytes.py", line 45 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | assert (true or false) == true File "stubs/bytes.py", line 45 + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} false or true File "stubs/bytes.py", line 46 + bz main_ternary_false@53 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false or true File "stubs/bytes.py", line 46 + // Implicit fall through to main_ternary_true@52 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false or true File "stubs/bytes.py", line 46 + +main_ternary_true@52: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + b main_ternary_merge@54 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%77#0 | ternary_result%77#0 + +main_ternary_false@53: + dig 11 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | true#0 true File "stubs/bytes.py", line 35 + // Implicit fall through to main_ternary_merge@54 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%77#0 | ternary_result%77#0 + +main_ternary_merge@54: + dig 12 // load true#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%77#0,true#0 ternary_result%77#0 true File "stubs/bytes.py", line 35 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {==} false or true) == true File "stubs/bytes.py", line 46 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | assert (false or true) == true File "stubs/bytes.py", line 46 + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + len // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {len} false or false File "stubs/bytes.py", line 47 + bz main_ternary_false@56 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false or false File "stubs/bytes.py", line 47 + // Implicit fall through to main_ternary_true@55 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false or false File "stubs/bytes.py", line 47 + +main_ternary_true@55: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + b main_ternary_merge@57 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%80#0 | ternary_result%80#0 + +main_ternary_false@56: + dig 12 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | false#0 false File "stubs/bytes.py", line 36 + // Implicit fall through to main_ternary_merge@57 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | (𝕏) ternary_result%80#0 | ternary_result%80#0 + +main_ternary_merge@57: + dig 13 // load false#0 from f-stack (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | ternary_result%80#0,false#0 ternary_result%80#0 false File "stubs/bytes.py", line 36 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {==} false or false) == false File "stubs/bytes.py", line 47 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | assert (false or false) == false File "stubs/bytes.py", line 47 + byte 0x00 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 0x00 Bytes.from_hex("00") File "stubs/bytes.py", line 50 + byte 0x0f // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | a#0,0x0f Bytes.from_hex("0F") File "stubs/bytes.py", line 51 + byte 0xf0 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | a#0,b#0,0xf0 Bytes.from_hex("F0") File "stubs/bytes.py", line 52 + cover 2 // store c#0 to l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | c#0,a#0,b#0 c File "stubs/bytes.py", line 19 + byte 0xff // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | c#0,a#0,b#0,0xff Bytes.from_hex("FF") File "stubs/bytes.py", line 53 + cover 3 // store d#0 to l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0 d File "stubs/bytes.py", line 49 + dig 1 // load a#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,a#0 a File "stubs/bytes.py", line 49 + dig 1 // load b#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,a#0,b#0 b File "stubs/bytes.py", line 49 + b& // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,{b&} a & b File "stubs/bytes.py", line 56 + dig 2 // load a#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,tmp%82#0,a#0 a File "stubs/bytes.py", line 49 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,{==} a & b == a File "stubs/bytes.py", line 56 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0 assert a & b == a File "stubs/bytes.py", line 56 + dup // load b#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,b#0 b File "stubs/bytes.py", line 49 + dig 3 // load c#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,b#0,c#0 c File "stubs/bytes.py", line 19 + b| // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,{b|} b | c File "stubs/bytes.py", line 57 + dig 4 // load d#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,tmp%84#0,d#0 d File "stubs/bytes.py", line 49 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,{==} b | c == d File "stubs/bytes.py", line 57 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0 assert b | c == d File "stubs/bytes.py", line 57 + dup // load b#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,b#0 b File "stubs/bytes.py", line 49 + dig 4 // load d#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,b#0,d#0 d File "stubs/bytes.py", line 49 + b^ // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,{b^} b ^ d File "stubs/bytes.py", line 58 + dig 3 // load c#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,tmp%86#0,c#0 c File "stubs/bytes.py", line 19 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,{==} b ^ d == c File "stubs/bytes.py", line 58 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0 assert b ^ d == c File "stubs/bytes.py", line 58 + dig 1 // load a#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,a#0 a File "stubs/bytes.py", line 49 + dig 4 // load d#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,y#0,d#0 d File "stubs/bytes.py", line 49 + b& // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,{b&} y &= d File "stubs/bytes.py", line 61 + dup // load y#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,a#0,b#0,y#0,y#0 y File "stubs/bytes.py", line 60 + uncover 3 // load a#0 from l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,b#0,y#0,y#0,a#0 a File "stubs/bytes.py", line 49 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,b#0,y#0,{==} y == a File "stubs/bytes.py", line 62 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,b#0,y#0 assert y == a File "stubs/bytes.py", line 62 + dig 3 // load d#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,b#0,y#0,d#0 d File "stubs/bytes.py", line 49 + b| // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,b#0,{b|} y |= d File "stubs/bytes.py", line 63 + dup // load y#0 from l-stack (copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | d#0,c#0,b#0,y#0,y#0 y File "stubs/bytes.py", line 60 + uncover 4 // load d#0 from l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | c#0,b#0,y#0,y#0,d#0 d File "stubs/bytes.py", line 49 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | c#0,b#0,y#0,{==} y == d File "stubs/bytes.py", line 64 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | c#0,b#0,y#0 assert y == d File "stubs/bytes.py", line 64 + uncover 2 // load c#0 from l-stack (no copy) (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | b#0,y#0,c#0 c File "stubs/bytes.py", line 19 + b^ // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | b#0,{b^} y ^= c File "stubs/bytes.py", line 65 + == // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | {==} y == b File "stubs/bytes.py", line 66 + assert // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | assert y == b File "stubs/bytes.py", line 66 + int 1 // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | 1 1 File "stubs/bytes.py", line 68 + return // (𝕗) false#0,true#0,awst_tmp%17#0,awst_tmp%24#0,awst_tmp%29#0,awst_tmp%34#0,awst_tmp%40#0,awst_tmp%49#0,ternary_result%19#0,ternary_result%42#0,ternary_result%51#0,abc#0,awst_tmp%11#0 | return UInt64(1) File "stubs/bytes.py", line 68 diff --git a/examples/stubs/out/bytes.approval_unoptimized.teal b/examples/stubs/out/bytes.approval_unoptimized.teal index 838aefebd0..a743a9ca87 100644 --- a/examples/stubs/out/bytes.approval_unoptimized.teal +++ b/examples/stubs/out/bytes.approval_unoptimized.teal @@ -1,6 +1,12 @@ #pragma version 8 // examples.stubs.bytes.BytesContract.approval_program() -> uint64: +main: + int 0 + dup + byte "" + dupn 8 + main_block@0: byte base64 QmFzZSA2NCBlbmNvZGVk dup @@ -16,12 +22,12 @@ main_block@0: == assert byte "" - uncover 1 + swap len - assert + assert // Non empty bytes should be Truthy len ! - assert + assert // Empty bytes should be Falsy byte "a" byte "b" concat @@ -36,227 +42,391 @@ main_block@0: assert byte "abc" dup + swap + dup extract 0 1 byte "a" == assert + len dup - extract 1 0 + swap + int 1 + > + bz main_ternary_false@2 + +main_ternary_true@1: + int 1 + b main_ternary_merge@3 + +main_ternary_false@2: + dup + +main_ternary_merge@3: + dig 2 + dup + len + swap + dup + uncover 3 + uncover 3 + substring3 byte "bc" == assert + len + dup + bury 12 + int 1 + > + bz main_ternary_false@5 + +main_ternary_true@4: + int 1 + bury 5 + b main_ternary_merge@6 + +main_ternary_false@5: + dig 10 + bury 5 + +main_ternary_merge@6: + dig 1 + len dup - substring 1 1 + bury 12 + int 1 + > + bz main_ternary_false@8 + +main_ternary_true@7: + int 1 + b main_ternary_merge@9 + +main_ternary_false@8: + dig 10 + +main_ternary_merge@9: + dig 2 + dup + dig 7 + uncover 3 + substring3 byte "" == assert + len dup - extract 0 1 + bury 11 + int 1 + > + bz main_ternary_false@11 + +main_ternary_true@10: + int 1 + b main_ternary_merge@12 + +main_ternary_false@11: + dig 9 + +main_ternary_merge@12: + dig 2 + dup + int 0 + uncover 3 + substring3 byte "a" == assert - dup len - pop dup - len + bury 10 + int 1 + > + bz main_ternary_false@14 + +main_ternary_true@13: + dig 8 int 1 - - dig 1 + b main_ternary_merge@15 + +main_ternary_false@14: int 0 - uncover 2 + +main_ternary_merge@15: + dig 2 + dup + int 0 + uncover 3 substring3 byte "ab" == assert - dup len - cover 1 dup - len + bury 9 + int 2 + > + bz main_ternary_false@17 + +main_ternary_true@16: + dig 7 int 2 - - dig 1 - uncover 1 + b main_ternary_merge@18 + +main_ternary_false@17: + int 0 + +main_ternary_merge@18: + dig 2 + dup + len + swap + dup + uncover 3 uncover 3 substring3 byte "bc" == assert - dup len - pop dup - len + bury 8 + int 2 + > + bz main_ternary_false@20 + +main_ternary_true@19: + dig 6 int 2 - - cover 1 - dup + bury 4 + b main_ternary_merge@21 + +main_ternary_false@20: + int 0 + bury 4 + +main_ternary_merge@21: + dig 1 len + dup + bury 8 + int 1 + > + bz main_ternary_false@23 + +main_ternary_true@22: + dig 6 int 1 - - uncover 1 - cover 2 + b main_ternary_merge@24 + +main_ternary_false@23: + int 0 + +main_ternary_merge@24: + dig 2 + dup + dig 6 + uncover 3 substring3 byte "b" == assert byte "1234567" - len - pop - byte "1234567" - len int 1 + int 6 + substring3 + byte "23456" + == + assert + len + dup + bury 7 + int 10 + > + bz main_ternary_false@26 + +main_ternary_true@25: + dig 5 + int 10 - - byte "1234567" - int 1 + bury 3 + b main_ternary_merge@27 + +main_ternary_false@26: + int 0 + bury 3 + +main_ternary_merge@27: + dig 1 + len + dup + bury 7 + int 10 + > + bz main_ternary_false@29 + +main_ternary_true@28: + int 10 + b main_ternary_merge@30 + +main_ternary_false@29: + dig 5 + +main_ternary_merge@30: + dig 2 + dig 4 uncover 2 substring3 - byte "23456" + byte "abc" == assert byte "1" dup - cover 1 + bury 13 byte "" - cover 1 + bury 14 len - bnz main_ternary_false@2 + bnz main_ternary_false@32 -main_ternary_true@1: - dig 1 - b main_ternary_merge@3 +main_ternary_true@31: + dig 11 + b main_ternary_merge@33 -main_ternary_false@2: - dig 1 +main_ternary_false@32: + dig 11 -main_ternary_merge@3: - dig 2 +main_ternary_merge@33: + dig 12 dup cover 2 == assert len - bnz main_ternary_false@5 + bnz main_ternary_false@35 -main_ternary_true@4: - dig 1 - b main_ternary_merge@6 +main_ternary_true@34: + dig 11 + b main_ternary_merge@36 -main_ternary_false@5: - dig 1 +main_ternary_false@35: + dig 11 -main_ternary_merge@6: - dig 2 +main_ternary_merge@36: + dig 12 dup cover 2 == assert len - bnz main_ternary_false@8 + bnz main_ternary_false@38 -main_ternary_true@7: - dig 1 - b main_ternary_merge@9 +main_ternary_true@37: + dig 11 + b main_ternary_merge@39 -main_ternary_false@8: - dup +main_ternary_false@38: + dig 12 -main_ternary_merge@9: - dig 1 +main_ternary_merge@39: + dig 13 dup cover 2 == assert len - bnz main_ternary_false@11 + bnz main_ternary_false@41 -main_ternary_true@10: - dup - b main_ternary_merge@12 +main_ternary_true@40: + dig 12 + b main_ternary_merge@42 -main_ternary_false@11: - dig 1 +main_ternary_false@41: + dig 11 -main_ternary_merge@12: - dig 1 +main_ternary_merge@42: + dig 13 dup cover 2 == assert len - bnz main_ternary_false@14 + bnz main_ternary_false@44 -main_ternary_true@13: - dup - b main_ternary_merge@15 +main_ternary_true@43: + dig 12 + b main_ternary_merge@45 -main_ternary_false@14: - dup +main_ternary_false@44: + dig 12 -main_ternary_merge@15: - dig 1 +main_ternary_merge@45: + dig 13 == assert - dig 1 + dig 11 len - bz main_ternary_false@17 + bz main_ternary_false@47 -main_ternary_true@16: - dig 1 - b main_ternary_merge@18 +main_ternary_true@46: + dig 11 + b main_ternary_merge@48 -main_ternary_false@17: - dig 1 +main_ternary_false@47: + dig 11 -main_ternary_merge@18: - dig 2 +main_ternary_merge@48: + dig 12 dup cover 2 == assert len - bz main_ternary_false@20 + bz main_ternary_false@50 -main_ternary_true@19: - dig 1 - b main_ternary_merge@21 +main_ternary_true@49: + dig 11 + b main_ternary_merge@51 -main_ternary_false@20: - dup +main_ternary_false@50: + dig 12 -main_ternary_merge@21: - dig 2 +main_ternary_merge@51: + dig 12 == assert - dup + dig 12 len - bz main_ternary_false@23 + bz main_ternary_false@53 -main_ternary_true@22: - dup - b main_ternary_merge@24 +main_ternary_true@52: + dig 12 + b main_ternary_merge@54 -main_ternary_false@23: - dig 1 +main_ternary_false@53: + dig 11 -main_ternary_merge@24: - dig 2 +main_ternary_merge@54: + dig 12 == assert - dup + dig 12 len - bz main_ternary_false@26 + bz main_ternary_false@56 -main_ternary_true@25: - dup - b main_ternary_merge@27 +main_ternary_true@55: + dig 12 + b main_ternary_merge@57 -main_ternary_false@26: - dup +main_ternary_false@56: + dig 12 -main_ternary_merge@27: - dig 1 +main_ternary_merge@57: + dig 13 == assert byte 0x00 diff --git a/examples/stubs/out/bytes.awst b/examples/stubs/out/bytes.awst index 8b659c3c57..0656a8b712 100644 --- a/examples/stubs/out/bytes.awst +++ b/examples/stubs/out/bytes.awst @@ -2,11 +2,11 @@ contract BytesContract { approval_program(): algopy.UInt64 { - base_64: algopy.Bytes = Bytes.from_base64("QmFzZSA2NCBlbmNvZGVk") + base_64: algopy.Bytes = b64<"QmFzZSA2NCBlbmNvZGVk"> assert(base_64 == 'Base 64 encoded') - base_32: algopy.Bytes = Bytes.from_base32("IJQXGZJAGMZCAZLOMNXWIZLE") + base_32: algopy.Bytes = b32<"IJQXGZJAGMZCAZLOMNXWIZLE"> assert(base_32 == 'Base 32 encoded') - base_16: algopy.Bytes = Bytes.from_base16("4261736520313620656E636F646564") + base_16: algopy.Bytes = hex<"4261736520313620656E636F646564"> assert(base_16 == 'Base 16 encoded') empty: algopy.Bytes = '' assert(reinterpret_cast(len(base_64)), comment="Non empty bytes should be Truthy") @@ -17,26 +17,27 @@ contract BytesContract assert(c == 'cd') abc: algopy.Bytes = 'abc' assert(abc[0u] == 'a') - assert(abc[1u:] == 'bc') - assert(abc[1u:1u] == '') - assert(abc[:1u] == 'a') - assert(abc[:-(len(abc), 1u)] == 'ab') - assert(abc[-(len(abc), 2u):] == 'bc') - assert(abc[-(len(abc), 2u):-(len(abc), 1u)] == 'b') - assert('1234567'[1u:-(len('1234567'), 1u)] == '23456') + assert(abc[(1u < tmp$0: algopy.UInt64 := len(abc)) ? (1u) : (tmp$0):] == 'bc') + assert(abc[(1u < tmp$1: algopy.UInt64 := len(abc)) ? (1u) : (tmp$1):(1u < tmp$1: algopy.UInt64 := len(abc)) ? (1u) : (tmp$1)] == '') + assert(abc[:(1u < tmp$2: algopy.UInt64 := len(abc)) ? (1u) : (tmp$2)] == 'a') + assert(abc[:(1u < tmp$3: algopy.UInt64 := len(abc)) ? (tmp$3 - 1u) : (0u)] == 'ab') + assert(abc[(2u < tmp$4: algopy.UInt64 := len(abc)) ? (tmp$4 - 2u) : (0u):] == 'bc') + assert(abc[(2u < tmp$5: algopy.UInt64 := len(abc)) ? (tmp$5 - 2u) : (0u):(1u < tmp$5: algopy.UInt64 := len(abc)) ? (tmp$5 - 1u) : (0u)] == 'b') + assert('1234567'[1u:6u] == '23456') + assert(abc[(10u < tmp$6: algopy.UInt64 := len(abc)) ? (tmp$6 - 10u) : (0u):(10u < tmp$6: algopy.UInt64 := len(abc)) ? (10u) : (tmp$6)] == 'abc') true: algopy.Bytes = '1' false: algopy.Bytes = '' - x: bool = !(reinterpret_cast(len(true))) ? true : true == true + x: bool = (!(reinterpret_cast(len(true)))) ? (true) : (true) == true assert(x) - assert(!(reinterpret_cast(len(true))) ? true : true == true) - assert(!(reinterpret_cast(len(true))) ? true : false == false) - assert(!(reinterpret_cast(len(false))) ? false : true == false) - assert(!(reinterpret_cast(len(false))) ? false : false == false) - assert(reinterpret_cast(len(true)) ? true : true == true) - assert(reinterpret_cast(len(true)) ? true : false == true) - assert(reinterpret_cast(len(false)) ? false : true == true) - assert(reinterpret_cast(len(false)) ? false : false == false) - (a, b, c, d): tuple[algopy.Bytes, algopy.Bytes, algopy.Bytes, algopy.Bytes] = (Bytes.from_base16("00"), Bytes.from_base16("0F"), Bytes.from_base16("F0"), Bytes.from_base16("FF")) + assert((!(reinterpret_cast(len(true)))) ? (true) : (true) == true) + assert((!(reinterpret_cast(len(true)))) ? (true) : (false) == false) + assert((!(reinterpret_cast(len(false)))) ? (false) : (true) == false) + assert((!(reinterpret_cast(len(false)))) ? (false) : (false) == false) + assert((reinterpret_cast(len(true))) ? (true) : (true) == true) + assert((reinterpret_cast(len(true))) ? (true) : (false) == true) + assert((reinterpret_cast(len(false))) ? (false) : (true) == true) + assert((reinterpret_cast(len(false))) ? (false) : (false) == false) + (a, b, c, d): tuple[algopy.Bytes, algopy.Bytes, algopy.Bytes, algopy.Bytes] = (hex<"00">, hex<"0F">, hex<"F0">, hex<"FF">) assert(a & b == a) assert(b | c == d) assert(b ^ d == c) diff --git a/examples/stubs/out/bytes.clear.debug.teal b/examples/stubs/out/bytes.clear.debug.teal index e3b0c5f700..bbac2808e8 100644 --- a/examples/stubs/out/bytes.clear.debug.teal +++ b/examples/stubs/out/bytes.clear.debug.teal @@ -4,6 +4,6 @@ // examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: main_block@0: - int 1 // 1 True File "stubs/bytes.py", line 72 - return // return True File "stubs/bytes.py", line 72 + int 1 // 1 True File "stubs/bytes.py", line 71 + return // return True File "stubs/bytes.py", line 71 diff --git a/examples/stubs/out/bytes.clear_unoptimized.debug.teal b/examples/stubs/out/bytes.clear_unoptimized.debug.teal index e3b0c5f700..bbac2808e8 100644 --- a/examples/stubs/out/bytes.clear_unoptimized.debug.teal +++ b/examples/stubs/out/bytes.clear_unoptimized.debug.teal @@ -4,6 +4,6 @@ // examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: main_block@0: - int 1 // 1 True File "stubs/bytes.py", line 72 - return // return True File "stubs/bytes.py", line 72 + int 1 // 1 True File "stubs/bytes.py", line 71 + return // return True File "stubs/bytes.py", line 71 diff --git a/examples/stubs/out/bytes_BytesContract.cssa.ir b/examples/stubs/out/bytes_BytesContract.cssa.ir index 8088c00c1b..3d7cbb993c 100644 --- a/examples/stubs/out/bytes_BytesContract.cssa.ir +++ b/examples/stubs/out/bytes_BytesContract.cssa.ir @@ -2,83 +2,9 @@ contract examples.stubs.bytes.BytesContract: program approval: subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: block@0: // L5 - let tmp%0#0: uint64 = (== QmFzZSA2NCBlbmNvZGVk "Base 64 encoded") - (assert tmp%0#0) - let tmp%1#0: uint64 = (== IJQXGZJAGMZCAZLOMNXWIZLE "Base 32 encoded") - (assert tmp%1#0) - let tmp%2#0: uint64 = (== 0x4261736520313620656e636f646564 "Base 16 encoded") - (assert tmp%2#0) - (assert 15u) // Non empty bytes should be Truthy - (assert 1u) // Empty bytes should be Falsy - let tmp%6#0: bytes = (concat "a" "b") - let tmp%7#0: uint64 = (== tmp%6#0 "ab") - (assert tmp%7#0) - let c#1: bytes = (concat "c" "d") - let tmp%8#0: uint64 = (== c#1 "cd") - (assert tmp%8#0) - let tmp%9#0: bytes = ((extract 0 1) "abc") - let tmp%10#0: uint64 = (== tmp%9#0 "a") - (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) "abc") - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) "abc") - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) "abc") - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let tmp%20#0: bytes = (substring3 "abc" 0u 2u) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let tmp%25#0: bytes = (substring3 "abc" 1u 3u) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let tmp%32#0: bytes = (substring3 "abc" 1u 2u) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let tmp%37#0: bytes = (substring3 "1234567" 1u 6u) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let x#0: uint64 = (== "1" "1") - (assert x#0) - let tmp%43#0: uint64 = (== "1" "1") - (assert tmp%43#0) - let tmp%46#0: uint64 = (== "" "") - (assert tmp%46#0) - let tmp%49#0: uint64 = (== "" "") - (assert tmp%49#0) - let tmp%52#0: uint64 = (== "" "") - (assert tmp%52#0) - let tmp%55#0: uint64 = (== "1" "1") - (assert tmp%55#0) - let tmp%58#0: uint64 = (== "1" "1") - (assert tmp%58#0) - let tmp%61#0: uint64 = (== "1" "1") - (assert tmp%61#0) - let tmp%64#0: uint64 = (== "" "") - (assert tmp%64#0) - let tmp%65#0: bytes = (b& 0x00 0x0f) - let tmp%66#0: uint64 = (== tmp%65#0 0x00) - (assert tmp%66#0) - let tmp%67#0: bytes = (b| 0x0f 0xf0) - let tmp%68#0: uint64 = (== tmp%67#0 0xff) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ 0x0f 0xff) - let tmp%70#0: uint64 = (== tmp%69#0 0xf0) - (assert tmp%70#0) - let y#1: bytes = (b& 0x00 0xff) - let tmp%71#0: uint64 = (== y#1 0x00) - (assert tmp%71#0) - let y#2: bytes = (b| y#1 0xff) - let tmp%72#0: uint64 = (== y#2 0xff) - (assert tmp%72#0) - let y#3: bytes = (b^ y#2 0xf0) - let tmp%73#0: uint64 = (== y#3 0x0f) - (assert tmp%73#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.final.ir b/examples/stubs/out/bytes_BytesContract.final.ir index 8cc60c7c3d..3d7cbb993c 100644 --- a/examples/stubs/out/bytes_BytesContract.final.ir +++ b/examples/stubs/out/bytes_BytesContract.final.ir @@ -2,83 +2,9 @@ contract examples.stubs.bytes.BytesContract: program approval: subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: block@0: // L5 - let tmp%0#0: uint64 = (== QmFzZSA2NCBlbmNvZGVk "Base 64 encoded") - (assert tmp%0#0) - let tmp%1#0: uint64 = (== IJQXGZJAGMZCAZLOMNXWIZLE "Base 32 encoded") - (assert tmp%1#0) - let tmp%2#0: uint64 = (== 0x4261736520313620656e636f646564 "Base 16 encoded") - (assert tmp%2#0) - (assert 15u) // Non empty bytes should be Truthy - (assert 1u) // Empty bytes should be Falsy - let tmp%6#0: bytes = (concat "a" "b") - let tmp%7#0: uint64 = (== tmp%6#0 "ab") - (assert tmp%7#0) - let c#1: bytes = (concat "c" "d") - let tmp%8#0: uint64 = (== c#1 "cd") - (assert tmp%8#0) - let tmp%9#0: bytes = ((extract 0 1) "abc") - let tmp%10#0: uint64 = (== tmp%9#0 "a") - (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) "abc") - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) "abc") - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) "abc") - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let tmp%20#0: bytes = (substring3 "abc" 0u 2u) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let tmp%25#0: bytes = (substring3 "abc" 1u 3u) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let tmp%32#0: bytes = (substring3 "abc" 1u 2u) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let tmp%37#0: bytes = (substring3 "1234567" 1u 6u) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let x#0: uint64 = (== "1" "1") - (assert x#0) - let tmp%43#0: uint64 = (== "1" "1") - (assert tmp%43#0) - let tmp%46#0: uint64 = (== "" "") - (assert tmp%46#0) - let tmp%49#0: uint64 = (== "" "") - (assert tmp%49#0) - let tmp%52#0: uint64 = (== "" "") - (assert tmp%52#0) - let tmp%55#0: uint64 = (== "1" "1") - (assert tmp%55#0) - let tmp%58#0: uint64 = (== "1" "1") - (assert tmp%58#0) - let tmp%61#0: uint64 = (== "1" "1") - (assert tmp%61#0) - let tmp%64#0: uint64 = (== "" "") - (assert tmp%64#0) - let tmp%65#0: bytes = (b& 0x00 0x0f) - let tmp%66#0: uint64 = (== tmp%65#0 0x00) - (assert tmp%66#0) - let tmp%67#0: bytes = (b| 0x0f 0xf0) - let tmp%68#0: uint64 = (== tmp%67#0 0xff) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ 0x0f 0xff) - let tmp%70#0: uint64 = (== tmp%69#0 0xf0) - (assert tmp%70#0) - let y#1: bytes = (b& 0x00 0xff) - let tmp%71#0: uint64 = (== y#1 0x00) - (assert tmp%71#0) - let y#1: bytes = (b| y#1 0xff) - let tmp%72#0: uint64 = (== y#1 0xff) - (assert tmp%72#0) - let y#1: bytes = (b^ y#1 0xf0) - let tmp%73#0: uint64 = (== y#1 0x0f) - (assert tmp%73#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.final_unoptimized.ir b/examples/stubs/out/bytes_BytesContract.final_unoptimized.ir index 9c2761f44d..b1099228e7 100644 --- a/examples/stubs/out/bytes_BytesContract.final_unoptimized.ir +++ b/examples/stubs/out/bytes_BytesContract.final_unoptimized.ir @@ -28,168 +28,259 @@ contract examples.stubs.bytes.BytesContract: let tmp%9#0: bytes = ((extract 0 1) abc#0) let tmp%10#0: uint64 = (== tmp%9#0 "a") (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) abc#0) - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) abc#0) - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) abc#0) - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let base_length%17#0: uint64 = (len abc#0) - let tmp%18#0: uint64 = (len abc#0) - let tmp%19#0: uint64 = (- tmp%18#0 1u) - let tmp%20#0: bytes = (substring3 abc#0 0u tmp%19#0) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let base_length%22#0: uint64 = (len abc#0) - let tmp%23#0: uint64 = (len abc#0) - let tmp%24#0: uint64 = (- tmp%23#0 2u) - let tmp%25#0: bytes = (substring3 abc#0 tmp%24#0 base_length%22#0) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let base_length%27#0: uint64 = (len abc#0) - let tmp%28#0: uint64 = (len abc#0) - let tmp%29#0: uint64 = (- tmp%28#0 2u) - let tmp%30#0: uint64 = (len abc#0) - let tmp%31#0: uint64 = (- tmp%30#0 1u) - let tmp%32#0: bytes = (substring3 abc#0 tmp%29#0 tmp%31#0) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let base_length%34#0: uint64 = (len "1234567") - let tmp%35#0: uint64 = (len "1234567") - let tmp%36#0: uint64 = (- tmp%35#0 1u) - let tmp%37#0: bytes = (substring3 "1234567" 1u tmp%36#0) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let true#0: bytes = "1" - let false#0: bytes = "" - let tmp%39#0: uint64 = (len true#0) - goto tmp%39#0 ? block@2 : block@1 - block@1: // ternary_true_L38 - let ternary_result%40#0: bytes = true#0 + let awst_tmp%11#0: uint64 = (len abc#0) + let tmp%12#0: uint64 = (< 1u awst_tmp%11#0) + goto tmp%12#0 ? block@1 : block@2 + block@1: // ternary_true_L26 + let ternary_result%13#0: uint64 = 1u goto block@3 - block@2: // ternary_false_L38 - let ternary_result%40#0: bytes = true#0 + block@2: // ternary_false_L26 + let ternary_result%13#0: uint64 = awst_tmp%11#0 goto block@3 - block@3: // ternary_merge_L38 - let x#0: uint64 = (== ternary_result%40#0 true#0) - (assert x#0) - let tmp%41#0: uint64 = (len true#0) - goto tmp%41#0 ? block@5 : block@4 - block@4: // ternary_true_L41 - let ternary_result%42#0: bytes = true#0 + block@3: // ternary_merge_L26 + let base_length%14#0: uint64 = (len abc#0) + let tmp%15#0: bytes = (substring3 abc#0 ternary_result%13#0 base_length%14#0) + let tmp%16#0: uint64 = (== tmp%15#0 "bc") + (assert tmp%16#0) + let awst_tmp%17#0: uint64 = (len abc#0) + let tmp%18#0: uint64 = (< 1u awst_tmp%17#0) + goto tmp%18#0 ? block@4 : block@5 + block@4: // ternary_true_L27 + let ternary_result%19#0: uint64 = 1u goto block@6 - block@5: // ternary_false_L41 - let ternary_result%42#0: bytes = true#0 + block@5: // ternary_false_L27 + let ternary_result%19#0: uint64 = awst_tmp%17#0 goto block@6 - block@6: // ternary_merge_L41 - let tmp%43#0: uint64 = (== ternary_result%42#0 true#0) - (assert tmp%43#0) - let tmp%44#0: uint64 = (len true#0) - goto tmp%44#0 ? block@8 : block@7 - block@7: // ternary_true_L42 - let ternary_result%45#0: bytes = true#0 + block@6: // ternary_merge_L27 + let awst_tmp%17#0: uint64 = (len abc#0) + let tmp%20#0: uint64 = (< 1u awst_tmp%17#0) + goto tmp%20#0 ? block@7 : block@8 + block@7: // ternary_true_L27 + let ternary_result%21#0: uint64 = 1u goto block@9 - block@8: // ternary_false_L42 - let ternary_result%45#0: bytes = false#0 + block@8: // ternary_false_L27 + let ternary_result%21#0: uint64 = awst_tmp%17#0 goto block@9 - block@9: // ternary_merge_L42 - let tmp%46#0: uint64 = (== ternary_result%45#0 false#0) - (assert tmp%46#0) - let tmp%47#0: uint64 = (len false#0) - goto tmp%47#0 ? block@11 : block@10 - block@10: // ternary_true_L43 - let ternary_result%48#0: bytes = false#0 + block@9: // ternary_merge_L27 + let tmp%22#0: bytes = (substring3 abc#0 ternary_result%19#0 ternary_result%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 "") + (assert tmp%23#0) + let awst_tmp%24#0: uint64 = (len abc#0) + let tmp%25#0: uint64 = (< 1u awst_tmp%24#0) + goto tmp%25#0 ? block@10 : block@11 + block@10: // ternary_true_L28 + let ternary_result%26#0: uint64 = 1u goto block@12 - block@11: // ternary_false_L43 - let ternary_result%48#0: bytes = true#0 + block@11: // ternary_false_L28 + let ternary_result%26#0: uint64 = awst_tmp%24#0 goto block@12 - block@12: // ternary_merge_L43 - let tmp%49#0: uint64 = (== ternary_result%48#0 false#0) - (assert tmp%49#0) - let tmp%50#0: uint64 = (len false#0) - goto tmp%50#0 ? block@14 : block@13 - block@13: // ternary_true_L44 - let ternary_result%51#0: bytes = false#0 + block@12: // ternary_merge_L28 + let tmp%27#0: bytes = (substring3 abc#0 0u ternary_result%26#0) + let tmp%28#0: uint64 = (== tmp%27#0 "a") + (assert tmp%28#0) + let awst_tmp%29#0: uint64 = (len abc#0) + let tmp%30#0: uint64 = (< 1u awst_tmp%29#0) + goto tmp%30#0 ? block@13 : block@14 + block@13: // ternary_true_L29 + let ternary_result%31#0: uint64 = (- awst_tmp%29#0 1u) goto block@15 - block@14: // ternary_false_L44 - let ternary_result%51#0: bytes = false#0 + block@14: // ternary_false_L29 + let ternary_result%31#0: uint64 = 0u goto block@15 - block@15: // ternary_merge_L44 - let tmp%52#0: uint64 = (== ternary_result%51#0 false#0) - (assert tmp%52#0) - let tmp%53#0: uint64 = (len true#0) - goto tmp%53#0 ? block@16 : block@17 - block@16: // ternary_true_L45 - let ternary_result%54#0: bytes = true#0 + block@15: // ternary_merge_L29 + let tmp%32#0: bytes = (substring3 abc#0 0u ternary_result%31#0) + let tmp%33#0: uint64 = (== tmp%32#0 "ab") + (assert tmp%33#0) + let awst_tmp%34#0: uint64 = (len abc#0) + let tmp%35#0: uint64 = (< 2u awst_tmp%34#0) + goto tmp%35#0 ? block@16 : block@17 + block@16: // ternary_true_L30 + let ternary_result%36#0: uint64 = (- awst_tmp%34#0 2u) goto block@18 - block@17: // ternary_false_L45 - let ternary_result%54#0: bytes = true#0 + block@17: // ternary_false_L30 + let ternary_result%36#0: uint64 = 0u goto block@18 - block@18: // ternary_merge_L45 - let tmp%55#0: uint64 = (== ternary_result%54#0 true#0) - (assert tmp%55#0) - let tmp%56#0: uint64 = (len true#0) - goto tmp%56#0 ? block@19 : block@20 - block@19: // ternary_true_L46 - let ternary_result%57#0: bytes = true#0 + block@18: // ternary_merge_L30 + let base_length%37#0: uint64 = (len abc#0) + let tmp%38#0: bytes = (substring3 abc#0 ternary_result%36#0 base_length%37#0) + let tmp%39#0: uint64 = (== tmp%38#0 "bc") + (assert tmp%39#0) + let awst_tmp%40#0: uint64 = (len abc#0) + let tmp%41#0: uint64 = (< 2u awst_tmp%40#0) + goto tmp%41#0 ? block@19 : block@20 + block@19: // ternary_true_L31 + let ternary_result%42#0: uint64 = (- awst_tmp%40#0 2u) goto block@21 - block@20: // ternary_false_L46 - let ternary_result%57#0: bytes = false#0 + block@20: // ternary_false_L31 + let ternary_result%42#0: uint64 = 0u goto block@21 - block@21: // ternary_merge_L46 - let tmp%58#0: uint64 = (== ternary_result%57#0 true#0) - (assert tmp%58#0) - let tmp%59#0: uint64 = (len false#0) - goto tmp%59#0 ? block@22 : block@23 - block@22: // ternary_true_L47 - let ternary_result%60#0: bytes = false#0 + block@21: // ternary_merge_L31 + let awst_tmp%40#0: uint64 = (len abc#0) + let tmp%43#0: uint64 = (< 1u awst_tmp%40#0) + goto tmp%43#0 ? block@22 : block@23 + block@22: // ternary_true_L31 + let ternary_result%44#0: uint64 = (- awst_tmp%40#0 1u) goto block@24 - block@23: // ternary_false_L47 - let ternary_result%60#0: bytes = true#0 + block@23: // ternary_false_L31 + let ternary_result%44#0: uint64 = 0u goto block@24 - block@24: // ternary_merge_L47 - let tmp%61#0: uint64 = (== ternary_result%60#0 true#0) - (assert tmp%61#0) - let tmp%62#0: uint64 = (len false#0) - goto tmp%62#0 ? block@25 : block@26 - block@25: // ternary_true_L48 - let ternary_result%63#0: bytes = false#0 + block@24: // ternary_merge_L31 + let tmp%45#0: bytes = (substring3 abc#0 ternary_result%42#0 ternary_result%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "b") + (assert tmp%46#0) + let tmp%47#0: bytes = (substring3 "1234567" 1u 6u) + let tmp%48#0: uint64 = (== tmp%47#0 "23456") + (assert tmp%48#0) + let awst_tmp%49#0: uint64 = (len abc#0) + let tmp%50#0: uint64 = (< 10u awst_tmp%49#0) + goto tmp%50#0 ? block@25 : block@26 + block@25: // ternary_true_L33 + let ternary_result%51#0: uint64 = (- awst_tmp%49#0 10u) goto block@27 - block@26: // ternary_false_L48 - let ternary_result%63#0: bytes = false#0 + block@26: // ternary_false_L33 + let ternary_result%51#0: uint64 = 0u goto block@27 - block@27: // ternary_merge_L48 - let tmp%64#0: uint64 = (== ternary_result%63#0 false#0) - (assert tmp%64#0) + block@27: // ternary_merge_L33 + let awst_tmp%49#0: uint64 = (len abc#0) + let tmp%52#0: uint64 = (< 10u awst_tmp%49#0) + goto tmp%52#0 ? block@28 : block@29 + block@28: // ternary_true_L33 + let ternary_result%53#0: uint64 = 10u + goto block@30 + block@29: // ternary_false_L33 + let ternary_result%53#0: uint64 = awst_tmp%49#0 + goto block@30 + block@30: // ternary_merge_L33 + let tmp%54#0: bytes = (substring3 abc#0 ternary_result%51#0 ternary_result%53#0) + let tmp%55#0: uint64 = (== tmp%54#0 "abc") + (assert tmp%55#0) + let true#0: bytes = "1" + let false#0: bytes = "" + let tmp%56#0: uint64 = (len true#0) + goto tmp%56#0 ? block@32 : block@31 + block@31: // ternary_true_L38 + let ternary_result%57#0: bytes = true#0 + goto block@33 + block@32: // ternary_false_L38 + let ternary_result%57#0: bytes = true#0 + goto block@33 + block@33: // ternary_merge_L38 + let x#0: uint64 = (== ternary_result%57#0 true#0) + (assert x#0) + let tmp%58#0: uint64 = (len true#0) + goto tmp%58#0 ? block@35 : block@34 + block@34: // ternary_true_L40 + let ternary_result%59#0: bytes = true#0 + goto block@36 + block@35: // ternary_false_L40 + let ternary_result%59#0: bytes = true#0 + goto block@36 + block@36: // ternary_merge_L40 + let tmp%60#0: uint64 = (== ternary_result%59#0 true#0) + (assert tmp%60#0) + let tmp%61#0: uint64 = (len true#0) + goto tmp%61#0 ? block@38 : block@37 + block@37: // ternary_true_L41 + let ternary_result%62#0: bytes = true#0 + goto block@39 + block@38: // ternary_false_L41 + let ternary_result%62#0: bytes = false#0 + goto block@39 + block@39: // ternary_merge_L41 + let tmp%63#0: uint64 = (== ternary_result%62#0 false#0) + (assert tmp%63#0) + let tmp%64#0: uint64 = (len false#0) + goto tmp%64#0 ? block@41 : block@40 + block@40: // ternary_true_L42 + let ternary_result%65#0: bytes = false#0 + goto block@42 + block@41: // ternary_false_L42 + let ternary_result%65#0: bytes = true#0 + goto block@42 + block@42: // ternary_merge_L42 + let tmp%66#0: uint64 = (== ternary_result%65#0 false#0) + (assert tmp%66#0) + let tmp%67#0: uint64 = (len false#0) + goto tmp%67#0 ? block@44 : block@43 + block@43: // ternary_true_L43 + let ternary_result%68#0: bytes = false#0 + goto block@45 + block@44: // ternary_false_L43 + let ternary_result%68#0: bytes = false#0 + goto block@45 + block@45: // ternary_merge_L43 + let tmp%69#0: uint64 = (== ternary_result%68#0 false#0) + (assert tmp%69#0) + let tmp%70#0: uint64 = (len true#0) + goto tmp%70#0 ? block@46 : block@47 + block@46: // ternary_true_L44 + let ternary_result%71#0: bytes = true#0 + goto block@48 + block@47: // ternary_false_L44 + let ternary_result%71#0: bytes = true#0 + goto block@48 + block@48: // ternary_merge_L44 + let tmp%72#0: uint64 = (== ternary_result%71#0 true#0) + (assert tmp%72#0) + let tmp%73#0: uint64 = (len true#0) + goto tmp%73#0 ? block@49 : block@50 + block@49: // ternary_true_L45 + let ternary_result%74#0: bytes = true#0 + goto block@51 + block@50: // ternary_false_L45 + let ternary_result%74#0: bytes = false#0 + goto block@51 + block@51: // ternary_merge_L45 + let tmp%75#0: uint64 = (== ternary_result%74#0 true#0) + (assert tmp%75#0) + let tmp%76#0: uint64 = (len false#0) + goto tmp%76#0 ? block@52 : block@53 + block@52: // ternary_true_L46 + let ternary_result%77#0: bytes = false#0 + goto block@54 + block@53: // ternary_false_L46 + let ternary_result%77#0: bytes = true#0 + goto block@54 + block@54: // ternary_merge_L46 + let tmp%78#0: uint64 = (== ternary_result%77#0 true#0) + (assert tmp%78#0) + let tmp%79#0: uint64 = (len false#0) + goto tmp%79#0 ? block@55 : block@56 + block@55: // ternary_true_L47 + let ternary_result%80#0: bytes = false#0 + goto block@57 + block@56: // ternary_false_L47 + let ternary_result%80#0: bytes = false#0 + goto block@57 + block@57: // ternary_merge_L47 + let tmp%81#0: uint64 = (== ternary_result%80#0 false#0) + (assert tmp%81#0) let a#0: bytes = 0x00 let b#0: bytes = 0x0f let c#0: bytes = 0xf0 let d#0: bytes = 0xff - let tmp%65#0: bytes = (b& a#0 b#0) - let tmp%66#0: uint64 = (== tmp%65#0 a#0) - (assert tmp%66#0) - let tmp%67#0: bytes = (b| b#0 c#0) - let tmp%68#0: uint64 = (== tmp%67#0 d#0) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ b#0 d#0) - let tmp%70#0: uint64 = (== tmp%69#0 c#0) - (assert tmp%70#0) + let tmp%82#0: bytes = (b& a#0 b#0) + let tmp%83#0: uint64 = (== tmp%82#0 a#0) + (assert tmp%83#0) + let tmp%84#0: bytes = (b| b#0 c#0) + let tmp%85#0: uint64 = (== tmp%84#0 d#0) + (assert tmp%85#0) + let tmp%86#0: bytes = (b^ b#0 d#0) + let tmp%87#0: uint64 = (== tmp%86#0 c#0) + (assert tmp%87#0) let y#0: bytes = a#0 let y#0: bytes = (b& y#0 d#0) - let tmp%71#0: uint64 = (== y#0 a#0) - (assert tmp%71#0) + let tmp%88#0: uint64 = (== y#0 a#0) + (assert tmp%88#0) let y#0: bytes = (b| y#0 d#0) - let tmp%72#0: uint64 = (== y#0 d#0) - (assert tmp%72#0) + let tmp%89#0: uint64 = (== y#0 d#0) + (assert tmp%89#0) let y#0: bytes = (b^ y#0 c#0) - let tmp%73#0: uint64 = (== y#0 b#0) - (assert tmp%73#0) + let tmp%90#0: uint64 = (== y#0 b#0) + (assert tmp%90#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.parallel_copies.ir b/examples/stubs/out/bytes_BytesContract.parallel_copies.ir index 8088c00c1b..3d7cbb993c 100644 --- a/examples/stubs/out/bytes_BytesContract.parallel_copies.ir +++ b/examples/stubs/out/bytes_BytesContract.parallel_copies.ir @@ -2,83 +2,9 @@ contract examples.stubs.bytes.BytesContract: program approval: subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: block@0: // L5 - let tmp%0#0: uint64 = (== QmFzZSA2NCBlbmNvZGVk "Base 64 encoded") - (assert tmp%0#0) - let tmp%1#0: uint64 = (== IJQXGZJAGMZCAZLOMNXWIZLE "Base 32 encoded") - (assert tmp%1#0) - let tmp%2#0: uint64 = (== 0x4261736520313620656e636f646564 "Base 16 encoded") - (assert tmp%2#0) - (assert 15u) // Non empty bytes should be Truthy - (assert 1u) // Empty bytes should be Falsy - let tmp%6#0: bytes = (concat "a" "b") - let tmp%7#0: uint64 = (== tmp%6#0 "ab") - (assert tmp%7#0) - let c#1: bytes = (concat "c" "d") - let tmp%8#0: uint64 = (== c#1 "cd") - (assert tmp%8#0) - let tmp%9#0: bytes = ((extract 0 1) "abc") - let tmp%10#0: uint64 = (== tmp%9#0 "a") - (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) "abc") - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) "abc") - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) "abc") - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let tmp%20#0: bytes = (substring3 "abc" 0u 2u) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let tmp%25#0: bytes = (substring3 "abc" 1u 3u) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let tmp%32#0: bytes = (substring3 "abc" 1u 2u) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let tmp%37#0: bytes = (substring3 "1234567" 1u 6u) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let x#0: uint64 = (== "1" "1") - (assert x#0) - let tmp%43#0: uint64 = (== "1" "1") - (assert tmp%43#0) - let tmp%46#0: uint64 = (== "" "") - (assert tmp%46#0) - let tmp%49#0: uint64 = (== "" "") - (assert tmp%49#0) - let tmp%52#0: uint64 = (== "" "") - (assert tmp%52#0) - let tmp%55#0: uint64 = (== "1" "1") - (assert tmp%55#0) - let tmp%58#0: uint64 = (== "1" "1") - (assert tmp%58#0) - let tmp%61#0: uint64 = (== "1" "1") - (assert tmp%61#0) - let tmp%64#0: uint64 = (== "" "") - (assert tmp%64#0) - let tmp%65#0: bytes = (b& 0x00 0x0f) - let tmp%66#0: uint64 = (== tmp%65#0 0x00) - (assert tmp%66#0) - let tmp%67#0: bytes = (b| 0x0f 0xf0) - let tmp%68#0: uint64 = (== tmp%67#0 0xff) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ 0x0f 0xff) - let tmp%70#0: uint64 = (== tmp%69#0 0xf0) - (assert tmp%70#0) - let y#1: bytes = (b& 0x00 0xff) - let tmp%71#0: uint64 = (== y#1 0x00) - (assert tmp%71#0) - let y#2: bytes = (b| y#1 0xff) - let tmp%72#0: uint64 = (== y#2 0xff) - (assert tmp%72#0) - let y#3: bytes = (b^ y#2 0xf0) - let tmp%73#0: uint64 = (== y#3 0x0f) - (assert tmp%73#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.post_ssa.ir b/examples/stubs/out/bytes_BytesContract.post_ssa.ir index 8088c00c1b..3d7cbb993c 100644 --- a/examples/stubs/out/bytes_BytesContract.post_ssa.ir +++ b/examples/stubs/out/bytes_BytesContract.post_ssa.ir @@ -2,83 +2,9 @@ contract examples.stubs.bytes.BytesContract: program approval: subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: block@0: // L5 - let tmp%0#0: uint64 = (== QmFzZSA2NCBlbmNvZGVk "Base 64 encoded") - (assert tmp%0#0) - let tmp%1#0: uint64 = (== IJQXGZJAGMZCAZLOMNXWIZLE "Base 32 encoded") - (assert tmp%1#0) - let tmp%2#0: uint64 = (== 0x4261736520313620656e636f646564 "Base 16 encoded") - (assert tmp%2#0) - (assert 15u) // Non empty bytes should be Truthy - (assert 1u) // Empty bytes should be Falsy - let tmp%6#0: bytes = (concat "a" "b") - let tmp%7#0: uint64 = (== tmp%6#0 "ab") - (assert tmp%7#0) - let c#1: bytes = (concat "c" "d") - let tmp%8#0: uint64 = (== c#1 "cd") - (assert tmp%8#0) - let tmp%9#0: bytes = ((extract 0 1) "abc") - let tmp%10#0: uint64 = (== tmp%9#0 "a") - (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) "abc") - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) "abc") - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) "abc") - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let tmp%20#0: bytes = (substring3 "abc" 0u 2u) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let tmp%25#0: bytes = (substring3 "abc" 1u 3u) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let tmp%32#0: bytes = (substring3 "abc" 1u 2u) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let tmp%37#0: bytes = (substring3 "1234567" 1u 6u) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let x#0: uint64 = (== "1" "1") - (assert x#0) - let tmp%43#0: uint64 = (== "1" "1") - (assert tmp%43#0) - let tmp%46#0: uint64 = (== "" "") - (assert tmp%46#0) - let tmp%49#0: uint64 = (== "" "") - (assert tmp%49#0) - let tmp%52#0: uint64 = (== "" "") - (assert tmp%52#0) - let tmp%55#0: uint64 = (== "1" "1") - (assert tmp%55#0) - let tmp%58#0: uint64 = (== "1" "1") - (assert tmp%58#0) - let tmp%61#0: uint64 = (== "1" "1") - (assert tmp%61#0) - let tmp%64#0: uint64 = (== "" "") - (assert tmp%64#0) - let tmp%65#0: bytes = (b& 0x00 0x0f) - let tmp%66#0: uint64 = (== tmp%65#0 0x00) - (assert tmp%66#0) - let tmp%67#0: bytes = (b| 0x0f 0xf0) - let tmp%68#0: uint64 = (== tmp%67#0 0xff) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ 0x0f 0xff) - let tmp%70#0: uint64 = (== tmp%69#0 0xf0) - (assert tmp%70#0) - let y#1: bytes = (b& 0x00 0xff) - let tmp%71#0: uint64 = (== y#1 0x00) - (assert tmp%71#0) - let y#2: bytes = (b| y#1 0xff) - let tmp%72#0: uint64 = (== y#2 0xff) - (assert tmp%72#0) - let y#3: bytes = (b^ y#2 0xf0) - let tmp%73#0: uint64 = (== y#3 0x0f) - (assert tmp%73#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.ssa.ir b/examples/stubs/out/bytes_BytesContract.ssa.ir index 5c02a5dec8..904dffb73b 100644 --- a/examples/stubs/out/bytes_BytesContract.ssa.ir +++ b/examples/stubs/out/bytes_BytesContract.ssa.ir @@ -28,177 +28,278 @@ contract examples.stubs.bytes.BytesContract: let tmp%9#0: bytes = ((extract 0 1) abc#0) let tmp%10#0: uint64 = (== tmp%9#0 "a") (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) abc#0) - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) abc#0) - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) abc#0) - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let base_length%17#0: uint64 = (len abc#0) - let tmp%18#0: uint64 = (len abc#0) - let tmp%19#0: uint64 = (- tmp%18#0 1u) - let tmp%20#0: bytes = (substring3 abc#0 0u tmp%19#0) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let base_length%22#0: uint64 = (len abc#0) - let tmp%23#0: uint64 = (len abc#0) - let tmp%24#0: uint64 = (- tmp%23#0 2u) - let tmp%25#0: bytes = (substring3 abc#0 tmp%24#0 base_length%22#0) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let base_length%27#0: uint64 = (len abc#0) - let tmp%28#0: uint64 = (len abc#0) - let tmp%29#0: uint64 = (- tmp%28#0 2u) - let tmp%30#0: uint64 = (len abc#0) - let tmp%31#0: uint64 = (- tmp%30#0 1u) - let tmp%32#0: bytes = (substring3 abc#0 tmp%29#0 tmp%31#0) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let base_length%34#0: uint64 = (len "1234567") - let tmp%35#0: uint64 = (len "1234567") - let tmp%36#0: uint64 = (- tmp%35#0 1u) - let tmp%37#0: bytes = (substring3 "1234567" 1u tmp%36#0) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let true#0: bytes = "1" - let false#0: bytes = "" - let tmp%39#0: uint64 = (len true#0) - goto tmp%39#0 ? block@2 : block@1 - block@1: // ternary_true_L38 - let ternary_result%40#0: bytes = true#0 + let awst_tmp%11#0: uint64 = (len abc#0) + let tmp%12#0: uint64 = (< 1u awst_tmp%11#0) + goto tmp%12#0 ? block@1 : block@2 + block@1: // ternary_true_L26 + let ternary_result%13#0: uint64 = 1u goto block@3 - block@2: // ternary_false_L38 - let ternary_result%40#1: bytes = true#0 + block@2: // ternary_false_L26 + let ternary_result%13#1: uint64 = awst_tmp%11#0 goto block@3 - block@3: // ternary_merge_L38 - let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@1, ternary_result%40#1 <- block@2) - let x#0: uint64 = (== ternary_result%40#2 true#0) - (assert x#0) - let tmp%41#0: uint64 = (len true#0) - goto tmp%41#0 ? block@5 : block@4 - block@4: // ternary_true_L41 - let ternary_result%42#0: bytes = true#0 + block@3: // ternary_merge_L26 + let ternary_result%13#2: uint64 = φ(ternary_result%13#0 <- block@1, ternary_result%13#1 <- block@2) + let base_length%14#0: uint64 = (len abc#0) + let tmp%15#0: bytes = (substring3 abc#0 ternary_result%13#2 base_length%14#0) + let tmp%16#0: uint64 = (== tmp%15#0 "bc") + (assert tmp%16#0) + let awst_tmp%17#0: uint64 = (len abc#0) + let tmp%18#0: uint64 = (< 1u awst_tmp%17#0) + goto tmp%18#0 ? block@4 : block@5 + block@4: // ternary_true_L27 + let ternary_result%19#0: uint64 = 1u goto block@6 - block@5: // ternary_false_L41 - let ternary_result%42#1: bytes = true#0 + block@5: // ternary_false_L27 + let ternary_result%19#1: uint64 = awst_tmp%17#0 goto block@6 - block@6: // ternary_merge_L41 - let ternary_result%42#2: bytes = φ(ternary_result%42#0 <- block@4, ternary_result%42#1 <- block@5) - let tmp%43#0: uint64 = (== ternary_result%42#2 true#0) - (assert tmp%43#0) - let tmp%44#0: uint64 = (len true#0) - goto tmp%44#0 ? block@8 : block@7 - block@7: // ternary_true_L42 - let ternary_result%45#0: bytes = true#0 + block@6: // ternary_merge_L27 + let ternary_result%19#2: uint64 = φ(ternary_result%19#0 <- block@4, ternary_result%19#1 <- block@5) + let awst_tmp%17#1: uint64 = (len abc#0) + let tmp%20#0: uint64 = (< 1u awst_tmp%17#1) + goto tmp%20#0 ? block@7 : block@8 + block@7: // ternary_true_L27 + let ternary_result%21#0: uint64 = 1u goto block@9 - block@8: // ternary_false_L42 - let ternary_result%45#1: bytes = false#0 + block@8: // ternary_false_L27 + let ternary_result%21#1: uint64 = awst_tmp%17#1 goto block@9 - block@9: // ternary_merge_L42 - let ternary_result%45#2: bytes = φ(ternary_result%45#0 <- block@7, ternary_result%45#1 <- block@8) - let tmp%46#0: uint64 = (== ternary_result%45#2 false#0) - (assert tmp%46#0) - let tmp%47#0: uint64 = (len false#0) - goto tmp%47#0 ? block@11 : block@10 - block@10: // ternary_true_L43 - let ternary_result%48#0: bytes = false#0 + block@9: // ternary_merge_L27 + let ternary_result%21#2: uint64 = φ(ternary_result%21#0 <- block@7, ternary_result%21#1 <- block@8) + let tmp%22#0: bytes = (substring3 abc#0 ternary_result%19#2 ternary_result%21#2) + let tmp%23#0: uint64 = (== tmp%22#0 "") + (assert tmp%23#0) + let awst_tmp%24#0: uint64 = (len abc#0) + let tmp%25#0: uint64 = (< 1u awst_tmp%24#0) + goto tmp%25#0 ? block@10 : block@11 + block@10: // ternary_true_L28 + let ternary_result%26#0: uint64 = 1u goto block@12 - block@11: // ternary_false_L43 - let ternary_result%48#1: bytes = true#0 + block@11: // ternary_false_L28 + let ternary_result%26#1: uint64 = awst_tmp%24#0 goto block@12 - block@12: // ternary_merge_L43 - let ternary_result%48#2: bytes = φ(ternary_result%48#0 <- block@10, ternary_result%48#1 <- block@11) - let tmp%49#0: uint64 = (== ternary_result%48#2 false#0) - (assert tmp%49#0) - let tmp%50#0: uint64 = (len false#0) - goto tmp%50#0 ? block@14 : block@13 - block@13: // ternary_true_L44 - let ternary_result%51#0: bytes = false#0 + block@12: // ternary_merge_L28 + let ternary_result%26#2: uint64 = φ(ternary_result%26#0 <- block@10, ternary_result%26#1 <- block@11) + let tmp%27#0: bytes = (substring3 abc#0 0u ternary_result%26#2) + let tmp%28#0: uint64 = (== tmp%27#0 "a") + (assert tmp%28#0) + let awst_tmp%29#0: uint64 = (len abc#0) + let tmp%30#0: uint64 = (< 1u awst_tmp%29#0) + goto tmp%30#0 ? block@13 : block@14 + block@13: // ternary_true_L29 + let ternary_result%31#0: uint64 = (- awst_tmp%29#0 1u) goto block@15 - block@14: // ternary_false_L44 - let ternary_result%51#1: bytes = false#0 + block@14: // ternary_false_L29 + let ternary_result%31#1: uint64 = 0u goto block@15 - block@15: // ternary_merge_L44 - let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@13, ternary_result%51#1 <- block@14) - let tmp%52#0: uint64 = (== ternary_result%51#2 false#0) - (assert tmp%52#0) - let tmp%53#0: uint64 = (len true#0) - goto tmp%53#0 ? block@16 : block@17 - block@16: // ternary_true_L45 - let ternary_result%54#0: bytes = true#0 + block@15: // ternary_merge_L29 + let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@13, ternary_result%31#1 <- block@14) + let tmp%32#0: bytes = (substring3 abc#0 0u ternary_result%31#2) + let tmp%33#0: uint64 = (== tmp%32#0 "ab") + (assert tmp%33#0) + let awst_tmp%34#0: uint64 = (len abc#0) + let tmp%35#0: uint64 = (< 2u awst_tmp%34#0) + goto tmp%35#0 ? block@16 : block@17 + block@16: // ternary_true_L30 + let ternary_result%36#0: uint64 = (- awst_tmp%34#0 2u) goto block@18 - block@17: // ternary_false_L45 - let ternary_result%54#1: bytes = true#0 + block@17: // ternary_false_L30 + let ternary_result%36#1: uint64 = 0u goto block@18 - block@18: // ternary_merge_L45 - let ternary_result%54#2: bytes = φ(ternary_result%54#0 <- block@16, ternary_result%54#1 <- block@17) - let tmp%55#0: uint64 = (== ternary_result%54#2 true#0) - (assert tmp%55#0) - let tmp%56#0: uint64 = (len true#0) - goto tmp%56#0 ? block@19 : block@20 - block@19: // ternary_true_L46 - let ternary_result%57#0: bytes = true#0 + block@18: // ternary_merge_L30 + let ternary_result%36#2: uint64 = φ(ternary_result%36#0 <- block@16, ternary_result%36#1 <- block@17) + let base_length%37#0: uint64 = (len abc#0) + let tmp%38#0: bytes = (substring3 abc#0 ternary_result%36#2 base_length%37#0) + let tmp%39#0: uint64 = (== tmp%38#0 "bc") + (assert tmp%39#0) + let awst_tmp%40#0: uint64 = (len abc#0) + let tmp%41#0: uint64 = (< 2u awst_tmp%40#0) + goto tmp%41#0 ? block@19 : block@20 + block@19: // ternary_true_L31 + let ternary_result%42#0: uint64 = (- awst_tmp%40#0 2u) goto block@21 - block@20: // ternary_false_L46 - let ternary_result%57#1: bytes = false#0 + block@20: // ternary_false_L31 + let ternary_result%42#1: uint64 = 0u goto block@21 - block@21: // ternary_merge_L46 - let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@19, ternary_result%57#1 <- block@20) - let tmp%58#0: uint64 = (== ternary_result%57#2 true#0) - (assert tmp%58#0) - let tmp%59#0: uint64 = (len false#0) - goto tmp%59#0 ? block@22 : block@23 - block@22: // ternary_true_L47 - let ternary_result%60#0: bytes = false#0 + block@21: // ternary_merge_L31 + let ternary_result%42#2: uint64 = φ(ternary_result%42#0 <- block@19, ternary_result%42#1 <- block@20) + let awst_tmp%40#1: uint64 = (len abc#0) + let tmp%43#0: uint64 = (< 1u awst_tmp%40#1) + goto tmp%43#0 ? block@22 : block@23 + block@22: // ternary_true_L31 + let ternary_result%44#0: uint64 = (- awst_tmp%40#1 1u) goto block@24 - block@23: // ternary_false_L47 - let ternary_result%60#1: bytes = true#0 + block@23: // ternary_false_L31 + let ternary_result%44#1: uint64 = 0u goto block@24 - block@24: // ternary_merge_L47 - let ternary_result%60#2: bytes = φ(ternary_result%60#0 <- block@22, ternary_result%60#1 <- block@23) - let tmp%61#0: uint64 = (== ternary_result%60#2 true#0) - (assert tmp%61#0) - let tmp%62#0: uint64 = (len false#0) - goto tmp%62#0 ? block@25 : block@26 - block@25: // ternary_true_L48 - let ternary_result%63#0: bytes = false#0 + block@24: // ternary_merge_L31 + let ternary_result%44#2: uint64 = φ(ternary_result%44#0 <- block@22, ternary_result%44#1 <- block@23) + let tmp%45#0: bytes = (substring3 abc#0 ternary_result%42#2 ternary_result%44#2) + let tmp%46#0: uint64 = (== tmp%45#0 "b") + (assert tmp%46#0) + let tmp%47#0: bytes = (substring3 "1234567" 1u 6u) + let tmp%48#0: uint64 = (== tmp%47#0 "23456") + (assert tmp%48#0) + let awst_tmp%49#0: uint64 = (len abc#0) + let tmp%50#0: uint64 = (< 10u awst_tmp%49#0) + goto tmp%50#0 ? block@25 : block@26 + block@25: // ternary_true_L33 + let ternary_result%51#0: uint64 = (- awst_tmp%49#0 10u) goto block@27 - block@26: // ternary_false_L48 - let ternary_result%63#1: bytes = false#0 + block@26: // ternary_false_L33 + let ternary_result%51#1: uint64 = 0u goto block@27 - block@27: // ternary_merge_L48 - let ternary_result%63#2: bytes = φ(ternary_result%63#0 <- block@25, ternary_result%63#1 <- block@26) - let tmp%64#0: uint64 = (== ternary_result%63#2 false#0) - (assert tmp%64#0) + block@27: // ternary_merge_L33 + let ternary_result%51#2: uint64 = φ(ternary_result%51#0 <- block@25, ternary_result%51#1 <- block@26) + let awst_tmp%49#1: uint64 = (len abc#0) + let tmp%52#0: uint64 = (< 10u awst_tmp%49#1) + goto tmp%52#0 ? block@28 : block@29 + block@28: // ternary_true_L33 + let ternary_result%53#0: uint64 = 10u + goto block@30 + block@29: // ternary_false_L33 + let ternary_result%53#1: uint64 = awst_tmp%49#1 + goto block@30 + block@30: // ternary_merge_L33 + let ternary_result%53#2: uint64 = φ(ternary_result%53#0 <- block@28, ternary_result%53#1 <- block@29) + let tmp%54#0: bytes = (substring3 abc#0 ternary_result%51#2 ternary_result%53#2) + let tmp%55#0: uint64 = (== tmp%54#0 "abc") + (assert tmp%55#0) + let true#0: bytes = "1" + let false#0: bytes = "" + let tmp%56#0: uint64 = (len true#0) + goto tmp%56#0 ? block@32 : block@31 + block@31: // ternary_true_L38 + let ternary_result%57#0: bytes = true#0 + goto block@33 + block@32: // ternary_false_L38 + let ternary_result%57#1: bytes = true#0 + goto block@33 + block@33: // ternary_merge_L38 + let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@31, ternary_result%57#1 <- block@32) + let x#0: uint64 = (== ternary_result%57#2 true#0) + (assert x#0) + let tmp%58#0: uint64 = (len true#0) + goto tmp%58#0 ? block@35 : block@34 + block@34: // ternary_true_L40 + let ternary_result%59#0: bytes = true#0 + goto block@36 + block@35: // ternary_false_L40 + let ternary_result%59#1: bytes = true#0 + goto block@36 + block@36: // ternary_merge_L40 + let ternary_result%59#2: bytes = φ(ternary_result%59#0 <- block@34, ternary_result%59#1 <- block@35) + let tmp%60#0: uint64 = (== ternary_result%59#2 true#0) + (assert tmp%60#0) + let tmp%61#0: uint64 = (len true#0) + goto tmp%61#0 ? block@38 : block@37 + block@37: // ternary_true_L41 + let ternary_result%62#0: bytes = true#0 + goto block@39 + block@38: // ternary_false_L41 + let ternary_result%62#1: bytes = false#0 + goto block@39 + block@39: // ternary_merge_L41 + let ternary_result%62#2: bytes = φ(ternary_result%62#0 <- block@37, ternary_result%62#1 <- block@38) + let tmp%63#0: uint64 = (== ternary_result%62#2 false#0) + (assert tmp%63#0) + let tmp%64#0: uint64 = (len false#0) + goto tmp%64#0 ? block@41 : block@40 + block@40: // ternary_true_L42 + let ternary_result%65#0: bytes = false#0 + goto block@42 + block@41: // ternary_false_L42 + let ternary_result%65#1: bytes = true#0 + goto block@42 + block@42: // ternary_merge_L42 + let ternary_result%65#2: bytes = φ(ternary_result%65#0 <- block@40, ternary_result%65#1 <- block@41) + let tmp%66#0: uint64 = (== ternary_result%65#2 false#0) + (assert tmp%66#0) + let tmp%67#0: uint64 = (len false#0) + goto tmp%67#0 ? block@44 : block@43 + block@43: // ternary_true_L43 + let ternary_result%68#0: bytes = false#0 + goto block@45 + block@44: // ternary_false_L43 + let ternary_result%68#1: bytes = false#0 + goto block@45 + block@45: // ternary_merge_L43 + let ternary_result%68#2: bytes = φ(ternary_result%68#0 <- block@43, ternary_result%68#1 <- block@44) + let tmp%69#0: uint64 = (== ternary_result%68#2 false#0) + (assert tmp%69#0) + let tmp%70#0: uint64 = (len true#0) + goto tmp%70#0 ? block@46 : block@47 + block@46: // ternary_true_L44 + let ternary_result%71#0: bytes = true#0 + goto block@48 + block@47: // ternary_false_L44 + let ternary_result%71#1: bytes = true#0 + goto block@48 + block@48: // ternary_merge_L44 + let ternary_result%71#2: bytes = φ(ternary_result%71#0 <- block@46, ternary_result%71#1 <- block@47) + let tmp%72#0: uint64 = (== ternary_result%71#2 true#0) + (assert tmp%72#0) + let tmp%73#0: uint64 = (len true#0) + goto tmp%73#0 ? block@49 : block@50 + block@49: // ternary_true_L45 + let ternary_result%74#0: bytes = true#0 + goto block@51 + block@50: // ternary_false_L45 + let ternary_result%74#1: bytes = false#0 + goto block@51 + block@51: // ternary_merge_L45 + let ternary_result%74#2: bytes = φ(ternary_result%74#0 <- block@49, ternary_result%74#1 <- block@50) + let tmp%75#0: uint64 = (== ternary_result%74#2 true#0) + (assert tmp%75#0) + let tmp%76#0: uint64 = (len false#0) + goto tmp%76#0 ? block@52 : block@53 + block@52: // ternary_true_L46 + let ternary_result%77#0: bytes = false#0 + goto block@54 + block@53: // ternary_false_L46 + let ternary_result%77#1: bytes = true#0 + goto block@54 + block@54: // ternary_merge_L46 + let ternary_result%77#2: bytes = φ(ternary_result%77#0 <- block@52, ternary_result%77#1 <- block@53) + let tmp%78#0: uint64 = (== ternary_result%77#2 true#0) + (assert tmp%78#0) + let tmp%79#0: uint64 = (len false#0) + goto tmp%79#0 ? block@55 : block@56 + block@55: // ternary_true_L47 + let ternary_result%80#0: bytes = false#0 + goto block@57 + block@56: // ternary_false_L47 + let ternary_result%80#1: bytes = false#0 + goto block@57 + block@57: // ternary_merge_L47 + let ternary_result%80#2: bytes = φ(ternary_result%80#0 <- block@55, ternary_result%80#1 <- block@56) + let tmp%81#0: uint64 = (== ternary_result%80#2 false#0) + (assert tmp%81#0) let a#0: bytes = 0x00 let b#0: bytes = 0x0f let c#2: bytes = 0xf0 let d#0: bytes = 0xff - let tmp%65#0: bytes = (b& a#0 b#0) - let tmp%66#0: uint64 = (== tmp%65#0 a#0) - (assert tmp%66#0) - let tmp%67#0: bytes = (b| b#0 c#2) - let tmp%68#0: uint64 = (== tmp%67#0 d#0) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ b#0 d#0) - let tmp%70#0: uint64 = (== tmp%69#0 c#2) - (assert tmp%70#0) + let tmp%82#0: bytes = (b& a#0 b#0) + let tmp%83#0: uint64 = (== tmp%82#0 a#0) + (assert tmp%83#0) + let tmp%84#0: bytes = (b| b#0 c#2) + let tmp%85#0: uint64 = (== tmp%84#0 d#0) + (assert tmp%85#0) + let tmp%86#0: bytes = (b^ b#0 d#0) + let tmp%87#0: uint64 = (== tmp%86#0 c#2) + (assert tmp%87#0) let y#0: bytes = a#0 let y#1: bytes = (b& y#0 d#0) - let tmp%71#0: uint64 = (== y#1 a#0) - (assert tmp%71#0) + let tmp%88#0: uint64 = (== y#1 a#0) + (assert tmp%88#0) let y#2: bytes = (b| y#1 d#0) - let tmp%72#0: uint64 = (== y#2 d#0) - (assert tmp%72#0) + let tmp%89#0: uint64 = (== y#2 d#0) + (assert tmp%89#0) let y#3: bytes = (b^ y#2 c#2) - let tmp%73#0: uint64 = (== y#3 b#0) - (assert tmp%73#0) + let tmp%90#0: uint64 = (== y#3 b#0) + (assert tmp%90#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_1.ir b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_1.ir index 422e5fc734..31164fe6e4 100644 --- a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_1.ir +++ b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_1.ir @@ -13,8 +13,7 @@ contract examples.stubs.bytes.BytesContract: let tmp%4#0: uint64 = (len "") let tmp%5#0: uint64 = (! tmp%4#0) (assert tmp%5#0) // Empty bytes should be Falsy - let tmp%6#0: bytes = (concat "a" "b") - let tmp%7#0: uint64 = (== tmp%6#0 "ab") + let tmp%7#0: uint64 = (== "ab" "ab") (assert tmp%7#0) let c#1: bytes = (concat "c" "d") let tmp%8#0: uint64 = (== c#1 "cd") @@ -22,168 +21,265 @@ contract examples.stubs.bytes.BytesContract: let tmp%9#0: bytes = ((extract 0 1) "abc") let tmp%10#0: uint64 = (== tmp%9#0 "a") (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) "abc") - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) "abc") - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) "abc") - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let base_length%17#0: uint64 = (len "abc") - let tmp%18#0: uint64 = (len "abc") - let tmp%19#0: uint64 = (- tmp%18#0 1u) - let tmp%20#0: bytes = (substring3 "abc" 0u tmp%19#0) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let base_length%22#0: uint64 = (len "abc") - let tmp%23#0: uint64 = (len "abc") - let tmp%24#0: uint64 = (- tmp%23#0 2u) - let tmp%25#0: bytes = (substring3 "abc" tmp%24#0 base_length%22#0) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let base_length%27#0: uint64 = (len "abc") - let tmp%28#0: uint64 = (len "abc") - let tmp%29#0: uint64 = (- tmp%28#0 2u) - let tmp%30#0: uint64 = (len "abc") - let tmp%31#0: uint64 = (- tmp%30#0 1u) - let tmp%32#0: bytes = (substring3 "abc" tmp%29#0 tmp%31#0) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let tmp%36#0: uint64 = (- 7u 1u) - let tmp%37#0: bytes = (substring3 "1234567" 1u tmp%36#0) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let tmp%39#0: uint64 = (len "1") - goto tmp%39#0 ? block@2 : block@1 - block@1: // ternary_true_L38 - let ternary_result%40#0: bytes = "1" + let awst_tmp%11#0: uint64 = (len "abc") + let tmp%12#0: uint64 = (< 1u awst_tmp%11#0) + goto tmp%12#0 ? block@1 : block@2 + block@1: // ternary_true_L26 + let ternary_result%13#0: uint64 = 1u goto block@3 - block@2: // ternary_false_L38 - let ternary_result%40#1: bytes = "1" + block@2: // ternary_false_L26 goto block@3 - block@3: // ternary_merge_L38 - let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@1, ternary_result%40#1 <- block@2) - let x#0: uint64 = (== ternary_result%40#2 "1") - (assert x#0) - let tmp%41#0: uint64 = (len "1") - goto tmp%41#0 ? block@5 : block@4 - block@4: // ternary_true_L41 - let ternary_result%42#0: bytes = "1" + block@3: // ternary_merge_L26 + let ternary_result%13#2: uint64 = φ(ternary_result%13#0 <- block@1, awst_tmp%11#0 <- block@2) + let base_length%14#0: uint64 = (len "abc") + let tmp%15#0: bytes = (substring3 "abc" ternary_result%13#2 base_length%14#0) + let tmp%16#0: uint64 = (== tmp%15#0 "bc") + (assert tmp%16#0) + let awst_tmp%17#0: uint64 = (len "abc") + let tmp%18#0: uint64 = (< 1u awst_tmp%17#0) + goto tmp%18#0 ? block@4 : block@5 + block@4: // ternary_true_L27 + let ternary_result%19#0: uint64 = 1u goto block@6 - block@5: // ternary_false_L41 - let ternary_result%42#1: bytes = "1" + block@5: // ternary_false_L27 goto block@6 - block@6: // ternary_merge_L41 - let ternary_result%42#2: bytes = φ(ternary_result%42#0 <- block@4, ternary_result%42#1 <- block@5) - let tmp%43#0: uint64 = (== ternary_result%42#2 "1") - (assert tmp%43#0) - let tmp%44#0: uint64 = (len "1") - goto tmp%44#0 ? block@8 : block@7 - block@7: // ternary_true_L42 - let ternary_result%45#0: bytes = "1" + block@6: // ternary_merge_L27 + let ternary_result%19#2: uint64 = φ(ternary_result%19#0 <- block@4, awst_tmp%17#0 <- block@5) + let awst_tmp%17#1: uint64 = (len "abc") + let tmp%20#0: uint64 = (< 1u awst_tmp%17#1) + goto tmp%20#0 ? block@7 : block@8 + block@7: // ternary_true_L27 + let ternary_result%21#0: uint64 = 1u goto block@9 - block@8: // ternary_false_L42 - let ternary_result%45#1: bytes = "" + block@8: // ternary_false_L27 goto block@9 - block@9: // ternary_merge_L42 - let ternary_result%45#2: bytes = φ(ternary_result%45#0 <- block@7, ternary_result%45#1 <- block@8) - let tmp%46#0: uint64 = (== ternary_result%45#2 "") - (assert tmp%46#0) - let tmp%47#0: uint64 = (len "") - goto tmp%47#0 ? block@11 : block@10 - block@10: // ternary_true_L43 - let ternary_result%48#0: bytes = "" + block@9: // ternary_merge_L27 + let ternary_result%21#2: uint64 = φ(ternary_result%21#0 <- block@7, awst_tmp%17#1 <- block@8) + let tmp%22#0: bytes = (substring3 "abc" ternary_result%19#2 ternary_result%21#2) + let tmp%23#0: uint64 = (== tmp%22#0 "") + (assert tmp%23#0) + let awst_tmp%24#0: uint64 = (len "abc") + let tmp%25#0: uint64 = (< 1u awst_tmp%24#0) + goto tmp%25#0 ? block@10 : block@11 + block@10: // ternary_true_L28 + let ternary_result%26#0: uint64 = 1u goto block@12 - block@11: // ternary_false_L43 - let ternary_result%48#1: bytes = "1" + block@11: // ternary_false_L28 goto block@12 - block@12: // ternary_merge_L43 - let ternary_result%48#2: bytes = φ(ternary_result%48#0 <- block@10, ternary_result%48#1 <- block@11) - let tmp%49#0: uint64 = (== ternary_result%48#2 "") - (assert tmp%49#0) - let tmp%50#0: uint64 = (len "") - goto tmp%50#0 ? block@14 : block@13 - block@13: // ternary_true_L44 - let ternary_result%51#0: bytes = "" + block@12: // ternary_merge_L28 + let ternary_result%26#2: uint64 = φ(ternary_result%26#0 <- block@10, awst_tmp%24#0 <- block@11) + let tmp%27#0: bytes = (substring3 "abc" 0u ternary_result%26#2) + let tmp%28#0: uint64 = (== tmp%27#0 "a") + (assert tmp%28#0) + let awst_tmp%29#0: uint64 = (len "abc") + let tmp%30#0: uint64 = (< 1u awst_tmp%29#0) + goto tmp%30#0 ? block@13 : block@14 + block@13: // ternary_true_L29 + let ternary_result%31#0: uint64 = (- awst_tmp%29#0 1u) goto block@15 - block@14: // ternary_false_L44 - let ternary_result%51#1: bytes = "" + block@14: // ternary_false_L29 + let ternary_result%31#1: uint64 = 0u goto block@15 - block@15: // ternary_merge_L44 - let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@13, ternary_result%51#1 <- block@14) - let tmp%52#0: uint64 = (== ternary_result%51#2 "") - (assert tmp%52#0) - let tmp%53#0: uint64 = (len "1") - goto tmp%53#0 ? block@16 : block@17 - block@16: // ternary_true_L45 - let ternary_result%54#0: bytes = "1" + block@15: // ternary_merge_L29 + let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@13, ternary_result%31#1 <- block@14) + let tmp%32#0: bytes = (substring3 "abc" 0u ternary_result%31#2) + let tmp%33#0: uint64 = (== tmp%32#0 "ab") + (assert tmp%33#0) + let awst_tmp%34#0: uint64 = (len "abc") + let tmp%35#0: uint64 = (< 2u awst_tmp%34#0) + goto tmp%35#0 ? block@16 : block@17 + block@16: // ternary_true_L30 + let ternary_result%36#0: uint64 = (- awst_tmp%34#0 2u) goto block@18 - block@17: // ternary_false_L45 - let ternary_result%54#1: bytes = "1" + block@17: // ternary_false_L30 + let ternary_result%36#1: uint64 = 0u goto block@18 - block@18: // ternary_merge_L45 - let ternary_result%54#2: bytes = φ(ternary_result%54#0 <- block@16, ternary_result%54#1 <- block@17) - let tmp%55#0: uint64 = (== ternary_result%54#2 "1") - (assert tmp%55#0) - let tmp%56#0: uint64 = (len "1") - goto tmp%56#0 ? block@19 : block@20 - block@19: // ternary_true_L46 - let ternary_result%57#0: bytes = "1" + block@18: // ternary_merge_L30 + let ternary_result%36#2: uint64 = φ(ternary_result%36#0 <- block@16, ternary_result%36#1 <- block@17) + let base_length%37#0: uint64 = (len "abc") + let tmp%38#0: bytes = (substring3 "abc" ternary_result%36#2 base_length%37#0) + let tmp%39#0: uint64 = (== tmp%38#0 "bc") + (assert tmp%39#0) + let awst_tmp%40#0: uint64 = (len "abc") + let tmp%41#0: uint64 = (< 2u awst_tmp%40#0) + goto tmp%41#0 ? block@19 : block@20 + block@19: // ternary_true_L31 + let ternary_result%42#0: uint64 = (- awst_tmp%40#0 2u) goto block@21 - block@20: // ternary_false_L46 - let ternary_result%57#1: bytes = "" + block@20: // ternary_false_L31 + let ternary_result%42#1: uint64 = 0u goto block@21 - block@21: // ternary_merge_L46 - let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@19, ternary_result%57#1 <- block@20) - let tmp%58#0: uint64 = (== ternary_result%57#2 "1") - (assert tmp%58#0) - let tmp%59#0: uint64 = (len "") - goto tmp%59#0 ? block@22 : block@23 - block@22: // ternary_true_L47 - let ternary_result%60#0: bytes = "" + block@21: // ternary_merge_L31 + let ternary_result%42#2: uint64 = φ(ternary_result%42#0 <- block@19, ternary_result%42#1 <- block@20) + let awst_tmp%40#1: uint64 = (len "abc") + let tmp%43#0: uint64 = (< 1u awst_tmp%40#1) + goto tmp%43#0 ? block@22 : block@23 + block@22: // ternary_true_L31 + let ternary_result%44#0: uint64 = (- awst_tmp%40#1 1u) goto block@24 - block@23: // ternary_false_L47 - let ternary_result%60#1: bytes = "1" + block@23: // ternary_false_L31 + let ternary_result%44#1: uint64 = 0u goto block@24 - block@24: // ternary_merge_L47 - let ternary_result%60#2: bytes = φ(ternary_result%60#0 <- block@22, ternary_result%60#1 <- block@23) - let tmp%61#0: uint64 = (== ternary_result%60#2 "1") - (assert tmp%61#0) - let tmp%62#0: uint64 = (len "") - goto tmp%62#0 ? block@25 : block@26 - block@25: // ternary_true_L48 - let ternary_result%63#0: bytes = "" + block@24: // ternary_merge_L31 + let ternary_result%44#2: uint64 = φ(ternary_result%44#0 <- block@22, ternary_result%44#1 <- block@23) + let tmp%45#0: bytes = (substring3 "abc" ternary_result%42#2 ternary_result%44#2) + let tmp%46#0: uint64 = (== tmp%45#0 "b") + (assert tmp%46#0) + let tmp%48#0: uint64 = (== "23456" "23456") + (assert tmp%48#0) + let awst_tmp%49#0: uint64 = (len "abc") + let tmp%50#0: uint64 = (< 10u awst_tmp%49#0) + goto tmp%50#0 ? block@25 : block@26 + block@25: // ternary_true_L33 + let ternary_result%51#0: uint64 = (- awst_tmp%49#0 10u) goto block@27 - block@26: // ternary_false_L48 - let ternary_result%63#1: bytes = "" + block@26: // ternary_false_L33 + let ternary_result%51#1: uint64 = 0u goto block@27 - block@27: // ternary_merge_L48 - let ternary_result%63#2: bytes = φ(ternary_result%63#0 <- block@25, ternary_result%63#1 <- block@26) - let tmp%64#0: uint64 = (== ternary_result%63#2 "") - (assert tmp%64#0) - let tmp%65#0: bytes = (b& 0x00 0x0f) - let tmp%66#0: uint64 = (== tmp%65#0 0x00) + block@27: // ternary_merge_L33 + let ternary_result%51#2: uint64 = φ(ternary_result%51#0 <- block@25, ternary_result%51#1 <- block@26) + let awst_tmp%49#1: uint64 = (len "abc") + let tmp%52#0: uint64 = (< 10u awst_tmp%49#1) + goto tmp%52#0 ? block@28 : block@29 + block@28: // ternary_true_L33 + let ternary_result%53#0: uint64 = 10u + goto block@30 + block@29: // ternary_false_L33 + goto block@30 + block@30: // ternary_merge_L33 + let ternary_result%53#2: uint64 = φ(ternary_result%53#0 <- block@28, awst_tmp%49#1 <- block@29) + let tmp%54#0: bytes = (substring3 "abc" ternary_result%51#2 ternary_result%53#2) + let tmp%55#0: uint64 = (== tmp%54#0 "abc") + (assert tmp%55#0) + let tmp%56#0: uint64 = (len "1") + goto tmp%56#0 ? block@32 : block@31 + block@31: // ternary_true_L38 + let ternary_result%57#0: bytes = "1" + goto block@33 + block@32: // ternary_false_L38 + let ternary_result%57#1: bytes = "1" + goto block@33 + block@33: // ternary_merge_L38 + let ternary_result%57#2: bytes = φ(ternary_result%57#0 <- block@31, ternary_result%57#1 <- block@32) + let x#0: uint64 = (== ternary_result%57#2 "1") + (assert x#0) + let tmp%58#0: uint64 = (len "1") + goto tmp%58#0 ? block@35 : block@34 + block@34: // ternary_true_L40 + let ternary_result%59#0: bytes = "1" + goto block@36 + block@35: // ternary_false_L40 + let ternary_result%59#1: bytes = "1" + goto block@36 + block@36: // ternary_merge_L40 + let ternary_result%59#2: bytes = φ(ternary_result%59#0 <- block@34, ternary_result%59#1 <- block@35) + let tmp%60#0: uint64 = (== ternary_result%59#2 "1") + (assert tmp%60#0) + let tmp%61#0: uint64 = (len "1") + goto tmp%61#0 ? block@38 : block@37 + block@37: // ternary_true_L41 + let ternary_result%62#0: bytes = "1" + goto block@39 + block@38: // ternary_false_L41 + let ternary_result%62#1: bytes = "" + goto block@39 + block@39: // ternary_merge_L41 + let ternary_result%62#2: bytes = φ(ternary_result%62#0 <- block@37, ternary_result%62#1 <- block@38) + let tmp%63#0: uint64 = (== ternary_result%62#2 "") + (assert tmp%63#0) + let tmp%64#0: uint64 = (len "") + goto tmp%64#0 ? block@41 : block@40 + block@40: // ternary_true_L42 + let ternary_result%65#0: bytes = "" + goto block@42 + block@41: // ternary_false_L42 + let ternary_result%65#1: bytes = "1" + goto block@42 + block@42: // ternary_merge_L42 + let ternary_result%65#2: bytes = φ(ternary_result%65#0 <- block@40, ternary_result%65#1 <- block@41) + let tmp%66#0: uint64 = (== ternary_result%65#2 "") (assert tmp%66#0) - let tmp%67#0: bytes = (b| 0x0f 0xf0) - let tmp%68#0: uint64 = (== tmp%67#0 0xff) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ 0x0f 0xff) - let tmp%70#0: uint64 = (== tmp%69#0 0xf0) - (assert tmp%70#0) + let tmp%67#0: uint64 = (len "") + goto tmp%67#0 ? block@44 : block@43 + block@43: // ternary_true_L43 + let ternary_result%68#0: bytes = "" + goto block@45 + block@44: // ternary_false_L43 + let ternary_result%68#1: bytes = "" + goto block@45 + block@45: // ternary_merge_L43 + let ternary_result%68#2: bytes = φ(ternary_result%68#0 <- block@43, ternary_result%68#1 <- block@44) + let tmp%69#0: uint64 = (== ternary_result%68#2 "") + (assert tmp%69#0) + let tmp%70#0: uint64 = (len "1") + goto tmp%70#0 ? block@46 : block@47 + block@46: // ternary_true_L44 + let ternary_result%71#0: bytes = "1" + goto block@48 + block@47: // ternary_false_L44 + let ternary_result%71#1: bytes = "1" + goto block@48 + block@48: // ternary_merge_L44 + let ternary_result%71#2: bytes = φ(ternary_result%71#0 <- block@46, ternary_result%71#1 <- block@47) + let tmp%72#0: uint64 = (== ternary_result%71#2 "1") + (assert tmp%72#0) + let tmp%73#0: uint64 = (len "1") + goto tmp%73#0 ? block@49 : block@50 + block@49: // ternary_true_L45 + let ternary_result%74#0: bytes = "1" + goto block@51 + block@50: // ternary_false_L45 + let ternary_result%74#1: bytes = "" + goto block@51 + block@51: // ternary_merge_L45 + let ternary_result%74#2: bytes = φ(ternary_result%74#0 <- block@49, ternary_result%74#1 <- block@50) + let tmp%75#0: uint64 = (== ternary_result%74#2 "1") + (assert tmp%75#0) + let tmp%76#0: uint64 = (len "") + goto tmp%76#0 ? block@52 : block@53 + block@52: // ternary_true_L46 + let ternary_result%77#0: bytes = "" + goto block@54 + block@53: // ternary_false_L46 + let ternary_result%77#1: bytes = "1" + goto block@54 + block@54: // ternary_merge_L46 + let ternary_result%77#2: bytes = φ(ternary_result%77#0 <- block@52, ternary_result%77#1 <- block@53) + let tmp%78#0: uint64 = (== ternary_result%77#2 "1") + (assert tmp%78#0) + let tmp%79#0: uint64 = (len "") + goto tmp%79#0 ? block@55 : block@56 + block@55: // ternary_true_L47 + let ternary_result%80#0: bytes = "" + goto block@57 + block@56: // ternary_false_L47 + let ternary_result%80#1: bytes = "" + goto block@57 + block@57: // ternary_merge_L47 + let ternary_result%80#2: bytes = φ(ternary_result%80#0 <- block@55, ternary_result%80#1 <- block@56) + let tmp%81#0: uint64 = (== ternary_result%80#2 "") + (assert tmp%81#0) + let tmp%82#0: bytes = (b& 0x00 0x0f) + let tmp%83#0: uint64 = (== tmp%82#0 0x00) + (assert tmp%83#0) + let tmp%84#0: bytes = (b| 0x0f 0xf0) + let tmp%85#0: uint64 = (== tmp%84#0 0xff) + (assert tmp%85#0) + let tmp%86#0: bytes = (b^ 0x0f 0xff) + let tmp%87#0: uint64 = (== tmp%86#0 0xf0) + (assert tmp%87#0) let y#1: bytes = (b& 0x00 0xff) - let tmp%71#0: uint64 = (== y#1 0x00) - (assert tmp%71#0) + let tmp%88#0: uint64 = (== y#1 0x00) + (assert tmp%88#0) let y#2: bytes = (b| y#1 0xff) - let tmp%72#0: uint64 = (== y#2 0xff) - (assert tmp%72#0) + let tmp%89#0: uint64 = (== y#2 0xff) + (assert tmp%89#0) let y#3: bytes = (b^ y#2 0xf0) - let tmp%73#0: uint64 = (== y#3 0x0f) - (assert tmp%73#0) + let tmp%90#0: uint64 = (== y#3 0x0f) + (assert tmp%90#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_2.ir b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_2.ir index 34752127fe..630d4d3ba5 100644 --- a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_2.ir +++ b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_2.ir @@ -2,115 +2,195 @@ contract examples.stubs.bytes.BytesContract: program approval: subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: block@0: // L5 - let tmp%0#0: uint64 = (== QmFzZSA2NCBlbmNvZGVk "Base 64 encoded") - (assert tmp%0#0) - let tmp%1#0: uint64 = (== IJQXGZJAGMZCAZLOMNXWIZLE "Base 32 encoded") - (assert tmp%1#0) - let tmp%2#0: uint64 = (== 0x4261736520313620656e636f646564 "Base 16 encoded") - (assert tmp%2#0) - (assert 15u) // Non empty bytes should be Truthy let tmp%5#0: uint64 = (! 0u) (assert tmp%5#0) // Empty bytes should be Falsy - let tmp%6#0: bytes = (concat "a" "b") - let tmp%7#0: uint64 = (== tmp%6#0 "ab") - (assert tmp%7#0) - let c#1: bytes = (concat "c" "d") - let tmp%8#0: uint64 = (== c#1 "cd") + let tmp%8#0: uint64 = (== "cd" "cd") (assert tmp%8#0) - let tmp%9#0: bytes = ((extract 0 1) "abc") - let tmp%10#0: uint64 = (== tmp%9#0 "a") + let tmp%10#0: uint64 = (== "a" "a") (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) "abc") - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) "abc") - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) "abc") - let tmp%16#0: uint64 = (== tmp%15#0 "a") - (assert tmp%16#0) - let tmp%19#0: uint64 = (- 3u 1u) - let tmp%20#0: bytes = (substring3 "abc" 0u tmp%19#0) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let tmp%24#0: uint64 = (- 3u 2u) - let tmp%25#0: bytes = (substring3 "abc" tmp%24#0 3u) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let tmp%29#0: uint64 = (- 3u 2u) - let tmp%31#0: uint64 = (- 3u 1u) - let tmp%32#0: bytes = (substring3 "abc" tmp%29#0 tmp%31#0) - let tmp%33#0: uint64 = (== tmp%32#0 "b") - (assert tmp%33#0) - let tmp%37#0: bytes = (substring3 "1234567" 1u 6u) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let ternary_result%40#1: bytes = "1" + let awst_tmp%11#0: uint64 = 3u + let tmp%12#0: uint64 = (< 1u 3u) + goto tmp%12#0 ? block@1 : block@2 + block@1: // ternary_true_L26 + let ternary_result%13#0: uint64 = 1u goto block@3 - block@3: // ternary_merge_L38 - let x#0: uint64 = (== ternary_result%40#1 "1") - (assert x#0) - let ternary_result%42#1: bytes = "1" + block@2: // ternary_false_L26 + goto block@3 + block@3: // ternary_merge_L26 + let ternary_result%13#2: uint64 = φ(ternary_result%13#0 <- block@1, awst_tmp%11#0 <- block@2) + let tmp%15#0: bytes = (substring3 "abc" ternary_result%13#2 3u) + let tmp%16#0: uint64 = (== tmp%15#0 "bc") + (assert tmp%16#0) + let awst_tmp%17#0: uint64 = 3u + let tmp%18#0: uint64 = (< 1u 3u) + goto tmp%18#0 ? block@4 : block@5 + block@4: // ternary_true_L27 + let ternary_result%19#0: uint64 = 1u goto block@6 - block@6: // ternary_merge_L41 - let tmp%43#0: uint64 = (== ternary_result%42#1 "1") - (assert tmp%43#0) - let ternary_result%45#1: bytes = "" + block@5: // ternary_false_L27 + goto block@6 + block@6: // ternary_merge_L27 + let ternary_result%19#2: uint64 = φ(ternary_result%19#0 <- block@4, awst_tmp%17#0 <- block@5) + let awst_tmp%17#1: uint64 = 3u + let tmp%20#0: uint64 = (< 1u 3u) + goto tmp%20#0 ? block@7 : block@8 + block@7: // ternary_true_L27 + let ternary_result%21#0: uint64 = 1u goto block@9 - block@9: // ternary_merge_L42 - let tmp%46#0: uint64 = (== ternary_result%45#1 "") - (assert tmp%46#0) - let ternary_result%48#0: bytes = "" + block@8: // ternary_false_L27 + goto block@9 + block@9: // ternary_merge_L27 + let ternary_result%21#2: uint64 = φ(ternary_result%21#0 <- block@7, awst_tmp%17#1 <- block@8) + let tmp%22#0: bytes = (substring3 "abc" ternary_result%19#2 ternary_result%21#2) + let tmp%23#0: uint64 = (== tmp%22#0 "") + (assert tmp%23#0) + let awst_tmp%24#0: uint64 = 3u + let tmp%25#0: uint64 = (< 1u 3u) + goto tmp%25#0 ? block@10 : block@11 + block@10: // ternary_true_L28 + let ternary_result%26#0: uint64 = 1u goto block@12 - block@12: // ternary_merge_L43 - let tmp%49#0: uint64 = (== ternary_result%48#0 "") - (assert tmp%49#0) - let ternary_result%51#0: bytes = "" + block@11: // ternary_false_L28 + goto block@12 + block@12: // ternary_merge_L28 + let ternary_result%26#2: uint64 = φ(ternary_result%26#0 <- block@10, awst_tmp%24#0 <- block@11) + let tmp%27#0: bytes = (substring3 "abc" 0u ternary_result%26#2) + let tmp%28#0: uint64 = (== tmp%27#0 "a") + (assert tmp%28#0) + let tmp%30#0: uint64 = (< 1u 3u) + goto tmp%30#0 ? block@13 : block@14 + block@13: // ternary_true_L29 + let ternary_result%31#0: uint64 = (- 3u 1u) + goto block@15 + block@14: // ternary_false_L29 + let ternary_result%31#1: uint64 = 0u goto block@15 - block@15: // ternary_merge_L44 - let tmp%52#0: uint64 = (== ternary_result%51#0 "") - (assert tmp%52#0) - let ternary_result%54#0: bytes = "1" + block@15: // ternary_merge_L29 + let ternary_result%31#2: uint64 = φ(ternary_result%31#0 <- block@13, ternary_result%31#1 <- block@14) + let tmp%32#0: bytes = (substring3 "abc" 0u ternary_result%31#2) + let tmp%33#0: uint64 = (== tmp%32#0 "ab") + (assert tmp%33#0) + let tmp%35#0: uint64 = (< 2u 3u) + goto tmp%35#0 ? block@16 : block@17 + block@16: // ternary_true_L30 + let ternary_result%36#0: uint64 = (- 3u 2u) goto block@18 - block@18: // ternary_merge_L45 - let tmp%55#0: uint64 = (== ternary_result%54#0 "1") - (assert tmp%55#0) - let ternary_result%57#0: bytes = "1" + block@17: // ternary_false_L30 + let ternary_result%36#1: uint64 = 0u + goto block@18 + block@18: // ternary_merge_L30 + let ternary_result%36#2: uint64 = φ(ternary_result%36#0 <- block@16, ternary_result%36#1 <- block@17) + let tmp%38#0: bytes = (substring3 "abc" ternary_result%36#2 3u) + let tmp%39#0: uint64 = (== tmp%38#0 "bc") + (assert tmp%39#0) + let tmp%41#0: uint64 = (< 2u 3u) + goto tmp%41#0 ? block@19 : block@20 + block@19: // ternary_true_L31 + let ternary_result%42#0: uint64 = (- 3u 2u) goto block@21 - block@21: // ternary_merge_L46 - let tmp%58#0: uint64 = (== ternary_result%57#0 "1") - (assert tmp%58#0) - let ternary_result%60#1: bytes = "1" + block@20: // ternary_false_L31 + let ternary_result%42#1: uint64 = 0u + goto block@21 + block@21: // ternary_merge_L31 + let ternary_result%42#2: uint64 = φ(ternary_result%42#0 <- block@19, ternary_result%42#1 <- block@20) + let tmp%43#0: uint64 = (< 1u 3u) + goto tmp%43#0 ? block@22 : block@23 + block@22: // ternary_true_L31 + let ternary_result%44#0: uint64 = (- 3u 1u) + goto block@24 + block@23: // ternary_false_L31 + let ternary_result%44#1: uint64 = 0u goto block@24 - block@24: // ternary_merge_L47 - let tmp%61#0: uint64 = (== ternary_result%60#1 "1") - (assert tmp%61#0) - let ternary_result%63#1: bytes = "" + block@24: // ternary_merge_L31 + let ternary_result%44#2: uint64 = φ(ternary_result%44#0 <- block@22, ternary_result%44#1 <- block@23) + let tmp%45#0: bytes = (substring3 "abc" ternary_result%42#2 ternary_result%44#2) + let tmp%46#0: uint64 = (== tmp%45#0 "b") + (assert tmp%46#0) + let tmp%50#0: uint64 = (< 10u 3u) + goto tmp%50#0 ? block@25 : block@26 + block@25: // ternary_true_L33 + let ternary_result%51#0: uint64 = (- 3u 10u) + goto block@27 + block@26: // ternary_false_L33 + let ternary_result%51#1: uint64 = 0u goto block@27 - block@27: // ternary_merge_L48 - let tmp%64#0: uint64 = (== ternary_result%63#1 "") - (assert tmp%64#0) - let tmp%65#0: bytes = (b& 0x00 0x0f) - let tmp%66#0: uint64 = (== tmp%65#0 0x00) + block@27: // ternary_merge_L33 + let ternary_result%51#2: uint64 = φ(ternary_result%51#0 <- block@25, ternary_result%51#1 <- block@26) + let awst_tmp%49#1: uint64 = 3u + let tmp%52#0: uint64 = (< 10u 3u) + goto tmp%52#0 ? block@28 : block@29 + block@28: // ternary_true_L33 + let ternary_result%53#0: uint64 = 10u + goto block@30 + block@29: // ternary_false_L33 + goto block@30 + block@30: // ternary_merge_L33 + let ternary_result%53#2: uint64 = φ(ternary_result%53#0 <- block@28, awst_tmp%49#1 <- block@29) + let tmp%54#0: bytes = (substring3 "abc" ternary_result%51#2 ternary_result%53#2) + let tmp%55#0: uint64 = (== tmp%54#0 "abc") + (assert tmp%55#0) + let ternary_result%57#1: bytes = "1" + goto block@33 + block@33: // ternary_merge_L38 + let x#0: uint64 = (== ternary_result%57#1 "1") + (assert x#0) + let ternary_result%59#1: bytes = "1" + goto block@36 + block@36: // ternary_merge_L40 + let tmp%60#0: uint64 = (== ternary_result%59#1 "1") + (assert tmp%60#0) + let ternary_result%62#1: bytes = "" + goto block@39 + block@39: // ternary_merge_L41 + let tmp%63#0: uint64 = (== ternary_result%62#1 "") + (assert tmp%63#0) + let ternary_result%65#0: bytes = "" + goto block@42 + block@42: // ternary_merge_L42 + let tmp%66#0: uint64 = (== ternary_result%65#0 "") (assert tmp%66#0) - let tmp%67#0: bytes = (b| 0x0f 0xf0) - let tmp%68#0: uint64 = (== tmp%67#0 0xff) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ 0x0f 0xff) - let tmp%70#0: uint64 = (== tmp%69#0 0xf0) - (assert tmp%70#0) - let y#1: bytes = (b& 0x00 0xff) - let tmp%71#0: uint64 = (== y#1 0x00) - (assert tmp%71#0) - let y#2: bytes = (b| y#1 0xff) - let tmp%72#0: uint64 = (== y#2 0xff) + let ternary_result%68#0: bytes = "" + goto block@45 + block@45: // ternary_merge_L43 + let tmp%69#0: uint64 = (== ternary_result%68#0 "") + (assert tmp%69#0) + let ternary_result%71#0: bytes = "1" + goto block@48 + block@48: // ternary_merge_L44 + let tmp%72#0: uint64 = (== ternary_result%71#0 "1") (assert tmp%72#0) + let ternary_result%74#0: bytes = "1" + goto block@51 + block@51: // ternary_merge_L45 + let tmp%75#0: uint64 = (== ternary_result%74#0 "1") + (assert tmp%75#0) + let ternary_result%77#1: bytes = "1" + goto block@54 + block@54: // ternary_merge_L46 + let tmp%78#0: uint64 = (== ternary_result%77#1 "1") + (assert tmp%78#0) + let ternary_result%80#1: bytes = "" + goto block@57 + block@57: // ternary_merge_L47 + let tmp%81#0: uint64 = (== ternary_result%80#1 "") + (assert tmp%81#0) + let tmp%83#0: uint64 = (== 0x00 0x00) + (assert tmp%83#0) + let tmp%85#0: uint64 = (== 0xff 0xff) + (assert tmp%85#0) + let tmp%87#0: uint64 = (== 0xf0 0xf0) + (assert tmp%87#0) + let tmp%88#0: uint64 = (== 0x00 0x00) + (assert tmp%88#0) + let y#2: bytes = (b| 0x00 0xff) + let tmp%89#0: uint64 = (== y#2 0xff) + (assert tmp%89#0) let y#3: bytes = (b^ y#2 0xf0) - let tmp%73#0: uint64 = (== y#3 0x0f) - (assert tmp%73#0) + let tmp%90#0: uint64 = (== y#3 0x0f) + (assert tmp%90#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_3.ir b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_3.ir index 8088c00c1b..1085fba695 100644 --- a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_3.ir +++ b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_3.ir @@ -2,83 +2,87 @@ contract examples.stubs.bytes.BytesContract: program approval: subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: block@0: // L5 - let tmp%0#0: uint64 = (== QmFzZSA2NCBlbmNvZGVk "Base 64 encoded") - (assert tmp%0#0) - let tmp%1#0: uint64 = (== IJQXGZJAGMZCAZLOMNXWIZLE "Base 32 encoded") - (assert tmp%1#0) - let tmp%2#0: uint64 = (== 0x4261736520313620656e636f646564 "Base 16 encoded") - (assert tmp%2#0) - (assert 15u) // Non empty bytes should be Truthy - (assert 1u) // Empty bytes should be Falsy - let tmp%6#0: bytes = (concat "a" "b") - let tmp%7#0: uint64 = (== tmp%6#0 "ab") - (assert tmp%7#0) - let c#1: bytes = (concat "c" "d") - let tmp%8#0: uint64 = (== c#1 "cd") - (assert tmp%8#0) - let tmp%9#0: bytes = ((extract 0 1) "abc") - let tmp%10#0: uint64 = (== tmp%9#0 "a") - (assert tmp%10#0) - let tmp%11#0: bytes = ((extract 1 0) "abc") - let tmp%12#0: uint64 = (== tmp%11#0 "bc") - (assert tmp%12#0) - let tmp%13#0: bytes = ((substring 1 1) "abc") - let tmp%14#0: uint64 = (== tmp%13#0 "") - (assert tmp%14#0) - let tmp%15#0: bytes = ((extract 0 1) "abc") - let tmp%16#0: uint64 = (== tmp%15#0 "a") + let awst_tmp%11#0: uint64 = 3u + let ternary_result%13#0: uint64 = 1u + goto block@3 + block@3: // ternary_merge_L26 + let tmp%15#0: bytes = (substring3 "abc" ternary_result%13#0 3u) + let tmp%16#0: uint64 = (== tmp%15#0 "bc") (assert tmp%16#0) - let tmp%20#0: bytes = (substring3 "abc" 0u 2u) - let tmp%21#0: uint64 = (== tmp%20#0 "ab") - (assert tmp%21#0) - let tmp%25#0: bytes = (substring3 "abc" 1u 3u) - let tmp%26#0: uint64 = (== tmp%25#0 "bc") - (assert tmp%26#0) - let tmp%32#0: bytes = (substring3 "abc" 1u 2u) - let tmp%33#0: uint64 = (== tmp%32#0 "b") + let awst_tmp%17#0: uint64 = 3u + let ternary_result%19#0: uint64 = 1u + goto block@6 + block@6: // ternary_merge_L27 + let awst_tmp%17#1: uint64 = 3u + let ternary_result%21#0: uint64 = 1u + goto block@9 + block@9: // ternary_merge_L27 + let tmp%22#0: bytes = (substring3 "abc" ternary_result%19#0 ternary_result%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 "") + (assert tmp%23#0) + let awst_tmp%24#0: uint64 = 3u + let ternary_result%26#0: uint64 = 1u + goto block@12 + block@12: // ternary_merge_L28 + let tmp%27#0: bytes = (substring3 "abc" 0u ternary_result%26#0) + let tmp%28#0: uint64 = (== tmp%27#0 "a") + (assert tmp%28#0) + let ternary_result%31#0: uint64 = 2u + goto block@15 + block@15: // ternary_merge_L29 + let tmp%32#0: bytes = (substring3 "abc" 0u ternary_result%31#0) + let tmp%33#0: uint64 = (== tmp%32#0 "ab") (assert tmp%33#0) - let tmp%37#0: bytes = (substring3 "1234567" 1u 6u) - let tmp%38#0: uint64 = (== tmp%37#0 "23456") - (assert tmp%38#0) - let x#0: uint64 = (== "1" "1") - (assert x#0) - let tmp%43#0: uint64 = (== "1" "1") - (assert tmp%43#0) - let tmp%46#0: uint64 = (== "" "") + let ternary_result%36#0: uint64 = 1u + goto block@18 + block@18: // ternary_merge_L30 + let tmp%38#0: bytes = (substring3 "abc" ternary_result%36#0 3u) + let tmp%39#0: uint64 = (== tmp%38#0 "bc") + (assert tmp%39#0) + let ternary_result%42#0: uint64 = 1u + goto block@21 + block@21: // ternary_merge_L31 + let ternary_result%44#0: uint64 = 2u + goto block@24 + block@24: // ternary_merge_L31 + let tmp%45#0: bytes = (substring3 "abc" ternary_result%42#0 ternary_result%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "b") (assert tmp%46#0) - let tmp%49#0: uint64 = (== "" "") - (assert tmp%49#0) - let tmp%52#0: uint64 = (== "" "") - (assert tmp%52#0) - let tmp%55#0: uint64 = (== "1" "1") + let ternary_result%51#1: uint64 = 0u + goto block@27 + block@27: // ternary_merge_L33 + let awst_tmp%49#1: uint64 = 3u + goto block@30 + block@30: // ternary_merge_L33 + let tmp%54#0: bytes = (substring3 "abc" ternary_result%51#1 awst_tmp%49#1) + let tmp%55#0: uint64 = (== tmp%54#0 "abc") (assert tmp%55#0) - let tmp%58#0: uint64 = (== "1" "1") - (assert tmp%58#0) - let tmp%61#0: uint64 = (== "1" "1") - (assert tmp%61#0) - let tmp%64#0: uint64 = (== "" "") - (assert tmp%64#0) - let tmp%65#0: bytes = (b& 0x00 0x0f) - let tmp%66#0: uint64 = (== tmp%65#0 0x00) + let x#0: uint64 = (== "1" "1") + (assert x#0) + let tmp%60#0: uint64 = (== "1" "1") + (assert tmp%60#0) + let tmp%63#0: uint64 = (== "" "") + (assert tmp%63#0) + let tmp%66#0: uint64 = (== "" "") (assert tmp%66#0) - let tmp%67#0: bytes = (b| 0x0f 0xf0) - let tmp%68#0: uint64 = (== tmp%67#0 0xff) - (assert tmp%68#0) - let tmp%69#0: bytes = (b^ 0x0f 0xff) - let tmp%70#0: uint64 = (== tmp%69#0 0xf0) - (assert tmp%70#0) - let y#1: bytes = (b& 0x00 0xff) - let tmp%71#0: uint64 = (== y#1 0x00) - (assert tmp%71#0) - let y#2: bytes = (b| y#1 0xff) - let tmp%72#0: uint64 = (== y#2 0xff) + let tmp%69#0: uint64 = (== "" "") + (assert tmp%69#0) + let tmp%72#0: uint64 = (== "1" "1") (assert tmp%72#0) - let y#3: bytes = (b^ y#2 0xf0) - let tmp%73#0: uint64 = (== y#3 0x0f) - (assert tmp%73#0) + let tmp%75#0: uint64 = (== "1" "1") + (assert tmp%75#0) + let tmp%78#0: uint64 = (== "1" "1") + (assert tmp%78#0) + let tmp%81#0: uint64 = (== "" "") + (assert tmp%81#0) + let tmp%89#0: uint64 = (== 0xff 0xff) + (assert tmp%89#0) + let y#3: bytes = (b^ 0xff 0xf0) + let tmp%90#0: uint64 = (== y#3 0x0f) + (assert tmp%90#0) return 1u program clear-state: subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: - block@0: // L71 + block@0: // L70 return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_4.ir b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_4.ir new file mode 100644 index 0000000000..3d2ca82fc7 --- /dev/null +++ b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_4.ir @@ -0,0 +1,33 @@ +contract examples.stubs.bytes.BytesContract: + program approval: + subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: + block@0: // L5 + let tmp%15#0: bytes = (substring3 "abc" 1u 3u) + let tmp%16#0: uint64 = (== tmp%15#0 "bc") + (assert tmp%16#0) + let tmp%22#0: bytes = (substring3 "abc" 1u 1u) + let tmp%23#0: uint64 = (== tmp%22#0 "") + (assert tmp%23#0) + let tmp%27#0: bytes = (substring3 "abc" 0u 1u) + let tmp%28#0: uint64 = (== tmp%27#0 "a") + (assert tmp%28#0) + let tmp%32#0: bytes = (substring3 "abc" 0u 2u) + let tmp%33#0: uint64 = (== tmp%32#0 "ab") + (assert tmp%33#0) + let tmp%38#0: bytes = (substring3 "abc" 1u 3u) + let tmp%39#0: uint64 = (== tmp%38#0 "bc") + (assert tmp%39#0) + let tmp%45#0: bytes = (substring3 "abc" 1u 2u) + let tmp%46#0: uint64 = (== tmp%45#0 "b") + (assert tmp%46#0) + let tmp%54#0: bytes = (substring3 "abc" 0u 3u) + let tmp%55#0: uint64 = (== tmp%54#0 "abc") + (assert tmp%55#0) + let tmp%90#0: uint64 = (== 0x0f 0x0f) + (assert tmp%90#0) + return 1u + + program clear-state: + subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_5.ir b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_5.ir new file mode 100644 index 0000000000..8da0e79be2 --- /dev/null +++ b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_5.ir @@ -0,0 +1,24 @@ +contract examples.stubs.bytes.BytesContract: + program approval: + subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: + block@0: // L5 + let tmp%16#0: uint64 = (== "bc" "bc") + (assert tmp%16#0) + let tmp%23#0: uint64 = (== "" "") + (assert tmp%23#0) + let tmp%28#0: uint64 = (== "a" "a") + (assert tmp%28#0) + let tmp%33#0: uint64 = (== "ab" "ab") + (assert tmp%33#0) + let tmp%39#0: uint64 = (== "bc" "bc") + (assert tmp%39#0) + let tmp%46#0: uint64 = (== "b" "b") + (assert tmp%46#0) + let tmp%55#0: uint64 = (== "abc" "abc") + (assert tmp%55#0) + return 1u + + program clear-state: + subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_6.ir b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..3d7cbb993c --- /dev/null +++ b/examples/stubs/out/bytes_BytesContract.ssa.opt_pass_6.ir @@ -0,0 +1,10 @@ +contract examples.stubs.bytes.BytesContract: + program approval: + subroutine examples.stubs.bytes.BytesContract.approval_program() -> uint64: + block@0: // L5 + return 1u + + program clear-state: + subroutine examples.stubs.bytes.BytesContract.clear_state_program() -> uint64: + block@0: // L70 + return 1u \ No newline at end of file diff --git a/examples/stubs/out/uint64.approval.debug.teal b/examples/stubs/out/uint64.approval.debug.teal index 1caba6bb2b..699a7fc4d2 100644 --- a/examples/stubs/out/uint64.approval.debug.teal +++ b/examples/stubs/out/uint64.approval.debug.teal @@ -1,131 +1,9 @@ -// Op // Op Description Stack (out) Source code Source line +// Op // Stack (out) Source code Source line #pragma version 8 // examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: main_block@0: - int 1 // 1 1 File "stubs/uint64.py", line 7 - assert // assert one, "Any non-zero number should be Truthy" File "stubs/uint64.py", line 13 - int 1 // 1 not zero File "stubs/uint64.py", line 14 - assert // assert not zero, "Zero should beFalsy" File "stubs/uint64.py", line 14 - int 1 // 1 one < five File "stubs/uint64.py", line 16 - assert // assert one < five File "stubs/uint64.py", line 16 - int 1 // 1 five > one File "stubs/uint64.py", line 17 - assert // assert five > one File "stubs/uint64.py", line 17 - int 1 // 1 1 File "stubs/uint64.py", line 7 - int 1 // 1,1 1 File "stubs/uint64.py", line 7 - <= // {<=} one <= one File "stubs/uint64.py", line 18 - assert // assert one <= one File "stubs/uint64.py", line 18 - int 5 // 5 5 File "stubs/uint64.py", line 9 - int 5 // 5,5 5 File "stubs/uint64.py", line 9 - >= // {>=} five >= five File "stubs/uint64.py", line 19 - assert // assert five >= five File "stubs/uint64.py", line 19 - int 1 // 1 one + five == 6 File "stubs/uint64.py", line 21 - assert // assert one + five == 6 File "stubs/uint64.py", line 21 - int 1 // 1 c == 65 File "stubs/uint64.py", line 25 - assert // assert c == 65 File "stubs/uint64.py", line 25 - int 1 // 1 sixty - five == 55 File "stubs/uint64.py", line 27 - assert // assert sixty - five == 55 File "stubs/uint64.py", line 27 - int 1 // 1 c == 60 File "stubs/uint64.py", line 29 - assert // assert c == 60 File "stubs/uint64.py", line 29 - int 1 // 1 sixty // five == 12 File "stubs/uint64.py", line 31 - assert // assert sixty // five == 12 File "stubs/uint64.py", line 31 - int 1 // 1 c == 12 File "stubs/uint64.py", line 34 - assert // assert c == 12 File "stubs/uint64.py", line 34 - int 1 // 1 five * sixty == 300 File "stubs/uint64.py", line 36 - assert // assert five * sixty == 300 File "stubs/uint64.py", line 36 - int 5 // 5 5 File "stubs/uint64.py", line 9 - int 3 // 5,3 3 File "stubs/uint64.py", line 10 - exp // {exp} five**three File "stubs/uint64.py", line 38 - int 125 // tmp%16#0,125 125 File "stubs/uint64.py", line 38 - == // {==} five**three == 125 File "stubs/uint64.py", line 38 - assert // assert five**three == 125 File "stubs/uint64.py", line 38 - int 12 // 12 c //= five File "stubs/uint64.py", line 32 - int 2 // 12,2 2 File "stubs/uint64.py", line 40 - exp // {exp} c **= 2 File "stubs/uint64.py", line 40 - dup // load c#4 from l-stack (copy) c#4,c#4 c File "stubs/uint64.py", line 40 - int 144 // c#4,c#4,144 144 File "stubs/uint64.py", line 42 - == // c#4,{==} c == 144 File "stubs/uint64.py", line 42 - assert // c#4 assert c == 144 File "stubs/uint64.py", line 42 - int 1 // c#4,1 1 File "stubs/uint64.py", line 7 - int 2 // c#4,1,2 2 File "stubs/uint64.py", line 8 - shl // c#4,{shl} one << two File "stubs/uint64.py", line 44 - int 4 // c#4,tmp%19#0,4 4 File "stubs/uint64.py", line 44 - == // c#4,{==} one << two == 4 File "stubs/uint64.py", line 44 - assert // c#4 assert one << two == 4 File "stubs/uint64.py", line 44 - int 6 // c#4,6 6 File "stubs/uint64.py", line 45 - shr // {shr} c >>= 6 File "stubs/uint64.py", line 45 - dup // load c#4 from l-stack (copy) c#4,c#4 c File "stubs/uint64.py", line 40 - int 2 // c#4,c#4,2 2 File "stubs/uint64.py", line 46 - == // c#4,{==} c == 2 File "stubs/uint64.py", line 46 - assert // c#4 assert c == 2 File "stubs/uint64.py", line 46 - int 6 // c#4,6 6 File "stubs/uint64.py", line 47 - shl // {shl} c <<= 6 File "stubs/uint64.py", line 47 - int 128 // c#4,128 128 File "stubs/uint64.py", line 48 - == // {==} c == 128 File "stubs/uint64.py", line 48 - assert // assert c == 128 File "stubs/uint64.py", line 48 - int 5 // 5 5 File "stubs/uint64.py", line 9 - int 3 // 5,3 3 File "stubs/uint64.py", line 10 - shr // {shr} five >> three File "stubs/uint64.py", line 49 - ! // {!} five >> three == 0 File "stubs/uint64.py", line 49 - assert // assert five >> three == 0 File "stubs/uint64.py", line 49 - int 1 // 1 1 File "stubs/uint64.py", line 7 - ~ // {~} ~one File "stubs/uint64.py", line 51 - int 18446744073709551614 // tmp%25#0,18446744073709551614 0xFFFFFFFFFFFFFFFE File "stubs/uint64.py", line 51 - == // {==} ~one == 0xFFFFFFFFFFFFFFFE File "stubs/uint64.py", line 51 - assert // assert ~one == 0xFFFFFFFFFFFFFFFE File "stubs/uint64.py", line 51 - int 1 // 1 true and true) == true File "stubs/uint64.py", line 55 - assert // assert (true and true) == true File "stubs/uint64.py", line 55 - int 1 // 1 true and false) == false File "stubs/uint64.py", line 56 - assert // assert (true and false) == false File "stubs/uint64.py", line 56 - int 1 // 1 false and true) == false File "stubs/uint64.py", line 57 - assert // assert (false and true) == false File "stubs/uint64.py", line 57 - int 1 // 1 false and false) == false File "stubs/uint64.py", line 58 - assert // assert (false and false) == false File "stubs/uint64.py", line 58 - int 1 // 1 true or true) == true File "stubs/uint64.py", line 59 - assert // assert (true or true) == true File "stubs/uint64.py", line 59 - int 1 // 1 true or false) == true File "stubs/uint64.py", line 60 - assert // assert (true or false) == true File "stubs/uint64.py", line 60 - int 1 // 1 false or true) == true File "stubs/uint64.py", line 61 - assert // assert (false or true) == true File "stubs/uint64.py", line 61 - int 1 // 1 false or false) == false File "stubs/uint64.py", line 62 - assert // assert (false or false) == false File "stubs/uint64.py", line 62 - int 1 // 1 1 File "stubs/uint64.py", line 7 - int 5 // 1,5 5 File "stubs/uint64.py", line 9 - & // {&} one & five File "stubs/uint64.py", line 64 - int 1 // tmp%43#0,1 1 File "stubs/uint64.py", line 7 - == // {==} one & five == one File "stubs/uint64.py", line 64 - assert // assert one & five == one File "stubs/uint64.py", line 64 - int 60 // 60 60 File "stubs/uint64.py", line 11 - int 5 // 60,5 5 File "stubs/uint64.py", line 9 - | // {|} sixty | five File "stubs/uint64.py", line 65 - int 61 // tmp%45#0,61 61 File "stubs/uint64.py", line 65 - == // {==} sixty | five == 61 File "stubs/uint64.py", line 65 - assert // assert sixty | five == 61 File "stubs/uint64.py", line 65 - int 60 // 60 60 File "stubs/uint64.py", line 11 - int 5 // 60,5 5 File "stubs/uint64.py", line 9 - ^ // {^} sixty ^ five File "stubs/uint64.py", line 66 - int 57 // tmp%47#0,57 57 File "stubs/uint64.py", line 66 - == // {==} sixty ^ five == 57 File "stubs/uint64.py", line 66 - assert // assert sixty ^ five == 57 File "stubs/uint64.py", line 66 - int 254 // 254 0b11111110 File "stubs/uint64.py", line 68 - int 31 // 254,31 0b00011111 File "stubs/uint64.py", line 69 - & // {&} y &= UInt64(0b00011111) File "stubs/uint64.py", line 69 - dup // load y#1 from l-stack (copy) y#1,y#1 y File "stubs/uint64.py", line 69 - int 30 // y#1,y#1,30 0b00011110 File "stubs/uint64.py", line 70 - == // y#1,{==} y == 0b00011110 File "stubs/uint64.py", line 70 - assert // y#1 assert y == 0b00011110 File "stubs/uint64.py", line 70 - int 54 // y#1,54 0b00110110 File "stubs/uint64.py", line 71 - | // {|} y |= 0b00110110 File "stubs/uint64.py", line 71 - dup // load y#1 from l-stack (copy) y#1,y#1 y File "stubs/uint64.py", line 69 - int 62 // y#1,y#1,62 0b00111110 File "stubs/uint64.py", line 72 - == // y#1,{==} y == 0b00111110 File "stubs/uint64.py", line 72 - assert // y#1 assert y == 0b00111110 File "stubs/uint64.py", line 72 - int 255 // y#1,255 0b11111111 File "stubs/uint64.py", line 73 - ^ // {^} y ^= 0b11111111 File "stubs/uint64.py", line 73 - int 193 // y#1,193 0b11000001 File "stubs/uint64.py", line 74 - == // {==} y == 0b11000001 File "stubs/uint64.py", line 74 - assert // assert y == 0b11000001 File "stubs/uint64.py", line 74 - int 1 // 1 1 File "stubs/uint64.py", line 76 - return // return UInt64(1) File "stubs/uint64.py", line 76 + int 1 // 1 1 File "stubs/uint64.py", line 76 + return // return UInt64(1) File "stubs/uint64.py", line 76 diff --git a/examples/stubs/out/uint64.approval.teal b/examples/stubs/out/uint64.approval.teal index b130f9c3aa..dd046a7489 100644 --- a/examples/stubs/out/uint64.approval.teal +++ b/examples/stubs/out/uint64.approval.teal @@ -2,128 +2,6 @@ // examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: main_block@0: - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - int 1 - <= - assert - int 5 - int 5 - >= - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 5 - int 3 - exp - int 125 - == - assert - int 12 - int 2 - exp - dup - int 144 - == - assert - int 1 - int 2 - shl - int 4 - == - assert - int 6 - shr - dup - int 2 - == - assert - int 6 - shl - int 128 - == - assert - int 5 - int 3 - shr - ! - assert - int 1 - ~ - int 18446744073709551614 - == - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - assert - int 1 - int 5 - & - int 1 - == - assert - int 60 - int 5 - | - int 61 - == - assert - int 60 - int 5 - ^ - int 57 - == - assert - int 254 - int 31 - & - dup - int 30 - == - assert - int 54 - | - dup - int 62 - == - assert - int 255 - ^ - int 193 - == - assert int 1 return diff --git a/examples/stubs/out/uint64.approval_unoptimized.debug.teal b/examples/stubs/out/uint64.approval_unoptimized.debug.teal index dda5e96872..1eb89e5a25 100644 --- a/examples/stubs/out/uint64.approval_unoptimized.debug.teal +++ b/examples/stubs/out/uint64.approval_unoptimized.debug.teal @@ -21,10 +21,10 @@ main_block@0: cover 4 // store sixty#0 to l-stack (copy) (𝕗) one#0,five#0 | two#0,three#0,sixty#0,five#0,zero#0,one#0,sixty#0 sixty File "stubs/uint64.py", line 11 cover 6 // store sixty#0 to f-stack (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,zero#0,one#0 sixty File "stubs/uint64.py", line 11 dup // load one#0 from l-stack (copy) (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,zero#0,one#0,one#0 one File "stubs/uint64.py", line 7 - assert // (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,zero#0,one#0 assert one, "Any non-zero number should be Truthy" File "stubs/uint64.py", line 13 - uncover 1 // load zero#0 from l-stack (no copy) (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0,zero#0 zero File "stubs/uint64.py", line 6 + assert // Any non-zero number should be Truthy // (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,zero#0,one#0 assert one, "Any non-zero number should be Truthy" File "stubs/uint64.py", line 13 + swap // load zero#0 from l-stack (no copy) (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0,zero#0 zero File "stubs/uint64.py", line 6 ! // (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0,{!} not zero File "stubs/uint64.py", line 14 - assert // (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0 assert not zero, "Zero should beFalsy" File "stubs/uint64.py", line 14 + assert // Zero should beFalsy // (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0 assert not zero, "Zero should beFalsy" File "stubs/uint64.py", line 14 dup // load one#0 from l-stack (copy) (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0,one#0 one File "stubs/uint64.py", line 7 dig 2 // load five#0 from l-stack (copy) (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0,one#0,five#0 five File "stubs/uint64.py", line 9 < // (𝕗) one#0,five#0,sixty#0 | two#0,three#0,sixty#0,five#0,one#0,{<} one < five File "stubs/uint64.py", line 16 @@ -113,7 +113,7 @@ main_block@0: int 128 // (𝕗) one#0,five#0,sixty#0 | three#0,five#0,one#0,c#0,128 128 File "stubs/uint64.py", line 48 == // (𝕗) one#0,five#0,sixty#0 | three#0,five#0,one#0,{==} c == 128 File "stubs/uint64.py", line 48 assert // (𝕗) one#0,five#0,sixty#0 | three#0,five#0,one#0 assert c == 128 File "stubs/uint64.py", line 48 - uncover 1 // load five#0 from l-stack (no copy) (𝕗) one#0,five#0,sixty#0 | three#0,one#0,five#0 five File "stubs/uint64.py", line 9 + swap // load five#0 from l-stack (no copy) (𝕗) one#0,five#0,sixty#0 | three#0,one#0,five#0 five File "stubs/uint64.py", line 9 uncover 2 // load three#0 from l-stack (no copy) (𝕗) one#0,five#0,sixty#0 | one#0,five#0,three#0 three File "stubs/uint64.py", line 10 shr // (𝕗) one#0,five#0,sixty#0 | one#0,{shr} five >> three File "stubs/uint64.py", line 49 int 0 // (𝕗) one#0,five#0,sixty#0 | one#0,tmp%23#0,0 0 File "stubs/uint64.py", line 49 @@ -125,9 +125,9 @@ main_block@0: assert // (𝕗) one#0,five#0,sixty#0 | assert ~one == 0xFFFFFFFFFFFFFFFE File "stubs/uint64.py", line 51 int 1 // (𝕗) one#0,five#0,sixty#0 | 1 1 File "stubs/uint64.py", line 53 dup // store true#0 to l-stack (copy) (𝕗) one#0,five#0,sixty#0 | true#0,true#0 true File "stubs/uint64.py", line 53 - cover 1 // store true#0 to f-stack (𝕗) one#0,five#0,sixty#0,true#0 | true#0 true File "stubs/uint64.py", line 53 + swap // store true#0 to f-stack (𝕗) one#0,five#0,sixty#0,true#0 | true#0 true File "stubs/uint64.py", line 53 int 0 // (𝕗) one#0,five#0,sixty#0,true#0 | true#0,0 0 File "stubs/uint64.py", line 54 - cover 1 // store false#0 to f-stack (𝕗) one#0,five#0,sixty#0,true#0,false#0 | true#0 false File "stubs/uint64.py", line 54 + swap // store false#0 to f-stack (𝕗) one#0,five#0,sixty#0,true#0,false#0 | true#0 false File "stubs/uint64.py", line 54 bnz main_ternary_false@2 // (𝕗) one#0,five#0,sixty#0,true#0,false#0 | true and true File "stubs/uint64.py", line 55 // Implicit fall through to main_ternary_true@1 // (𝕗) one#0,five#0,sixty#0,true#0,false#0 | true and true File "stubs/uint64.py", line 55 diff --git a/examples/stubs/out/uint64.approval_unoptimized.teal b/examples/stubs/out/uint64.approval_unoptimized.teal index 06b03ce067..8cfeb024e8 100644 --- a/examples/stubs/out/uint64.approval_unoptimized.teal +++ b/examples/stubs/out/uint64.approval_unoptimized.teal @@ -19,10 +19,10 @@ main_block@0: cover 4 cover 6 dup - assert - uncover 1 + assert // Any non-zero number should be Truthy + swap ! - assert + assert // Zero should beFalsy dup dig 2 < @@ -111,7 +111,7 @@ main_block@0: int 128 == assert - uncover 1 + swap uncover 2 shr int 0 @@ -123,9 +123,9 @@ main_block@0: assert int 1 dup - cover 1 + swap int 0 - cover 1 + swap bnz main_ternary_false@2 main_ternary_true@1: diff --git a/examples/stubs/out/uint64.awst b/examples/stubs/out/uint64.awst index db36858ee8..d67197b2e4 100644 --- a/examples/stubs/out/uint64.awst +++ b/examples/stubs/out/uint64.awst @@ -37,14 +37,14 @@ contract Uint64Contract assert(~(one) == 18446744073709551614u) true: algopy.UInt64 = 1u false: algopy.UInt64 = 0u - assert(!(reinterpret_cast(true)) ? true : true == true) - assert(!(reinterpret_cast(true)) ? true : false == false) - assert(!(reinterpret_cast(false)) ? false : true == false) - assert(!(reinterpret_cast(false)) ? false : false == false) - assert(reinterpret_cast(true) ? true : true == true) - assert(reinterpret_cast(true) ? true : false == true) - assert(reinterpret_cast(false) ? false : true == true) - assert(reinterpret_cast(false) ? false : false == false) + assert((!(reinterpret_cast(true))) ? (true) : (true) == true) + assert((!(reinterpret_cast(true))) ? (true) : (false) == false) + assert((!(reinterpret_cast(false))) ? (false) : (true) == false) + assert((!(reinterpret_cast(false))) ? (false) : (false) == false) + assert((reinterpret_cast(true)) ? (true) : (true) == true) + assert((reinterpret_cast(true)) ? (true) : (false) == true) + assert((reinterpret_cast(false)) ? (false) : (true) == true) + assert((reinterpret_cast(false)) ? (false) : (false) == false) assert(one & five == one) assert(sixty | five == 61u) assert(sixty ^ five == 57u) diff --git a/examples/stubs/out/uint64_Uint64Contract.cssa.ir b/examples/stubs/out/uint64_Uint64Contract.cssa.ir index cd13286539..2a4cecb52b 100644 --- a/examples/stubs/out/uint64_Uint64Contract.cssa.ir +++ b/examples/stubs/out/uint64_Uint64Contract.cssa.ir @@ -2,68 +2,6 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) - (assert tmp%17#0) - let c#4: uint64 = (exp 12u 2u) - let tmp%18#0: uint64 = (== c#4 144u) - (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) - (assert tmp%20#0) - let c#5: uint64 = (shr c#4 6u) - let tmp%21#0: uint64 = (== c#5 2u) - (assert tmp%21#0) - let c#6: uint64 = (shl c#5 6u) - let tmp%22#0: uint64 = (== c#6 128u) - (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) - (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) - (assert tmp%26#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) - (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) - (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) - (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) - (assert tmp%49#0) - let y#2: uint64 = (| y#1 54u) - let tmp%50#0: uint64 = (== y#2 62u) - (assert tmp%50#0) - let y#3: uint64 = (^ y#2 255u) - let tmp%51#0: uint64 = (== y#3 193u) - (assert tmp%51#0) return 1u program clear-state: diff --git a/examples/stubs/out/uint64_Uint64Contract.final.ir b/examples/stubs/out/uint64_Uint64Contract.final.ir index 213eef0702..2a4cecb52b 100644 --- a/examples/stubs/out/uint64_Uint64Contract.final.ir +++ b/examples/stubs/out/uint64_Uint64Contract.final.ir @@ -2,68 +2,6 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) - (assert tmp%17#0) - let c#4: uint64 = (exp 12u 2u) - let tmp%18#0: uint64 = (== c#4 144u) - (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) - (assert tmp%20#0) - let c#4: uint64 = (shr c#4 6u) - let tmp%21#0: uint64 = (== c#4 2u) - (assert tmp%21#0) - let c#4: uint64 = (shl c#4 6u) - let tmp%22#0: uint64 = (== c#4 128u) - (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) - (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) - (assert tmp%26#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) - (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) - (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) - (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) - (assert tmp%49#0) - let y#1: uint64 = (| y#1 54u) - let tmp%50#0: uint64 = (== y#1 62u) - (assert tmp%50#0) - let y#1: uint64 = (^ y#1 255u) - let tmp%51#0: uint64 = (== y#1 193u) - (assert tmp%51#0) return 1u program clear-state: diff --git a/examples/stubs/out/uint64_Uint64Contract.parallel_copies.ir b/examples/stubs/out/uint64_Uint64Contract.parallel_copies.ir index cd13286539..2a4cecb52b 100644 --- a/examples/stubs/out/uint64_Uint64Contract.parallel_copies.ir +++ b/examples/stubs/out/uint64_Uint64Contract.parallel_copies.ir @@ -2,68 +2,6 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) - (assert tmp%17#0) - let c#4: uint64 = (exp 12u 2u) - let tmp%18#0: uint64 = (== c#4 144u) - (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) - (assert tmp%20#0) - let c#5: uint64 = (shr c#4 6u) - let tmp%21#0: uint64 = (== c#5 2u) - (assert tmp%21#0) - let c#6: uint64 = (shl c#5 6u) - let tmp%22#0: uint64 = (== c#6 128u) - (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) - (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) - (assert tmp%26#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) - (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) - (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) - (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) - (assert tmp%49#0) - let y#2: uint64 = (| y#1 54u) - let tmp%50#0: uint64 = (== y#2 62u) - (assert tmp%50#0) - let y#3: uint64 = (^ y#2 255u) - let tmp%51#0: uint64 = (== y#3 193u) - (assert tmp%51#0) return 1u program clear-state: diff --git a/examples/stubs/out/uint64_Uint64Contract.post_ssa.ir b/examples/stubs/out/uint64_Uint64Contract.post_ssa.ir index cd13286539..2a4cecb52b 100644 --- a/examples/stubs/out/uint64_Uint64Contract.post_ssa.ir +++ b/examples/stubs/out/uint64_Uint64Contract.post_ssa.ir @@ -2,68 +2,6 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) - (assert tmp%17#0) - let c#4: uint64 = (exp 12u 2u) - let tmp%18#0: uint64 = (== c#4 144u) - (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) - (assert tmp%20#0) - let c#5: uint64 = (shr c#4 6u) - let tmp%21#0: uint64 = (== c#5 2u) - (assert tmp%21#0) - let c#6: uint64 = (shl c#5 6u) - let tmp%22#0: uint64 = (== c#6 128u) - (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) - (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) - (assert tmp%26#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) - (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) - (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) - (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) - (assert tmp%49#0) - let y#2: uint64 = (| y#1 54u) - let tmp%50#0: uint64 = (== y#2 62u) - (assert tmp%50#0) - let y#3: uint64 = (^ y#2 255u) - let tmp%51#0: uint64 = (== y#3 193u) - (assert tmp%51#0) return 1u program clear-state: diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_1.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_1.ir index c6d1945217..ff7da4bd05 100644 --- a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_1.ir +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_1.ir @@ -2,17 +2,12 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy let tmp%0#0: uint64 = (! 0u) (assert tmp%0#0) // Zero should beFalsy let tmp%1#0: uint64 = (< 1u 5u) (assert tmp%1#0) let tmp%2#0: uint64 = (> 5u 1u) (assert tmp%2#0) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) let tmp%5#0: uint64 = (+ 1u 5u) let tmp%6#0: uint64 = (== tmp%5#0 6u) (assert tmp%6#0) diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_2.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_2.ir index 1eaad2f3b8..289b1447ab 100644 --- a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_2.ir +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_2.ir @@ -2,14 +2,6 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) let tmp%6#0: uint64 = (== 6u 6u) (assert tmp%6#0) let tmp%7#0: uint64 = (== 65u 65u) @@ -26,14 +18,12 @@ contract examples.stubs.uint64.Uint64Contract: (assert tmp%13#0) let tmp%15#0: uint64 = (== 300u 300u) (assert tmp%15#0) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) + let tmp%17#0: uint64 = (== 125u 125u) (assert tmp%17#0) let c#4: uint64 = (exp c#3 2u) let tmp%18#0: uint64 = (== c#4 144u) (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) + let tmp%20#0: uint64 = (== 4u 4u) (assert tmp%20#0) let c#5: uint64 = (shr c#4 6u) let tmp%21#0: uint64 = (== c#5 2u) @@ -41,11 +31,9 @@ contract examples.stubs.uint64.Uint64Contract: let c#6: uint64 = (shl c#5 6u) let tmp%22#0: uint64 = (== c#6 128u) (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) + let tmp%24#0: uint64 = (! 0u) (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) + let tmp%26#0: uint64 = (== 18446744073709551614u 18446744073709551614u) (assert tmp%26#0) let tmp%28#0: uint64 = (== 1u 1u) (assert tmp%28#0) @@ -63,19 +51,15 @@ contract examples.stubs.uint64.Uint64Contract: (assert tmp%40#0) let tmp%42#0: uint64 = (! 0u) (assert tmp%42#0) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) + let tmp%44#0: uint64 = (== 1u 1u) (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) + let tmp%46#0: uint64 = (== 61u 61u) (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) + let tmp%48#0: uint64 = (== 57u 57u) (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) + let tmp%49#0: uint64 = (== 30u 30u) (assert tmp%49#0) - let y#2: uint64 = (| y#1 54u) + let y#2: uint64 = (| 30u 54u) let tmp%50#0: uint64 = (== y#2 62u) (assert tmp%50#0) let y#3: uint64 = (^ y#2 255u) diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_3.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_3.ir index d50a99ab66..a9e7df557f 100644 --- a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_3.ir +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_3.ir @@ -2,69 +2,23 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) - (assert 1u) - (assert 1u) - (assert 1u) let tmp%10#0: uint64 = (== 60u 60u) (assert tmp%10#0) - (assert 1u) let c#3: uint64 = (/ 60u 5u) let tmp%13#0: uint64 = (== c#3 12u) (assert tmp%13#0) - (assert 1u) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) - (assert tmp%17#0) let c#4: uint64 = (exp c#3 2u) let tmp%18#0: uint64 = (== c#4 144u) (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) - (assert tmp%20#0) let c#5: uint64 = (shr c#4 6u) let tmp%21#0: uint64 = (== c#5 2u) (assert tmp%21#0) let c#6: uint64 = (shl c#5 6u) let tmp%22#0: uint64 = (== c#6 128u) (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) - (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) - (assert tmp%26#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) - (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) - (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) - (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) - (assert tmp%49#0) - let y#2: uint64 = (| y#1 54u) - let tmp%50#0: uint64 = (== y#2 62u) + let tmp%50#0: uint64 = (== 62u 62u) (assert tmp%50#0) - let y#3: uint64 = (^ y#2 255u) + let y#3: uint64 = (^ 62u 255u) let tmp%51#0: uint64 = (== y#3 193u) (assert tmp%51#0) return 1u diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_4.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_4.ir index 3589a5d3f1..3a6c8b1b99 100644 --- a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_4.ir +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_4.ir @@ -2,68 +2,18 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) let tmp%13#0: uint64 = (== 12u 12u) (assert tmp%13#0) - (assert 1u) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) - (assert tmp%17#0) let c#4: uint64 = (exp 12u 2u) let tmp%18#0: uint64 = (== c#4 144u) (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) - (assert tmp%20#0) let c#5: uint64 = (shr c#4 6u) let tmp%21#0: uint64 = (== c#5 2u) (assert tmp%21#0) let c#6: uint64 = (shl c#5 6u) let tmp%22#0: uint64 = (== c#6 128u) (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) - (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) - (assert tmp%26#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) - (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) - (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) - (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) - (assert tmp%49#0) - let y#2: uint64 = (| y#1 54u) - let tmp%50#0: uint64 = (== y#2 62u) - (assert tmp%50#0) - let y#3: uint64 = (^ y#2 255u) - let tmp%51#0: uint64 = (== y#3 193u) + let tmp%51#0: uint64 = (== 193u 193u) (assert tmp%51#0) return 1u diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_5.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_5.ir index cd13286539..743bea7779 100644 --- a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_5.ir +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_5.ir @@ -2,68 +2,14 @@ contract examples.stubs.uint64.Uint64Contract: program approval: subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: block@0: // L5 - (assert 1u) // Any non-zero number should be Truthy - (assert 1u) // Zero should beFalsy - (assert 1u) - (assert 1u) - let tmp%3#0: uint64 = (<= 1u 1u) - (assert tmp%3#0) - let tmp%4#0: uint64 = (>= 5u 5u) - (assert tmp%4#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%16#0: uint64 = (exp 5u 3u) - let tmp%17#0: uint64 = (== tmp%16#0 125u) - (assert tmp%17#0) - let c#4: uint64 = (exp 12u 2u) - let tmp%18#0: uint64 = (== c#4 144u) + let tmp%18#0: uint64 = (== 144u 144u) (assert tmp%18#0) - let tmp%19#0: uint64 = (shl 1u 2u) - let tmp%20#0: uint64 = (== tmp%19#0 4u) - (assert tmp%20#0) - let c#5: uint64 = (shr c#4 6u) + let c#5: uint64 = (shr 144u 6u) let tmp%21#0: uint64 = (== c#5 2u) (assert tmp%21#0) let c#6: uint64 = (shl c#5 6u) let tmp%22#0: uint64 = (== c#6 128u) (assert tmp%22#0) - let tmp%23#0: uint64 = (shr 5u 3u) - let tmp%24#0: uint64 = (! tmp%23#0) - (assert tmp%24#0) - let tmp%25#0: uint64 = (~ 1u) - let tmp%26#0: uint64 = (== tmp%25#0 18446744073709551614u) - (assert tmp%26#0) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - (assert 1u) - let tmp%43#0: uint64 = (& 1u 5u) - let tmp%44#0: uint64 = (== tmp%43#0 1u) - (assert tmp%44#0) - let tmp%45#0: uint64 = (| 60u 5u) - let tmp%46#0: uint64 = (== tmp%45#0 61u) - (assert tmp%46#0) - let tmp%47#0: uint64 = (^ 60u 5u) - let tmp%48#0: uint64 = (== tmp%47#0 57u) - (assert tmp%48#0) - let y#1: uint64 = (& 254u 31u) - let tmp%49#0: uint64 = (== y#1 30u) - (assert tmp%49#0) - let y#2: uint64 = (| y#1 54u) - let tmp%50#0: uint64 = (== y#2 62u) - (assert tmp%50#0) - let y#3: uint64 = (^ y#2 255u) - let tmp%51#0: uint64 = (== y#3 193u) - (assert tmp%51#0) return 1u program clear-state: diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_6.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_6.ir new file mode 100644 index 0000000000..d833ea658f --- /dev/null +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_6.ir @@ -0,0 +1,15 @@ +contract examples.stubs.uint64.Uint64Contract: + program approval: + subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: + block@0: // L5 + let tmp%21#0: uint64 = (== 2u 2u) + (assert tmp%21#0) + let c#6: uint64 = (shl 2u 6u) + let tmp%22#0: uint64 = (== c#6 128u) + (assert tmp%22#0) + return 1u + + program clear-state: + subroutine examples.stubs.uint64.Uint64Contract.clear_state_program() -> uint64: + block@0: // L78 + return 1u \ No newline at end of file diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_7.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_7.ir new file mode 100644 index 0000000000..c9c11dc76c --- /dev/null +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_7.ir @@ -0,0 +1,12 @@ +contract examples.stubs.uint64.Uint64Contract: + program approval: + subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: + block@0: // L5 + let tmp%22#0: uint64 = (== 128u 128u) + (assert tmp%22#0) + return 1u + + program clear-state: + subroutine examples.stubs.uint64.Uint64Contract.clear_state_program() -> uint64: + block@0: // L78 + return 1u \ No newline at end of file diff --git a/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_8.ir b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_8.ir new file mode 100644 index 0000000000..2a4cecb52b --- /dev/null +++ b/examples/stubs/out/uint64_Uint64Contract.ssa.opt_pass_8.ir @@ -0,0 +1,10 @@ +contract examples.stubs.uint64.Uint64Contract: + program approval: + subroutine examples.stubs.uint64.Uint64Contract.approval_program() -> uint64: + block@0: // L5 + return 1u + + program clear-state: + subroutine examples.stubs.uint64.Uint64Contract.clear_state_program() -> uint64: + block@0: // L78 + return 1u \ No newline at end of file diff --git a/examples/transaction/algopy.log b/examples/transaction/algopy.log new file mode 100644 index 0000000000..618933017f --- /dev/null +++ b/examples/transaction/algopy.log @@ -0,0 +1,673 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug transaction +debug: Building AWST for __init__.py +debug: Building AWST for transaction +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for transaction/contract.py +debug: Sealing block@0: // L18 +debug: Terminated block@0: // L18 +debug: Sealing block@0: // L37 +debug: Terminated block@0: // L37 +debug: Sealing block@0: // L22 +debug: Terminated block@0: // L22 +debug: Sealing block@0: // L46 +debug: Terminated block@0: // L46 +debug: Sealing block@0: // L57 +debug: Terminated block@0: // L57 +debug: Sealing block@0: // L74 +debug: Terminated block@0: // L74 +debug: Sealing block@0: // L83 +debug: Terminated block@0: // L83 +debug: Sealing block@0: // L91 +debug: Terminated block@0: // L91 +debug: Sealing block@0: // L16 +debug: Terminated block@0: // L16 +debug: Sealing block@None: // abi_routing_L16 +debug: Sealing block@None: // else_body_L16 +debug: Terminated block@1: // abi_routing_L16 +debug: Sealing block@None: // switch_case_default_L16 +debug: Sealing block@None: // create_route_L17 +debug: Sealing block@None: // pay_route_L36 +debug: Sealing block@None: // key_route_L45 +debug: Sealing block@None: // asset_config_route_L56 +debug: Sealing block@None: // asset_transfer_route_L73 +debug: Sealing block@None: // asset_freeze_route_L82 +debug: Sealing block@None: // application_call_route_L90 +debug: Terminated block@2: // create_route_L17 +debug: Terminated block@3: // pay_route_L36 +debug: Terminated block@4: // key_route_L45 +debug: Terminated block@5: // asset_config_route_L56 +debug: Terminated block@6: // asset_transfer_route_L73 +debug: Terminated block@7: // asset_freeze_route_L82 +debug: Terminated block@8: // application_call_route_L90 +debug: Terminated block@9: // switch_case_default_L16 +debug: Sealing block@10: // switch_case_next_L16 +debug: Terminated block@10: // switch_case_next_L16 +debug: Sealing block@11: // after_if_else_L16 +debug: Terminated block@11: // after_if_else_L16 +debug: Sealing block@0: // L16 +debug: Terminated block@0: // L16 +debug: Output IR to /examples/transaction/out/contract_TransactionContract.ssa.ir +info: Optimizing examples.transaction.contract.TransactionContract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%12#0, maybe_value%9#0 +debug: Replacing {maybe_value%9#0} with awst_tmp%12#0 made 1 modifications +debug: Found equivalence set: tmp%14#0, maybe_value_did_exist%10#0 +debug: Replacing {maybe_value_did_exist%10#0} with tmp%14#0 made 1 modifications +debug: Found equivalence set: awst_tmp%12#1, maybe_value%18#0 +debug: Replacing {maybe_value%18#0} with awst_tmp%12#1 made 1 modifications +debug: Found equivalence set: tmp%22#0, maybe_value_did_exist%19#0 +debug: Replacing {maybe_value_did_exist%19#0} with tmp%22#0 made 1 modifications +debug: Found equivalence set: awst_tmp%12#2, maybe_value%26#0 +debug: Replacing {maybe_value%26#0} with awst_tmp%12#2 made 1 modifications +debug: Found equivalence set: tmp%30#0, maybe_value_did_exist%27#0 +debug: Replacing {maybe_value_did_exist%27#0} with tmp%30#0 made 1 modifications +debug: Found equivalence set: awst_tmp%12#3, maybe_value%34#0 +debug: Replacing {maybe_value%34#0} with awst_tmp%12#3 made 1 modifications +debug: Found equivalence set: tmp%38#0, maybe_value_did_exist%35#0 +debug: Replacing {maybe_value_did_exist%35#0} with tmp%38#0 made 1 modifications +debug: Found equivalence set: awst_tmp%12#4, maybe_value%42#0 +debug: Replacing {maybe_value%42#0} with awst_tmp%12#4 made 1 modifications +debug: Found equivalence set: tmp%46#0, maybe_value_did_exist%43#0 +debug: Replacing {maybe_value_did_exist%43#0} with tmp%46#0 made 1 modifications +debug: Found equivalence set: awst_tmp%12#5, maybe_value%50#0 +debug: Replacing {maybe_value%50#0} with awst_tmp%12#5 made 1 modifications +debug: Found equivalence set: tmp%54#0, maybe_value_did_exist%51#0 +debug: Replacing {maybe_value_did_exist%51#0} with tmp%54#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@10: // switch_case_next_L16 with block@9: // switch_case_default_L16 in block@11: // after_if_else_L16 +debug: Merged linear block@10: // switch_case_next_L16 into block@9: // switch_case_default_L16 +debug: Optimizer: Remove Empty Blocks +debug: Removed empty block: block@9: // switch_case_default_L16 +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.create +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.pay +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract._common_checks +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.key +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.asset_config +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.asset_transfer +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.asset_freeze +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.application_call +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/transaction/out/contract_TransactionContract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.create +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.pay +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract._common_checks +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.key +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.asset_config +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.asset_transfer +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.asset_freeze +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.application_call +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.transaction.contract.TransactionContract.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 2, ending loop +debug: Output IR to /examples/transaction/out/contract_TransactionContract.cssa.ir +debug: Removing Phis from examples.transaction.contract.TransactionContract.approval_program +debug: Removing Phis from examples.transaction.contract.TransactionContract.create +debug: Removing Phis from examples.transaction.contract.TransactionContract.pay +debug: Removing Phis from examples.transaction.contract.TransactionContract._common_checks +debug: Removing Phis from examples.transaction.contract.TransactionContract.key +debug: Removing Phis from examples.transaction.contract.TransactionContract.asset_config +debug: Removing Phis from examples.transaction.contract.TransactionContract.asset_transfer +debug: Removing Phis from examples.transaction.contract.TransactionContract.asset_freeze +debug: Removing Phis from examples.transaction.contract.TransactionContract.application_call +debug: Removing Phis from examples.transaction.contract.TransactionContract.clear_state_program +debug: Output IR to /examples/transaction/out/contract_TransactionContract.post_ssa.ir +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.approval_program +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.create +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.pay +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract._common_checks +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.key +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.asset_config +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.asset_transfer +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.asset_freeze +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.application_call +debug: Sequentializing parallel copies in examples.transaction.contract.TransactionContract.clear_state_program +debug: Output IR to /examples/transaction/out/contract_TransactionContract.parallel_copies.ir +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.approval_program using strategy RootOperandGrouping +debug: Coalescing awst_tmp%12#0 with [awst_tmp%12#1, awst_tmp%12#2, awst_tmp%12#3, awst_tmp%12#4, awst_tmp%12#5] +debug: Coalescing resulted in 15 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.create using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.pay using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract._common_checks using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.key using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.asset_config using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.asset_transfer using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.asset_freeze using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.application_call using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.transaction.contract.TransactionContract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/transaction/out/contract_TransactionContract.final.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[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_create_route@2.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_create_route@2.ops[3]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_create_route@2.ops[5]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_create_route@2.ops[7]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_create_route@2.ops[10]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_create_route@2.ops[12]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_create_route@2.ops[14]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_create_route@2.ops[16]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[1]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[3]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[5]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[7]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[10]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[12]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[15]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[17]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[20]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[22]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[24]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[26]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[29]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[31]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_pay_route@3.ops[23]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_pay_route@3.ops[34]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[1]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[3]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[5]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[7]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[10]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[12]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[15]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[17]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[20]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[22]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[24]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[26]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[29]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[31]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_key_route@4.ops[23]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_key_route@4.ops[34]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[1]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[3]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[5]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[7]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[10]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[12]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[15]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[17]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[20]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[22]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[24]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[26]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[29]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[31]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_asset_config_route@5.ops[23]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_asset_config_route@5.ops[34]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[1]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[3]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[5]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[7]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[10]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[12]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[15]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[17]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[20]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[22]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[24]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[26]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[29]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[31]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted main_asset_transfer_route@6.ops[23]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_asset_transfer_route@6.ops[34]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[1]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[3]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[5]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[7]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[10]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[12]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[15]: 'store tmp%44#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[17]: 'load tmp%44#0' with 'load tmp%44#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[20]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[22]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[24]: 'store tmp%45#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[26]: 'load tmp%45#0' with 'load tmp%45#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[29]: 'store tmp%46#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[31]: 'load tmp%46#0' with 'load tmp%46#0 from l-stack (no copy)' +debug: Inserted main_asset_freeze_route@7.ops[23]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_asset_freeze_route@7.ops[34]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[1]: 'store tmp%47#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[3]: 'load tmp%47#0' with 'load tmp%47#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[5]: 'store tmp%48#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[7]: 'load tmp%48#0' with 'load tmp%48#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[10]: 'store tmp%49#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[12]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[15]: 'store tmp%52#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[17]: 'load tmp%52#0' with 'load tmp%52#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[20]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[22]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[24]: 'store tmp%53#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[26]: 'load tmp%53#0' with 'load tmp%53#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[29]: 'store tmp%54#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[31]: 'load tmp%54#0' with 'load tmp%54#0 from l-stack (no copy)' +debug: Inserted main_application_call_route@8.ops[23]: 'store awst_tmp%12#0 to l-stack (copy)' +debug: Replaced main_application_call_route@8.ops[34]: 'load awst_tmp%12#0' with 'load awst_tmp%12#0 from l-stack (no copy)' +debug: Found 1 edge set/s for examples.transaction.contract.TransactionContract.approval_program +debug: Inserted pay_block@0.ops[10]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted pay_block@0.ops[16]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[18]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted pay_block@0.ops[21]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[23]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted pay_block@0.ops[33]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[35]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted pay_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[9]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted pay_block@0.ops[30]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[33]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted pay_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[9]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted pay_block@0.ops[29]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced pay_block@0.ops[34]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[8]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[18]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[20]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[24]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[26]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[30]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[32]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[36]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[38]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[40]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[42]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[46]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[48]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[51]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[53]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[57]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[59]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[61]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[63]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[67]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[69]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[73]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[75]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[79]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[81]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[85]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[87]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[89]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[91]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[101]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[103]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[14]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[17]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[98]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[101]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[12]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[17]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted _common_checks_block@0.ops[97]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced _common_checks_block@0.ops[102]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[10]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[22]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[24]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[28]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[30]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[34]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[36]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[40]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[42]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[46]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[48]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[52]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[54]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[56]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[58]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[9]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[19]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[22]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[9]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted key_block@0.ops[18]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced key_block@0.ops[23]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[16]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[18]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[22]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[24]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[28]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[30]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[32]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[34]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[38]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[40]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[42]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[44]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[48]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[50]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[52]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[54]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[58]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[60]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[62]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[64]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[74]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[76]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[86]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[88]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[98]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[100]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[110]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[112]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[70]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[73]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[83]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[86]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[96]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[99]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[109]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[112]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[68]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[73]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[82]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[87]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[96]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[101]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted asset_config_block@0.ops[110]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced asset_config_block@0.ops[115]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[22]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[24]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[34]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[36]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[46]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[48]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[18]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[21]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[31]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[34]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[44]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[47]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[16]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[21]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[30]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[35]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted asset_transfer_block@0.ops[44]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced asset_transfer_block@0.ops[49]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted asset_freeze_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced asset_freeze_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted asset_freeze_block@0.ops[16]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced asset_freeze_block@0.ops[18]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted asset_freeze_block@0.ops[22]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced asset_freeze_block@0.ops[24]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted asset_freeze_block@0.ops[12]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced asset_freeze_block@0.ops[15]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted asset_freeze_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced asset_freeze_block@0.ops[15]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[6]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[16]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[18]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[22]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[24]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[28]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[30]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[32]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[34]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[38]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[40]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[42]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[44]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[48]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[50]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[54]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[56]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[60]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[62]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[66]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[68]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[72]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[74]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[78]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[80]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[84]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[86]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[90]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[92]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[94]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[96]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[100]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[102]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[106]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[108]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[113]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[115]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[117]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[119]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[130]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[132]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[137]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[139]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[144]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[146]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[151]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[153]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[155]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[157]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[162]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[164]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[166]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[168]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[126]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[129]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted application_call_block@0.ops[124]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced application_call_block@0.ops[129]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +info: Writing transaction/out/contract.approval.teal +info: Writing transaction/out/contract.approval.debug.teal +info: Writing transaction/out/contract.clear.teal +info: Writing transaction/out/contract.clear.debug.teal +info: Writing transaction/out/application.json +>> exit code = 0 \ No newline at end of file diff --git a/examples/transaction/contract.py b/examples/transaction/contract.py new file mode 100644 index 0000000000..26c86322bf --- /dev/null +++ b/examples/transaction/contract.py @@ -0,0 +1,114 @@ +from algopy import ( + Global, + PaymentTransaction, + KeyRegistrationTransaction, + AssetConfigTransaction, + AssetTransferTransaction, + AssetFreezeTransaction, + ApplicationCallTransaction, + TransactionBase, + arc4, + subroutine, + Bytes, +) + + +class TransactionContract(arc4.ARC4Contract): + @arc4.abimethod(create=True) + def create(self) -> None: + pass + + @subroutine + def _common_checks(self, txn: TransactionBase) -> None: + assert txn.txn_id, "txn_id" + assert txn.sender == Global.creator_address(), "sender" + assert txn.fee, "fee" + assert txn.type, "type" + assert txn.type_bytes, "type_bytes" + assert txn.note == Bytes(b""), "note" + assert txn.group_index == 0, "group_index" + assert txn.first_valid, "first_valid" + assert txn.first_valid_time, "first_valid_time" + assert txn.last_valid, "last_valid" + assert txn.lease, "lease" + assert txn.rekey_to == Global.zero_address(), "rekey_to" + + @arc4.abimethod + def pay(self, txn: PaymentTransaction) -> None: + self._common_checks(txn) + assert ( + txn.receiver == Global.current_application_address() + ), "Payment should be for this app" + assert txn.amount > 1000, "Payment should be for >1000 micro algos" + assert txn.close_remainder_to == Global.zero_address(), "close_remainder_to" + + @arc4.abimethod + def key(self, txn: KeyRegistrationTransaction) -> None: + self._common_checks(txn) + assert txn.vote_key, "vote_key" + assert txn.selection_key, "selection_key" + assert txn.vote_key_dilution, "vote_key_dilution" + assert txn.vote_first, "vote_first" + assert txn.vote_last, "vote_last" + assert txn.non_participation, "non_participation" + assert txn.state_proof_key, "state_proof_key" + + @arc4.abimethod + def asset_config(self, txn: AssetConfigTransaction) -> None: + self._common_checks(txn) + + assert txn.config_asset, "config_asset" + assert txn.total, "total" + assert txn.decimals, "decimals" + assert txn.default_frozen, "default_frozen" + assert txn.unit_name, "unit_name" + assert txn.asset_name, "asset_name" + assert txn.url, "url" + assert txn.metadata_hash, "metadata_hash" + assert txn.manager, "manager" + assert txn.reserve, "reserve" + assert txn.freeze, "freeze" + assert txn.clawback, "clawback" + + @arc4.abimethod + def asset_transfer(self, txn: AssetTransferTransaction) -> None: + self._common_checks(txn) + assert txn.xfer_asset, "xfer_asset" + assert txn.asset_amount, "asset_amount" + assert txn.asset_sender, "asset_sender" + assert txn.asset_receiver, "asset_receiver" + assert txn.asset_close_to, "asset_close_to" + + @arc4.abimethod + def asset_freeze(self, txn: AssetFreezeTransaction) -> None: + self._common_checks(txn) + + assert txn.freeze_asset, "freeze_asset" + assert txn.freeze_account, "freeze_account" + assert txn.frozen, "frozen" + + @arc4.abimethod + def application_call(self, txn: ApplicationCallTransaction) -> None: + self._common_checks(txn) + assert txn.application_id, "application_id" + assert txn.on_completion, "on_completion" + assert txn.num_app_args, "num_app_args" + assert txn.num_accounts, "num_accounts" + assert txn.approval_program, "approval_program" + assert txn.clear_state_program, "clear_state_program" + assert txn.num_assets, "num_assets" + assert txn.num_applications, "num_applications" + assert txn.global_num_uint, "global_num_uint" + assert txn.global_num_byte_slice, "global_num_byte_slice" + assert txn.local_num_uint, "local_num_uint" + assert txn.local_num_byte_slice, "local_num_byte_slice" + assert txn.extra_program_pages, "extra_program_pages" + assert txn.last_log, "last_log" + assert txn.num_approval_program_pages, "num_approval_program_pages" + assert txn.num_clear_state_program_pages, "num_clear_state_program_pages" + assert txn.application_args(0), "application_args(0)" + assert txn.accounts(0), "accounts(0)" + assert txn.assets(0), "assets(0)" + assert txn.applications(0), "applications(0)" + assert txn.approval_program_pages(0), "approval_program_pages(0)" + assert txn.clear_state_program_pages(0), "clear_state_program_pages(0)" diff --git a/examples/transaction/out/application.json b/examples/transaction/out/application.json new file mode 100644 index 0000000000..cb76427b9b --- /dev/null +++ b/examples/transaction/out/application.json @@ -0,0 +1,149 @@ +{ + "hints": { + "create()void": { + "call_config": { + "no_op": "CREATE" + } + }, + "pay(pay)void": { + "call_config": { + "no_op": "CALL" + } + }, + "key(keyreg)void": { + "call_config": { + "no_op": "CALL" + } + }, + "asset_config(acfg)void": { + "call_config": { + "no_op": "CALL" + } + }, + "asset_transfer(axfer)void": { + "call_config": { + "no_op": "CALL" + } + }, + "asset_freeze(afrz)void": { + "call_config": { + "no_op": "CALL" + } + }, + "application_call(appl)void": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuYXBwcm92YWxfcHJvZ3JhbSgpIC0+IHVpbnQ2NDoKbWFpbl9ibG9ja0AwOgogICAgICAgIHR4biBOdW1BcHBBcmdzCiAgICAgICAgYnogbWFpbl9hZnRlcl9pZl9lbHNlQDExCgptYWluX2FiaV9yb3V0aW5nQDE6CiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgICAgIG1ldGhvZCAiY3JlYXRlKCl2b2lkIgogICAgICAgIG1ldGhvZCAicGF5KHBheSl2b2lkIgogICAgICAgIG1ldGhvZCAia2V5KGtleXJlZyl2b2lkIgogICAgICAgIG1ldGhvZCAiYXNzZXRfY29uZmlnKGFjZmcpdm9pZCIKICAgICAgICBtZXRob2QgImFzc2V0X3RyYW5zZmVyKGF4ZmVyKXZvaWQiCiAgICAgICAgbWV0aG9kICJhc3NldF9mcmVlemUoYWZyeil2b2lkIgogICAgICAgIG1ldGhvZCAiYXBwbGljYXRpb25fY2FsbChhcHBsKXZvaWQiCiAgICAgICAgdW5jb3ZlciA3CiAgICAgICAgbWF0Y2ggbWFpbl9jcmVhdGVfcm91dGVAMiBtYWluX3BheV9yb3V0ZUAzIG1haW5fa2V5X3JvdXRlQDQgbWFpbl9hc3NldF9jb25maWdfcm91dGVANSBtYWluX2Fzc2V0X3RyYW5zZmVyX3JvdXRlQDYgbWFpbl9hc3NldF9mcmVlemVfcm91dGVANyBtYWluX2FwcGxpY2F0aW9uX2NhbGxfcm91dGVAOAogICAgICAgIGIgbWFpbl9hZnRlcl9pZl9lbHNlQDExCgptYWluX2NyZWF0ZV9yb3V0ZUAyOgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIGlzIGNyZWF0aW5nCiAgICAgICAgY2FsbHN1YiBjcmVhdGUKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9wYXlfcm91dGVAMzoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4biBHcm91cEluZGV4CiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZHVwCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBpbnQgcGF5CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBwYXkKICAgICAgICBjYWxsc3ViIHBheQogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2tleV9yb3V0ZUA0OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuIEdyb3VwSW5kZXgKICAgICAgICBpbnQgMQogICAgICAgIC0KICAgICAgICBkdXAKICAgICAgICBndHhucyBUeXBlRW51bQogICAgICAgIGludCBrZXlyZWcKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGtleXJlZwogICAgICAgIGNhbGxzdWIga2V5CiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fYXNzZXRfY29uZmlnX3JvdXRlQDU6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICB0eG4gR3JvdXBJbmRleAogICAgICAgIGludCAxCiAgICAgICAgLQogICAgICAgIGR1cAogICAgICAgIGd0eG5zIFR5cGVFbnVtCiAgICAgICAgaW50IGFjZmcKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIGFjZmcKICAgICAgICBjYWxsc3ViIGFzc2V0X2NvbmZpZwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2Fzc2V0X3RyYW5zZmVyX3JvdXRlQDY6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICB0eG4gR3JvdXBJbmRleAogICAgICAgIGludCAxCiAgICAgICAgLQogICAgICAgIGR1cAogICAgICAgIGd0eG5zIFR5cGVFbnVtCiAgICAgICAgaW50IGF4ZmVyCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBheGZlcgogICAgICAgIGNhbGxzdWIgYXNzZXRfdHJhbnNmZXIKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9hc3NldF9mcmVlemVfcm91dGVANzoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4biBHcm91cEluZGV4CiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZHVwCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBpbnQgYWZyegogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIHRyYW5zYWN0aW9uIHR5cGUgaXMgYWZyegogICAgICAgIGNhbGxzdWIgYXNzZXRfZnJlZXplCiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fYXBwbGljYXRpb25fY2FsbF9yb3V0ZUA4OgogICAgICAgIHR4biBPbkNvbXBsZXRpb24KICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIE9uQ29tcGxldGlvbiBpcyBOb09wCiAgICAgICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgICAgICBhc3NlcnQgLy8gaXMgbm90IGNyZWF0aW5nCiAgICAgICAgdHhuIEdyb3VwSW5kZXgKICAgICAgICBpbnQgMQogICAgICAgIC0KICAgICAgICBkdXAKICAgICAgICBndHhucyBUeXBlRW51bQogICAgICAgIGludCBhcHBsCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBhcHBsCiAgICAgICAgY2FsbHN1YiBhcHBsaWNhdGlvbl9jYWxsCiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fYWZ0ZXJfaWZfZWxzZUAxMToKICAgICAgICBlcnIgLy8gcmVqZWN0IHRyYW5zYWN0aW9uCgoKLy8gZXhhbXBsZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5jcmVhdGUoKSAtPiB2b2lkOgpjcmVhdGU6CiAgICAgICAgcHJvdG8gMCAwCgpjcmVhdGVfYmxvY2tAMDoKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LnBheSh0eG4jMDogdWludDY0KSAtPiB2b2lkOgpwYXk6CiAgICAgICAgcHJvdG8gMSAwCgpwYXlfYmxvY2tAMDoKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgUmVjZWl2ZXIKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIFBheW1lbnQgc2hvdWxkIGJlIGZvciB0aGlzIGFwcAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIEFtb3VudAogICAgICAgIGludCAxMDAwCiAgICAgICAgPgogICAgICAgIGFzc2VydCAvLyBQYXltZW50IHNob3VsZCBiZSBmb3IgPjEwMDAgbWljcm8gYWxnb3MKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBDbG9zZVJlbWFpbmRlclRvCiAgICAgICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gY2xvc2VfcmVtYWluZGVyX3RvCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5fY29tbW9uX2NoZWNrcyh0eG4jMDogdWludDY0KSAtPiB2b2lkOgpfY29tbW9uX2NoZWNrczoKICAgICAgICBwcm90byAxIDAKCl9jb21tb25fY2hlY2tzX2Jsb2NrQDA6CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgVHhJRAogICAgICAgIGxlbgogICAgICAgIGFzc2VydCAvLyB0eG5faWQKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBTZW5kZXIKICAgICAgICBnbG9iYWwgQ3JlYXRvckFkZHJlc3MKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBzZW5kZXIKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBGZWUKICAgICAgICBhc3NlcnQgLy8gZmVlCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBhc3NlcnQgLy8gdHlwZQogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIFR5cGUKICAgICAgICBsZW4KICAgICAgICBhc3NlcnQgLy8gdHlwZV9ieXRlcwogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIE5vdGUKICAgICAgICBieXRlICIiCiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gbm90ZQogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIEdyb3VwSW5kZXgKICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIGdyb3VwX2luZGV4CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgRmlyc3RWYWxpZAogICAgICAgIGFzc2VydCAvLyBmaXJzdF92YWxpZAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIEZpcnN0VmFsaWRUaW1lCiAgICAgICAgYXNzZXJ0IC8vIGZpcnN0X3ZhbGlkX3RpbWUKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBMYXN0VmFsaWQKICAgICAgICBhc3NlcnQgLy8gbGFzdF92YWxpZAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIExlYXNlCiAgICAgICAgbGVuCiAgICAgICAgYXNzZXJ0IC8vIGxlYXNlCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgUmVrZXlUbwogICAgICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIHJla2V5X3RvCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudHJhbnNhY3Rpb24uY29udHJhY3QuVHJhbnNhY3Rpb25Db250cmFjdC5rZXkodHhuIzA6IHVpbnQ2NCkgLT4gdm9pZDoKa2V5OgogICAgICAgIHByb3RvIDEgMAoKa2V5X2Jsb2NrQDA6CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgY2FsbHN1YiBfY29tbW9uX2NoZWNrcwogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIFZvdGVQSwogICAgICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgICAgICE9CiAgICAgICAgYXNzZXJ0IC8vIHZvdGVfa2V5CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgU2VsZWN0aW9uUEsKICAgICAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICAgICAhPQogICAgICAgIGFzc2VydCAvLyBzZWxlY3Rpb25fa2V5CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgVm90ZUtleURpbHV0aW9uCiAgICAgICAgYXNzZXJ0IC8vIHZvdGVfa2V5X2RpbHV0aW9uCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgVm90ZUZpcnN0CiAgICAgICAgYXNzZXJ0IC8vIHZvdGVfZmlyc3QKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBWb3RlTGFzdAogICAgICAgIGFzc2VydCAvLyB2b3RlX2xhc3QKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBOb25wYXJ0aWNpcGF0aW9uCiAgICAgICAgYXNzZXJ0IC8vIG5vbl9wYXJ0aWNpcGF0aW9uCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgU3RhdGVQcm9vZlBLCiAgICAgICAgbGVuCiAgICAgICAgYXNzZXJ0IC8vIHN0YXRlX3Byb29mX2tleQogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuYXNzZXRfY29uZmlnKHR4biMwOiB1aW50NjQpIC0+IHZvaWQ6CmFzc2V0X2NvbmZpZzoKICAgICAgICBwcm90byAxIDAKCmFzc2V0X2NvbmZpZ19ibG9ja0AwOgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGNhbGxzdWIgX2NvbW1vbl9jaGVja3MKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBDb25maWdBc3NldAogICAgICAgIGFzc2VydCAvLyBjb25maWdfYXNzZXQKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBDb25maWdBc3NldFRvdGFsCiAgICAgICAgYXNzZXJ0IC8vIHRvdGFsCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQ29uZmlnQXNzZXREZWNpbWFscwogICAgICAgIGFzc2VydCAvLyBkZWNpbWFscwogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIENvbmZpZ0Fzc2V0RGVmYXVsdEZyb3plbgogICAgICAgIGFzc2VydCAvLyBkZWZhdWx0X2Zyb3plbgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIENvbmZpZ0Fzc2V0VW5pdE5hbWUKICAgICAgICBsZW4KICAgICAgICBhc3NlcnQgLy8gdW5pdF9uYW1lCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQ29uZmlnQXNzZXROYW1lCiAgICAgICAgbGVuCiAgICAgICAgYXNzZXJ0IC8vIGFzc2V0X25hbWUKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBDb25maWdBc3NldFVSTAogICAgICAgIGxlbgogICAgICAgIGFzc2VydCAvLyB1cmwKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBDb25maWdBc3NldE1ldGFkYXRhSGFzaAogICAgICAgIGxlbgogICAgICAgIGFzc2VydCAvLyBtZXRhZGF0YV9oYXNoCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQ29uZmlnQXNzZXRNYW5hZ2VyCiAgICAgICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAgICAgIT0KICAgICAgICBhc3NlcnQgLy8gbWFuYWdlcgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIENvbmZpZ0Fzc2V0UmVzZXJ2ZQogICAgICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgICAgICE9CiAgICAgICAgYXNzZXJ0IC8vIHJlc2VydmUKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBDb25maWdBc3NldEZyZWV6ZQogICAgICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgICAgICE9CiAgICAgICAgYXNzZXJ0IC8vIGZyZWV6ZQogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIENvbmZpZ0Fzc2V0Q2xhd2JhY2sKICAgICAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICAgICAhPQogICAgICAgIGFzc2VydCAvLyBjbGF3YmFjawogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuYXNzZXRfdHJhbnNmZXIodHhuIzA6IHVpbnQ2NCkgLT4gdm9pZDoKYXNzZXRfdHJhbnNmZXI6CiAgICAgICAgcHJvdG8gMSAwCgphc3NldF90cmFuc2Zlcl9ibG9ja0AwOgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGNhbGxzdWIgX2NvbW1vbl9jaGVja3MKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBYZmVyQXNzZXQKICAgICAgICBhc3NlcnQgLy8geGZlcl9hc3NldAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIEFzc2V0QW1vdW50CiAgICAgICAgYXNzZXJ0IC8vIGFzc2V0X2Ftb3VudAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIEFzc2V0U2VuZGVyCiAgICAgICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAgICAgIT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXRfc2VuZGVyCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQXNzZXRSZWNlaXZlcgogICAgICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgICAgICE9CiAgICAgICAgYXNzZXJ0IC8vIGFzc2V0X3JlY2VpdmVyCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQXNzZXRDbG9zZVRvCiAgICAgICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAgICAgIT0KICAgICAgICBhc3NlcnQgLy8gYXNzZXRfY2xvc2VfdG8KICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFzc2V0X2ZyZWV6ZSh0eG4jMDogdWludDY0KSAtPiB2b2lkOgphc3NldF9mcmVlemU6CiAgICAgICAgcHJvdG8gMSAwCgphc3NldF9mcmVlemVfYmxvY2tAMDoKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgRnJlZXplQXNzZXQKICAgICAgICBhc3NlcnQgLy8gZnJlZXplX2Fzc2V0CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgRnJlZXplQXNzZXRBY2NvdW50CiAgICAgICAgZ2xvYmFsIFplcm9BZGRyZXNzCiAgICAgICAgIT0KICAgICAgICBhc3NlcnQgLy8gZnJlZXplX2FjY291bnQKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBGcmVlemVBc3NldEZyb3plbgogICAgICAgIGFzc2VydCAvLyBmcm96ZW4KICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy50cmFuc2FjdGlvbi5jb250cmFjdC5UcmFuc2FjdGlvbkNvbnRyYWN0LmFwcGxpY2F0aW9uX2NhbGwodHhuIzA6IHVpbnQ2NCkgLT4gdm9pZDoKYXBwbGljYXRpb25fY2FsbDoKICAgICAgICBwcm90byAxIDAKCmFwcGxpY2F0aW9uX2NhbGxfYmxvY2tAMDoKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBjYWxsc3ViIF9jb21tb25fY2hlY2tzCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBhcHBsaWNhdGlvbl9pZAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIE9uQ29tcGxldGlvbgogICAgICAgIGFzc2VydCAvLyBvbl9jb21wbGV0aW9uCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgTnVtQXBwQXJncwogICAgICAgIGFzc2VydCAvLyBudW1fYXBwX2FyZ3MKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBOdW1BY2NvdW50cwogICAgICAgIGFzc2VydCAvLyBudW1fYWNjb3VudHMKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBBcHByb3ZhbFByb2dyYW0KICAgICAgICBsZW4KICAgICAgICBhc3NlcnQgLy8gYXBwcm92YWxfcHJvZ3JhbQogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIENsZWFyU3RhdGVQcm9ncmFtCiAgICAgICAgbGVuCiAgICAgICAgYXNzZXJ0IC8vIGNsZWFyX3N0YXRlX3Byb2dyYW0KICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBOdW1Bc3NldHMKICAgICAgICBhc3NlcnQgLy8gbnVtX2Fzc2V0cwogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIE51bUFwcGxpY2F0aW9ucwogICAgICAgIGFzc2VydCAvLyBudW1fYXBwbGljYXRpb25zCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgR2xvYmFsTnVtVWludAogICAgICAgIGFzc2VydCAvLyBnbG9iYWxfbnVtX3VpbnQKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBHbG9iYWxOdW1CeXRlU2xpY2UKICAgICAgICBhc3NlcnQgLy8gZ2xvYmFsX251bV9ieXRlX3NsaWNlCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgTG9jYWxOdW1VaW50CiAgICAgICAgYXNzZXJ0IC8vIGxvY2FsX251bV91aW50CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgTG9jYWxOdW1CeXRlU2xpY2UKICAgICAgICBhc3NlcnQgLy8gbG9jYWxfbnVtX2J5dGVfc2xpY2UKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBFeHRyYVByb2dyYW1QYWdlcwogICAgICAgIGFzc2VydCAvLyBleHRyYV9wcm9ncmFtX3BhZ2VzCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgTGFzdExvZwogICAgICAgIGxlbgogICAgICAgIGFzc2VydCAvLyBsYXN0X2xvZwogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGd0eG5zIE51bUFwcHJvdmFsUHJvZ3JhbVBhZ2VzCiAgICAgICAgYXNzZXJ0IC8vIG51bV9hcHByb3ZhbF9wcm9ncmFtX3BhZ2VzCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgTnVtQ2xlYXJTdGF0ZVByb2dyYW1QYWdlcwogICAgICAgIGFzc2VydCAvLyBudW1fY2xlYXJfc3RhdGVfcHJvZ3JhbV9wYWdlcwogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGludCAwCiAgICAgICAgZ3R4bnNhcyBBcHBsaWNhdGlvbkFyZ3MKICAgICAgICBsZW4KICAgICAgICBhc3NlcnQgLy8gYXBwbGljYXRpb25fYXJncygwKQogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGludCAwCiAgICAgICAgZ3R4bnNhcyBBY2NvdW50cwogICAgICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgICAgICE9CiAgICAgICAgYXNzZXJ0IC8vIGFjY291bnRzKDApCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgaW50IDAKICAgICAgICBndHhuc2FzIEFzc2V0cwogICAgICAgIGFzc2VydCAvLyBhc3NldHMoMCkKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBpbnQgMAogICAgICAgIGd0eG5zYXMgQXBwbGljYXRpb25zCiAgICAgICAgYXNzZXJ0IC8vIGFwcGxpY2F0aW9ucygwKQogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGludCAwCiAgICAgICAgZ3R4bnNhcyBBcHByb3ZhbFByb2dyYW1QYWdlcwogICAgICAgIGxlbgogICAgICAgIGFzc2VydCAvLyBhcHByb3ZhbF9wcm9ncmFtX3BhZ2VzKDApCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgaW50IDAKICAgICAgICBndHhuc2FzIENsZWFyU3RhdGVQcm9ncmFtUGFnZXMKICAgICAgICBsZW4KICAgICAgICBhc3NlcnQgLy8gY2xlYXJfc3RhdGVfcHJvZ3JhbV9wYWdlcygwKQogICAgICAgIHJldHN1YgoK", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLnRyYW5zYWN0aW9uLmNvbnRyYWN0LlRyYW5zYWN0aW9uQ29udHJhY3QuY2xlYXJfc3RhdGVfcHJvZ3JhbSgpIC0+IHVpbnQ2NDoKbWFpbl9ibG9ja0AwOgogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgo=" + }, + "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": "TransactionContract", + "methods": [ + { + "name": "create", + "args": [], + "returns": { + "type": "void" + } + }, + { + "name": "pay", + "args": [ + { + "type": "pay", + "name": "txn" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "key", + "args": [ + { + "type": "keyreg", + "name": "txn" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "asset_config", + "args": [ + { + "type": "acfg", + "name": "txn" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "asset_transfer", + "args": [ + { + "type": "axfer", + "name": "txn" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "asset_freeze", + "args": [ + { + "type": "afrz", + "name": "txn" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "application_call", + "args": [ + { + "type": "appl", + "name": "txn" + } + ], + "returns": { + "type": "void" + } + } + ], + "networks": {} + }, + "bare_call_config": {} +} \ No newline at end of file diff --git a/examples/transaction/out/contract.approval.debug.teal b/examples/transaction/out/contract.approval.debug.teal new file mode 100644 index 0000000000..5254496469 --- /dev/null +++ b/examples/transaction/out/contract.approval.debug.teal @@ -0,0 +1,468 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.transaction.contract.TransactionContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + bz main_after_if_else@11 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + // Implicit fall through to main_abi_routing@1 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + +main_abi_routing@1: + txna ApplicationArgs 0 // {txna} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + method "create()void" // tmp%1#0,method<"create()void"> arc4.abimethod(create=True) File "transaction/contract.py", line 17 + method "pay(pay)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void"> arc4.abimethod File "transaction/contract.py", line 36 + method "key(keyreg)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void"> arc4.abimethod File "transaction/contract.py", line 45 + method "asset_config(acfg)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void"> arc4.abimethod File "transaction/contract.py", line 56 + method "asset_transfer(axfer)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void"> arc4.abimethod File "transaction/contract.py", line 73 + method "asset_freeze(afrz)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void">,method<"asset_freeze(afrz)void"> arc4.abimethod File "transaction/contract.py", line 82 + method "application_call(appl)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void">,method<"asset_freeze(afrz)void">,method<"application_call(appl)void"> arc4.abimethod File "transaction/contract.py", line 90 + uncover 7 // load tmp%1#0 from l-stack (no copy) method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void">,method<"asset_freeze(afrz)void">,method<"application_call(appl)void">,tmp%1#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + match main_create_route@2 main_pay_route@3 main_key_route@4 main_asset_config_route@5 main_asset_transfer_route@6 main_asset_freeze_route@7 main_application_call_route@8 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + b main_after_if_else@11 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + +main_create_route@2: + txn OnCompletion // {txn} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + ! // {!} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + assert // OnCompletion is NoOp // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + txn ApplicationID // {txn} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + ! // {!} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + assert // is creating // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + callsub create // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + int 1 // 1 arc4.abimethod(create=True) File "transaction/contract.py", line 17 + return // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + +main_pay_route@3: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 36 + ! // {!} arc4.abimethod File "transaction/contract.py", line 36 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 36 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 36 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 36 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%11#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int pay // awst_tmp%12#0,tmp%13#0,pay class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is pay // awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub pay // arc4.abimethod File "transaction/contract.py", line 36 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 36 + return // arc4.abimethod File "transaction/contract.py", line 36 + +main_key_route@4: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 45 + ! // {!} arc4.abimethod File "transaction/contract.py", line 45 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 45 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 45 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 45 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%20#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int keyreg // awst_tmp%12#0,tmp%21#0,keyreg class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is keyreg // awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub key // arc4.abimethod File "transaction/contract.py", line 45 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 45 + return // arc4.abimethod File "transaction/contract.py", line 45 + +main_asset_config_route@5: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 56 + ! // {!} arc4.abimethod File "transaction/contract.py", line 56 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 56 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 56 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 56 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%28#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int acfg // awst_tmp%12#0,tmp%29#0,acfg class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is acfg // awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub asset_config // arc4.abimethod File "transaction/contract.py", line 56 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 56 + return // arc4.abimethod File "transaction/contract.py", line 56 + +main_asset_transfer_route@6: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 73 + ! // {!} arc4.abimethod File "transaction/contract.py", line 73 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 73 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 73 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 73 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%36#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int axfer // awst_tmp%12#0,tmp%37#0,axfer class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is axfer // awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub asset_transfer // arc4.abimethod File "transaction/contract.py", line 73 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 73 + return // arc4.abimethod File "transaction/contract.py", line 73 + +main_asset_freeze_route@7: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 82 + ! // {!} arc4.abimethod File "transaction/contract.py", line 82 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 82 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 82 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 82 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%44#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int afrz // awst_tmp%12#0,tmp%45#0,afrz class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is afrz // awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub asset_freeze // arc4.abimethod File "transaction/contract.py", line 82 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 82 + return // arc4.abimethod File "transaction/contract.py", line 82 + +main_application_call_route@8: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 90 + ! // {!} arc4.abimethod File "transaction/contract.py", line 90 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 90 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 90 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 90 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%52#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int appl // awst_tmp%12#0,tmp%53#0,appl class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is appl // awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub application_call // arc4.abimethod File "transaction/contract.py", line 90 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 90 + return // arc4.abimethod File "transaction/contract.py", line 90 + +main_after_if_else@11: + err // reject transaction // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + + +// examples.transaction.contract.TransactionContract.create() -> void: +create: + proto 0 0 // def create(self) -> None: File "transaction/contract.py", line 18 + +create_block@0: + retsub // + + +// examples.transaction.contract.TransactionContract.pay(txn#0: uint64) -> void: +pay: + proto 1 0 // (𝕡) txn#0 | def pay(self, txn: PaymentTransaction) -> None: File "transaction/contract.py", line 37 + +pay_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 38 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + gtxns Receiver // (𝕡) txn#0 | {gtxns} txn.receiver File "transaction/contract.py", line 40 + global CurrentApplicationAddress // (𝕡) txn#0 | tmp%0#0,{global} Global.current_application_address() File "transaction/contract.py", line 40 + == // (𝕡) txn#0 | {==} txn.receiver == Global.current_application_address() File "transaction/contract.py", line 40 + assert // Payment should be for this app // (𝕡) txn#0 | assert ( File "transaction/contract.py", line 39 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + gtxns Amount // (𝕡) txn#0 | {gtxns} txn.amount File "transaction/contract.py", line 42 + int 1000 // (𝕡) txn#0 | tmp%3#0,1000 1000 File "transaction/contract.py", line 42 + > // (𝕡) txn#0 | {>} txn.amount > 1000, "Payment should be for >1000 micro algos" File "transaction/contract.py", line 42 + assert // Payment should be for >1000 micro algos // (𝕡) txn#0 | assert txn.amount > 1000, "Payment should be for >1000 micro algos" File "transaction/contract.py", line 42 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + gtxns CloseRemainderTo // (𝕡) txn#0 | {gtxns} txn.close_remainder_to File "transaction/contract.py", line 43 + global ZeroAddress // (𝕡) txn#0 | tmp%5#0,{global} Global.zero_address() File "transaction/contract.py", line 43 + == // (𝕡) txn#0 | {==} txn.close_remainder_to == Global.zero_address(), "close_remainder_to" File "transaction/contract.py", line 43 + assert // close_remainder_to // (𝕡) txn#0 | assert txn.close_remainder_to == Global.zero_address(), "close_remainder_to" File "transaction/contract.py", line 43 + retsub // + + +// examples.transaction.contract.TransactionContract._common_checks(txn#0: uint64) -> void: +_common_checks: + proto 1 0 // (𝕡) txn#0 | def _common_checks(self, txn: TransactionBase) -> None: File "transaction/contract.py", line 22 + +_common_checks_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns TxID // (𝕡) txn#0 | {gtxns} txn.txn_id File "transaction/contract.py", line 23 + len // (𝕡) txn#0 | {len} txn.txn_id File "transaction/contract.py", line 23 + assert // txn_id // (𝕡) txn#0 | assert txn.txn_id, "txn_id" File "transaction/contract.py", line 23 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Sender // (𝕡) txn#0 | {gtxns} txn.sender File "transaction/contract.py", line 24 + global CreatorAddress // (𝕡) txn#0 | tmp%2#0,{global} Global.creator_address() File "transaction/contract.py", line 24 + == // (𝕡) txn#0 | {==} txn.sender == Global.creator_address(), "sender" File "transaction/contract.py", line 24 + assert // sender // (𝕡) txn#0 | assert txn.sender == Global.creator_address(), "sender" File "transaction/contract.py", line 24 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Fee // (𝕡) txn#0 | {gtxns} txn.fee File "transaction/contract.py", line 25 + assert // fee // (𝕡) txn#0 | assert txn.fee, "fee" File "transaction/contract.py", line 25 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns TypeEnum // (𝕡) txn#0 | {gtxns} txn.type File "transaction/contract.py", line 26 + assert // type // (𝕡) txn#0 | assert txn.type, "type" File "transaction/contract.py", line 26 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Type // (𝕡) txn#0 | {gtxns} txn.type_bytes File "transaction/contract.py", line 27 + len // (𝕡) txn#0 | {len} txn.type_bytes File "transaction/contract.py", line 27 + assert // type_bytes // (𝕡) txn#0 | assert txn.type_bytes, "type_bytes" File "transaction/contract.py", line 27 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Note // (𝕡) txn#0 | {gtxns} txn.note File "transaction/contract.py", line 28 + byte "" // (𝕡) txn#0 | tmp%9#0,"" b"" File "transaction/contract.py", line 28 + == // (𝕡) txn#0 | {==} txn.note == Bytes(b""), "note" File "transaction/contract.py", line 28 + assert // note // (𝕡) txn#0 | assert txn.note == Bytes(b""), "note" File "transaction/contract.py", line 28 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns GroupIndex // (𝕡) txn#0 | {gtxns} txn.group_index File "transaction/contract.py", line 29 + ! // (𝕡) txn#0 | {!} txn.group_index == 0, "group_index" File "transaction/contract.py", line 29 + assert // group_index // (𝕡) txn#0 | assert txn.group_index == 0, "group_index" File "transaction/contract.py", line 29 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns FirstValid // (𝕡) txn#0 | {gtxns} txn.first_valid File "transaction/contract.py", line 30 + assert // first_valid // (𝕡) txn#0 | assert txn.first_valid, "first_valid" File "transaction/contract.py", line 30 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns FirstValidTime // (𝕡) txn#0 | {gtxns} txn.first_valid_time File "transaction/contract.py", line 31 + assert // first_valid_time // (𝕡) txn#0 | assert txn.first_valid_time, "first_valid_time" File "transaction/contract.py", line 31 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns LastValid // (𝕡) txn#0 | {gtxns} txn.last_valid File "transaction/contract.py", line 32 + assert // last_valid // (𝕡) txn#0 | assert txn.last_valid, "last_valid" File "transaction/contract.py", line 32 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Lease // (𝕡) txn#0 | {gtxns} txn.lease File "transaction/contract.py", line 33 + len // (𝕡) txn#0 | {len} txn.lease File "transaction/contract.py", line 33 + assert // lease // (𝕡) txn#0 | assert txn.lease, "lease" File "transaction/contract.py", line 33 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns RekeyTo // (𝕡) txn#0 | {gtxns} txn.rekey_to File "transaction/contract.py", line 34 + global ZeroAddress // (𝕡) txn#0 | tmp%18#0,{global} Global.zero_address() File "transaction/contract.py", line 34 + == // (𝕡) txn#0 | {==} txn.rekey_to == Global.zero_address(), "rekey_to" File "transaction/contract.py", line 34 + assert // rekey_to // (𝕡) txn#0 | assert txn.rekey_to == Global.zero_address(), "rekey_to" File "transaction/contract.py", line 34 + retsub // + + +// examples.transaction.contract.TransactionContract.key(txn#0: uint64) -> void: +key: + proto 1 0 // (𝕡) txn#0 | def key(self, txn: KeyRegistrationTransaction) -> None: File "transaction/contract.py", line 46 + +key_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 47 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VotePK // (𝕡) txn#0 | {gtxns} txn.vote_key File "transaction/contract.py", line 48 + global ZeroAddress // (𝕡) txn#0 | tmp%0#0,{global} txn.vote_key File "transaction/contract.py", line 48 + != // (𝕡) txn#0 | {!=} txn.vote_key File "transaction/contract.py", line 48 + assert // vote_key // (𝕡) txn#0 | assert txn.vote_key, "vote_key" File "transaction/contract.py", line 48 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns SelectionPK // (𝕡) txn#0 | {gtxns} txn.selection_key File "transaction/contract.py", line 49 + global ZeroAddress // (𝕡) txn#0 | tmp%3#0,{global} txn.selection_key File "transaction/contract.py", line 49 + != // (𝕡) txn#0 | {!=} txn.selection_key File "transaction/contract.py", line 49 + assert // selection_key // (𝕡) txn#0 | assert txn.selection_key, "selection_key" File "transaction/contract.py", line 49 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VoteKeyDilution // (𝕡) txn#0 | {gtxns} txn.vote_key_dilution File "transaction/contract.py", line 50 + assert // vote_key_dilution // (𝕡) txn#0 | assert txn.vote_key_dilution, "vote_key_dilution" File "transaction/contract.py", line 50 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VoteFirst // (𝕡) txn#0 | {gtxns} txn.vote_first File "transaction/contract.py", line 51 + assert // vote_first // (𝕡) txn#0 | assert txn.vote_first, "vote_first" File "transaction/contract.py", line 51 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VoteLast // (𝕡) txn#0 | {gtxns} txn.vote_last File "transaction/contract.py", line 52 + assert // vote_last // (𝕡) txn#0 | assert txn.vote_last, "vote_last" File "transaction/contract.py", line 52 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns Nonparticipation // (𝕡) txn#0 | {gtxns} txn.non_participation File "transaction/contract.py", line 53 + assert // non_participation // (𝕡) txn#0 | assert txn.non_participation, "non_participation" File "transaction/contract.py", line 53 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns StateProofPK // (𝕡) txn#0 | {gtxns} txn.state_proof_key File "transaction/contract.py", line 54 + len // (𝕡) txn#0 | {len} txn.state_proof_key File "transaction/contract.py", line 54 + assert // state_proof_key // (𝕡) txn#0 | assert txn.state_proof_key, "state_proof_key" File "transaction/contract.py", line 54 + retsub // + + +// examples.transaction.contract.TransactionContract.asset_config(txn#0: uint64) -> void: +asset_config: + proto 1 0 // (𝕡) txn#0 | def asset_config(self, txn: AssetConfigTransaction) -> None: File "transaction/contract.py", line 57 + +asset_config_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 58 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAsset // (𝕡) txn#0 | {gtxns} txn.config_asset File "transaction/contract.py", line 60 + assert // config_asset // (𝕡) txn#0 | assert txn.config_asset, "config_asset" File "transaction/contract.py", line 60 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetTotal // (𝕡) txn#0 | {gtxns} txn.total File "transaction/contract.py", line 61 + assert // total // (𝕡) txn#0 | assert txn.total, "total" File "transaction/contract.py", line 61 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetDecimals // (𝕡) txn#0 | {gtxns} txn.decimals File "transaction/contract.py", line 62 + assert // decimals // (𝕡) txn#0 | assert txn.decimals, "decimals" File "transaction/contract.py", line 62 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetDefaultFrozen // (𝕡) txn#0 | {gtxns} txn.default_frozen File "transaction/contract.py", line 63 + assert // default_frozen // (𝕡) txn#0 | assert txn.default_frozen, "default_frozen" File "transaction/contract.py", line 63 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetUnitName // (𝕡) txn#0 | {gtxns} txn.unit_name File "transaction/contract.py", line 64 + len // (𝕡) txn#0 | {len} txn.unit_name File "transaction/contract.py", line 64 + assert // unit_name // (𝕡) txn#0 | assert txn.unit_name, "unit_name" File "transaction/contract.py", line 64 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetName // (𝕡) txn#0 | {gtxns} txn.asset_name File "transaction/contract.py", line 65 + len // (𝕡) txn#0 | {len} txn.asset_name File "transaction/contract.py", line 65 + assert // asset_name // (𝕡) txn#0 | assert txn.asset_name, "asset_name" File "transaction/contract.py", line 65 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetURL // (𝕡) txn#0 | {gtxns} txn.url File "transaction/contract.py", line 66 + len // (𝕡) txn#0 | {len} txn.url File "transaction/contract.py", line 66 + assert // url // (𝕡) txn#0 | assert txn.url, "url" File "transaction/contract.py", line 66 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetMetadataHash // (𝕡) txn#0 | {gtxns} txn.metadata_hash File "transaction/contract.py", line 67 + len // (𝕡) txn#0 | {len} txn.metadata_hash File "transaction/contract.py", line 67 + assert // metadata_hash // (𝕡) txn#0 | assert txn.metadata_hash, "metadata_hash" File "transaction/contract.py", line 67 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetManager // (𝕡) txn#0 | {gtxns} txn.manager File "transaction/contract.py", line 68 + global ZeroAddress // (𝕡) txn#0 | tmp%12#0,{global} txn.manager File "transaction/contract.py", line 68 + != // (𝕡) txn#0 | {!=} txn.manager File "transaction/contract.py", line 68 + assert // manager // (𝕡) txn#0 | assert txn.manager, "manager" File "transaction/contract.py", line 68 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetReserve // (𝕡) txn#0 | {gtxns} txn.reserve File "transaction/contract.py", line 69 + global ZeroAddress // (𝕡) txn#0 | tmp%15#0,{global} txn.reserve File "transaction/contract.py", line 69 + != // (𝕡) txn#0 | {!=} txn.reserve File "transaction/contract.py", line 69 + assert // reserve // (𝕡) txn#0 | assert txn.reserve, "reserve" File "transaction/contract.py", line 69 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetFreeze // (𝕡) txn#0 | {gtxns} txn.freeze File "transaction/contract.py", line 70 + global ZeroAddress // (𝕡) txn#0 | tmp%18#0,{global} txn.freeze File "transaction/contract.py", line 70 + != // (𝕡) txn#0 | {!=} txn.freeze File "transaction/contract.py", line 70 + assert // freeze // (𝕡) txn#0 | assert txn.freeze, "freeze" File "transaction/contract.py", line 70 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetClawback // (𝕡) txn#0 | {gtxns} txn.clawback File "transaction/contract.py", line 71 + global ZeroAddress // (𝕡) txn#0 | tmp%21#0,{global} txn.clawback File "transaction/contract.py", line 71 + != // (𝕡) txn#0 | {!=} txn.clawback File "transaction/contract.py", line 71 + assert // clawback // (𝕡) txn#0 | assert txn.clawback, "clawback" File "transaction/contract.py", line 71 + retsub // + + +// examples.transaction.contract.TransactionContract.asset_transfer(txn#0: uint64) -> void: +asset_transfer: + proto 1 0 // (𝕡) txn#0 | def asset_transfer(self, txn: AssetTransferTransaction) -> None: File "transaction/contract.py", line 74 + +asset_transfer_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 75 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns XferAsset // (𝕡) txn#0 | {gtxns} txn.xfer_asset File "transaction/contract.py", line 76 + assert // xfer_asset // (𝕡) txn#0 | assert txn.xfer_asset, "xfer_asset" File "transaction/contract.py", line 76 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetAmount // (𝕡) txn#0 | {gtxns} txn.asset_amount File "transaction/contract.py", line 77 + assert // asset_amount // (𝕡) txn#0 | assert txn.asset_amount, "asset_amount" File "transaction/contract.py", line 77 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetSender // (𝕡) txn#0 | {gtxns} txn.asset_sender File "transaction/contract.py", line 78 + global ZeroAddress // (𝕡) txn#0 | tmp%2#0,{global} txn.asset_sender File "transaction/contract.py", line 78 + != // (𝕡) txn#0 | {!=} txn.asset_sender File "transaction/contract.py", line 78 + assert // asset_sender // (𝕡) txn#0 | assert txn.asset_sender, "asset_sender" File "transaction/contract.py", line 78 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetReceiver // (𝕡) txn#0 | {gtxns} txn.asset_receiver File "transaction/contract.py", line 79 + global ZeroAddress // (𝕡) txn#0 | tmp%5#0,{global} txn.asset_receiver File "transaction/contract.py", line 79 + != // (𝕡) txn#0 | {!=} txn.asset_receiver File "transaction/contract.py", line 79 + assert // asset_receiver // (𝕡) txn#0 | assert txn.asset_receiver, "asset_receiver" File "transaction/contract.py", line 79 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetCloseTo // (𝕡) txn#0 | {gtxns} txn.asset_close_to File "transaction/contract.py", line 80 + global ZeroAddress // (𝕡) txn#0 | tmp%8#0,{global} txn.asset_close_to File "transaction/contract.py", line 80 + != // (𝕡) txn#0 | {!=} txn.asset_close_to File "transaction/contract.py", line 80 + assert // asset_close_to // (𝕡) txn#0 | assert txn.asset_close_to, "asset_close_to" File "transaction/contract.py", line 80 + retsub // + + +// examples.transaction.contract.TransactionContract.asset_freeze(txn#0: uint64) -> void: +asset_freeze: + proto 1 0 // (𝕡) txn#0 | def asset_freeze(self, txn: AssetFreezeTransaction) -> None: File "transaction/contract.py", line 83 + +asset_freeze_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 84 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + gtxns FreezeAsset // (𝕡) txn#0 | {gtxns} txn.freeze_asset File "transaction/contract.py", line 86 + assert // freeze_asset // (𝕡) txn#0 | assert txn.freeze_asset, "freeze_asset" File "transaction/contract.py", line 86 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + gtxns FreezeAssetAccount // (𝕡) txn#0 | {gtxns} txn.freeze_account File "transaction/contract.py", line 87 + global ZeroAddress // (𝕡) txn#0 | tmp%1#0,{global} txn.freeze_account File "transaction/contract.py", line 87 + != // (𝕡) txn#0 | {!=} txn.freeze_account File "transaction/contract.py", line 87 + assert // freeze_account // (𝕡) txn#0 | assert txn.freeze_account, "freeze_account" File "transaction/contract.py", line 87 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + gtxns FreezeAssetFrozen // (𝕡) txn#0 | {gtxns} txn.frozen File "transaction/contract.py", line 88 + assert // frozen // (𝕡) txn#0 | assert txn.frozen, "frozen" File "transaction/contract.py", line 88 + retsub // + + +// examples.transaction.contract.TransactionContract.application_call(txn#0: uint64) -> void: +application_call: + proto 1 0 // (𝕡) txn#0 | def application_call(self, txn: ApplicationCallTransaction) -> None: File "transaction/contract.py", line 91 + +application_call_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 92 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ApplicationID // (𝕡) txn#0 | {gtxns} txn.application_id File "transaction/contract.py", line 93 + assert // application_id // (𝕡) txn#0 | assert txn.application_id, "application_id" File "transaction/contract.py", line 93 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns OnCompletion // (𝕡) txn#0 | {gtxns} txn.on_completion File "transaction/contract.py", line 94 + assert // on_completion // (𝕡) txn#0 | assert txn.on_completion, "on_completion" File "transaction/contract.py", line 94 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumAppArgs // (𝕡) txn#0 | {gtxns} txn.num_app_args File "transaction/contract.py", line 95 + assert // num_app_args // (𝕡) txn#0 | assert txn.num_app_args, "num_app_args" File "transaction/contract.py", line 95 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumAccounts // (𝕡) txn#0 | {gtxns} txn.num_accounts File "transaction/contract.py", line 96 + assert // num_accounts // (𝕡) txn#0 | assert txn.num_accounts, "num_accounts" File "transaction/contract.py", line 96 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ApprovalProgram // (𝕡) txn#0 | {gtxns} txn.approval_program File "transaction/contract.py", line 97 + len // (𝕡) txn#0 | {len} txn.approval_program File "transaction/contract.py", line 97 + assert // approval_program // (𝕡) txn#0 | assert txn.approval_program, "approval_program" File "transaction/contract.py", line 97 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ClearStateProgram // (𝕡) txn#0 | {gtxns} txn.clear_state_program File "transaction/contract.py", line 98 + len // (𝕡) txn#0 | {len} txn.clear_state_program File "transaction/contract.py", line 98 + assert // clear_state_program // (𝕡) txn#0 | assert txn.clear_state_program, "clear_state_program" File "transaction/contract.py", line 98 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumAssets // (𝕡) txn#0 | {gtxns} txn.num_assets File "transaction/contract.py", line 99 + assert // num_assets // (𝕡) txn#0 | assert txn.num_assets, "num_assets" File "transaction/contract.py", line 99 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumApplications // (𝕡) txn#0 | {gtxns} txn.num_applications File "transaction/contract.py", line 100 + assert // num_applications // (𝕡) txn#0 | assert txn.num_applications, "num_applications" File "transaction/contract.py", line 100 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns GlobalNumUint // (𝕡) txn#0 | {gtxns} txn.global_num_uint File "transaction/contract.py", line 101 + assert // global_num_uint // (𝕡) txn#0 | assert txn.global_num_uint, "global_num_uint" File "transaction/contract.py", line 101 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns GlobalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.global_num_byte_slice File "transaction/contract.py", line 102 + assert // global_num_byte_slice // (𝕡) txn#0 | assert txn.global_num_byte_slice, "global_num_byte_slice" File "transaction/contract.py", line 102 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns LocalNumUint // (𝕡) txn#0 | {gtxns} txn.local_num_uint File "transaction/contract.py", line 103 + assert // local_num_uint // (𝕡) txn#0 | assert txn.local_num_uint, "local_num_uint" File "transaction/contract.py", line 103 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns LocalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.local_num_byte_slice File "transaction/contract.py", line 104 + assert // local_num_byte_slice // (𝕡) txn#0 | assert txn.local_num_byte_slice, "local_num_byte_slice" File "transaction/contract.py", line 104 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ExtraProgramPages // (𝕡) txn#0 | {gtxns} txn.extra_program_pages File "transaction/contract.py", line 105 + assert // extra_program_pages // (𝕡) txn#0 | assert txn.extra_program_pages, "extra_program_pages" File "transaction/contract.py", line 105 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns LastLog // (𝕡) txn#0 | {gtxns} txn.last_log File "transaction/contract.py", line 106 + len // (𝕡) txn#0 | {len} txn.last_log File "transaction/contract.py", line 106 + assert // last_log // (𝕡) txn#0 | assert txn.last_log, "last_log" File "transaction/contract.py", line 106 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumApprovalProgramPages // (𝕡) txn#0 | {gtxns} txn.num_approval_program_pages File "transaction/contract.py", line 107 + assert // num_approval_program_pages // (𝕡) txn#0 | assert txn.num_approval_program_pages, "num_approval_program_pages" File "transaction/contract.py", line 107 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumClearStateProgramPages // (𝕡) txn#0 | {gtxns} txn.num_clear_state_program_pages File "transaction/contract.py", line 108 + assert // num_clear_state_program_pages // (𝕡) txn#0 | assert txn.num_clear_state_program_pages, "num_clear_state_program_pages" File "transaction/contract.py", line 108 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 109 + gtxnsas ApplicationArgs // (𝕡) txn#0 | {gtxnsas} txn.application_args(0) File "transaction/contract.py", line 109 + len // (𝕡) txn#0 | {len} txn.application_args(0) File "transaction/contract.py", line 109 + assert // application_args(0) // (𝕡) txn#0 | assert txn.application_args(0), "application_args(0)" File "transaction/contract.py", line 109 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 110 + gtxnsas Accounts // (𝕡) txn#0 | {gtxnsas} txn.accounts(0) File "transaction/contract.py", line 110 + global ZeroAddress // (𝕡) txn#0 | tmp%21#0,{global} txn.accounts(0) File "transaction/contract.py", line 110 + != // (𝕡) txn#0 | {!=} txn.accounts(0) File "transaction/contract.py", line 110 + assert // accounts(0) // (𝕡) txn#0 | assert txn.accounts(0), "accounts(0)" File "transaction/contract.py", line 110 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 111 + gtxnsas Assets // (𝕡) txn#0 | {gtxnsas} txn.assets(0) File "transaction/contract.py", line 111 + assert // assets(0) // (𝕡) txn#0 | assert txn.assets(0), "assets(0)" File "transaction/contract.py", line 111 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 112 + gtxnsas Applications // (𝕡) txn#0 | {gtxnsas} txn.applications(0) File "transaction/contract.py", line 112 + assert // applications(0) // (𝕡) txn#0 | assert txn.applications(0), "applications(0)" File "transaction/contract.py", line 112 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 113 + gtxnsas ApprovalProgramPages // (𝕡) txn#0 | {gtxnsas} txn.approval_program_pages(0) File "transaction/contract.py", line 113 + len // (𝕡) txn#0 | {len} txn.approval_program_pages(0) File "transaction/contract.py", line 113 + assert // approval_program_pages(0) // (𝕡) txn#0 | assert txn.approval_program_pages(0), "approval_program_pages(0)" File "transaction/contract.py", line 113 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 114 + gtxnsas ClearStateProgramPages // (𝕡) txn#0 | {gtxnsas} txn.clear_state_program_pages(0) File "transaction/contract.py", line 114 + len // (𝕡) txn#0 | {len} txn.clear_state_program_pages(0) File "transaction/contract.py", line 114 + assert // clear_state_program_pages(0) // (𝕡) txn#0 | assert txn.clear_state_program_pages(0), "clear_state_program_pages(0)" File "transaction/contract.py", line 114 + retsub // + diff --git a/examples/transaction/out/contract.approval.teal b/examples/transaction/out/contract.approval.teal new file mode 100644 index 0000000000..e9d4d2d153 --- /dev/null +++ b/examples/transaction/out/contract.approval.teal @@ -0,0 +1,465 @@ +#pragma version 8 + +// examples.transaction.contract.TransactionContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs + bz main_after_if_else@11 + +main_abi_routing@1: + txna ApplicationArgs 0 + method "create()void" + method "pay(pay)void" + method "key(keyreg)void" + method "asset_config(acfg)void" + method "asset_transfer(axfer)void" + method "asset_freeze(afrz)void" + method "application_call(appl)void" + uncover 7 + match main_create_route@2 main_pay_route@3 main_key_route@4 main_asset_config_route@5 main_asset_transfer_route@6 main_asset_freeze_route@7 main_application_call_route@8 + b main_after_if_else@11 + +main_create_route@2: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + ! + assert // is creating + callsub create + int 1 + return + +main_pay_route@3: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + callsub pay + int 1 + return + +main_key_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int keyreg + == + assert // transaction type is keyreg + callsub key + int 1 + return + +main_asset_config_route@5: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int acfg + == + assert // transaction type is acfg + callsub asset_config + int 1 + return + +main_asset_transfer_route@6: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + callsub asset_transfer + int 1 + return + +main_asset_freeze_route@7: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int afrz + == + assert // transaction type is afrz + callsub asset_freeze + int 1 + return + +main_application_call_route@8: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int appl + == + assert // transaction type is appl + callsub application_call + int 1 + return + +main_after_if_else@11: + err // reject transaction + + +// examples.transaction.contract.TransactionContract.create() -> void: +create: + proto 0 0 + +create_block@0: + retsub + + +// examples.transaction.contract.TransactionContract.pay(txn#0: uint64) -> void: +pay: + proto 1 0 + +pay_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns Receiver + global CurrentApplicationAddress + == + assert // Payment should be for this app + frame_dig -1 + gtxns Amount + int 1000 + > + assert // Payment should be for >1000 micro algos + frame_dig -1 + gtxns CloseRemainderTo + global ZeroAddress + == + assert // close_remainder_to + retsub + + +// examples.transaction.contract.TransactionContract._common_checks(txn#0: uint64) -> void: +_common_checks: + proto 1 0 + +_common_checks_block@0: + frame_dig -1 + gtxns TxID + len + assert // txn_id + frame_dig -1 + gtxns Sender + global CreatorAddress + == + assert // sender + frame_dig -1 + gtxns Fee + assert // fee + frame_dig -1 + gtxns TypeEnum + assert // type + frame_dig -1 + gtxns Type + len + assert // type_bytes + frame_dig -1 + gtxns Note + byte "" + == + assert // note + frame_dig -1 + gtxns GroupIndex + ! + assert // group_index + frame_dig -1 + gtxns FirstValid + assert // first_valid + frame_dig -1 + gtxns FirstValidTime + assert // first_valid_time + frame_dig -1 + gtxns LastValid + assert // last_valid + frame_dig -1 + gtxns Lease + len + assert // lease + frame_dig -1 + gtxns RekeyTo + global ZeroAddress + == + assert // rekey_to + retsub + + +// examples.transaction.contract.TransactionContract.key(txn#0: uint64) -> void: +key: + proto 1 0 + +key_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns VotePK + global ZeroAddress + != + assert // vote_key + frame_dig -1 + gtxns SelectionPK + global ZeroAddress + != + assert // selection_key + frame_dig -1 + gtxns VoteKeyDilution + assert // vote_key_dilution + frame_dig -1 + gtxns VoteFirst + assert // vote_first + frame_dig -1 + gtxns VoteLast + assert // vote_last + frame_dig -1 + gtxns Nonparticipation + assert // non_participation + frame_dig -1 + gtxns StateProofPK + len + assert // state_proof_key + retsub + + +// examples.transaction.contract.TransactionContract.asset_config(txn#0: uint64) -> void: +asset_config: + proto 1 0 + +asset_config_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns ConfigAsset + assert // config_asset + frame_dig -1 + gtxns ConfigAssetTotal + assert // total + frame_dig -1 + gtxns ConfigAssetDecimals + assert // decimals + frame_dig -1 + gtxns ConfigAssetDefaultFrozen + assert // default_frozen + frame_dig -1 + gtxns ConfigAssetUnitName + len + assert // unit_name + frame_dig -1 + gtxns ConfigAssetName + len + assert // asset_name + frame_dig -1 + gtxns ConfigAssetURL + len + assert // url + frame_dig -1 + gtxns ConfigAssetMetadataHash + len + assert // metadata_hash + frame_dig -1 + gtxns ConfigAssetManager + global ZeroAddress + != + assert // manager + frame_dig -1 + gtxns ConfigAssetReserve + global ZeroAddress + != + assert // reserve + frame_dig -1 + gtxns ConfigAssetFreeze + global ZeroAddress + != + assert // freeze + frame_dig -1 + gtxns ConfigAssetClawback + global ZeroAddress + != + assert // clawback + retsub + + +// examples.transaction.contract.TransactionContract.asset_transfer(txn#0: uint64) -> void: +asset_transfer: + proto 1 0 + +asset_transfer_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns XferAsset + assert // xfer_asset + frame_dig -1 + gtxns AssetAmount + assert // asset_amount + frame_dig -1 + gtxns AssetSender + global ZeroAddress + != + assert // asset_sender + frame_dig -1 + gtxns AssetReceiver + global ZeroAddress + != + assert // asset_receiver + frame_dig -1 + gtxns AssetCloseTo + global ZeroAddress + != + assert // asset_close_to + retsub + + +// examples.transaction.contract.TransactionContract.asset_freeze(txn#0: uint64) -> void: +asset_freeze: + proto 1 0 + +asset_freeze_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns FreezeAsset + assert // freeze_asset + frame_dig -1 + gtxns FreezeAssetAccount + global ZeroAddress + != + assert // freeze_account + frame_dig -1 + gtxns FreezeAssetFrozen + assert // frozen + retsub + + +// examples.transaction.contract.TransactionContract.application_call(txn#0: uint64) -> void: +application_call: + proto 1 0 + +application_call_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns ApplicationID + assert // application_id + frame_dig -1 + gtxns OnCompletion + assert // on_completion + frame_dig -1 + gtxns NumAppArgs + assert // num_app_args + frame_dig -1 + gtxns NumAccounts + assert // num_accounts + frame_dig -1 + gtxns ApprovalProgram + len + assert // approval_program + frame_dig -1 + gtxns ClearStateProgram + len + assert // clear_state_program + frame_dig -1 + gtxns NumAssets + assert // num_assets + frame_dig -1 + gtxns NumApplications + assert // num_applications + frame_dig -1 + gtxns GlobalNumUint + assert // global_num_uint + frame_dig -1 + gtxns GlobalNumByteSlice + assert // global_num_byte_slice + frame_dig -1 + gtxns LocalNumUint + assert // local_num_uint + frame_dig -1 + gtxns LocalNumByteSlice + assert // local_num_byte_slice + frame_dig -1 + gtxns ExtraProgramPages + assert // extra_program_pages + frame_dig -1 + gtxns LastLog + len + assert // last_log + frame_dig -1 + gtxns NumApprovalProgramPages + assert // num_approval_program_pages + frame_dig -1 + gtxns NumClearStateProgramPages + assert // num_clear_state_program_pages + frame_dig -1 + int 0 + gtxnsas ApplicationArgs + len + assert // application_args(0) + frame_dig -1 + int 0 + gtxnsas Accounts + global ZeroAddress + != + assert // accounts(0) + frame_dig -1 + int 0 + gtxnsas Assets + assert // assets(0) + frame_dig -1 + int 0 + gtxnsas Applications + assert // applications(0) + frame_dig -1 + int 0 + gtxnsas ApprovalProgramPages + len + assert // approval_program_pages(0) + frame_dig -1 + int 0 + gtxnsas ClearStateProgramPages + len + assert // clear_state_program_pages(0) + retsub + diff --git a/examples/transaction/out/contract.approval_unoptimized.debug.teal b/examples/transaction/out/contract.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..82dacafbc3 --- /dev/null +++ b/examples/transaction/out/contract.approval_unoptimized.debug.teal @@ -0,0 +1,482 @@ +// Op // Op Description Stack (out) Source code Source line + +#pragma version 8 + +// examples.transaction.contract.TransactionContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + bz main_after_if_else@11 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + // Implicit fall through to main_abi_routing@1 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + +main_abi_routing@1: + txna ApplicationArgs 0 // {txna} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + method "create()void" // tmp%1#0,method<"create()void"> arc4.abimethod(create=True) File "transaction/contract.py", line 17 + method "pay(pay)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void"> arc4.abimethod File "transaction/contract.py", line 36 + method "key(keyreg)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void"> arc4.abimethod File "transaction/contract.py", line 45 + method "asset_config(acfg)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void"> arc4.abimethod File "transaction/contract.py", line 56 + method "asset_transfer(axfer)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void"> arc4.abimethod File "transaction/contract.py", line 73 + method "asset_freeze(afrz)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void">,method<"asset_freeze(afrz)void"> arc4.abimethod File "transaction/contract.py", line 82 + method "application_call(appl)void" // tmp%1#0,method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void">,method<"asset_freeze(afrz)void">,method<"application_call(appl)void"> arc4.abimethod File "transaction/contract.py", line 90 + uncover 7 // load tmp%1#0 from l-stack (no copy) method<"create()void">,method<"pay(pay)void">,method<"key(keyreg)void">,method<"asset_config(acfg)void">,method<"asset_transfer(axfer)void">,method<"asset_freeze(afrz)void">,method<"application_call(appl)void">,tmp%1#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + match main_create_route@2 main_pay_route@3 main_key_route@4 main_asset_config_route@5 main_asset_transfer_route@6 main_asset_freeze_route@7 main_application_call_route@8 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + b main_switch_case_default@9 // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + +main_create_route@2: + txn OnCompletion // {txn} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + int NoOp // tmp%2#0,NoOp arc4.abimethod(create=True) File "transaction/contract.py", line 17 + == // {==} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + assert // OnCompletion is NoOp // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + txn ApplicationID // {txn} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + ! // {!} arc4.abimethod(create=True) File "transaction/contract.py", line 17 + assert // is creating // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + callsub create // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + int 1 // 1 arc4.abimethod(create=True) File "transaction/contract.py", line 17 + return // arc4.abimethod(create=True) File "transaction/contract.py", line 17 + +main_pay_route@3: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 36 + int NoOp // tmp%6#0,NoOp arc4.abimethod File "transaction/contract.py", line 36 + == // {==} arc4.abimethod File "transaction/contract.py", line 36 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 36 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 36 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 36 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%11#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int pay // awst_tmp%12#0,tmp%13#0,pay class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is pay // maybe_value%9#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub pay // arc4.abimethod File "transaction/contract.py", line 36 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 36 + return // arc4.abimethod File "transaction/contract.py", line 36 + +main_key_route@4: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 45 + int NoOp // tmp%15#0,NoOp arc4.abimethod File "transaction/contract.py", line 45 + == // {==} arc4.abimethod File "transaction/contract.py", line 45 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 45 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 45 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 45 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%20#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int keyreg // awst_tmp%12#0,tmp%21#0,keyreg class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is keyreg // maybe_value%18#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub key // arc4.abimethod File "transaction/contract.py", line 45 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 45 + return // arc4.abimethod File "transaction/contract.py", line 45 + +main_asset_config_route@5: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 56 + int NoOp // tmp%23#0,NoOp arc4.abimethod File "transaction/contract.py", line 56 + == // {==} arc4.abimethod File "transaction/contract.py", line 56 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 56 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 56 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 56 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%28#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int acfg // awst_tmp%12#0,tmp%29#0,acfg class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is acfg // maybe_value%26#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub asset_config // arc4.abimethod File "transaction/contract.py", line 56 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 56 + return // arc4.abimethod File "transaction/contract.py", line 56 + +main_asset_transfer_route@6: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 73 + int NoOp // tmp%31#0,NoOp arc4.abimethod File "transaction/contract.py", line 73 + == // {==} arc4.abimethod File "transaction/contract.py", line 73 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 73 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 73 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 73 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%36#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int axfer // awst_tmp%12#0,tmp%37#0,axfer class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is axfer // maybe_value%34#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub asset_transfer // arc4.abimethod File "transaction/contract.py", line 73 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 73 + return // arc4.abimethod File "transaction/contract.py", line 73 + +main_asset_freeze_route@7: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 82 + int NoOp // tmp%39#0,NoOp arc4.abimethod File "transaction/contract.py", line 82 + == // {==} arc4.abimethod File "transaction/contract.py", line 82 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 82 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 82 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 82 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%44#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int afrz // awst_tmp%12#0,tmp%45#0,afrz class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is afrz // maybe_value%42#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub asset_freeze // arc4.abimethod File "transaction/contract.py", line 82 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 82 + return // arc4.abimethod File "transaction/contract.py", line 82 + +main_application_call_route@8: + txn OnCompletion // {txn} arc4.abimethod File "transaction/contract.py", line 90 + int NoOp // tmp%47#0,NoOp arc4.abimethod File "transaction/contract.py", line 90 + == // {==} arc4.abimethod File "transaction/contract.py", line 90 + assert // OnCompletion is NoOp // arc4.abimethod File "transaction/contract.py", line 90 + txn ApplicationID // {txn} arc4.abimethod File "transaction/contract.py", line 90 + assert // is not creating // arc4.abimethod File "transaction/contract.py", line 90 + txn GroupIndex // {txn} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int 1 // tmp%52#0,1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + - // {-} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + dup // load awst_tmp%12#0 from l-stack (copy) awst_tmp%12#0,awst_tmp%12#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + gtxns TypeEnum // awst_tmp%12#0,{gtxns} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + int appl // awst_tmp%12#0,tmp%53#0,appl class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + == // awst_tmp%12#0,{==} class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + assert // transaction type is appl // maybe_value%50#0 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + callsub application_call // arc4.abimethod File "transaction/contract.py", line 90 + int 1 // 1 arc4.abimethod File "transaction/contract.py", line 90 + return // arc4.abimethod File "transaction/contract.py", line 90 + +main_switch_case_default@9: + // Implicit fall through to main_switch_case_next@10 // + +main_switch_case_next@10: + // Implicit fall through to main_after_if_else@11 // + +main_after_if_else@11: + err // reject transaction // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + + +// examples.transaction.contract.TransactionContract.create() -> void: +create: + proto 0 0 // def create(self) -> None: File "transaction/contract.py", line 18 + +create_block@0: + retsub // + + +// examples.transaction.contract.TransactionContract.pay(txn#0: uint64) -> void: +pay: + proto 1 0 // (𝕡) txn#0 | def pay(self, txn: PaymentTransaction) -> None: File "transaction/contract.py", line 37 + +pay_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 38 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + gtxns Receiver // (𝕡) txn#0 | {gtxns} txn.receiver File "transaction/contract.py", line 40 + global CurrentApplicationAddress // (𝕡) txn#0 | tmp%0#0,{global} Global.current_application_address() File "transaction/contract.py", line 40 + == // (𝕡) txn#0 | {==} txn.receiver == Global.current_application_address() File "transaction/contract.py", line 40 + assert // Payment should be for this app // (𝕡) txn#0 | assert ( File "transaction/contract.py", line 39 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + gtxns Amount // (𝕡) txn#0 | {gtxns} txn.amount File "transaction/contract.py", line 42 + int 1000 // (𝕡) txn#0 | tmp%3#0,1000 1000 File "transaction/contract.py", line 42 + > // (𝕡) txn#0 | {>} txn.amount > 1000, "Payment should be for >1000 micro algos" File "transaction/contract.py", line 42 + assert // Payment should be for >1000 micro algos // (𝕡) txn#0 | assert txn.amount > 1000, "Payment should be for >1000 micro algos" File "transaction/contract.py", line 42 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: PaymentTransaction File "transaction/contract.py", line 37 + gtxns CloseRemainderTo // (𝕡) txn#0 | {gtxns} txn.close_remainder_to File "transaction/contract.py", line 43 + global ZeroAddress // (𝕡) txn#0 | tmp%5#0,{global} Global.zero_address() File "transaction/contract.py", line 43 + == // (𝕡) txn#0 | {==} txn.close_remainder_to == Global.zero_address(), "close_remainder_to" File "transaction/contract.py", line 43 + assert // close_remainder_to // (𝕡) txn#0 | assert txn.close_remainder_to == Global.zero_address(), "close_remainder_to" File "transaction/contract.py", line 43 + retsub // + + +// examples.transaction.contract.TransactionContract._common_checks(txn#0: uint64) -> void: +_common_checks: + proto 1 0 // (𝕡) txn#0 | def _common_checks(self, txn: TransactionBase) -> None: File "transaction/contract.py", line 22 + +_common_checks_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns TxID // (𝕡) txn#0 | {gtxns} txn.txn_id File "transaction/contract.py", line 23 + len // (𝕡) txn#0 | {len} txn.txn_id File "transaction/contract.py", line 23 + assert // txn_id // (𝕡) txn#0 | assert txn.txn_id, "txn_id" File "transaction/contract.py", line 23 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Sender // (𝕡) txn#0 | {gtxns} txn.sender File "transaction/contract.py", line 24 + global CreatorAddress // (𝕡) txn#0 | tmp%2#0,{global} Global.creator_address() File "transaction/contract.py", line 24 + == // (𝕡) txn#0 | {==} txn.sender == Global.creator_address(), "sender" File "transaction/contract.py", line 24 + assert // sender // (𝕡) txn#0 | assert txn.sender == Global.creator_address(), "sender" File "transaction/contract.py", line 24 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Fee // (𝕡) txn#0 | {gtxns} txn.fee File "transaction/contract.py", line 25 + assert // fee // (𝕡) txn#0 | assert txn.fee, "fee" File "transaction/contract.py", line 25 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns TypeEnum // (𝕡) txn#0 | {gtxns} txn.type File "transaction/contract.py", line 26 + assert // type // (𝕡) txn#0 | assert txn.type, "type" File "transaction/contract.py", line 26 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Type // (𝕡) txn#0 | {gtxns} txn.type_bytes File "transaction/contract.py", line 27 + len // (𝕡) txn#0 | {len} txn.type_bytes File "transaction/contract.py", line 27 + assert // type_bytes // (𝕡) txn#0 | assert txn.type_bytes, "type_bytes" File "transaction/contract.py", line 27 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Note // (𝕡) txn#0 | {gtxns} txn.note File "transaction/contract.py", line 28 + byte "" // (𝕡) txn#0 | tmp%9#0,"" b"" File "transaction/contract.py", line 28 + == // (𝕡) txn#0 | {==} txn.note == Bytes(b""), "note" File "transaction/contract.py", line 28 + assert // note // (𝕡) txn#0 | assert txn.note == Bytes(b""), "note" File "transaction/contract.py", line 28 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns GroupIndex // (𝕡) txn#0 | {gtxns} txn.group_index File "transaction/contract.py", line 29 + int 0 // (𝕡) txn#0 | tmp%11#0,0 0 File "transaction/contract.py", line 29 + == // (𝕡) txn#0 | {==} txn.group_index == 0, "group_index" File "transaction/contract.py", line 29 + assert // group_index // (𝕡) txn#0 | assert txn.group_index == 0, "group_index" File "transaction/contract.py", line 29 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns FirstValid // (𝕡) txn#0 | {gtxns} txn.first_valid File "transaction/contract.py", line 30 + assert // first_valid // (𝕡) txn#0 | assert txn.first_valid, "first_valid" File "transaction/contract.py", line 30 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns FirstValidTime // (𝕡) txn#0 | {gtxns} txn.first_valid_time File "transaction/contract.py", line 31 + assert // first_valid_time // (𝕡) txn#0 | assert txn.first_valid_time, "first_valid_time" File "transaction/contract.py", line 31 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns LastValid // (𝕡) txn#0 | {gtxns} txn.last_valid File "transaction/contract.py", line 32 + assert // last_valid // (𝕡) txn#0 | assert txn.last_valid, "last_valid" File "transaction/contract.py", line 32 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns Lease // (𝕡) txn#0 | {gtxns} txn.lease File "transaction/contract.py", line 33 + len // (𝕡) txn#0 | {len} txn.lease File "transaction/contract.py", line 33 + assert // lease // (𝕡) txn#0 | assert txn.lease, "lease" File "transaction/contract.py", line 33 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: TransactionBase File "transaction/contract.py", line 22 + gtxns RekeyTo // (𝕡) txn#0 | {gtxns} txn.rekey_to File "transaction/contract.py", line 34 + global ZeroAddress // (𝕡) txn#0 | tmp%18#0,{global} Global.zero_address() File "transaction/contract.py", line 34 + == // (𝕡) txn#0 | {==} txn.rekey_to == Global.zero_address(), "rekey_to" File "transaction/contract.py", line 34 + assert // rekey_to // (𝕡) txn#0 | assert txn.rekey_to == Global.zero_address(), "rekey_to" File "transaction/contract.py", line 34 + retsub // + + +// examples.transaction.contract.TransactionContract.key(txn#0: uint64) -> void: +key: + proto 1 0 // (𝕡) txn#0 | def key(self, txn: KeyRegistrationTransaction) -> None: File "transaction/contract.py", line 46 + +key_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 47 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VotePK // (𝕡) txn#0 | {gtxns} txn.vote_key File "transaction/contract.py", line 48 + global ZeroAddress // (𝕡) txn#0 | tmp%0#0,{global} txn.vote_key File "transaction/contract.py", line 48 + != // (𝕡) txn#0 | {!=} txn.vote_key File "transaction/contract.py", line 48 + assert // vote_key // (𝕡) txn#0 | assert txn.vote_key, "vote_key" File "transaction/contract.py", line 48 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns SelectionPK // (𝕡) txn#0 | {gtxns} txn.selection_key File "transaction/contract.py", line 49 + global ZeroAddress // (𝕡) txn#0 | tmp%3#0,{global} txn.selection_key File "transaction/contract.py", line 49 + != // (𝕡) txn#0 | {!=} txn.selection_key File "transaction/contract.py", line 49 + assert // selection_key // (𝕡) txn#0 | assert txn.selection_key, "selection_key" File "transaction/contract.py", line 49 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VoteKeyDilution // (𝕡) txn#0 | {gtxns} txn.vote_key_dilution File "transaction/contract.py", line 50 + assert // vote_key_dilution // (𝕡) txn#0 | assert txn.vote_key_dilution, "vote_key_dilution" File "transaction/contract.py", line 50 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VoteFirst // (𝕡) txn#0 | {gtxns} txn.vote_first File "transaction/contract.py", line 51 + assert // vote_first // (𝕡) txn#0 | assert txn.vote_first, "vote_first" File "transaction/contract.py", line 51 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns VoteLast // (𝕡) txn#0 | {gtxns} txn.vote_last File "transaction/contract.py", line 52 + assert // vote_last // (𝕡) txn#0 | assert txn.vote_last, "vote_last" File "transaction/contract.py", line 52 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns Nonparticipation // (𝕡) txn#0 | {gtxns} txn.non_participation File "transaction/contract.py", line 53 + assert // non_participation // (𝕡) txn#0 | assert txn.non_participation, "non_participation" File "transaction/contract.py", line 53 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: KeyRegistrationTransaction File "transaction/contract.py", line 46 + gtxns StateProofPK // (𝕡) txn#0 | {gtxns} txn.state_proof_key File "transaction/contract.py", line 54 + len // (𝕡) txn#0 | {len} txn.state_proof_key File "transaction/contract.py", line 54 + assert // state_proof_key // (𝕡) txn#0 | assert txn.state_proof_key, "state_proof_key" File "transaction/contract.py", line 54 + retsub // + + +// examples.transaction.contract.TransactionContract.asset_config(txn#0: uint64) -> void: +asset_config: + proto 1 0 // (𝕡) txn#0 | def asset_config(self, txn: AssetConfigTransaction) -> None: File "transaction/contract.py", line 57 + +asset_config_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 58 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAsset // (𝕡) txn#0 | {gtxns} txn.config_asset File "transaction/contract.py", line 60 + assert // config_asset // (𝕡) txn#0 | assert txn.config_asset, "config_asset" File "transaction/contract.py", line 60 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetTotal // (𝕡) txn#0 | {gtxns} txn.total File "transaction/contract.py", line 61 + assert // total // (𝕡) txn#0 | assert txn.total, "total" File "transaction/contract.py", line 61 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetDecimals // (𝕡) txn#0 | {gtxns} txn.decimals File "transaction/contract.py", line 62 + assert // decimals // (𝕡) txn#0 | assert txn.decimals, "decimals" File "transaction/contract.py", line 62 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetDefaultFrozen // (𝕡) txn#0 | {gtxns} txn.default_frozen File "transaction/contract.py", line 63 + assert // default_frozen // (𝕡) txn#0 | assert txn.default_frozen, "default_frozen" File "transaction/contract.py", line 63 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetUnitName // (𝕡) txn#0 | {gtxns} txn.unit_name File "transaction/contract.py", line 64 + len // (𝕡) txn#0 | {len} txn.unit_name File "transaction/contract.py", line 64 + assert // unit_name // (𝕡) txn#0 | assert txn.unit_name, "unit_name" File "transaction/contract.py", line 64 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetName // (𝕡) txn#0 | {gtxns} txn.asset_name File "transaction/contract.py", line 65 + len // (𝕡) txn#0 | {len} txn.asset_name File "transaction/contract.py", line 65 + assert // asset_name // (𝕡) txn#0 | assert txn.asset_name, "asset_name" File "transaction/contract.py", line 65 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetURL // (𝕡) txn#0 | {gtxns} txn.url File "transaction/contract.py", line 66 + len // (𝕡) txn#0 | {len} txn.url File "transaction/contract.py", line 66 + assert // url // (𝕡) txn#0 | assert txn.url, "url" File "transaction/contract.py", line 66 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetMetadataHash // (𝕡) txn#0 | {gtxns} txn.metadata_hash File "transaction/contract.py", line 67 + len // (𝕡) txn#0 | {len} txn.metadata_hash File "transaction/contract.py", line 67 + assert // metadata_hash // (𝕡) txn#0 | assert txn.metadata_hash, "metadata_hash" File "transaction/contract.py", line 67 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetManager // (𝕡) txn#0 | {gtxns} txn.manager File "transaction/contract.py", line 68 + global ZeroAddress // (𝕡) txn#0 | tmp%12#0,{global} txn.manager File "transaction/contract.py", line 68 + != // (𝕡) txn#0 | {!=} txn.manager File "transaction/contract.py", line 68 + assert // manager // (𝕡) txn#0 | assert txn.manager, "manager" File "transaction/contract.py", line 68 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetReserve // (𝕡) txn#0 | {gtxns} txn.reserve File "transaction/contract.py", line 69 + global ZeroAddress // (𝕡) txn#0 | tmp%15#0,{global} txn.reserve File "transaction/contract.py", line 69 + != // (𝕡) txn#0 | {!=} txn.reserve File "transaction/contract.py", line 69 + assert // reserve // (𝕡) txn#0 | assert txn.reserve, "reserve" File "transaction/contract.py", line 69 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetFreeze // (𝕡) txn#0 | {gtxns} txn.freeze File "transaction/contract.py", line 70 + global ZeroAddress // (𝕡) txn#0 | tmp%18#0,{global} txn.freeze File "transaction/contract.py", line 70 + != // (𝕡) txn#0 | {!=} txn.freeze File "transaction/contract.py", line 70 + assert // freeze // (𝕡) txn#0 | assert txn.freeze, "freeze" File "transaction/contract.py", line 70 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetConfigTransaction File "transaction/contract.py", line 57 + gtxns ConfigAssetClawback // (𝕡) txn#0 | {gtxns} txn.clawback File "transaction/contract.py", line 71 + global ZeroAddress // (𝕡) txn#0 | tmp%21#0,{global} txn.clawback File "transaction/contract.py", line 71 + != // (𝕡) txn#0 | {!=} txn.clawback File "transaction/contract.py", line 71 + assert // clawback // (𝕡) txn#0 | assert txn.clawback, "clawback" File "transaction/contract.py", line 71 + retsub // + + +// examples.transaction.contract.TransactionContract.asset_transfer(txn#0: uint64) -> void: +asset_transfer: + proto 1 0 // (𝕡) txn#0 | def asset_transfer(self, txn: AssetTransferTransaction) -> None: File "transaction/contract.py", line 74 + +asset_transfer_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 75 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns XferAsset // (𝕡) txn#0 | {gtxns} txn.xfer_asset File "transaction/contract.py", line 76 + assert // xfer_asset // (𝕡) txn#0 | assert txn.xfer_asset, "xfer_asset" File "transaction/contract.py", line 76 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetAmount // (𝕡) txn#0 | {gtxns} txn.asset_amount File "transaction/contract.py", line 77 + assert // asset_amount // (𝕡) txn#0 | assert txn.asset_amount, "asset_amount" File "transaction/contract.py", line 77 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetSender // (𝕡) txn#0 | {gtxns} txn.asset_sender File "transaction/contract.py", line 78 + global ZeroAddress // (𝕡) txn#0 | tmp%2#0,{global} txn.asset_sender File "transaction/contract.py", line 78 + != // (𝕡) txn#0 | {!=} txn.asset_sender File "transaction/contract.py", line 78 + assert // asset_sender // (𝕡) txn#0 | assert txn.asset_sender, "asset_sender" File "transaction/contract.py", line 78 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetReceiver // (𝕡) txn#0 | {gtxns} txn.asset_receiver File "transaction/contract.py", line 79 + global ZeroAddress // (𝕡) txn#0 | tmp%5#0,{global} txn.asset_receiver File "transaction/contract.py", line 79 + != // (𝕡) txn#0 | {!=} txn.asset_receiver File "transaction/contract.py", line 79 + assert // asset_receiver // (𝕡) txn#0 | assert txn.asset_receiver, "asset_receiver" File "transaction/contract.py", line 79 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetTransferTransaction File "transaction/contract.py", line 74 + gtxns AssetCloseTo // (𝕡) txn#0 | {gtxns} txn.asset_close_to File "transaction/contract.py", line 80 + global ZeroAddress // (𝕡) txn#0 | tmp%8#0,{global} txn.asset_close_to File "transaction/contract.py", line 80 + != // (𝕡) txn#0 | {!=} txn.asset_close_to File "transaction/contract.py", line 80 + assert // asset_close_to // (𝕡) txn#0 | assert txn.asset_close_to, "asset_close_to" File "transaction/contract.py", line 80 + retsub // + + +// examples.transaction.contract.TransactionContract.asset_freeze(txn#0: uint64) -> void: +asset_freeze: + proto 1 0 // (𝕡) txn#0 | def asset_freeze(self, txn: AssetFreezeTransaction) -> None: File "transaction/contract.py", line 83 + +asset_freeze_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 84 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + gtxns FreezeAsset // (𝕡) txn#0 | {gtxns} txn.freeze_asset File "transaction/contract.py", line 86 + assert // freeze_asset // (𝕡) txn#0 | assert txn.freeze_asset, "freeze_asset" File "transaction/contract.py", line 86 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + gtxns FreezeAssetAccount // (𝕡) txn#0 | {gtxns} txn.freeze_account File "transaction/contract.py", line 87 + global ZeroAddress // (𝕡) txn#0 | tmp%1#0,{global} txn.freeze_account File "transaction/contract.py", line 87 + != // (𝕡) txn#0 | {!=} txn.freeze_account File "transaction/contract.py", line 87 + assert // freeze_account // (𝕡) txn#0 | assert txn.freeze_account, "freeze_account" File "transaction/contract.py", line 87 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: AssetFreezeTransaction File "transaction/contract.py", line 83 + gtxns FreezeAssetFrozen // (𝕡) txn#0 | {gtxns} txn.frozen File "transaction/contract.py", line 88 + assert // frozen // (𝕡) txn#0 | assert txn.frozen, "frozen" File "transaction/contract.py", line 88 + retsub // + + +// examples.transaction.contract.TransactionContract.application_call(txn#0: uint64) -> void: +application_call: + proto 1 0 // (𝕡) txn#0 | def application_call(self, txn: ApplicationCallTransaction) -> None: File "transaction/contract.py", line 91 + +application_call_block@0: + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + callsub _common_checks // (𝕡) txn#0 | self._common_checks(txn) File "transaction/contract.py", line 92 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ApplicationID // (𝕡) txn#0 | {gtxns} txn.application_id File "transaction/contract.py", line 93 + assert // application_id // (𝕡) txn#0 | assert txn.application_id, "application_id" File "transaction/contract.py", line 93 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns OnCompletion // (𝕡) txn#0 | {gtxns} txn.on_completion File "transaction/contract.py", line 94 + assert // on_completion // (𝕡) txn#0 | assert txn.on_completion, "on_completion" File "transaction/contract.py", line 94 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumAppArgs // (𝕡) txn#0 | {gtxns} txn.num_app_args File "transaction/contract.py", line 95 + assert // num_app_args // (𝕡) txn#0 | assert txn.num_app_args, "num_app_args" File "transaction/contract.py", line 95 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumAccounts // (𝕡) txn#0 | {gtxns} txn.num_accounts File "transaction/contract.py", line 96 + assert // num_accounts // (𝕡) txn#0 | assert txn.num_accounts, "num_accounts" File "transaction/contract.py", line 96 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ApprovalProgram // (𝕡) txn#0 | {gtxns} txn.approval_program File "transaction/contract.py", line 97 + len // (𝕡) txn#0 | {len} txn.approval_program File "transaction/contract.py", line 97 + assert // approval_program // (𝕡) txn#0 | assert txn.approval_program, "approval_program" File "transaction/contract.py", line 97 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ClearStateProgram // (𝕡) txn#0 | {gtxns} txn.clear_state_program File "transaction/contract.py", line 98 + len // (𝕡) txn#0 | {len} txn.clear_state_program File "transaction/contract.py", line 98 + assert // clear_state_program // (𝕡) txn#0 | assert txn.clear_state_program, "clear_state_program" File "transaction/contract.py", line 98 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumAssets // (𝕡) txn#0 | {gtxns} txn.num_assets File "transaction/contract.py", line 99 + assert // num_assets // (𝕡) txn#0 | assert txn.num_assets, "num_assets" File "transaction/contract.py", line 99 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumApplications // (𝕡) txn#0 | {gtxns} txn.num_applications File "transaction/contract.py", line 100 + assert // num_applications // (𝕡) txn#0 | assert txn.num_applications, "num_applications" File "transaction/contract.py", line 100 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns GlobalNumUint // (𝕡) txn#0 | {gtxns} txn.global_num_uint File "transaction/contract.py", line 101 + assert // global_num_uint // (𝕡) txn#0 | assert txn.global_num_uint, "global_num_uint" File "transaction/contract.py", line 101 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns GlobalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.global_num_byte_slice File "transaction/contract.py", line 102 + assert // global_num_byte_slice // (𝕡) txn#0 | assert txn.global_num_byte_slice, "global_num_byte_slice" File "transaction/contract.py", line 102 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns LocalNumUint // (𝕡) txn#0 | {gtxns} txn.local_num_uint File "transaction/contract.py", line 103 + assert // local_num_uint // (𝕡) txn#0 | assert txn.local_num_uint, "local_num_uint" File "transaction/contract.py", line 103 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns LocalNumByteSlice // (𝕡) txn#0 | {gtxns} txn.local_num_byte_slice File "transaction/contract.py", line 104 + assert // local_num_byte_slice // (𝕡) txn#0 | assert txn.local_num_byte_slice, "local_num_byte_slice" File "transaction/contract.py", line 104 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns ExtraProgramPages // (𝕡) txn#0 | {gtxns} txn.extra_program_pages File "transaction/contract.py", line 105 + assert // extra_program_pages // (𝕡) txn#0 | assert txn.extra_program_pages, "extra_program_pages" File "transaction/contract.py", line 105 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns LastLog // (𝕡) txn#0 | {gtxns} txn.last_log File "transaction/contract.py", line 106 + len // (𝕡) txn#0 | {len} txn.last_log File "transaction/contract.py", line 106 + assert // last_log // (𝕡) txn#0 | assert txn.last_log, "last_log" File "transaction/contract.py", line 106 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumApprovalProgramPages // (𝕡) txn#0 | {gtxns} txn.num_approval_program_pages File "transaction/contract.py", line 107 + assert // num_approval_program_pages // (𝕡) txn#0 | assert txn.num_approval_program_pages, "num_approval_program_pages" File "transaction/contract.py", line 107 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + gtxns NumClearStateProgramPages // (𝕡) txn#0 | {gtxns} txn.num_clear_state_program_pages File "transaction/contract.py", line 108 + assert // num_clear_state_program_pages // (𝕡) txn#0 | assert txn.num_clear_state_program_pages, "num_clear_state_program_pages" File "transaction/contract.py", line 108 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 109 + gtxnsas ApplicationArgs // (𝕡) txn#0 | {gtxnsas} txn.application_args(0) File "transaction/contract.py", line 109 + len // (𝕡) txn#0 | {len} txn.application_args(0) File "transaction/contract.py", line 109 + assert // application_args(0) // (𝕡) txn#0 | assert txn.application_args(0), "application_args(0)" File "transaction/contract.py", line 109 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 110 + gtxnsas Accounts // (𝕡) txn#0 | {gtxnsas} txn.accounts(0) File "transaction/contract.py", line 110 + global ZeroAddress // (𝕡) txn#0 | tmp%21#0,{global} txn.accounts(0) File "transaction/contract.py", line 110 + != // (𝕡) txn#0 | {!=} txn.accounts(0) File "transaction/contract.py", line 110 + assert // accounts(0) // (𝕡) txn#0 | assert txn.accounts(0), "accounts(0)" File "transaction/contract.py", line 110 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 111 + gtxnsas Assets // (𝕡) txn#0 | {gtxnsas} txn.assets(0) File "transaction/contract.py", line 111 + assert // assets(0) // (𝕡) txn#0 | assert txn.assets(0), "assets(0)" File "transaction/contract.py", line 111 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 112 + gtxnsas Applications // (𝕡) txn#0 | {gtxnsas} txn.applications(0) File "transaction/contract.py", line 112 + assert // applications(0) // (𝕡) txn#0 | assert txn.applications(0), "applications(0)" File "transaction/contract.py", line 112 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 113 + gtxnsas ApprovalProgramPages // (𝕡) txn#0 | {gtxnsas} txn.approval_program_pages(0) File "transaction/contract.py", line 113 + len // (𝕡) txn#0 | {len} txn.approval_program_pages(0) File "transaction/contract.py", line 113 + assert // approval_program_pages(0) // (𝕡) txn#0 | assert txn.approval_program_pages(0), "approval_program_pages(0)" File "transaction/contract.py", line 113 + frame_dig -1 // load txn#0 from parameters (𝕡) txn#0 | txn#0 txn: ApplicationCallTransaction File "transaction/contract.py", line 91 + int 0 // (𝕡) txn#0 | txn#0,0 0 File "transaction/contract.py", line 114 + gtxnsas ClearStateProgramPages // (𝕡) txn#0 | {gtxnsas} txn.clear_state_program_pages(0) File "transaction/contract.py", line 114 + len // (𝕡) txn#0 | {len} txn.clear_state_program_pages(0) File "transaction/contract.py", line 114 + assert // clear_state_program_pages(0) // (𝕡) txn#0 | assert txn.clear_state_program_pages(0), "clear_state_program_pages(0)" File "transaction/contract.py", line 114 + retsub // + diff --git a/examples/transaction/out/contract.approval_unoptimized.teal b/examples/transaction/out/contract.approval_unoptimized.teal new file mode 100644 index 0000000000..90ba60c5b1 --- /dev/null +++ b/examples/transaction/out/contract.approval_unoptimized.teal @@ -0,0 +1,477 @@ +#pragma version 8 + +// examples.transaction.contract.TransactionContract.approval_program() -> uint64: +main_block@0: + txn NumAppArgs + bz main_after_if_else@11 + +main_abi_routing@1: + txna ApplicationArgs 0 + method "create()void" + method "pay(pay)void" + method "key(keyreg)void" + method "asset_config(acfg)void" + method "asset_transfer(axfer)void" + method "asset_freeze(afrz)void" + method "application_call(appl)void" + uncover 7 + match main_create_route@2 main_pay_route@3 main_key_route@4 main_asset_config_route@5 main_asset_transfer_route@6 main_asset_freeze_route@7 main_application_call_route@8 + b main_switch_case_default@9 + +main_create_route@2: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + ! + assert // is creating + callsub create + int 1 + return + +main_pay_route@3: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + callsub pay + int 1 + return + +main_key_route@4: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int keyreg + == + assert // transaction type is keyreg + callsub key + int 1 + return + +main_asset_config_route@5: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int acfg + == + assert // transaction type is acfg + callsub asset_config + int 1 + return + +main_asset_transfer_route@6: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int axfer + == + assert // transaction type is axfer + callsub asset_transfer + int 1 + return + +main_asset_freeze_route@7: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int afrz + == + assert // transaction type is afrz + callsub asset_freeze + int 1 + return + +main_application_call_route@8: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int appl + == + assert // transaction type is appl + callsub application_call + int 1 + return + +main_switch_case_default@9: + +main_switch_case_next@10: + +main_after_if_else@11: + err // reject transaction + + +// examples.transaction.contract.TransactionContract.create() -> void: +create: + proto 0 0 + +create_block@0: + retsub + + +// examples.transaction.contract.TransactionContract.pay(txn#0: uint64) -> void: +pay: + proto 1 0 + +pay_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns Receiver + global CurrentApplicationAddress + == + assert // Payment should be for this app + frame_dig -1 + gtxns Amount + int 1000 + > + assert // Payment should be for >1000 micro algos + frame_dig -1 + gtxns CloseRemainderTo + global ZeroAddress + == + assert // close_remainder_to + retsub + + +// examples.transaction.contract.TransactionContract._common_checks(txn#0: uint64) -> void: +_common_checks: + proto 1 0 + +_common_checks_block@0: + frame_dig -1 + gtxns TxID + len + assert // txn_id + frame_dig -1 + gtxns Sender + global CreatorAddress + == + assert // sender + frame_dig -1 + gtxns Fee + assert // fee + frame_dig -1 + gtxns TypeEnum + assert // type + frame_dig -1 + gtxns Type + len + assert // type_bytes + frame_dig -1 + gtxns Note + byte "" + == + assert // note + frame_dig -1 + gtxns GroupIndex + int 0 + == + assert // group_index + frame_dig -1 + gtxns FirstValid + assert // first_valid + frame_dig -1 + gtxns FirstValidTime + assert // first_valid_time + frame_dig -1 + gtxns LastValid + assert // last_valid + frame_dig -1 + gtxns Lease + len + assert // lease + frame_dig -1 + gtxns RekeyTo + global ZeroAddress + == + assert // rekey_to + retsub + + +// examples.transaction.contract.TransactionContract.key(txn#0: uint64) -> void: +key: + proto 1 0 + +key_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns VotePK + global ZeroAddress + != + assert // vote_key + frame_dig -1 + gtxns SelectionPK + global ZeroAddress + != + assert // selection_key + frame_dig -1 + gtxns VoteKeyDilution + assert // vote_key_dilution + frame_dig -1 + gtxns VoteFirst + assert // vote_first + frame_dig -1 + gtxns VoteLast + assert // vote_last + frame_dig -1 + gtxns Nonparticipation + assert // non_participation + frame_dig -1 + gtxns StateProofPK + len + assert // state_proof_key + retsub + + +// examples.transaction.contract.TransactionContract.asset_config(txn#0: uint64) -> void: +asset_config: + proto 1 0 + +asset_config_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns ConfigAsset + assert // config_asset + frame_dig -1 + gtxns ConfigAssetTotal + assert // total + frame_dig -1 + gtxns ConfigAssetDecimals + assert // decimals + frame_dig -1 + gtxns ConfigAssetDefaultFrozen + assert // default_frozen + frame_dig -1 + gtxns ConfigAssetUnitName + len + assert // unit_name + frame_dig -1 + gtxns ConfigAssetName + len + assert // asset_name + frame_dig -1 + gtxns ConfigAssetURL + len + assert // url + frame_dig -1 + gtxns ConfigAssetMetadataHash + len + assert // metadata_hash + frame_dig -1 + gtxns ConfigAssetManager + global ZeroAddress + != + assert // manager + frame_dig -1 + gtxns ConfigAssetReserve + global ZeroAddress + != + assert // reserve + frame_dig -1 + gtxns ConfigAssetFreeze + global ZeroAddress + != + assert // freeze + frame_dig -1 + gtxns ConfigAssetClawback + global ZeroAddress + != + assert // clawback + retsub + + +// examples.transaction.contract.TransactionContract.asset_transfer(txn#0: uint64) -> void: +asset_transfer: + proto 1 0 + +asset_transfer_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns XferAsset + assert // xfer_asset + frame_dig -1 + gtxns AssetAmount + assert // asset_amount + frame_dig -1 + gtxns AssetSender + global ZeroAddress + != + assert // asset_sender + frame_dig -1 + gtxns AssetReceiver + global ZeroAddress + != + assert // asset_receiver + frame_dig -1 + gtxns AssetCloseTo + global ZeroAddress + != + assert // asset_close_to + retsub + + +// examples.transaction.contract.TransactionContract.asset_freeze(txn#0: uint64) -> void: +asset_freeze: + proto 1 0 + +asset_freeze_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns FreezeAsset + assert // freeze_asset + frame_dig -1 + gtxns FreezeAssetAccount + global ZeroAddress + != + assert // freeze_account + frame_dig -1 + gtxns FreezeAssetFrozen + assert // frozen + retsub + + +// examples.transaction.contract.TransactionContract.application_call(txn#0: uint64) -> void: +application_call: + proto 1 0 + +application_call_block@0: + frame_dig -1 + callsub _common_checks + frame_dig -1 + gtxns ApplicationID + assert // application_id + frame_dig -1 + gtxns OnCompletion + assert // on_completion + frame_dig -1 + gtxns NumAppArgs + assert // num_app_args + frame_dig -1 + gtxns NumAccounts + assert // num_accounts + frame_dig -1 + gtxns ApprovalProgram + len + assert // approval_program + frame_dig -1 + gtxns ClearStateProgram + len + assert // clear_state_program + frame_dig -1 + gtxns NumAssets + assert // num_assets + frame_dig -1 + gtxns NumApplications + assert // num_applications + frame_dig -1 + gtxns GlobalNumUint + assert // global_num_uint + frame_dig -1 + gtxns GlobalNumByteSlice + assert // global_num_byte_slice + frame_dig -1 + gtxns LocalNumUint + assert // local_num_uint + frame_dig -1 + gtxns LocalNumByteSlice + assert // local_num_byte_slice + frame_dig -1 + gtxns ExtraProgramPages + assert // extra_program_pages + frame_dig -1 + gtxns LastLog + len + assert // last_log + frame_dig -1 + gtxns NumApprovalProgramPages + assert // num_approval_program_pages + frame_dig -1 + gtxns NumClearStateProgramPages + assert // num_clear_state_program_pages + frame_dig -1 + int 0 + gtxnsas ApplicationArgs + len + assert // application_args(0) + frame_dig -1 + int 0 + gtxnsas Accounts + global ZeroAddress + != + assert // accounts(0) + frame_dig -1 + int 0 + gtxnsas Assets + assert // assets(0) + frame_dig -1 + int 0 + gtxnsas Applications + assert // applications(0) + frame_dig -1 + int 0 + gtxnsas ApprovalProgramPages + len + assert // approval_program_pages(0) + frame_dig -1 + int 0 + gtxnsas ClearStateProgramPages + len + assert // clear_state_program_pages(0) + retsub + diff --git a/examples/transaction/out/contract.awst b/examples/transaction/out/contract.awst new file mode 100644 index 0000000000..74831c6ba1 --- /dev/null +++ b/examples/transaction/out/contract.awst @@ -0,0 +1,104 @@ +contract TransactionContract +{ + abimethod create(): None + { + } + + subroutine _common_checks(txn: algopy.TransactionBase): None + { + assert(reinterpret_cast(len(gtxns(txn))), comment="txn_id") + assert(gtxns(txn) == global(), comment="sender") + assert(reinterpret_cast(gtxns(txn)), comment="fee") + assert(reinterpret_cast(gtxns(txn)), comment="type") + assert(reinterpret_cast(len(gtxns(txn))), comment="type_bytes") + assert(gtxns(txn) == '', comment="note") + assert(gtxns(txn) == 0u, comment="group_index") + assert(reinterpret_cast(gtxns(txn)), comment="first_valid") + assert(reinterpret_cast(gtxns(txn)), comment="first_valid_time") + assert(reinterpret_cast(gtxns(txn)), comment="last_valid") + assert(reinterpret_cast(len(gtxns(txn))), comment="lease") + assert(gtxns(txn) == global(), comment="rekey_to") + } + + abimethod pay(txn: algopy.PaymentTransaction): None + { + this::_common_checks(txn) + assert(gtxns(txn) == global(), comment="Payment should be for this app") + assert(gtxns(txn) > 1000u, comment="Payment should be for >1000 micro algos") + assert(gtxns(txn) == global(), comment="close_remainder_to") + } + + abimethod key(txn: algopy.KeyRegistrationTransaction): None + { + this::_common_checks(txn) + assert(gtxns(txn) != global(), comment="vote_key") + assert(gtxns(txn) != global(), comment="selection_key") + assert(reinterpret_cast(gtxns(txn)), comment="vote_key_dilution") + assert(reinterpret_cast(gtxns(txn)), comment="vote_first") + assert(reinterpret_cast(gtxns(txn)), comment="vote_last") + assert(gtxns(txn), comment="non_participation") + assert(reinterpret_cast(len(gtxns(txn))), comment="state_proof_key") + } + + abimethod asset_config(txn: algopy.AssetConfigTransaction): None + { + this::_common_checks(txn) + assert(reinterpret_cast(gtxns(txn)), comment="config_asset") + assert(reinterpret_cast(gtxns(txn)), comment="total") + assert(reinterpret_cast(gtxns(txn)), comment="decimals") + assert(gtxns(txn), comment="default_frozen") + assert(reinterpret_cast(len(gtxns(txn))), comment="unit_name") + assert(reinterpret_cast(len(gtxns(txn))), comment="asset_name") + assert(reinterpret_cast(len(gtxns(txn))), comment="url") + assert(reinterpret_cast(len(gtxns(txn))), comment="metadata_hash") + assert(gtxns(txn) != global(), comment="manager") + assert(gtxns(txn) != global(), comment="reserve") + assert(gtxns(txn) != global(), comment="freeze") + assert(gtxns(txn) != global(), comment="clawback") + } + + abimethod asset_transfer(txn: algopy.AssetTransferTransaction): None + { + this::_common_checks(txn) + assert(reinterpret_cast(gtxns(txn)), comment="xfer_asset") + assert(reinterpret_cast(gtxns(txn)), comment="asset_amount") + assert(gtxns(txn) != global(), comment="asset_sender") + assert(gtxns(txn) != global(), comment="asset_receiver") + assert(gtxns(txn) != global(), comment="asset_close_to") + } + + abimethod asset_freeze(txn: algopy.AssetFreezeTransaction): None + { + this::_common_checks(txn) + assert(reinterpret_cast(gtxns(txn)), comment="freeze_asset") + assert(gtxns(txn) != global(), comment="freeze_account") + assert(gtxns(txn), comment="frozen") + } + + abimethod application_call(txn: algopy.ApplicationCallTransaction): None + { + this::_common_checks(txn) + assert(reinterpret_cast(gtxns(txn)), comment="application_id") + assert(reinterpret_cast(gtxns(txn)), comment="on_completion") + assert(reinterpret_cast(gtxns(txn)), comment="num_app_args") + assert(reinterpret_cast(gtxns(txn)), comment="num_accounts") + assert(reinterpret_cast(len(gtxns(txn))), comment="approval_program") + assert(reinterpret_cast(len(gtxns(txn))), comment="clear_state_program") + assert(reinterpret_cast(gtxns(txn)), comment="num_assets") + assert(reinterpret_cast(gtxns(txn)), comment="num_applications") + 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="local_num_uint") + assert(reinterpret_cast(gtxns(txn)), comment="local_num_byte_slice") + 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") + assert(reinterpret_cast(gtxns(txn)), comment="num_clear_state_program_pages") + assert(reinterpret_cast(len(gtxnsas(txn, 0u))), comment="application_args(0)") + assert(gtxnsas(txn, 0u) != global(), comment="accounts(0)") + assert(reinterpret_cast(gtxnsas(txn, 0u)), comment="assets(0)") + assert(reinterpret_cast(gtxnsas(txn, 0u)), comment="applications(0)") + assert(reinterpret_cast(len(gtxnsas(txn, 0u))), comment="approval_program_pages(0)") + assert(reinterpret_cast(len(gtxnsas(txn, 0u))), comment="clear_state_program_pages(0)") + } +} \ No newline at end of file diff --git a/examples/transaction/out/contract.clear.debug.teal b/examples/transaction/out/contract.clear.debug.teal new file mode 100644 index 0000000000..c34ad25261 --- /dev/null +++ b/examples/transaction/out/contract.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + return // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + diff --git a/examples/transaction/out/contract.clear.teal b/examples/transaction/out/contract.clear.teal new file mode 100644 index 0000000000..abcc9b4edf --- /dev/null +++ b/examples/transaction/out/contract.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/transaction/out/contract.clear_unoptimized.debug.teal b/examples/transaction/out/contract.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..c34ad25261 --- /dev/null +++ b/examples/transaction/out/contract.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + return // class TransactionContract(arc4.ARC4Contract): File "transaction/contract.py", line 16 + diff --git a/examples/transaction/out/contract.clear_unoptimized.teal b/examples/transaction/out/contract.clear_unoptimized.teal new file mode 100644 index 0000000000..abcc9b4edf --- /dev/null +++ b/examples/transaction/out/contract.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/transaction/out/contract_TransactionContract.cssa.ir b/examples/transaction/out/contract_TransactionContract.cssa.ir new file mode 100644 index 0000000000..24891775c6 --- /dev/null +++ b/examples/transaction/out/contract_TransactionContract.cssa.ir @@ -0,0 +1,316 @@ +contract examples.transaction.contract.TransactionContract: + program approval: + subroutine examples.transaction.contract.TransactionContract.approval_program() -> uint64: + block@0: // L16 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@11 + block@1: // abi_routing_L16 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "create()void" => block@2, method "pay(pay)void" => block@3, method "key(keyreg)void" => block@4, method "asset_config(acfg)void" => block@5, method "asset_transfer(axfer)void" => block@6, method "asset_freeze(afrz)void" => block@7, method "application_call(appl)void" => block@8, * => block@11} + block@2: // create_route_L17 + 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) + let tmp%5#0: uint64 = (! tmp%4#0) + (assert tmp%5#0) // is creating + examples.transaction.contract.TransactionContract.create() + return 1u + block@3: // pay_route_L36 + let tmp%6#0: uint64 = (txn OnCompletion) + let tmp%7#0: uint64 = (! tmp%6#0) + (assert tmp%7#0) // OnCompletion is NoOp + let tmp%8#0: uint64 = (txn ApplicationID) + (assert tmp%8#0) // is not creating + let tmp%11#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%11#0 1u) + let tmp%13#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%14#0: uint64 = (== tmp%13#0 pay) + (assert tmp%14#0) // transaction type is pay + examples.transaction.contract.TransactionContract.pay(awst_tmp%12#0) + return 1u + block@4: // key_route_L45 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%12#1: uint64 = (- tmp%20#0 1u) + let tmp%21#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#1) + let tmp%22#0: uint64 = (== tmp%21#0 keyreg) + (assert tmp%22#0) // transaction type is keyreg + examples.transaction.contract.TransactionContract.key(awst_tmp%12#1) + return 1u + block@5: // asset_config_route_L56 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%12#2: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#2) + let tmp%30#0: uint64 = (== tmp%29#0 acfg) + (assert tmp%30#0) // transaction type is acfg + examples.transaction.contract.TransactionContract.asset_config(awst_tmp%12#2) + return 1u + block@6: // asset_transfer_route_L73 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + let tmp%36#0: uint64 = (txn GroupIndex) + let awst_tmp%12#3: uint64 = (- tmp%36#0 1u) + let tmp%37#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#3) + let tmp%38#0: uint64 = (== tmp%37#0 axfer) + (assert tmp%38#0) // transaction type is axfer + examples.transaction.contract.TransactionContract.asset_transfer(awst_tmp%12#3) + return 1u + block@7: // asset_freeze_route_L82 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%44#0: uint64 = (txn GroupIndex) + let awst_tmp%12#4: uint64 = (- tmp%44#0 1u) + let tmp%45#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#4) + let tmp%46#0: uint64 = (== tmp%45#0 afrz) + (assert tmp%46#0) // transaction type is afrz + examples.transaction.contract.TransactionContract.asset_freeze(awst_tmp%12#4) + return 1u + block@8: // application_call_route_L90 + let tmp%47#0: uint64 = (txn OnCompletion) + let tmp%48#0: uint64 = (! tmp%47#0) + (assert tmp%48#0) // OnCompletion is NoOp + let tmp%49#0: uint64 = (txn ApplicationID) + (assert tmp%49#0) // is not creating + let tmp%52#0: uint64 = (txn GroupIndex) + let awst_tmp%12#5: uint64 = (- tmp%52#0 1u) + let tmp%53#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#5) + let tmp%54#0: uint64 = (== tmp%53#0 appl) + (assert tmp%54#0) // transaction type is appl + examples.transaction.contract.TransactionContract.application_call(awst_tmp%12#5) + return 1u + block@11: // after_if_else_L16 + fail // reject transaction + + subroutine examples.transaction.contract.TransactionContract.create() -> void: + block@0: // L18 + return + + subroutine examples.transaction.contract.TransactionContract.pay(txn: uint64) -> void: + block@0: // L37 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns Receiver) txn#0) + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Payment should be for this app + let tmp%3#0: uint64 = ((gtxns Amount) txn#0) + let tmp%4#0: uint64 = (> tmp%3#0 1000u) + (assert tmp%4#0) // Payment should be for >1000 micro algos + let tmp%5#0: bytes = ((gtxns CloseRemainderTo) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // close_remainder_to + return + + subroutine examples.transaction.contract.TransactionContract._common_checks(txn: uint64) -> void: + block@0: // L22 + let tmp%0#0: bytes = ((gtxns TxID) txn#0) + let tmp%1#0: uint64 = (len tmp%0#0) + (assert tmp%1#0) // txn_id + let tmp%2#0: bytes = ((gtxns Sender) txn#0) + let tmp%3#0: bytes = (global CreatorAddress) + let tmp%4#0: uint64 = (== tmp%2#0 tmp%3#0) + (assert tmp%4#0) // sender + let tmp%5#0: uint64 = ((gtxns Fee) txn#0) + (assert tmp%5#0) // fee + let tmp%6#0: uint64 = ((gtxns TypeEnum) txn#0) + (assert tmp%6#0) // type + let tmp%7#0: bytes = ((gtxns Type) txn#0) + let tmp%8#0: uint64 = (len tmp%7#0) + (assert tmp%8#0) // type_bytes + let tmp%9#0: bytes = ((gtxns Note) txn#0) + let tmp%10#0: uint64 = (== tmp%9#0 "") + (assert tmp%10#0) // note + let tmp%11#0: uint64 = ((gtxns GroupIndex) txn#0) + let tmp%12#0: uint64 = (! tmp%11#0) + (assert tmp%12#0) // group_index + let tmp%13#0: uint64 = ((gtxns FirstValid) txn#0) + (assert tmp%13#0) // first_valid + let tmp%14#0: uint64 = ((gtxns FirstValidTime) txn#0) + (assert tmp%14#0) // first_valid_time + let tmp%15#0: uint64 = ((gtxns LastValid) txn#0) + (assert tmp%15#0) // last_valid + let tmp%16#0: bytes = ((gtxns Lease) txn#0) + let tmp%17#0: uint64 = (len tmp%16#0) + (assert tmp%17#0) // lease + let tmp%18#0: bytes = ((gtxns RekeyTo) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // rekey_to + return + + subroutine examples.transaction.contract.TransactionContract.key(txn: uint64) -> void: + block@0: // L46 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns VotePK) txn#0) + let tmp%1#0: bytes = (global ZeroAddress) + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // vote_key + let tmp%3#0: bytes = ((gtxns SelectionPK) txn#0) + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (!= tmp%3#0 tmp%4#0) + (assert tmp%5#0) // selection_key + let tmp%6#0: uint64 = ((gtxns VoteKeyDilution) txn#0) + (assert tmp%6#0) // vote_key_dilution + let tmp%7#0: uint64 = ((gtxns VoteFirst) txn#0) + (assert tmp%7#0) // vote_first + let tmp%8#0: uint64 = ((gtxns VoteLast) txn#0) + (assert tmp%8#0) // vote_last + let tmp%9#0: uint64 = ((gtxns Nonparticipation) txn#0) + (assert tmp%9#0) // non_participation + let tmp%10#0: bytes = ((gtxns StateProofPK) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // state_proof_key + return + + subroutine examples.transaction.contract.TransactionContract.asset_config(txn: uint64) -> void: + block@0: // L57 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ConfigAsset) txn#0) + (assert tmp%0#0) // config_asset + let tmp%1#0: uint64 = ((gtxns ConfigAssetTotal) txn#0) + (assert tmp%1#0) // total + let tmp%2#0: uint64 = ((gtxns ConfigAssetDecimals) txn#0) + (assert tmp%2#0) // decimals + let tmp%3#0: uint64 = ((gtxns ConfigAssetDefaultFrozen) txn#0) + (assert tmp%3#0) // default_frozen + let tmp%4#0: bytes = ((gtxns ConfigAssetUnitName) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // unit_name + let tmp%6#0: bytes = ((gtxns ConfigAssetName) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // asset_name + let tmp%8#0: bytes = ((gtxns ConfigAssetURL) txn#0) + let tmp%9#0: uint64 = (len tmp%8#0) + (assert tmp%9#0) // url + let tmp%10#0: bytes = ((gtxns ConfigAssetMetadataHash) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // metadata_hash + let tmp%12#0: bytes = ((gtxns ConfigAssetManager) txn#0) + let tmp%13#0: bytes = (global ZeroAddress) + let tmp%14#0: uint64 = (!= tmp%12#0 tmp%13#0) + (assert tmp%14#0) // manager + let tmp%15#0: bytes = ((gtxns ConfigAssetReserve) txn#0) + let tmp%16#0: bytes = (global ZeroAddress) + let tmp%17#0: uint64 = (!= tmp%15#0 tmp%16#0) + (assert tmp%17#0) // reserve + let tmp%18#0: bytes = ((gtxns ConfigAssetFreeze) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (!= tmp%18#0 tmp%19#0) + (assert tmp%20#0) // freeze + let tmp%21#0: bytes = ((gtxns ConfigAssetClawback) txn#0) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // clawback + return + + subroutine examples.transaction.contract.TransactionContract.asset_transfer(txn: uint64) -> void: + block@0: // L74 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns XferAsset) txn#0) + (assert tmp%0#0) // xfer_asset + let tmp%1#0: uint64 = ((gtxns AssetAmount) txn#0) + (assert tmp%1#0) // asset_amount + let tmp%2#0: bytes = ((gtxns AssetSender) txn#0) + let tmp%3#0: bytes = (global ZeroAddress) + let tmp%4#0: uint64 = (!= tmp%2#0 tmp%3#0) + (assert tmp%4#0) // asset_sender + let tmp%5#0: bytes = ((gtxns AssetReceiver) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (!= tmp%5#0 tmp%6#0) + (assert tmp%7#0) // asset_receiver + let tmp%8#0: bytes = ((gtxns AssetCloseTo) txn#0) + let tmp%9#0: bytes = (global ZeroAddress) + let tmp%10#0: uint64 = (!= tmp%8#0 tmp%9#0) + (assert tmp%10#0) // asset_close_to + return + + subroutine examples.transaction.contract.TransactionContract.asset_freeze(txn: uint64) -> void: + block@0: // L83 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns FreezeAsset) txn#0) + (assert tmp%0#0) // freeze_asset + let tmp%1#0: bytes = ((gtxns FreezeAssetAccount) txn#0) + let tmp%2#0: bytes = (global ZeroAddress) + let tmp%3#0: uint64 = (!= tmp%1#0 tmp%2#0) + (assert tmp%3#0) // freeze_account + let tmp%4#0: uint64 = ((gtxns FreezeAssetFrozen) txn#0) + (assert tmp%4#0) // frozen + return + + subroutine examples.transaction.contract.TransactionContract.application_call(txn: uint64) -> void: + block@0: // L91 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ApplicationID) txn#0) + (assert tmp%0#0) // application_id + let tmp%1#0: uint64 = ((gtxns OnCompletion) txn#0) + (assert tmp%1#0) // on_completion + let tmp%2#0: uint64 = ((gtxns NumAppArgs) txn#0) + (assert tmp%2#0) // num_app_args + let tmp%3#0: uint64 = ((gtxns NumAccounts) txn#0) + (assert tmp%3#0) // num_accounts + let tmp%4#0: bytes = ((gtxns ApprovalProgram) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // approval_program + let tmp%6#0: bytes = ((gtxns ClearStateProgram) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // clear_state_program + let tmp%8#0: uint64 = ((gtxns NumAssets) txn#0) + (assert tmp%8#0) // num_assets + let tmp%9#0: uint64 = ((gtxns NumApplications) txn#0) + (assert tmp%9#0) // num_applications + 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 + 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 + 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) + let tmp%16#0: uint64 = (len tmp%15#0) + (assert tmp%16#0) // last_log + let tmp%17#0: uint64 = ((gtxns NumApprovalProgramPages) txn#0) + (assert tmp%17#0) // num_approval_program_pages + let tmp%18#0: uint64 = ((gtxns NumClearStateProgramPages) txn#0) + (assert tmp%18#0) // num_clear_state_program_pages + let tmp%19#0: bytes = ((gtxnsas ApplicationArgs) txn#0 0u) + let tmp%20#0: uint64 = (len tmp%19#0) + (assert tmp%20#0) // application_args(0) + let tmp%21#0: bytes = ((gtxnsas Accounts) txn#0 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // accounts(0) + let tmp%24#0: uint64 = ((gtxnsas Assets) txn#0 0u) + (assert tmp%24#0) // assets(0) + let tmp%25#0: uint64 = ((gtxnsas Applications) txn#0 0u) + (assert tmp%25#0) // applications(0) + let tmp%26#0: bytes = ((gtxnsas ApprovalProgramPages) txn#0 0u) + let tmp%27#0: uint64 = (len tmp%26#0) + (assert tmp%27#0) // approval_program_pages(0) + let tmp%28#0: bytes = ((gtxnsas ClearStateProgramPages) txn#0 0u) + let tmp%29#0: uint64 = (len tmp%28#0) + (assert tmp%29#0) // clear_state_program_pages(0) + return + + program clear-state: + subroutine examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: + block@0: // L16 + return 1u \ No newline at end of file diff --git a/examples/transaction/out/contract_TransactionContract.final.ir b/examples/transaction/out/contract_TransactionContract.final.ir new file mode 100644 index 0000000000..1201d6dd09 --- /dev/null +++ b/examples/transaction/out/contract_TransactionContract.final.ir @@ -0,0 +1,316 @@ +contract examples.transaction.contract.TransactionContract: + program approval: + subroutine examples.transaction.contract.TransactionContract.approval_program() -> uint64: + block@0: // L16 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@11 + block@1: // abi_routing_L16 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "create()void" => block@2, method "pay(pay)void" => block@3, method "key(keyreg)void" => block@4, method "asset_config(acfg)void" => block@5, method "asset_transfer(axfer)void" => block@6, method "asset_freeze(afrz)void" => block@7, method "application_call(appl)void" => block@8, * => block@11} + block@2: // create_route_L17 + 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) + let tmp%5#0: uint64 = (! tmp%4#0) + (assert tmp%5#0) // is creating + examples.transaction.contract.TransactionContract.create() + return 1u + block@3: // pay_route_L36 + let tmp%6#0: uint64 = (txn OnCompletion) + let tmp%7#0: uint64 = (! tmp%6#0) + (assert tmp%7#0) // OnCompletion is NoOp + let tmp%8#0: uint64 = (txn ApplicationID) + (assert tmp%8#0) // is not creating + let tmp%11#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%11#0 1u) + let tmp%13#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%14#0: uint64 = (== tmp%13#0 pay) + (assert tmp%14#0) // transaction type is pay + examples.transaction.contract.TransactionContract.pay(awst_tmp%12#0) + return 1u + block@4: // key_route_L45 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%20#0 1u) + let tmp%21#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%22#0: uint64 = (== tmp%21#0 keyreg) + (assert tmp%22#0) // transaction type is keyreg + examples.transaction.contract.TransactionContract.key(awst_tmp%12#0) + return 1u + block@5: // asset_config_route_L56 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%30#0: uint64 = (== tmp%29#0 acfg) + (assert tmp%30#0) // transaction type is acfg + examples.transaction.contract.TransactionContract.asset_config(awst_tmp%12#0) + return 1u + block@6: // asset_transfer_route_L73 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + let tmp%36#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%36#0 1u) + let tmp%37#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%38#0: uint64 = (== tmp%37#0 axfer) + (assert tmp%38#0) // transaction type is axfer + examples.transaction.contract.TransactionContract.asset_transfer(awst_tmp%12#0) + return 1u + block@7: // asset_freeze_route_L82 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%44#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%44#0 1u) + let tmp%45#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%46#0: uint64 = (== tmp%45#0 afrz) + (assert tmp%46#0) // transaction type is afrz + examples.transaction.contract.TransactionContract.asset_freeze(awst_tmp%12#0) + return 1u + block@8: // application_call_route_L90 + let tmp%47#0: uint64 = (txn OnCompletion) + let tmp%48#0: uint64 = (! tmp%47#0) + (assert tmp%48#0) // OnCompletion is NoOp + let tmp%49#0: uint64 = (txn ApplicationID) + (assert tmp%49#0) // is not creating + let tmp%52#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%52#0 1u) + let tmp%53#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%54#0: uint64 = (== tmp%53#0 appl) + (assert tmp%54#0) // transaction type is appl + examples.transaction.contract.TransactionContract.application_call(awst_tmp%12#0) + return 1u + block@11: // after_if_else_L16 + fail // reject transaction + + subroutine examples.transaction.contract.TransactionContract.create() -> void: + block@0: // L18 + return + + subroutine examples.transaction.contract.TransactionContract.pay(txn: uint64) -> void: + block@0: // L37 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns Receiver) txn#0) + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Payment should be for this app + let tmp%3#0: uint64 = ((gtxns Amount) txn#0) + let tmp%4#0: uint64 = (> tmp%3#0 1000u) + (assert tmp%4#0) // Payment should be for >1000 micro algos + let tmp%5#0: bytes = ((gtxns CloseRemainderTo) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // close_remainder_to + return + + subroutine examples.transaction.contract.TransactionContract._common_checks(txn: uint64) -> void: + block@0: // L22 + let tmp%0#0: bytes = ((gtxns TxID) txn#0) + let tmp%1#0: uint64 = (len tmp%0#0) + (assert tmp%1#0) // txn_id + let tmp%2#0: bytes = ((gtxns Sender) txn#0) + let tmp%3#0: bytes = (global CreatorAddress) + let tmp%4#0: uint64 = (== tmp%2#0 tmp%3#0) + (assert tmp%4#0) // sender + let tmp%5#0: uint64 = ((gtxns Fee) txn#0) + (assert tmp%5#0) // fee + let tmp%6#0: uint64 = ((gtxns TypeEnum) txn#0) + (assert tmp%6#0) // type + let tmp%7#0: bytes = ((gtxns Type) txn#0) + let tmp%8#0: uint64 = (len tmp%7#0) + (assert tmp%8#0) // type_bytes + let tmp%9#0: bytes = ((gtxns Note) txn#0) + let tmp%10#0: uint64 = (== tmp%9#0 "") + (assert tmp%10#0) // note + let tmp%11#0: uint64 = ((gtxns GroupIndex) txn#0) + let tmp%12#0: uint64 = (! tmp%11#0) + (assert tmp%12#0) // group_index + let tmp%13#0: uint64 = ((gtxns FirstValid) txn#0) + (assert tmp%13#0) // first_valid + let tmp%14#0: uint64 = ((gtxns FirstValidTime) txn#0) + (assert tmp%14#0) // first_valid_time + let tmp%15#0: uint64 = ((gtxns LastValid) txn#0) + (assert tmp%15#0) // last_valid + let tmp%16#0: bytes = ((gtxns Lease) txn#0) + let tmp%17#0: uint64 = (len tmp%16#0) + (assert tmp%17#0) // lease + let tmp%18#0: bytes = ((gtxns RekeyTo) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // rekey_to + return + + subroutine examples.transaction.contract.TransactionContract.key(txn: uint64) -> void: + block@0: // L46 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns VotePK) txn#0) + let tmp%1#0: bytes = (global ZeroAddress) + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // vote_key + let tmp%3#0: bytes = ((gtxns SelectionPK) txn#0) + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (!= tmp%3#0 tmp%4#0) + (assert tmp%5#0) // selection_key + let tmp%6#0: uint64 = ((gtxns VoteKeyDilution) txn#0) + (assert tmp%6#0) // vote_key_dilution + let tmp%7#0: uint64 = ((gtxns VoteFirst) txn#0) + (assert tmp%7#0) // vote_first + let tmp%8#0: uint64 = ((gtxns VoteLast) txn#0) + (assert tmp%8#0) // vote_last + let tmp%9#0: uint64 = ((gtxns Nonparticipation) txn#0) + (assert tmp%9#0) // non_participation + let tmp%10#0: bytes = ((gtxns StateProofPK) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // state_proof_key + return + + subroutine examples.transaction.contract.TransactionContract.asset_config(txn: uint64) -> void: + block@0: // L57 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ConfigAsset) txn#0) + (assert tmp%0#0) // config_asset + let tmp%1#0: uint64 = ((gtxns ConfigAssetTotal) txn#0) + (assert tmp%1#0) // total + let tmp%2#0: uint64 = ((gtxns ConfigAssetDecimals) txn#0) + (assert tmp%2#0) // decimals + let tmp%3#0: uint64 = ((gtxns ConfigAssetDefaultFrozen) txn#0) + (assert tmp%3#0) // default_frozen + let tmp%4#0: bytes = ((gtxns ConfigAssetUnitName) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // unit_name + let tmp%6#0: bytes = ((gtxns ConfigAssetName) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // asset_name + let tmp%8#0: bytes = ((gtxns ConfigAssetURL) txn#0) + let tmp%9#0: uint64 = (len tmp%8#0) + (assert tmp%9#0) // url + let tmp%10#0: bytes = ((gtxns ConfigAssetMetadataHash) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // metadata_hash + let tmp%12#0: bytes = ((gtxns ConfigAssetManager) txn#0) + let tmp%13#0: bytes = (global ZeroAddress) + let tmp%14#0: uint64 = (!= tmp%12#0 tmp%13#0) + (assert tmp%14#0) // manager + let tmp%15#0: bytes = ((gtxns ConfigAssetReserve) txn#0) + let tmp%16#0: bytes = (global ZeroAddress) + let tmp%17#0: uint64 = (!= tmp%15#0 tmp%16#0) + (assert tmp%17#0) // reserve + let tmp%18#0: bytes = ((gtxns ConfigAssetFreeze) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (!= tmp%18#0 tmp%19#0) + (assert tmp%20#0) // freeze + let tmp%21#0: bytes = ((gtxns ConfigAssetClawback) txn#0) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // clawback + return + + subroutine examples.transaction.contract.TransactionContract.asset_transfer(txn: uint64) -> void: + block@0: // L74 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns XferAsset) txn#0) + (assert tmp%0#0) // xfer_asset + let tmp%1#0: uint64 = ((gtxns AssetAmount) txn#0) + (assert tmp%1#0) // asset_amount + let tmp%2#0: bytes = ((gtxns AssetSender) txn#0) + let tmp%3#0: bytes = (global ZeroAddress) + let tmp%4#0: uint64 = (!= tmp%2#0 tmp%3#0) + (assert tmp%4#0) // asset_sender + let tmp%5#0: bytes = ((gtxns AssetReceiver) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (!= tmp%5#0 tmp%6#0) + (assert tmp%7#0) // asset_receiver + let tmp%8#0: bytes = ((gtxns AssetCloseTo) txn#0) + let tmp%9#0: bytes = (global ZeroAddress) + let tmp%10#0: uint64 = (!= tmp%8#0 tmp%9#0) + (assert tmp%10#0) // asset_close_to + return + + subroutine examples.transaction.contract.TransactionContract.asset_freeze(txn: uint64) -> void: + block@0: // L83 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns FreezeAsset) txn#0) + (assert tmp%0#0) // freeze_asset + let tmp%1#0: bytes = ((gtxns FreezeAssetAccount) txn#0) + let tmp%2#0: bytes = (global ZeroAddress) + let tmp%3#0: uint64 = (!= tmp%1#0 tmp%2#0) + (assert tmp%3#0) // freeze_account + let tmp%4#0: uint64 = ((gtxns FreezeAssetFrozen) txn#0) + (assert tmp%4#0) // frozen + return + + subroutine examples.transaction.contract.TransactionContract.application_call(txn: uint64) -> void: + block@0: // L91 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ApplicationID) txn#0) + (assert tmp%0#0) // application_id + let tmp%1#0: uint64 = ((gtxns OnCompletion) txn#0) + (assert tmp%1#0) // on_completion + let tmp%2#0: uint64 = ((gtxns NumAppArgs) txn#0) + (assert tmp%2#0) // num_app_args + let tmp%3#0: uint64 = ((gtxns NumAccounts) txn#0) + (assert tmp%3#0) // num_accounts + let tmp%4#0: bytes = ((gtxns ApprovalProgram) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // approval_program + let tmp%6#0: bytes = ((gtxns ClearStateProgram) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // clear_state_program + let tmp%8#0: uint64 = ((gtxns NumAssets) txn#0) + (assert tmp%8#0) // num_assets + let tmp%9#0: uint64 = ((gtxns NumApplications) txn#0) + (assert tmp%9#0) // num_applications + 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 + 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 + 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) + let tmp%16#0: uint64 = (len tmp%15#0) + (assert tmp%16#0) // last_log + let tmp%17#0: uint64 = ((gtxns NumApprovalProgramPages) txn#0) + (assert tmp%17#0) // num_approval_program_pages + let tmp%18#0: uint64 = ((gtxns NumClearStateProgramPages) txn#0) + (assert tmp%18#0) // num_clear_state_program_pages + let tmp%19#0: bytes = ((gtxnsas ApplicationArgs) txn#0 0u) + let tmp%20#0: uint64 = (len tmp%19#0) + (assert tmp%20#0) // application_args(0) + let tmp%21#0: bytes = ((gtxnsas Accounts) txn#0 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // accounts(0) + let tmp%24#0: uint64 = ((gtxnsas Assets) txn#0 0u) + (assert tmp%24#0) // assets(0) + let tmp%25#0: uint64 = ((gtxnsas Applications) txn#0 0u) + (assert tmp%25#0) // applications(0) + let tmp%26#0: bytes = ((gtxnsas ApprovalProgramPages) txn#0 0u) + let tmp%27#0: uint64 = (len tmp%26#0) + (assert tmp%27#0) // approval_program_pages(0) + let tmp%28#0: bytes = ((gtxnsas ClearStateProgramPages) txn#0 0u) + let tmp%29#0: uint64 = (len tmp%28#0) + (assert tmp%29#0) // clear_state_program_pages(0) + return + + program clear-state: + subroutine examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: + block@0: // L16 + return 1u \ No newline at end of file diff --git a/examples/transaction/out/contract_TransactionContract.final_unoptimized.ir b/examples/transaction/out/contract_TransactionContract.final_unoptimized.ir new file mode 100644 index 0000000000..dd20ef94ff --- /dev/null +++ b/examples/transaction/out/contract_TransactionContract.final_unoptimized.ir @@ -0,0 +1,332 @@ +contract examples.transaction.contract.TransactionContract: + program approval: + subroutine examples.transaction.contract.TransactionContract.approval_program() -> uint64: + block@0: // L16 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@11 + block@1: // abi_routing_L16 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "create()void" => block@2, method "pay(pay)void" => block@3, method "key(keyreg)void" => block@4, method "asset_config(acfg)void" => block@5, method "asset_transfer(axfer)void" => block@6, method "asset_freeze(afrz)void" => block@7, method "application_call(appl)void" => block@8, * => block@9} + block@2: // create_route_L17 + 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) + let tmp%5#0: uint64 = (! tmp%4#0) + (assert tmp%5#0) // is creating + examples.transaction.contract.TransactionContract.create() + return 1u + block@3: // pay_route_L36 + let tmp%6#0: uint64 = (txn OnCompletion) + let tmp%7#0: uint64 = (== tmp%6#0 NoOp) + (assert tmp%7#0) // OnCompletion is NoOp + let tmp%8#0: uint64 = (txn ApplicationID) + (assert tmp%8#0) // is not creating + let tmp%11#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%11#0 1u) + let tmp%13#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%14#0: uint64 = (== tmp%13#0 pay) + let maybe_value_did_exist%10#0: uint64 = tmp%14#0 + let maybe_value%9#0: uint64 = awst_tmp%12#0 + (assert maybe_value_did_exist%10#0) // transaction type is pay + examples.transaction.contract.TransactionContract.pay(maybe_value%9#0) + return 1u + block@4: // key_route_L45 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (== tmp%15#0 NoOp) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%20#0 1u) + let tmp%21#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%22#0: uint64 = (== tmp%21#0 keyreg) + let maybe_value_did_exist%19#0: uint64 = tmp%22#0 + let maybe_value%18#0: uint64 = awst_tmp%12#0 + (assert maybe_value_did_exist%19#0) // transaction type is keyreg + examples.transaction.contract.TransactionContract.key(maybe_value%18#0) + return 1u + block@5: // asset_config_route_L56 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (== tmp%23#0 NoOp) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%30#0: uint64 = (== tmp%29#0 acfg) + let maybe_value_did_exist%27#0: uint64 = tmp%30#0 + let maybe_value%26#0: uint64 = awst_tmp%12#0 + (assert maybe_value_did_exist%27#0) // transaction type is acfg + examples.transaction.contract.TransactionContract.asset_config(maybe_value%26#0) + return 1u + block@6: // asset_transfer_route_L73 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (== tmp%31#0 NoOp) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + let tmp%36#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%36#0 1u) + let tmp%37#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%38#0: uint64 = (== tmp%37#0 axfer) + let maybe_value_did_exist%35#0: uint64 = tmp%38#0 + let maybe_value%34#0: uint64 = awst_tmp%12#0 + (assert maybe_value_did_exist%35#0) // transaction type is axfer + examples.transaction.contract.TransactionContract.asset_transfer(maybe_value%34#0) + return 1u + block@7: // asset_freeze_route_L82 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (== tmp%39#0 NoOp) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%44#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%44#0 1u) + let tmp%45#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%46#0: uint64 = (== tmp%45#0 afrz) + let maybe_value_did_exist%43#0: uint64 = tmp%46#0 + let maybe_value%42#0: uint64 = awst_tmp%12#0 + (assert maybe_value_did_exist%43#0) // transaction type is afrz + examples.transaction.contract.TransactionContract.asset_freeze(maybe_value%42#0) + return 1u + block@8: // application_call_route_L90 + let tmp%47#0: uint64 = (txn OnCompletion) + let tmp%48#0: uint64 = (== tmp%47#0 NoOp) + (assert tmp%48#0) // OnCompletion is NoOp + let tmp%49#0: uint64 = (txn ApplicationID) + (assert tmp%49#0) // is not creating + let tmp%52#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%52#0 1u) + let tmp%53#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%54#0: uint64 = (== tmp%53#0 appl) + let maybe_value_did_exist%51#0: uint64 = tmp%54#0 + let maybe_value%50#0: uint64 = awst_tmp%12#0 + (assert maybe_value_did_exist%51#0) // transaction type is appl + examples.transaction.contract.TransactionContract.application_call(maybe_value%50#0) + return 1u + block@9: // switch_case_default_L16 + goto block@10 + block@10: // switch_case_next_L16 + goto block@11 + block@11: // after_if_else_L16 + fail // reject transaction + + subroutine examples.transaction.contract.TransactionContract.create() -> void: + block@0: // L18 + return + + subroutine examples.transaction.contract.TransactionContract.pay(txn: uint64) -> void: + block@0: // L37 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns Receiver) txn#0) + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Payment should be for this app + let tmp%3#0: uint64 = ((gtxns Amount) txn#0) + let tmp%4#0: uint64 = (> tmp%3#0 1000u) + (assert tmp%4#0) // Payment should be for >1000 micro algos + let tmp%5#0: bytes = ((gtxns CloseRemainderTo) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // close_remainder_to + return + + subroutine examples.transaction.contract.TransactionContract._common_checks(txn: uint64) -> void: + block@0: // L22 + let tmp%0#0: bytes = ((gtxns TxID) txn#0) + let tmp%1#0: uint64 = (len tmp%0#0) + (assert tmp%1#0) // txn_id + let tmp%2#0: bytes = ((gtxns Sender) txn#0) + let tmp%3#0: bytes = (global CreatorAddress) + let tmp%4#0: uint64 = (== tmp%2#0 tmp%3#0) + (assert tmp%4#0) // sender + let tmp%5#0: uint64 = ((gtxns Fee) txn#0) + (assert tmp%5#0) // fee + let tmp%6#0: uint64 = ((gtxns TypeEnum) txn#0) + (assert tmp%6#0) // type + let tmp%7#0: bytes = ((gtxns Type) txn#0) + let tmp%8#0: uint64 = (len tmp%7#0) + (assert tmp%8#0) // type_bytes + let tmp%9#0: bytes = ((gtxns Note) txn#0) + let tmp%10#0: uint64 = (== tmp%9#0 "") + (assert tmp%10#0) // note + let tmp%11#0: uint64 = ((gtxns GroupIndex) txn#0) + let tmp%12#0: uint64 = (== tmp%11#0 0u) + (assert tmp%12#0) // group_index + let tmp%13#0: uint64 = ((gtxns FirstValid) txn#0) + (assert tmp%13#0) // first_valid + let tmp%14#0: uint64 = ((gtxns FirstValidTime) txn#0) + (assert tmp%14#0) // first_valid_time + let tmp%15#0: uint64 = ((gtxns LastValid) txn#0) + (assert tmp%15#0) // last_valid + let tmp%16#0: bytes = ((gtxns Lease) txn#0) + let tmp%17#0: uint64 = (len tmp%16#0) + (assert tmp%17#0) // lease + let tmp%18#0: bytes = ((gtxns RekeyTo) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // rekey_to + return + + subroutine examples.transaction.contract.TransactionContract.key(txn: uint64) -> void: + block@0: // L46 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns VotePK) txn#0) + let tmp%1#0: bytes = (global ZeroAddress) + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // vote_key + let tmp%3#0: bytes = ((gtxns SelectionPK) txn#0) + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (!= tmp%3#0 tmp%4#0) + (assert tmp%5#0) // selection_key + let tmp%6#0: uint64 = ((gtxns VoteKeyDilution) txn#0) + (assert tmp%6#0) // vote_key_dilution + let tmp%7#0: uint64 = ((gtxns VoteFirst) txn#0) + (assert tmp%7#0) // vote_first + let tmp%8#0: uint64 = ((gtxns VoteLast) txn#0) + (assert tmp%8#0) // vote_last + let tmp%9#0: uint64 = ((gtxns Nonparticipation) txn#0) + (assert tmp%9#0) // non_participation + let tmp%10#0: bytes = ((gtxns StateProofPK) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // state_proof_key + return + + subroutine examples.transaction.contract.TransactionContract.asset_config(txn: uint64) -> void: + block@0: // L57 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ConfigAsset) txn#0) + (assert tmp%0#0) // config_asset + let tmp%1#0: uint64 = ((gtxns ConfigAssetTotal) txn#0) + (assert tmp%1#0) // total + let tmp%2#0: uint64 = ((gtxns ConfigAssetDecimals) txn#0) + (assert tmp%2#0) // decimals + let tmp%3#0: uint64 = ((gtxns ConfigAssetDefaultFrozen) txn#0) + (assert tmp%3#0) // default_frozen + let tmp%4#0: bytes = ((gtxns ConfigAssetUnitName) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // unit_name + let tmp%6#0: bytes = ((gtxns ConfigAssetName) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // asset_name + let tmp%8#0: bytes = ((gtxns ConfigAssetURL) txn#0) + let tmp%9#0: uint64 = (len tmp%8#0) + (assert tmp%9#0) // url + let tmp%10#0: bytes = ((gtxns ConfigAssetMetadataHash) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // metadata_hash + let tmp%12#0: bytes = ((gtxns ConfigAssetManager) txn#0) + let tmp%13#0: bytes = (global ZeroAddress) + let tmp%14#0: uint64 = (!= tmp%12#0 tmp%13#0) + (assert tmp%14#0) // manager + let tmp%15#0: bytes = ((gtxns ConfigAssetReserve) txn#0) + let tmp%16#0: bytes = (global ZeroAddress) + let tmp%17#0: uint64 = (!= tmp%15#0 tmp%16#0) + (assert tmp%17#0) // reserve + let tmp%18#0: bytes = ((gtxns ConfigAssetFreeze) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (!= tmp%18#0 tmp%19#0) + (assert tmp%20#0) // freeze + let tmp%21#0: bytes = ((gtxns ConfigAssetClawback) txn#0) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // clawback + return + + subroutine examples.transaction.contract.TransactionContract.asset_transfer(txn: uint64) -> void: + block@0: // L74 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns XferAsset) txn#0) + (assert tmp%0#0) // xfer_asset + let tmp%1#0: uint64 = ((gtxns AssetAmount) txn#0) + (assert tmp%1#0) // asset_amount + let tmp%2#0: bytes = ((gtxns AssetSender) txn#0) + let tmp%3#0: bytes = (global ZeroAddress) + let tmp%4#0: uint64 = (!= tmp%2#0 tmp%3#0) + (assert tmp%4#0) // asset_sender + let tmp%5#0: bytes = ((gtxns AssetReceiver) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (!= tmp%5#0 tmp%6#0) + (assert tmp%7#0) // asset_receiver + let tmp%8#0: bytes = ((gtxns AssetCloseTo) txn#0) + let tmp%9#0: bytes = (global ZeroAddress) + let tmp%10#0: uint64 = (!= tmp%8#0 tmp%9#0) + (assert tmp%10#0) // asset_close_to + return + + subroutine examples.transaction.contract.TransactionContract.asset_freeze(txn: uint64) -> void: + block@0: // L83 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns FreezeAsset) txn#0) + (assert tmp%0#0) // freeze_asset + let tmp%1#0: bytes = ((gtxns FreezeAssetAccount) txn#0) + let tmp%2#0: bytes = (global ZeroAddress) + let tmp%3#0: uint64 = (!= tmp%1#0 tmp%2#0) + (assert tmp%3#0) // freeze_account + let tmp%4#0: uint64 = ((gtxns FreezeAssetFrozen) txn#0) + (assert tmp%4#0) // frozen + return + + subroutine examples.transaction.contract.TransactionContract.application_call(txn: uint64) -> void: + block@0: // L91 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ApplicationID) txn#0) + (assert tmp%0#0) // application_id + let tmp%1#0: uint64 = ((gtxns OnCompletion) txn#0) + (assert tmp%1#0) // on_completion + let tmp%2#0: uint64 = ((gtxns NumAppArgs) txn#0) + (assert tmp%2#0) // num_app_args + let tmp%3#0: uint64 = ((gtxns NumAccounts) txn#0) + (assert tmp%3#0) // num_accounts + let tmp%4#0: bytes = ((gtxns ApprovalProgram) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // approval_program + let tmp%6#0: bytes = ((gtxns ClearStateProgram) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // clear_state_program + let tmp%8#0: uint64 = ((gtxns NumAssets) txn#0) + (assert tmp%8#0) // num_assets + let tmp%9#0: uint64 = ((gtxns NumApplications) txn#0) + (assert tmp%9#0) // num_applications + 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 + 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 + 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) + let tmp%16#0: uint64 = (len tmp%15#0) + (assert tmp%16#0) // last_log + let tmp%17#0: uint64 = ((gtxns NumApprovalProgramPages) txn#0) + (assert tmp%17#0) // num_approval_program_pages + let tmp%18#0: uint64 = ((gtxns NumClearStateProgramPages) txn#0) + (assert tmp%18#0) // num_clear_state_program_pages + let tmp%19#0: bytes = ((gtxnsas ApplicationArgs) txn#0 0u) + let tmp%20#0: uint64 = (len tmp%19#0) + (assert tmp%20#0) // application_args(0) + let tmp%21#0: bytes = ((gtxnsas Accounts) txn#0 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // accounts(0) + let tmp%24#0: uint64 = ((gtxnsas Assets) txn#0 0u) + (assert tmp%24#0) // assets(0) + let tmp%25#0: uint64 = ((gtxnsas Applications) txn#0 0u) + (assert tmp%25#0) // applications(0) + let tmp%26#0: bytes = ((gtxnsas ApprovalProgramPages) txn#0 0u) + let tmp%27#0: uint64 = (len tmp%26#0) + (assert tmp%27#0) // approval_program_pages(0) + let tmp%28#0: bytes = ((gtxnsas ClearStateProgramPages) txn#0 0u) + let tmp%29#0: uint64 = (len tmp%28#0) + (assert tmp%29#0) // clear_state_program_pages(0) + return + + program clear-state: + subroutine examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: + block@0: // L16 + return 1u \ No newline at end of file diff --git a/examples/transaction/out/contract_TransactionContract.parallel_copies.ir b/examples/transaction/out/contract_TransactionContract.parallel_copies.ir new file mode 100644 index 0000000000..24891775c6 --- /dev/null +++ b/examples/transaction/out/contract_TransactionContract.parallel_copies.ir @@ -0,0 +1,316 @@ +contract examples.transaction.contract.TransactionContract: + program approval: + subroutine examples.transaction.contract.TransactionContract.approval_program() -> uint64: + block@0: // L16 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@11 + block@1: // abi_routing_L16 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "create()void" => block@2, method "pay(pay)void" => block@3, method "key(keyreg)void" => block@4, method "asset_config(acfg)void" => block@5, method "asset_transfer(axfer)void" => block@6, method "asset_freeze(afrz)void" => block@7, method "application_call(appl)void" => block@8, * => block@11} + block@2: // create_route_L17 + 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) + let tmp%5#0: uint64 = (! tmp%4#0) + (assert tmp%5#0) // is creating + examples.transaction.contract.TransactionContract.create() + return 1u + block@3: // pay_route_L36 + let tmp%6#0: uint64 = (txn OnCompletion) + let tmp%7#0: uint64 = (! tmp%6#0) + (assert tmp%7#0) // OnCompletion is NoOp + let tmp%8#0: uint64 = (txn ApplicationID) + (assert tmp%8#0) // is not creating + let tmp%11#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%11#0 1u) + let tmp%13#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%14#0: uint64 = (== tmp%13#0 pay) + (assert tmp%14#0) // transaction type is pay + examples.transaction.contract.TransactionContract.pay(awst_tmp%12#0) + return 1u + block@4: // key_route_L45 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%12#1: uint64 = (- tmp%20#0 1u) + let tmp%21#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#1) + let tmp%22#0: uint64 = (== tmp%21#0 keyreg) + (assert tmp%22#0) // transaction type is keyreg + examples.transaction.contract.TransactionContract.key(awst_tmp%12#1) + return 1u + block@5: // asset_config_route_L56 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%12#2: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#2) + let tmp%30#0: uint64 = (== tmp%29#0 acfg) + (assert tmp%30#0) // transaction type is acfg + examples.transaction.contract.TransactionContract.asset_config(awst_tmp%12#2) + return 1u + block@6: // asset_transfer_route_L73 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + let tmp%36#0: uint64 = (txn GroupIndex) + let awst_tmp%12#3: uint64 = (- tmp%36#0 1u) + let tmp%37#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#3) + let tmp%38#0: uint64 = (== tmp%37#0 axfer) + (assert tmp%38#0) // transaction type is axfer + examples.transaction.contract.TransactionContract.asset_transfer(awst_tmp%12#3) + return 1u + block@7: // asset_freeze_route_L82 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%44#0: uint64 = (txn GroupIndex) + let awst_tmp%12#4: uint64 = (- tmp%44#0 1u) + let tmp%45#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#4) + let tmp%46#0: uint64 = (== tmp%45#0 afrz) + (assert tmp%46#0) // transaction type is afrz + examples.transaction.contract.TransactionContract.asset_freeze(awst_tmp%12#4) + return 1u + block@8: // application_call_route_L90 + let tmp%47#0: uint64 = (txn OnCompletion) + let tmp%48#0: uint64 = (! tmp%47#0) + (assert tmp%48#0) // OnCompletion is NoOp + let tmp%49#0: uint64 = (txn ApplicationID) + (assert tmp%49#0) // is not creating + let tmp%52#0: uint64 = (txn GroupIndex) + let awst_tmp%12#5: uint64 = (- tmp%52#0 1u) + let tmp%53#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#5) + let tmp%54#0: uint64 = (== tmp%53#0 appl) + (assert tmp%54#0) // transaction type is appl + examples.transaction.contract.TransactionContract.application_call(awst_tmp%12#5) + return 1u + block@11: // after_if_else_L16 + fail // reject transaction + + subroutine examples.transaction.contract.TransactionContract.create() -> void: + block@0: // L18 + return + + subroutine examples.transaction.contract.TransactionContract.pay(txn: uint64) -> void: + block@0: // L37 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns Receiver) txn#0) + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Payment should be for this app + let tmp%3#0: uint64 = ((gtxns Amount) txn#0) + let tmp%4#0: uint64 = (> tmp%3#0 1000u) + (assert tmp%4#0) // Payment should be for >1000 micro algos + let tmp%5#0: bytes = ((gtxns CloseRemainderTo) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // close_remainder_to + return + + subroutine examples.transaction.contract.TransactionContract._common_checks(txn: uint64) -> void: + block@0: // L22 + let tmp%0#0: bytes = ((gtxns TxID) txn#0) + let tmp%1#0: uint64 = (len tmp%0#0) + (assert tmp%1#0) // txn_id + let tmp%2#0: bytes = ((gtxns Sender) txn#0) + let tmp%3#0: bytes = (global CreatorAddress) + let tmp%4#0: uint64 = (== tmp%2#0 tmp%3#0) + (assert tmp%4#0) // sender + let tmp%5#0: uint64 = ((gtxns Fee) txn#0) + (assert tmp%5#0) // fee + let tmp%6#0: uint64 = ((gtxns TypeEnum) txn#0) + (assert tmp%6#0) // type + let tmp%7#0: bytes = ((gtxns Type) txn#0) + let tmp%8#0: uint64 = (len tmp%7#0) + (assert tmp%8#0) // type_bytes + let tmp%9#0: bytes = ((gtxns Note) txn#0) + let tmp%10#0: uint64 = (== tmp%9#0 "") + (assert tmp%10#0) // note + let tmp%11#0: uint64 = ((gtxns GroupIndex) txn#0) + let tmp%12#0: uint64 = (! tmp%11#0) + (assert tmp%12#0) // group_index + let tmp%13#0: uint64 = ((gtxns FirstValid) txn#0) + (assert tmp%13#0) // first_valid + let tmp%14#0: uint64 = ((gtxns FirstValidTime) txn#0) + (assert tmp%14#0) // first_valid_time + let tmp%15#0: uint64 = ((gtxns LastValid) txn#0) + (assert tmp%15#0) // last_valid + let tmp%16#0: bytes = ((gtxns Lease) txn#0) + let tmp%17#0: uint64 = (len tmp%16#0) + (assert tmp%17#0) // lease + let tmp%18#0: bytes = ((gtxns RekeyTo) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // rekey_to + return + + subroutine examples.transaction.contract.TransactionContract.key(txn: uint64) -> void: + block@0: // L46 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns VotePK) txn#0) + let tmp%1#0: bytes = (global ZeroAddress) + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // vote_key + let tmp%3#0: bytes = ((gtxns SelectionPK) txn#0) + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (!= tmp%3#0 tmp%4#0) + (assert tmp%5#0) // selection_key + let tmp%6#0: uint64 = ((gtxns VoteKeyDilution) txn#0) + (assert tmp%6#0) // vote_key_dilution + let tmp%7#0: uint64 = ((gtxns VoteFirst) txn#0) + (assert tmp%7#0) // vote_first + let tmp%8#0: uint64 = ((gtxns VoteLast) txn#0) + (assert tmp%8#0) // vote_last + let tmp%9#0: uint64 = ((gtxns Nonparticipation) txn#0) + (assert tmp%9#0) // non_participation + let tmp%10#0: bytes = ((gtxns StateProofPK) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // state_proof_key + return + + subroutine examples.transaction.contract.TransactionContract.asset_config(txn: uint64) -> void: + block@0: // L57 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ConfigAsset) txn#0) + (assert tmp%0#0) // config_asset + let tmp%1#0: uint64 = ((gtxns ConfigAssetTotal) txn#0) + (assert tmp%1#0) // total + let tmp%2#0: uint64 = ((gtxns ConfigAssetDecimals) txn#0) + (assert tmp%2#0) // decimals + let tmp%3#0: uint64 = ((gtxns ConfigAssetDefaultFrozen) txn#0) + (assert tmp%3#0) // default_frozen + let tmp%4#0: bytes = ((gtxns ConfigAssetUnitName) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // unit_name + let tmp%6#0: bytes = ((gtxns ConfigAssetName) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // asset_name + let tmp%8#0: bytes = ((gtxns ConfigAssetURL) txn#0) + let tmp%9#0: uint64 = (len tmp%8#0) + (assert tmp%9#0) // url + let tmp%10#0: bytes = ((gtxns ConfigAssetMetadataHash) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // metadata_hash + let tmp%12#0: bytes = ((gtxns ConfigAssetManager) txn#0) + let tmp%13#0: bytes = (global ZeroAddress) + let tmp%14#0: uint64 = (!= tmp%12#0 tmp%13#0) + (assert tmp%14#0) // manager + let tmp%15#0: bytes = ((gtxns ConfigAssetReserve) txn#0) + let tmp%16#0: bytes = (global ZeroAddress) + let tmp%17#0: uint64 = (!= tmp%15#0 tmp%16#0) + (assert tmp%17#0) // reserve + let tmp%18#0: bytes = ((gtxns ConfigAssetFreeze) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (!= tmp%18#0 tmp%19#0) + (assert tmp%20#0) // freeze + let tmp%21#0: bytes = ((gtxns ConfigAssetClawback) txn#0) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // clawback + return + + subroutine examples.transaction.contract.TransactionContract.asset_transfer(txn: uint64) -> void: + block@0: // L74 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns XferAsset) txn#0) + (assert tmp%0#0) // xfer_asset + let tmp%1#0: uint64 = ((gtxns AssetAmount) txn#0) + (assert tmp%1#0) // asset_amount + let tmp%2#0: bytes = ((gtxns AssetSender) txn#0) + let tmp%3#0: bytes = (global ZeroAddress) + let tmp%4#0: uint64 = (!= tmp%2#0 tmp%3#0) + (assert tmp%4#0) // asset_sender + let tmp%5#0: bytes = ((gtxns AssetReceiver) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (!= tmp%5#0 tmp%6#0) + (assert tmp%7#0) // asset_receiver + let tmp%8#0: bytes = ((gtxns AssetCloseTo) txn#0) + let tmp%9#0: bytes = (global ZeroAddress) + let tmp%10#0: uint64 = (!= tmp%8#0 tmp%9#0) + (assert tmp%10#0) // asset_close_to + return + + subroutine examples.transaction.contract.TransactionContract.asset_freeze(txn: uint64) -> void: + block@0: // L83 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns FreezeAsset) txn#0) + (assert tmp%0#0) // freeze_asset + let tmp%1#0: bytes = ((gtxns FreezeAssetAccount) txn#0) + let tmp%2#0: bytes = (global ZeroAddress) + let tmp%3#0: uint64 = (!= tmp%1#0 tmp%2#0) + (assert tmp%3#0) // freeze_account + let tmp%4#0: uint64 = ((gtxns FreezeAssetFrozen) txn#0) + (assert tmp%4#0) // frozen + return + + subroutine examples.transaction.contract.TransactionContract.application_call(txn: uint64) -> void: + block@0: // L91 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ApplicationID) txn#0) + (assert tmp%0#0) // application_id + let tmp%1#0: uint64 = ((gtxns OnCompletion) txn#0) + (assert tmp%1#0) // on_completion + let tmp%2#0: uint64 = ((gtxns NumAppArgs) txn#0) + (assert tmp%2#0) // num_app_args + let tmp%3#0: uint64 = ((gtxns NumAccounts) txn#0) + (assert tmp%3#0) // num_accounts + let tmp%4#0: bytes = ((gtxns ApprovalProgram) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // approval_program + let tmp%6#0: bytes = ((gtxns ClearStateProgram) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // clear_state_program + let tmp%8#0: uint64 = ((gtxns NumAssets) txn#0) + (assert tmp%8#0) // num_assets + let tmp%9#0: uint64 = ((gtxns NumApplications) txn#0) + (assert tmp%9#0) // num_applications + 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 + 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 + 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) + let tmp%16#0: uint64 = (len tmp%15#0) + (assert tmp%16#0) // last_log + let tmp%17#0: uint64 = ((gtxns NumApprovalProgramPages) txn#0) + (assert tmp%17#0) // num_approval_program_pages + let tmp%18#0: uint64 = ((gtxns NumClearStateProgramPages) txn#0) + (assert tmp%18#0) // num_clear_state_program_pages + let tmp%19#0: bytes = ((gtxnsas ApplicationArgs) txn#0 0u) + let tmp%20#0: uint64 = (len tmp%19#0) + (assert tmp%20#0) // application_args(0) + let tmp%21#0: bytes = ((gtxnsas Accounts) txn#0 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // accounts(0) + let tmp%24#0: uint64 = ((gtxnsas Assets) txn#0 0u) + (assert tmp%24#0) // assets(0) + let tmp%25#0: uint64 = ((gtxnsas Applications) txn#0 0u) + (assert tmp%25#0) // applications(0) + let tmp%26#0: bytes = ((gtxnsas ApprovalProgramPages) txn#0 0u) + let tmp%27#0: uint64 = (len tmp%26#0) + (assert tmp%27#0) // approval_program_pages(0) + let tmp%28#0: bytes = ((gtxnsas ClearStateProgramPages) txn#0 0u) + let tmp%29#0: uint64 = (len tmp%28#0) + (assert tmp%29#0) // clear_state_program_pages(0) + return + + program clear-state: + subroutine examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: + block@0: // L16 + return 1u \ No newline at end of file diff --git a/examples/transaction/out/contract_TransactionContract.post_ssa.ir b/examples/transaction/out/contract_TransactionContract.post_ssa.ir new file mode 100644 index 0000000000..24891775c6 --- /dev/null +++ b/examples/transaction/out/contract_TransactionContract.post_ssa.ir @@ -0,0 +1,316 @@ +contract examples.transaction.contract.TransactionContract: + program approval: + subroutine examples.transaction.contract.TransactionContract.approval_program() -> uint64: + block@0: // L16 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@11 + block@1: // abi_routing_L16 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "create()void" => block@2, method "pay(pay)void" => block@3, method "key(keyreg)void" => block@4, method "asset_config(acfg)void" => block@5, method "asset_transfer(axfer)void" => block@6, method "asset_freeze(afrz)void" => block@7, method "application_call(appl)void" => block@8, * => block@11} + block@2: // create_route_L17 + 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) + let tmp%5#0: uint64 = (! tmp%4#0) + (assert tmp%5#0) // is creating + examples.transaction.contract.TransactionContract.create() + return 1u + block@3: // pay_route_L36 + let tmp%6#0: uint64 = (txn OnCompletion) + let tmp%7#0: uint64 = (! tmp%6#0) + (assert tmp%7#0) // OnCompletion is NoOp + let tmp%8#0: uint64 = (txn ApplicationID) + (assert tmp%8#0) // is not creating + let tmp%11#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%11#0 1u) + let tmp%13#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%14#0: uint64 = (== tmp%13#0 pay) + (assert tmp%14#0) // transaction type is pay + examples.transaction.contract.TransactionContract.pay(awst_tmp%12#0) + return 1u + block@4: // key_route_L45 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%12#1: uint64 = (- tmp%20#0 1u) + let tmp%21#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#1) + let tmp%22#0: uint64 = (== tmp%21#0 keyreg) + (assert tmp%22#0) // transaction type is keyreg + examples.transaction.contract.TransactionContract.key(awst_tmp%12#1) + return 1u + block@5: // asset_config_route_L56 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%12#2: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#2) + let tmp%30#0: uint64 = (== tmp%29#0 acfg) + (assert tmp%30#0) // transaction type is acfg + examples.transaction.contract.TransactionContract.asset_config(awst_tmp%12#2) + return 1u + block@6: // asset_transfer_route_L73 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + let tmp%36#0: uint64 = (txn GroupIndex) + let awst_tmp%12#3: uint64 = (- tmp%36#0 1u) + let tmp%37#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#3) + let tmp%38#0: uint64 = (== tmp%37#0 axfer) + (assert tmp%38#0) // transaction type is axfer + examples.transaction.contract.TransactionContract.asset_transfer(awst_tmp%12#3) + return 1u + block@7: // asset_freeze_route_L82 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%44#0: uint64 = (txn GroupIndex) + let awst_tmp%12#4: uint64 = (- tmp%44#0 1u) + let tmp%45#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#4) + let tmp%46#0: uint64 = (== tmp%45#0 afrz) + (assert tmp%46#0) // transaction type is afrz + examples.transaction.contract.TransactionContract.asset_freeze(awst_tmp%12#4) + return 1u + block@8: // application_call_route_L90 + let tmp%47#0: uint64 = (txn OnCompletion) + let tmp%48#0: uint64 = (! tmp%47#0) + (assert tmp%48#0) // OnCompletion is NoOp + let tmp%49#0: uint64 = (txn ApplicationID) + (assert tmp%49#0) // is not creating + let tmp%52#0: uint64 = (txn GroupIndex) + let awst_tmp%12#5: uint64 = (- tmp%52#0 1u) + let tmp%53#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#5) + let tmp%54#0: uint64 = (== tmp%53#0 appl) + (assert tmp%54#0) // transaction type is appl + examples.transaction.contract.TransactionContract.application_call(awst_tmp%12#5) + return 1u + block@11: // after_if_else_L16 + fail // reject transaction + + subroutine examples.transaction.contract.TransactionContract.create() -> void: + block@0: // L18 + return + + subroutine examples.transaction.contract.TransactionContract.pay(txn: uint64) -> void: + block@0: // L37 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns Receiver) txn#0) + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Payment should be for this app + let tmp%3#0: uint64 = ((gtxns Amount) txn#0) + let tmp%4#0: uint64 = (> tmp%3#0 1000u) + (assert tmp%4#0) // Payment should be for >1000 micro algos + let tmp%5#0: bytes = ((gtxns CloseRemainderTo) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // close_remainder_to + return + + subroutine examples.transaction.contract.TransactionContract._common_checks(txn: uint64) -> void: + block@0: // L22 + let tmp%0#0: bytes = ((gtxns TxID) txn#0) + let tmp%1#0: uint64 = (len tmp%0#0) + (assert tmp%1#0) // txn_id + let tmp%2#0: bytes = ((gtxns Sender) txn#0) + let tmp%3#0: bytes = (global CreatorAddress) + let tmp%4#0: uint64 = (== tmp%2#0 tmp%3#0) + (assert tmp%4#0) // sender + let tmp%5#0: uint64 = ((gtxns Fee) txn#0) + (assert tmp%5#0) // fee + let tmp%6#0: uint64 = ((gtxns TypeEnum) txn#0) + (assert tmp%6#0) // type + let tmp%7#0: bytes = ((gtxns Type) txn#0) + let tmp%8#0: uint64 = (len tmp%7#0) + (assert tmp%8#0) // type_bytes + let tmp%9#0: bytes = ((gtxns Note) txn#0) + let tmp%10#0: uint64 = (== tmp%9#0 "") + (assert tmp%10#0) // note + let tmp%11#0: uint64 = ((gtxns GroupIndex) txn#0) + let tmp%12#0: uint64 = (! tmp%11#0) + (assert tmp%12#0) // group_index + let tmp%13#0: uint64 = ((gtxns FirstValid) txn#0) + (assert tmp%13#0) // first_valid + let tmp%14#0: uint64 = ((gtxns FirstValidTime) txn#0) + (assert tmp%14#0) // first_valid_time + let tmp%15#0: uint64 = ((gtxns LastValid) txn#0) + (assert tmp%15#0) // last_valid + let tmp%16#0: bytes = ((gtxns Lease) txn#0) + let tmp%17#0: uint64 = (len tmp%16#0) + (assert tmp%17#0) // lease + let tmp%18#0: bytes = ((gtxns RekeyTo) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // rekey_to + return + + subroutine examples.transaction.contract.TransactionContract.key(txn: uint64) -> void: + block@0: // L46 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns VotePK) txn#0) + let tmp%1#0: bytes = (global ZeroAddress) + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // vote_key + let tmp%3#0: bytes = ((gtxns SelectionPK) txn#0) + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (!= tmp%3#0 tmp%4#0) + (assert tmp%5#0) // selection_key + let tmp%6#0: uint64 = ((gtxns VoteKeyDilution) txn#0) + (assert tmp%6#0) // vote_key_dilution + let tmp%7#0: uint64 = ((gtxns VoteFirst) txn#0) + (assert tmp%7#0) // vote_first + let tmp%8#0: uint64 = ((gtxns VoteLast) txn#0) + (assert tmp%8#0) // vote_last + let tmp%9#0: uint64 = ((gtxns Nonparticipation) txn#0) + (assert tmp%9#0) // non_participation + let tmp%10#0: bytes = ((gtxns StateProofPK) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // state_proof_key + return + + subroutine examples.transaction.contract.TransactionContract.asset_config(txn: uint64) -> void: + block@0: // L57 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ConfigAsset) txn#0) + (assert tmp%0#0) // config_asset + let tmp%1#0: uint64 = ((gtxns ConfigAssetTotal) txn#0) + (assert tmp%1#0) // total + let tmp%2#0: uint64 = ((gtxns ConfigAssetDecimals) txn#0) + (assert tmp%2#0) // decimals + let tmp%3#0: uint64 = ((gtxns ConfigAssetDefaultFrozen) txn#0) + (assert tmp%3#0) // default_frozen + let tmp%4#0: bytes = ((gtxns ConfigAssetUnitName) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // unit_name + let tmp%6#0: bytes = ((gtxns ConfigAssetName) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // asset_name + let tmp%8#0: bytes = ((gtxns ConfigAssetURL) txn#0) + let tmp%9#0: uint64 = (len tmp%8#0) + (assert tmp%9#0) // url + let tmp%10#0: bytes = ((gtxns ConfigAssetMetadataHash) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // metadata_hash + let tmp%12#0: bytes = ((gtxns ConfigAssetManager) txn#0) + let tmp%13#0: bytes = (global ZeroAddress) + let tmp%14#0: uint64 = (!= tmp%12#0 tmp%13#0) + (assert tmp%14#0) // manager + let tmp%15#0: bytes = ((gtxns ConfigAssetReserve) txn#0) + let tmp%16#0: bytes = (global ZeroAddress) + let tmp%17#0: uint64 = (!= tmp%15#0 tmp%16#0) + (assert tmp%17#0) // reserve + let tmp%18#0: bytes = ((gtxns ConfigAssetFreeze) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (!= tmp%18#0 tmp%19#0) + (assert tmp%20#0) // freeze + let tmp%21#0: bytes = ((gtxns ConfigAssetClawback) txn#0) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // clawback + return + + subroutine examples.transaction.contract.TransactionContract.asset_transfer(txn: uint64) -> void: + block@0: // L74 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns XferAsset) txn#0) + (assert tmp%0#0) // xfer_asset + let tmp%1#0: uint64 = ((gtxns AssetAmount) txn#0) + (assert tmp%1#0) // asset_amount + let tmp%2#0: bytes = ((gtxns AssetSender) txn#0) + let tmp%3#0: bytes = (global ZeroAddress) + let tmp%4#0: uint64 = (!= tmp%2#0 tmp%3#0) + (assert tmp%4#0) // asset_sender + let tmp%5#0: bytes = ((gtxns AssetReceiver) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (!= tmp%5#0 tmp%6#0) + (assert tmp%7#0) // asset_receiver + let tmp%8#0: bytes = ((gtxns AssetCloseTo) txn#0) + let tmp%9#0: bytes = (global ZeroAddress) + let tmp%10#0: uint64 = (!= tmp%8#0 tmp%9#0) + (assert tmp%10#0) // asset_close_to + return + + subroutine examples.transaction.contract.TransactionContract.asset_freeze(txn: uint64) -> void: + block@0: // L83 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns FreezeAsset) txn#0) + (assert tmp%0#0) // freeze_asset + let tmp%1#0: bytes = ((gtxns FreezeAssetAccount) txn#0) + let tmp%2#0: bytes = (global ZeroAddress) + let tmp%3#0: uint64 = (!= tmp%1#0 tmp%2#0) + (assert tmp%3#0) // freeze_account + let tmp%4#0: uint64 = ((gtxns FreezeAssetFrozen) txn#0) + (assert tmp%4#0) // frozen + return + + subroutine examples.transaction.contract.TransactionContract.application_call(txn: uint64) -> void: + block@0: // L91 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ApplicationID) txn#0) + (assert tmp%0#0) // application_id + let tmp%1#0: uint64 = ((gtxns OnCompletion) txn#0) + (assert tmp%1#0) // on_completion + let tmp%2#0: uint64 = ((gtxns NumAppArgs) txn#0) + (assert tmp%2#0) // num_app_args + let tmp%3#0: uint64 = ((gtxns NumAccounts) txn#0) + (assert tmp%3#0) // num_accounts + let tmp%4#0: bytes = ((gtxns ApprovalProgram) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // approval_program + let tmp%6#0: bytes = ((gtxns ClearStateProgram) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // clear_state_program + let tmp%8#0: uint64 = ((gtxns NumAssets) txn#0) + (assert tmp%8#0) // num_assets + let tmp%9#0: uint64 = ((gtxns NumApplications) txn#0) + (assert tmp%9#0) // num_applications + 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 + 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 + 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) + let tmp%16#0: uint64 = (len tmp%15#0) + (assert tmp%16#0) // last_log + let tmp%17#0: uint64 = ((gtxns NumApprovalProgramPages) txn#0) + (assert tmp%17#0) // num_approval_program_pages + let tmp%18#0: uint64 = ((gtxns NumClearStateProgramPages) txn#0) + (assert tmp%18#0) // num_clear_state_program_pages + let tmp%19#0: bytes = ((gtxnsas ApplicationArgs) txn#0 0u) + let tmp%20#0: uint64 = (len tmp%19#0) + (assert tmp%20#0) // application_args(0) + let tmp%21#0: bytes = ((gtxnsas Accounts) txn#0 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // accounts(0) + let tmp%24#0: uint64 = ((gtxnsas Assets) txn#0 0u) + (assert tmp%24#0) // assets(0) + let tmp%25#0: uint64 = ((gtxnsas Applications) txn#0 0u) + (assert tmp%25#0) // applications(0) + let tmp%26#0: bytes = ((gtxnsas ApprovalProgramPages) txn#0 0u) + let tmp%27#0: uint64 = (len tmp%26#0) + (assert tmp%27#0) // approval_program_pages(0) + let tmp%28#0: bytes = ((gtxnsas ClearStateProgramPages) txn#0 0u) + let tmp%29#0: uint64 = (len tmp%28#0) + (assert tmp%29#0) // clear_state_program_pages(0) + return + + program clear-state: + subroutine examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: + block@0: // L16 + return 1u \ No newline at end of file diff --git a/examples/transaction/out/contract_TransactionContract.ssa.ir b/examples/transaction/out/contract_TransactionContract.ssa.ir new file mode 100644 index 0000000000..59a0483ea9 --- /dev/null +++ b/examples/transaction/out/contract_TransactionContract.ssa.ir @@ -0,0 +1,326 @@ +contract examples.transaction.contract.TransactionContract: + program approval: + subroutine examples.transaction.contract.TransactionContract.approval_program() -> uint64: + block@0: // L16 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@11 + block@1: // abi_routing_L16 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "create()void" => block@2, method "pay(pay)void" => block@3, method "key(keyreg)void" => block@4, method "asset_config(acfg)void" => block@5, method "asset_transfer(axfer)void" => block@6, method "asset_freeze(afrz)void" => block@7, method "application_call(appl)void" => block@8, * => block@9} + block@2: // create_route_L17 + 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) + let tmp%5#0: uint64 = (! tmp%4#0) + (assert tmp%5#0) // is creating + examples.transaction.contract.TransactionContract.create() + return 1u + block@3: // pay_route_L36 + let tmp%6#0: uint64 = (txn OnCompletion) + let tmp%7#0: uint64 = (== tmp%6#0 NoOp) + (assert tmp%7#0) // OnCompletion is NoOp + let tmp%8#0: uint64 = (txn ApplicationID) + (assert tmp%8#0) // is not creating + let tmp%11#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%11#0 1u) + let tmp%13#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%14#0: uint64 = (== tmp%13#0 pay) + let (maybe_value%9#0: uint64, maybe_value_did_exist%10#0: uint64) = (awst_tmp%12#0, tmp%14#0) + (assert maybe_value_did_exist%10#0) // transaction type is pay + examples.transaction.contract.TransactionContract.pay(maybe_value%9#0) + return 1u + block@4: // key_route_L45 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (== tmp%15#0 NoOp) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%12#1: uint64 = (- tmp%20#0 1u) + let tmp%21#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#1) + let tmp%22#0: uint64 = (== tmp%21#0 keyreg) + let (maybe_value%18#0: uint64, maybe_value_did_exist%19#0: uint64) = (awst_tmp%12#1, tmp%22#0) + (assert maybe_value_did_exist%19#0) // transaction type is keyreg + examples.transaction.contract.TransactionContract.key(maybe_value%18#0) + return 1u + block@5: // asset_config_route_L56 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (== tmp%23#0 NoOp) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%12#2: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#2) + let tmp%30#0: uint64 = (== tmp%29#0 acfg) + let (maybe_value%26#0: uint64, maybe_value_did_exist%27#0: uint64) = (awst_tmp%12#2, tmp%30#0) + (assert maybe_value_did_exist%27#0) // transaction type is acfg + examples.transaction.contract.TransactionContract.asset_config(maybe_value%26#0) + return 1u + block@6: // asset_transfer_route_L73 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (== tmp%31#0 NoOp) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + let tmp%36#0: uint64 = (txn GroupIndex) + let awst_tmp%12#3: uint64 = (- tmp%36#0 1u) + let tmp%37#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#3) + let tmp%38#0: uint64 = (== tmp%37#0 axfer) + let (maybe_value%34#0: uint64, maybe_value_did_exist%35#0: uint64) = (awst_tmp%12#3, tmp%38#0) + (assert maybe_value_did_exist%35#0) // transaction type is axfer + examples.transaction.contract.TransactionContract.asset_transfer(maybe_value%34#0) + return 1u + block@7: // asset_freeze_route_L82 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (== tmp%39#0 NoOp) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%44#0: uint64 = (txn GroupIndex) + let awst_tmp%12#4: uint64 = (- tmp%44#0 1u) + let tmp%45#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#4) + let tmp%46#0: uint64 = (== tmp%45#0 afrz) + let (maybe_value%42#0: uint64, maybe_value_did_exist%43#0: uint64) = (awst_tmp%12#4, tmp%46#0) + (assert maybe_value_did_exist%43#0) // transaction type is afrz + examples.transaction.contract.TransactionContract.asset_freeze(maybe_value%42#0) + return 1u + block@8: // application_call_route_L90 + let tmp%47#0: uint64 = (txn OnCompletion) + let tmp%48#0: uint64 = (== tmp%47#0 NoOp) + (assert tmp%48#0) // OnCompletion is NoOp + let tmp%49#0: uint64 = (txn ApplicationID) + (assert tmp%49#0) // is not creating + let tmp%52#0: uint64 = (txn GroupIndex) + let awst_tmp%12#5: uint64 = (- tmp%52#0 1u) + let tmp%53#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#5) + let tmp%54#0: uint64 = (== tmp%53#0 appl) + let (maybe_value%50#0: uint64, maybe_value_did_exist%51#0: uint64) = (awst_tmp%12#5, tmp%54#0) + (assert maybe_value_did_exist%51#0) // transaction type is appl + examples.transaction.contract.TransactionContract.application_call(maybe_value%50#0) + return 1u + block@9: // switch_case_default_L16 + goto block@10 + block@10: // switch_case_next_L16 + goto block@11 + block@11: // after_if_else_L16 + fail // reject transaction + + subroutine examples.transaction.contract.TransactionContract.create() -> void: + block@0: // L18 + return + + subroutine examples.transaction.contract.TransactionContract.pay(txn: uint64) -> void: + block@0: // L37 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns Receiver) txn#0) + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Payment should be for this app + let tmp%3#0: uint64 = ((gtxns Amount) txn#0) + let tmp%4#0: uint64 = (> tmp%3#0 1000u) + (assert tmp%4#0) // Payment should be for >1000 micro algos + let tmp%5#0: bytes = ((gtxns CloseRemainderTo) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // close_remainder_to + return + + subroutine examples.transaction.contract.TransactionContract._common_checks(txn: uint64) -> void: + block@0: // L22 + let tmp%0#0: bytes = ((gtxns TxID) txn#0) + let tmp%1#0: uint64 = (len tmp%0#0) + (assert tmp%1#0) // txn_id + let tmp%2#0: bytes = ((gtxns Sender) txn#0) + let tmp%3#0: bytes = (global CreatorAddress) + let tmp%4#0: uint64 = (== tmp%2#0 tmp%3#0) + (assert tmp%4#0) // sender + let tmp%5#0: uint64 = ((gtxns Fee) txn#0) + (assert tmp%5#0) // fee + let tmp%6#0: uint64 = ((gtxns TypeEnum) txn#0) + (assert tmp%6#0) // type + let tmp%7#0: bytes = ((gtxns Type) txn#0) + let tmp%8#0: uint64 = (len tmp%7#0) + (assert tmp%8#0) // type_bytes + let tmp%9#0: bytes = ((gtxns Note) txn#0) + let tmp%10#0: uint64 = (== tmp%9#0 "") + (assert tmp%10#0) // note + let tmp%11#0: uint64 = ((gtxns GroupIndex) txn#0) + let tmp%12#0: uint64 = (== tmp%11#0 0u) + (assert tmp%12#0) // group_index + let tmp%13#0: uint64 = ((gtxns FirstValid) txn#0) + (assert tmp%13#0) // first_valid + let tmp%14#0: uint64 = ((gtxns FirstValidTime) txn#0) + (assert tmp%14#0) // first_valid_time + let tmp%15#0: uint64 = ((gtxns LastValid) txn#0) + (assert tmp%15#0) // last_valid + let tmp%16#0: bytes = ((gtxns Lease) txn#0) + let tmp%17#0: uint64 = (len tmp%16#0) + (assert tmp%17#0) // lease + let tmp%18#0: bytes = ((gtxns RekeyTo) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // rekey_to + return + + subroutine examples.transaction.contract.TransactionContract.key(txn: uint64) -> void: + block@0: // L46 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns VotePK) txn#0) + let tmp%1#0: bytes = (global ZeroAddress) + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // vote_key + let tmp%3#0: bytes = ((gtxns SelectionPK) txn#0) + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (!= tmp%3#0 tmp%4#0) + (assert tmp%5#0) // selection_key + let tmp%6#0: uint64 = ((gtxns VoteKeyDilution) txn#0) + (assert tmp%6#0) // vote_key_dilution + let tmp%7#0: uint64 = ((gtxns VoteFirst) txn#0) + (assert tmp%7#0) // vote_first + let tmp%8#0: uint64 = ((gtxns VoteLast) txn#0) + (assert tmp%8#0) // vote_last + let tmp%9#0: uint64 = ((gtxns Nonparticipation) txn#0) + (assert tmp%9#0) // non_participation + let tmp%10#0: bytes = ((gtxns StateProofPK) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // state_proof_key + return + + subroutine examples.transaction.contract.TransactionContract.asset_config(txn: uint64) -> void: + block@0: // L57 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ConfigAsset) txn#0) + (assert tmp%0#0) // config_asset + let tmp%1#0: uint64 = ((gtxns ConfigAssetTotal) txn#0) + (assert tmp%1#0) // total + let tmp%2#0: uint64 = ((gtxns ConfigAssetDecimals) txn#0) + (assert tmp%2#0) // decimals + let tmp%3#0: uint64 = ((gtxns ConfigAssetDefaultFrozen) txn#0) + (assert tmp%3#0) // default_frozen + let tmp%4#0: bytes = ((gtxns ConfigAssetUnitName) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // unit_name + let tmp%6#0: bytes = ((gtxns ConfigAssetName) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // asset_name + let tmp%8#0: bytes = ((gtxns ConfigAssetURL) txn#0) + let tmp%9#0: uint64 = (len tmp%8#0) + (assert tmp%9#0) // url + let tmp%10#0: bytes = ((gtxns ConfigAssetMetadataHash) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // metadata_hash + let tmp%12#0: bytes = ((gtxns ConfigAssetManager) txn#0) + let tmp%13#0: bytes = (global ZeroAddress) + let tmp%14#0: uint64 = (!= tmp%12#0 tmp%13#0) + (assert tmp%14#0) // manager + let tmp%15#0: bytes = ((gtxns ConfigAssetReserve) txn#0) + let tmp%16#0: bytes = (global ZeroAddress) + let tmp%17#0: uint64 = (!= tmp%15#0 tmp%16#0) + (assert tmp%17#0) // reserve + let tmp%18#0: bytes = ((gtxns ConfigAssetFreeze) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (!= tmp%18#0 tmp%19#0) + (assert tmp%20#0) // freeze + let tmp%21#0: bytes = ((gtxns ConfigAssetClawback) txn#0) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // clawback + return + + subroutine examples.transaction.contract.TransactionContract.asset_transfer(txn: uint64) -> void: + block@0: // L74 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns XferAsset) txn#0) + (assert tmp%0#0) // xfer_asset + let tmp%1#0: uint64 = ((gtxns AssetAmount) txn#0) + (assert tmp%1#0) // asset_amount + let tmp%2#0: bytes = ((gtxns AssetSender) txn#0) + let tmp%3#0: bytes = (global ZeroAddress) + let tmp%4#0: uint64 = (!= tmp%2#0 tmp%3#0) + (assert tmp%4#0) // asset_sender + let tmp%5#0: bytes = ((gtxns AssetReceiver) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (!= tmp%5#0 tmp%6#0) + (assert tmp%7#0) // asset_receiver + let tmp%8#0: bytes = ((gtxns AssetCloseTo) txn#0) + let tmp%9#0: bytes = (global ZeroAddress) + let tmp%10#0: uint64 = (!= tmp%8#0 tmp%9#0) + (assert tmp%10#0) // asset_close_to + return + + subroutine examples.transaction.contract.TransactionContract.asset_freeze(txn: uint64) -> void: + block@0: // L83 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns FreezeAsset) txn#0) + (assert tmp%0#0) // freeze_asset + let tmp%1#0: bytes = ((gtxns FreezeAssetAccount) txn#0) + let tmp%2#0: bytes = (global ZeroAddress) + let tmp%3#0: uint64 = (!= tmp%1#0 tmp%2#0) + (assert tmp%3#0) // freeze_account + let tmp%4#0: uint64 = ((gtxns FreezeAssetFrozen) txn#0) + (assert tmp%4#0) // frozen + return + + subroutine examples.transaction.contract.TransactionContract.application_call(txn: uint64) -> void: + block@0: // L91 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ApplicationID) txn#0) + (assert tmp%0#0) // application_id + let tmp%1#0: uint64 = ((gtxns OnCompletion) txn#0) + (assert tmp%1#0) // on_completion + let tmp%2#0: uint64 = ((gtxns NumAppArgs) txn#0) + (assert tmp%2#0) // num_app_args + let tmp%3#0: uint64 = ((gtxns NumAccounts) txn#0) + (assert tmp%3#0) // num_accounts + let tmp%4#0: bytes = ((gtxns ApprovalProgram) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // approval_program + let tmp%6#0: bytes = ((gtxns ClearStateProgram) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // clear_state_program + let tmp%8#0: uint64 = ((gtxns NumAssets) txn#0) + (assert tmp%8#0) // num_assets + let tmp%9#0: uint64 = ((gtxns NumApplications) txn#0) + (assert tmp%9#0) // num_applications + 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 + 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 + 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) + let tmp%16#0: uint64 = (len tmp%15#0) + (assert tmp%16#0) // last_log + let tmp%17#0: uint64 = ((gtxns NumApprovalProgramPages) txn#0) + (assert tmp%17#0) // num_approval_program_pages + let tmp%18#0: uint64 = ((gtxns NumClearStateProgramPages) txn#0) + (assert tmp%18#0) // num_clear_state_program_pages + let tmp%19#0: bytes = ((gtxnsas ApplicationArgs) txn#0 0u) + let tmp%20#0: uint64 = (len tmp%19#0) + (assert tmp%20#0) // application_args(0) + let tmp%21#0: bytes = ((gtxnsas Accounts) txn#0 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // accounts(0) + let tmp%24#0: uint64 = ((gtxnsas Assets) txn#0 0u) + (assert tmp%24#0) // assets(0) + let tmp%25#0: uint64 = ((gtxnsas Applications) txn#0 0u) + (assert tmp%25#0) // applications(0) + let tmp%26#0: bytes = ((gtxnsas ApprovalProgramPages) txn#0 0u) + let tmp%27#0: uint64 = (len tmp%26#0) + (assert tmp%27#0) // approval_program_pages(0) + let tmp%28#0: bytes = ((gtxnsas ClearStateProgramPages) txn#0 0u) + let tmp%29#0: uint64 = (len tmp%28#0) + (assert tmp%29#0) // clear_state_program_pages(0) + return + + program clear-state: + subroutine examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: + block@0: // L16 + return 1u \ No newline at end of file diff --git a/examples/transaction/out/contract_TransactionContract.ssa.opt_pass_1.ir b/examples/transaction/out/contract_TransactionContract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..24891775c6 --- /dev/null +++ b/examples/transaction/out/contract_TransactionContract.ssa.opt_pass_1.ir @@ -0,0 +1,316 @@ +contract examples.transaction.contract.TransactionContract: + program approval: + subroutine examples.transaction.contract.TransactionContract.approval_program() -> uint64: + block@0: // L16 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@11 + block@1: // abi_routing_L16 + let tmp%1#0: bytes = (txna ApplicationArgs 0) + switch tmp%1#0 {method "create()void" => block@2, method "pay(pay)void" => block@3, method "key(keyreg)void" => block@4, method "asset_config(acfg)void" => block@5, method "asset_transfer(axfer)void" => block@6, method "asset_freeze(afrz)void" => block@7, method "application_call(appl)void" => block@8, * => block@11} + block@2: // create_route_L17 + 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) + let tmp%5#0: uint64 = (! tmp%4#0) + (assert tmp%5#0) // is creating + examples.transaction.contract.TransactionContract.create() + return 1u + block@3: // pay_route_L36 + let tmp%6#0: uint64 = (txn OnCompletion) + let tmp%7#0: uint64 = (! tmp%6#0) + (assert tmp%7#0) // OnCompletion is NoOp + let tmp%8#0: uint64 = (txn ApplicationID) + (assert tmp%8#0) // is not creating + let tmp%11#0: uint64 = (txn GroupIndex) + let awst_tmp%12#0: uint64 = (- tmp%11#0 1u) + let tmp%13#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#0) + let tmp%14#0: uint64 = (== tmp%13#0 pay) + (assert tmp%14#0) // transaction type is pay + examples.transaction.contract.TransactionContract.pay(awst_tmp%12#0) + return 1u + block@4: // key_route_L45 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%12#1: uint64 = (- tmp%20#0 1u) + let tmp%21#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#1) + let tmp%22#0: uint64 = (== tmp%21#0 keyreg) + (assert tmp%22#0) // transaction type is keyreg + examples.transaction.contract.TransactionContract.key(awst_tmp%12#1) + return 1u + block@5: // asset_config_route_L56 + let tmp%23#0: uint64 = (txn OnCompletion) + let tmp%24#0: uint64 = (! tmp%23#0) + (assert tmp%24#0) // OnCompletion is NoOp + let tmp%25#0: uint64 = (txn ApplicationID) + (assert tmp%25#0) // is not creating + let tmp%28#0: uint64 = (txn GroupIndex) + let awst_tmp%12#2: uint64 = (- tmp%28#0 1u) + let tmp%29#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#2) + let tmp%30#0: uint64 = (== tmp%29#0 acfg) + (assert tmp%30#0) // transaction type is acfg + examples.transaction.contract.TransactionContract.asset_config(awst_tmp%12#2) + return 1u + block@6: // asset_transfer_route_L73 + let tmp%31#0: uint64 = (txn OnCompletion) + let tmp%32#0: uint64 = (! tmp%31#0) + (assert tmp%32#0) // OnCompletion is NoOp + let tmp%33#0: uint64 = (txn ApplicationID) + (assert tmp%33#0) // is not creating + let tmp%36#0: uint64 = (txn GroupIndex) + let awst_tmp%12#3: uint64 = (- tmp%36#0 1u) + let tmp%37#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#3) + let tmp%38#0: uint64 = (== tmp%37#0 axfer) + (assert tmp%38#0) // transaction type is axfer + examples.transaction.contract.TransactionContract.asset_transfer(awst_tmp%12#3) + return 1u + block@7: // asset_freeze_route_L82 + let tmp%39#0: uint64 = (txn OnCompletion) + let tmp%40#0: uint64 = (! tmp%39#0) + (assert tmp%40#0) // OnCompletion is NoOp + let tmp%41#0: uint64 = (txn ApplicationID) + (assert tmp%41#0) // is not creating + let tmp%44#0: uint64 = (txn GroupIndex) + let awst_tmp%12#4: uint64 = (- tmp%44#0 1u) + let tmp%45#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#4) + let tmp%46#0: uint64 = (== tmp%45#0 afrz) + (assert tmp%46#0) // transaction type is afrz + examples.transaction.contract.TransactionContract.asset_freeze(awst_tmp%12#4) + return 1u + block@8: // application_call_route_L90 + let tmp%47#0: uint64 = (txn OnCompletion) + let tmp%48#0: uint64 = (! tmp%47#0) + (assert tmp%48#0) // OnCompletion is NoOp + let tmp%49#0: uint64 = (txn ApplicationID) + (assert tmp%49#0) // is not creating + let tmp%52#0: uint64 = (txn GroupIndex) + let awst_tmp%12#5: uint64 = (- tmp%52#0 1u) + let tmp%53#0: uint64 = ((gtxns TypeEnum) awst_tmp%12#5) + let tmp%54#0: uint64 = (== tmp%53#0 appl) + (assert tmp%54#0) // transaction type is appl + examples.transaction.contract.TransactionContract.application_call(awst_tmp%12#5) + return 1u + block@11: // after_if_else_L16 + fail // reject transaction + + subroutine examples.transaction.contract.TransactionContract.create() -> void: + block@0: // L18 + return + + subroutine examples.transaction.contract.TransactionContract.pay(txn: uint64) -> void: + block@0: // L37 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns Receiver) txn#0) + let tmp%1#0: bytes = (global CurrentApplicationAddress) + let tmp%2#0: uint64 = (== tmp%0#0 tmp%1#0) + (assert tmp%2#0) // Payment should be for this app + let tmp%3#0: uint64 = ((gtxns Amount) txn#0) + let tmp%4#0: uint64 = (> tmp%3#0 1000u) + (assert tmp%4#0) // Payment should be for >1000 micro algos + let tmp%5#0: bytes = ((gtxns CloseRemainderTo) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (== tmp%5#0 tmp%6#0) + (assert tmp%7#0) // close_remainder_to + return + + subroutine examples.transaction.contract.TransactionContract._common_checks(txn: uint64) -> void: + block@0: // L22 + let tmp%0#0: bytes = ((gtxns TxID) txn#0) + let tmp%1#0: uint64 = (len tmp%0#0) + (assert tmp%1#0) // txn_id + let tmp%2#0: bytes = ((gtxns Sender) txn#0) + let tmp%3#0: bytes = (global CreatorAddress) + let tmp%4#0: uint64 = (== tmp%2#0 tmp%3#0) + (assert tmp%4#0) // sender + let tmp%5#0: uint64 = ((gtxns Fee) txn#0) + (assert tmp%5#0) // fee + let tmp%6#0: uint64 = ((gtxns TypeEnum) txn#0) + (assert tmp%6#0) // type + let tmp%7#0: bytes = ((gtxns Type) txn#0) + let tmp%8#0: uint64 = (len tmp%7#0) + (assert tmp%8#0) // type_bytes + let tmp%9#0: bytes = ((gtxns Note) txn#0) + let tmp%10#0: uint64 = (== tmp%9#0 "") + (assert tmp%10#0) // note + let tmp%11#0: uint64 = ((gtxns GroupIndex) txn#0) + let tmp%12#0: uint64 = (! tmp%11#0) + (assert tmp%12#0) // group_index + let tmp%13#0: uint64 = ((gtxns FirstValid) txn#0) + (assert tmp%13#0) // first_valid + let tmp%14#0: uint64 = ((gtxns FirstValidTime) txn#0) + (assert tmp%14#0) // first_valid_time + let tmp%15#0: uint64 = ((gtxns LastValid) txn#0) + (assert tmp%15#0) // last_valid + let tmp%16#0: bytes = ((gtxns Lease) txn#0) + let tmp%17#0: uint64 = (len tmp%16#0) + (assert tmp%17#0) // lease + let tmp%18#0: bytes = ((gtxns RekeyTo) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (== tmp%18#0 tmp%19#0) + (assert tmp%20#0) // rekey_to + return + + subroutine examples.transaction.contract.TransactionContract.key(txn: uint64) -> void: + block@0: // L46 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: bytes = ((gtxns VotePK) txn#0) + let tmp%1#0: bytes = (global ZeroAddress) + let tmp%2#0: uint64 = (!= tmp%0#0 tmp%1#0) + (assert tmp%2#0) // vote_key + let tmp%3#0: bytes = ((gtxns SelectionPK) txn#0) + let tmp%4#0: bytes = (global ZeroAddress) + let tmp%5#0: uint64 = (!= tmp%3#0 tmp%4#0) + (assert tmp%5#0) // selection_key + let tmp%6#0: uint64 = ((gtxns VoteKeyDilution) txn#0) + (assert tmp%6#0) // vote_key_dilution + let tmp%7#0: uint64 = ((gtxns VoteFirst) txn#0) + (assert tmp%7#0) // vote_first + let tmp%8#0: uint64 = ((gtxns VoteLast) txn#0) + (assert tmp%8#0) // vote_last + let tmp%9#0: uint64 = ((gtxns Nonparticipation) txn#0) + (assert tmp%9#0) // non_participation + let tmp%10#0: bytes = ((gtxns StateProofPK) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // state_proof_key + return + + subroutine examples.transaction.contract.TransactionContract.asset_config(txn: uint64) -> void: + block@0: // L57 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ConfigAsset) txn#0) + (assert tmp%0#0) // config_asset + let tmp%1#0: uint64 = ((gtxns ConfigAssetTotal) txn#0) + (assert tmp%1#0) // total + let tmp%2#0: uint64 = ((gtxns ConfigAssetDecimals) txn#0) + (assert tmp%2#0) // decimals + let tmp%3#0: uint64 = ((gtxns ConfigAssetDefaultFrozen) txn#0) + (assert tmp%3#0) // default_frozen + let tmp%4#0: bytes = ((gtxns ConfigAssetUnitName) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // unit_name + let tmp%6#0: bytes = ((gtxns ConfigAssetName) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // asset_name + let tmp%8#0: bytes = ((gtxns ConfigAssetURL) txn#0) + let tmp%9#0: uint64 = (len tmp%8#0) + (assert tmp%9#0) // url + let tmp%10#0: bytes = ((gtxns ConfigAssetMetadataHash) txn#0) + let tmp%11#0: uint64 = (len tmp%10#0) + (assert tmp%11#0) // metadata_hash + let tmp%12#0: bytes = ((gtxns ConfigAssetManager) txn#0) + let tmp%13#0: bytes = (global ZeroAddress) + let tmp%14#0: uint64 = (!= tmp%12#0 tmp%13#0) + (assert tmp%14#0) // manager + let tmp%15#0: bytes = ((gtxns ConfigAssetReserve) txn#0) + let tmp%16#0: bytes = (global ZeroAddress) + let tmp%17#0: uint64 = (!= tmp%15#0 tmp%16#0) + (assert tmp%17#0) // reserve + let tmp%18#0: bytes = ((gtxns ConfigAssetFreeze) txn#0) + let tmp%19#0: bytes = (global ZeroAddress) + let tmp%20#0: uint64 = (!= tmp%18#0 tmp%19#0) + (assert tmp%20#0) // freeze + let tmp%21#0: bytes = ((gtxns ConfigAssetClawback) txn#0) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // clawback + return + + subroutine examples.transaction.contract.TransactionContract.asset_transfer(txn: uint64) -> void: + block@0: // L74 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns XferAsset) txn#0) + (assert tmp%0#0) // xfer_asset + let tmp%1#0: uint64 = ((gtxns AssetAmount) txn#0) + (assert tmp%1#0) // asset_amount + let tmp%2#0: bytes = ((gtxns AssetSender) txn#0) + let tmp%3#0: bytes = (global ZeroAddress) + let tmp%4#0: uint64 = (!= tmp%2#0 tmp%3#0) + (assert tmp%4#0) // asset_sender + let tmp%5#0: bytes = ((gtxns AssetReceiver) txn#0) + let tmp%6#0: bytes = (global ZeroAddress) + let tmp%7#0: uint64 = (!= tmp%5#0 tmp%6#0) + (assert tmp%7#0) // asset_receiver + let tmp%8#0: bytes = ((gtxns AssetCloseTo) txn#0) + let tmp%9#0: bytes = (global ZeroAddress) + let tmp%10#0: uint64 = (!= tmp%8#0 tmp%9#0) + (assert tmp%10#0) // asset_close_to + return + + subroutine examples.transaction.contract.TransactionContract.asset_freeze(txn: uint64) -> void: + block@0: // L83 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns FreezeAsset) txn#0) + (assert tmp%0#0) // freeze_asset + let tmp%1#0: bytes = ((gtxns FreezeAssetAccount) txn#0) + let tmp%2#0: bytes = (global ZeroAddress) + let tmp%3#0: uint64 = (!= tmp%1#0 tmp%2#0) + (assert tmp%3#0) // freeze_account + let tmp%4#0: uint64 = ((gtxns FreezeAssetFrozen) txn#0) + (assert tmp%4#0) // frozen + return + + subroutine examples.transaction.contract.TransactionContract.application_call(txn: uint64) -> void: + block@0: // L91 + examples.transaction.contract.TransactionContract._common_checks(txn#0) + let tmp%0#0: uint64 = ((gtxns ApplicationID) txn#0) + (assert tmp%0#0) // application_id + let tmp%1#0: uint64 = ((gtxns OnCompletion) txn#0) + (assert tmp%1#0) // on_completion + let tmp%2#0: uint64 = ((gtxns NumAppArgs) txn#0) + (assert tmp%2#0) // num_app_args + let tmp%3#0: uint64 = ((gtxns NumAccounts) txn#0) + (assert tmp%3#0) // num_accounts + let tmp%4#0: bytes = ((gtxns ApprovalProgram) txn#0) + let tmp%5#0: uint64 = (len tmp%4#0) + (assert tmp%5#0) // approval_program + let tmp%6#0: bytes = ((gtxns ClearStateProgram) txn#0) + let tmp%7#0: uint64 = (len tmp%6#0) + (assert tmp%7#0) // clear_state_program + let tmp%8#0: uint64 = ((gtxns NumAssets) txn#0) + (assert tmp%8#0) // num_assets + let tmp%9#0: uint64 = ((gtxns NumApplications) txn#0) + (assert tmp%9#0) // num_applications + 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 + 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 + 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) + let tmp%16#0: uint64 = (len tmp%15#0) + (assert tmp%16#0) // last_log + let tmp%17#0: uint64 = ((gtxns NumApprovalProgramPages) txn#0) + (assert tmp%17#0) // num_approval_program_pages + let tmp%18#0: uint64 = ((gtxns NumClearStateProgramPages) txn#0) + (assert tmp%18#0) // num_clear_state_program_pages + let tmp%19#0: bytes = ((gtxnsas ApplicationArgs) txn#0 0u) + let tmp%20#0: uint64 = (len tmp%19#0) + (assert tmp%20#0) // application_args(0) + let tmp%21#0: bytes = ((gtxnsas Accounts) txn#0 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: uint64 = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // accounts(0) + let tmp%24#0: uint64 = ((gtxnsas Assets) txn#0 0u) + (assert tmp%24#0) // assets(0) + let tmp%25#0: uint64 = ((gtxnsas Applications) txn#0 0u) + (assert tmp%25#0) // applications(0) + let tmp%26#0: bytes = ((gtxnsas ApprovalProgramPages) txn#0 0u) + let tmp%27#0: uint64 = (len tmp%26#0) + (assert tmp%27#0) // approval_program_pages(0) + let tmp%28#0: bytes = ((gtxnsas ClearStateProgramPages) txn#0 0u) + let tmp%29#0: uint64 = (len tmp%28#0) + (assert tmp%29#0) // clear_state_program_pages(0) + return + + program clear-state: + subroutine examples.transaction.contract.TransactionContract.clear_state_program() -> uint64: + block@0: // L16 + return 1u \ No newline at end of file diff --git a/examples/tuple_support.algopy.log b/examples/tuple_support.algopy.log index f997adb9ec..4c9aa572a9 100644 --- a/examples/tuple_support.algopy.log +++ b/examples/tuple_support.algopy.log @@ -1,87 +1,90 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 tuple_support.py -info: Building AWST for __init__.py -info: Building AWST for tuple_support.py -debug: Sealing block@0: // L65 -debug: Terminated block@0: // L65 -debug: Sealing block@1: // for_header_0_L67 -debug: Terminated block@1: // for_header_0_L67 -debug: Terminated block@2: // for_header_1_L67 -debug: Terminated block@3: // for_header_2_L67 -debug: Sealing block@None: // for_body_L67 -debug: Created Phi assignment: let total#1: uint64 = undefined while trying to resolve 'total' in block@4: // for_body_L67 -debug: Added total#0 to Phi node: let total#1: uint64 = φ(total#0 <- block@1) in block@1: // for_header_0_L67 -debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L67 -debug: Created Phi assignment: let total#2: uint64 = undefined while trying to resolve 'total' in block@2: // for_header_1_L67 -debug: Added total#2 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2) in block@2: // for_header_1_L67 -debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L67 -debug: Created Phi assignment: let total#3: uint64 = undefined while trying to resolve 'total' in block@3: // for_header_2_L67 -debug: Added total#3 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2, total#3 <- block@3) in block@3: // for_header_2_L67 -debug: Created Phi assignment: let value#3: uint64 = undefined while trying to resolve 'value' in block@4: // for_body_L67 -debug: Added value#0 to Phi node: let value#3: uint64 = φ(value#0 <- block@1) in block@1: // for_header_0_L67 -debug: Added value#1 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2) in block@2: // for_header_1_L67 -debug: Added value#2 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2, value#2 <- block@3) in block@3: // for_header_2_L67 -debug: Terminated block@4: // for_body_L67 -debug: Sealing block@5: // for_footer_L67 -debug: Created Phi assignment: let tuple_index%0#1: uint64 = undefined while trying to resolve 'tuple_index%0' in block@4: // for_body_L67 -debug: Added tuple_index%0#0 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1) in block@1: // for_header_0_L67 -debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L67 -debug: Created Phi assignment: let tuple_index%0#2: uint64 = undefined while trying to resolve 'tuple_index%0' in block@2: // for_header_1_L67 -debug: Added tuple_index%0#2 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2) in block@2: // for_header_1_L67 -debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L67 -debug: Created Phi assignment: let tuple_index%0#3: uint64 = undefined while trying to resolve 'tuple_index%0' in block@3: // for_header_2_L67 -debug: Added tuple_index%0#3 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2, tuple_index%0#3 <- block@3) in block@3: // for_header_2_L67 -debug: Terminated block@5: // for_footer_L67 -debug: Sealing block@2: // for_header_1_L67 -debug: Added total#4 to Phi node: let total#2: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L67 +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug tuple_support.py +debug: Building AWST for __init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for tuple_support.py +debug: Sealing block@0: // L76 +debug: Terminated block@0: // L76 +debug: Sealing block@1: // for_header_0_L78 +debug: Terminated block@1: // for_header_0_L78 +debug: Terminated block@2: // for_header_1_L78 +debug: Terminated block@3: // for_header_2_L78 +debug: Sealing block@None: // for_body_L78 +debug: Created Phi assignment: let total#1: uint64 = undefined while trying to resolve 'total' in block@4: // for_body_L78 +debug: Added total#0 to Phi node: let total#1: uint64 = φ(total#0 <- block@1) in block@1: // for_header_0_L78 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L78 +debug: Created Phi assignment: let total#2: uint64 = undefined while trying to resolve 'total' in block@2: // for_header_1_L78 +debug: Added total#2 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2) in block@2: // for_header_1_L78 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L78 +debug: Created Phi assignment: let total#3: uint64 = undefined while trying to resolve 'total' in block@3: // for_header_2_L78 +debug: Added total#3 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2, total#3 <- block@3) in block@3: // for_header_2_L78 +debug: Created Phi assignment: let value#3: uint64 = undefined while trying to resolve 'value' in block@4: // for_body_L78 +debug: Added value#0 to Phi node: let value#3: uint64 = φ(value#0 <- block@1) in block@1: // for_header_0_L78 +debug: Added value#1 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2) in block@2: // for_header_1_L78 +debug: Added value#2 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2, value#2 <- block@3) in block@3: // for_header_2_L78 +debug: Terminated block@4: // for_body_L78 +debug: Sealing block@5: // for_footer_L78 +debug: Created Phi assignment: let tuple_index%0#1: uint64 = undefined while trying to resolve 'tuple_index%0' in block@4: // for_body_L78 +debug: Added tuple_index%0#0 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1) in block@1: // for_header_0_L78 +debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L78 +debug: Created Phi assignment: let tuple_index%0#2: uint64 = undefined while trying to resolve 'tuple_index%0' in block@2: // for_header_1_L78 +debug: Added tuple_index%0#2 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2) in block@2: // for_header_1_L78 +debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L78 +debug: Created Phi assignment: let tuple_index%0#3: uint64 = undefined while trying to resolve 'tuple_index%0' in block@3: // for_header_2_L78 +debug: Added tuple_index%0#3 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2, tuple_index%0#3 <- block@3) in block@3: // for_header_2_L78 +debug: Terminated block@5: // for_footer_L78 +debug: Sealing block@2: // for_header_1_L78 +debug: Added total#4 to Phi node: let total#2: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L78 debug: Replacing trivial Phi node: let total#2: uint64 = φ(total#4 <- block@5) (total#2) with total#4 debug: Deleting Phi assignment: let total#2: uint64 = φ(total#4 <- block@5) debug: Replaced trivial Phi node: let total#2: uint64 = φ(total#4 <- block@5) (total#2) with total#4 in current definition for 1 blocks -debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L67 +debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L78 debug: Replacing trivial Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#2) with tuple_index%0#4 debug: Deleting Phi assignment: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) debug: Replaced trivial Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#2) with tuple_index%0#4 in current definition for 1 blocks -debug: Sealing block@3: // for_header_2_L67 -debug: Added total#4 to Phi node: let total#3: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L67 +debug: Sealing block@3: // for_header_2_L78 +debug: Added total#4 to Phi node: let total#3: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L78 debug: Replacing trivial Phi node: let total#3: uint64 = φ(total#4 <- block@5) (total#3) with total#4 debug: Deleting Phi assignment: let total#3: uint64 = φ(total#4 <- block@5) debug: Replaced trivial Phi node: let total#3: uint64 = φ(total#4 <- block@5) (total#3) with total#4 in current definition for 1 blocks -debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L67 +debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L78 debug: Replacing trivial Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#3) with tuple_index%0#4 debug: Deleting Phi assignment: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) debug: Replaced trivial Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#3) with tuple_index%0#4 in current definition for 1 blocks -debug: Sealing block@None: // after_for_L67 -debug: Terminated block@6: // after_for_L67 -debug: Sealing block@0: // L48 -debug: Terminated block@0: // L48 -debug: Sealing block@0: // L76 -debug: Terminated block@0: // L76 -debug: Sealing block@0: // L55 -debug: Terminated block@0: // L55 -debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@1: // for_header_L59 -debug: Created Phi assignment: let range_item%0#1: uint64 = undefined while trying to resolve 'range_item%0' in block@1: // for_header_L59 -debug: Terminated block@1: // for_header_L59 -debug: Sealing block@None: // for_body_L59 -debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@1: // for_header_L59 -debug: Created Phi assignment: let result#1: bytes = undefined while trying to resolve 'result' in block@1: // for_header_L59 -debug: Looking for 'b' in an unsealed block creating an incomplete Phi: block@1: // for_header_L59 -debug: Created Phi assignment: let b#1: bytes = undefined while trying to resolve 'b' in block@1: // for_header_L59 -debug: Terminated block@2: // for_body_L59 -debug: Sealing block@3: // for_footer_L59 -debug: Sealing block@None: // after_for_L59 -debug: Terminated block@3: // for_footer_L59 -debug: Sealing block@1: // for_header_L59 -debug: Added range_item%0#0 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0) in block@0: // L55 -debug: Added range_item%0#2 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0, range_item%0#2 <- block@3) in block@3: // for_footer_L59 -debug: Added result#0 to Phi node: let result#1: bytes = φ(result#0 <- block@0) in block@0: // L55 -debug: Added result#2 to Phi node: let result#1: bytes = φ(result#0 <- block@0, result#2 <- block@3) in block@3: // for_footer_L59 -debug: Added b#0 to Phi node: let b#1: bytes = φ(b#0 <- block@0) in block@0: // L55 -debug: Added b#1 to Phi node: let b#1: bytes = φ(b#0 <- block@0, b#1 <- block@3) in block@3: // for_footer_L59 +debug: Sealing block@None: // after_for_L78 +debug: Terminated block@6: // after_for_L78 +debug: Sealing block@0: // L60 +debug: Terminated block@0: // L60 +debug: Sealing block@0: // L87 +debug: Terminated block@0: // L87 +debug: Sealing block@0: // L67 +debug: Terminated block@0: // L67 +debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@1: // for_header_L70 +debug: Created Phi assignment: let range_item%0#1: uint64 = undefined while trying to resolve 'range_item%0' in block@1: // for_header_L70 +debug: Terminated block@1: // for_header_L70 +debug: Sealing block@None: // for_body_L70 +debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@1: // for_header_L70 +debug: Created Phi assignment: let result#1: bytes = undefined while trying to resolve 'result' in block@1: // for_header_L70 +debug: Looking for 'b' in an unsealed block creating an incomplete Phi: block@1: // for_header_L70 +debug: Created Phi assignment: let b#1: bytes = undefined while trying to resolve 'b' in block@1: // for_header_L70 +debug: Terminated block@2: // for_body_L70 +debug: Sealing block@3: // for_footer_L70 +debug: Sealing block@None: // after_for_L70 +debug: Terminated block@3: // for_footer_L70 +debug: Sealing block@1: // for_header_L70 +debug: Added range_item%0#0 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0) in block@0: // L67 +debug: Added range_item%0#2 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0, range_item%0#2 <- block@3) in block@3: // for_footer_L70 +debug: Added result#0 to Phi node: let result#1: bytes = φ(result#0 <- block@0) in block@0: // L67 +debug: Added result#2 to Phi node: let result#1: bytes = φ(result#0 <- block@0, result#2 <- block@3) in block@3: // for_footer_L70 +debug: Added b#0 to Phi node: let b#1: bytes = φ(b#0 <- block@0) in block@0: // L67 +debug: Added b#1 to Phi node: let b#1: bytes = φ(b#0 <- block@0, b#1 <- block@3) in block@3: // for_footer_L70 debug: Replacing trivial Phi node: let b#1: bytes = φ(b#0 <- block@0, b#1 <- block@3) (b#1) with b#0 debug: Deleting Phi assignment: let b#1: bytes = φ(b#0 <- block@0, b#1 <- block@3) debug: Replaced trivial Phi node: let b#1: bytes = φ(b#0 <- block@0, b#1 <- block@3) (b#1) with b#0 in current definition for 3 blocks -debug: Terminated block@4: // after_for_L59 -debug: Sealing block@0: // L88 -debug: Terminated block@0: // L88 +debug: Terminated block@4: // after_for_L70 +debug: Sealing block@0: // L99 +debug: Terminated block@0: // L99 +debug: Sealing block@0: // L108 +debug: Terminated block@0: // L108 debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L8 @@ -138,8 +141,8 @@ debug: Created Phi assignment: let tup.1#2: uint64 = undefined while trying to r debug: Added tup.1#0 to Phi node: let tup.1#2: uint64 = φ(tup.1#0 <- block@3) in block@3: // if_body_L22 debug: Added tup.1#1 to Phi node: let tup.1#2: uint64 = φ(tup.1#0 <- block@3, tup.1#1 <- block@4) in block@4: // else_body_L22 debug: Terminated block@5: // after_if_else_L22 -debug: Sealing block@0: // L43 -debug: Terminated block@0: // L43 +debug: Sealing block@0: // L55 +debug: Terminated block@0: // L55 debug: Output IR to /examples/out/tuple_support_TupleSupport.ssa.ir info: Optimizing examples.tuple_support.TupleSupport at level 1 debug: Begin optimization pass 1/100 @@ -156,6 +159,7 @@ debug: Found equivalence set: tuple_assignment%17#0, mid#0 debug: Replacing {tuple_assignment%17#0} with mid#0 made 1 modifications debug: Found equivalence set: tuple_assignment%18#0, lo#0 debug: Replacing {tuple_assignment%18#0} with lo#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable a#0 debug: Removing unused variable b#0 @@ -185,18 +189,19 @@ debug: Found equivalence set: values.1#0, value#1 debug: Replacing {value#1} with values.1#0 made 1 modifications debug: Found equivalence set: values.2#0, value#2 debug: Replacing {value#2} with values.2#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump -debug: Replaced predecessor block@1: // for_header_0_L67 with block@0: // L65 in block@4: // for_body_L67 -debug: Merged linear block@1: // for_header_0_L67 into block@0: // L65 -debug: Replaced predecessor block@5: // for_footer_L67 with block@4: // for_body_L67 in block@2: // for_header_1_L67 -debug: Replaced predecessor block@5: // for_footer_L67 with block@4: // for_body_L67 in block@3: // for_header_2_L67 -debug: Replaced predecessor block@5: // for_footer_L67 with block@4: // for_body_L67 in block@6: // after_for_L67 -debug: Merged linear block@5: // for_footer_L67 into block@4: // for_body_L67 +debug: Replaced predecessor block@1: // for_header_0_L78 with block@0: // L76 in block@4: // for_body_L78 +debug: Merged linear block@1: // for_header_0_L78 into block@0: // L76 +debug: Replaced predecessor block@5: // for_footer_L78 with block@4: // for_body_L78 in block@2: // for_header_1_L78 +debug: Replaced predecessor block@5: // for_footer_L78 with block@4: // for_body_L78 in block@3: // for_header_2_L78 +debug: Replaced predecessor block@5: // for_footer_L78 with block@4: // for_body_L78 in block@6: // after_for_L78 +debug: Merged linear block@5: // for_footer_L78 into block@4: // for_body_L78 debug: Optimizer: Remove Empty Blocks -info: Not removing empty block block@2: // for_header_1_L67 because it's used by phi nodes -info: Not removing empty block block@3: // for_header_2_L67 because it's used by phi nodes +info: Not removing empty block block@2: // for_header_1_L78 because it's used by phi nodes +info: Not removing empty block block@3: // for_header_2_L78 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.tuple_support.bytes_combine debug: Splitting parallel copies prior to optimization @@ -207,6 +212,7 @@ debug: Found equivalence set: arg.0#0, a#0 debug: Replacing {a#0} with arg.0#0 made 1 modifications debug: Found equivalence set: arg.1#0, b#0 debug: Replacing {b#0} with arg.1#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -241,6 +247,7 @@ debug: Found equivalence set: tuple_assignment%6#0, did_overflow#0 debug: Replacing {tuple_assignment%6#0} with did_overflow#0 made 1 modifications debug: Found equivalence set: tuple_assignment%7#0, c_hi#0 debug: Replacing {tuple_assignment%7#0} with c_hi#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -257,11 +264,12 @@ debug: Found equivalence set: arg.1#0, count#0 debug: Replacing {count#0} with arg.1#0 made 1 modifications debug: Found equivalence set: range_item%0#1, _i#0 debug: Replacing {range_item%0#1} with _i#0 made 3 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump -debug: Replaced predecessor block@3: // for_footer_L59 with block@2: // for_body_L59 in block@1: // for_header_L59 -debug: Merged linear block@3: // for_footer_L59 into block@2: // for_body_L59 +debug: Replaced predecessor block@3: // for_footer_L70 with block@2: // for_body_L70 in block@1: // for_header_L70 +debug: Merged linear block@3: // for_footer_L70 into block@2: // for_body_L70 debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.tuple_support.test_tuple_swap @@ -273,16 +281,37 @@ debug: Found equivalence set: b#0, a#1 debug: Replacing {a#1} with b#0 made 1 modifications debug: Found equivalence set: a#0, b#1 debug: Replacing {b#1} with a#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.tuple_support.slicing +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded None == None to 1 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: values.0#0, one_to_three.0#0 +debug: Replacing {one_to_three.0#0} with values.0#0 made 1 modifications +debug: Found equivalence set: values.1#0, one_to_three.1#0 +debug: Replacing {one_to_three.1#0} with values.1#0 made 1 modifications +debug: Found equivalence set: values.2#0, one_to_three.2#0 +debug: Replacing {one_to_three.2#0} with values.2#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%4#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.tuple_support.TupleSupport.__init__ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -293,6 +322,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -308,6 +338,7 @@ debug: Folded 2 == 2 to 1 debug: Folded 1 + 2 to 3 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%6#0 debug: Removing unused variable tmp%7#0 @@ -322,26 +353,29 @@ debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Removing unreachable blocks: block@3: // if_body_L22 debug: Removed unreachable predecessors from block@5: // after_if_else_L22 -debug: Found tup.0#0, tup.1#0 to remove from Phi nodes +debug: Removing unreachable phi arguments: tup.0#0 <- block@3 debug: Replacing trivial Phi node: let tup.0#2: uint64 = φ(tup.0#1 <- block@2) (tup.0#2) with tup.0#1 debug: Deleting Phi assignment: let tup.0#2: uint64 = φ(tup.0#1 <- block@2) +debug: Removing unreachable phi arguments: tup.1#0 <- block@3 debug: Replacing trivial Phi node: let tup.1#2: uint64 = φ(tup.1#1 <- block@2) (tup.1#2) with tup.1#1 debug: Deleting Phi assignment: let tup.1#2: uint64 = φ(tup.1#1 <- block@2) debug: Optimizing subroutine examples.tuple_support.add_three_values debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -info: Not removing empty block block@2: // for_header_1_L67 because it's used by phi nodes -info: Not removing empty block block@3: // for_header_2_L67 because it's used by phi nodes +info: Not removing empty block block@2: // for_header_1_L78 because it's used by phi nodes +info: Not removing empty block block@3: // for_header_2_L78 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.tuple_support.bytes_combine debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -351,6 +385,7 @@ debug: Optimizing subroutine examples.tuple_support.addw2 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -360,6 +395,7 @@ debug: Optimizing subroutine examples.tuple_support.bytes_multiply debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -369,6 +405,17 @@ debug: Optimizing subroutine examples.tuple_support.test_tuple_swap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.tuple_support.slicing +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -378,6 +425,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.__init__ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -387,6 +435,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -398,6 +447,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.approval_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tup.0#1 debug: Removing unused variable tup.1#1 @@ -410,17 +460,19 @@ debug: Optimizing subroutine examples.tuple_support.add_three_values debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -info: Not removing empty block block@2: // for_header_1_L67 because it's used by phi nodes -info: Not removing empty block block@3: // for_header_2_L67 because it's used by phi nodes +info: Not removing empty block block@2: // for_header_1_L78 because it's used by phi nodes +info: Not removing empty block block@3: // for_header_2_L78 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.tuple_support.bytes_combine debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -430,6 +482,7 @@ debug: Optimizing subroutine examples.tuple_support.addw2 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -439,6 +492,7 @@ debug: Optimizing subroutine examples.tuple_support.bytes_multiply debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -448,6 +502,17 @@ debug: Optimizing subroutine examples.tuple_support.test_tuple_swap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.tuple_support.slicing +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -457,6 +522,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.__init__ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -466,6 +532,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -479,6 +546,7 @@ debug: Folded 3 == 3 to 1 debug: Folded 3 == 3 to 1 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%9#0 debug: Removing unused variable tmp%10#0 @@ -490,17 +558,19 @@ debug: Optimizing subroutine examples.tuple_support.add_three_values debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -info: Not removing empty block block@2: // for_header_1_L67 because it's used by phi nodes -info: Not removing empty block block@3: // for_header_2_L67 because it's used by phi nodes +info: Not removing empty block block@2: // for_header_1_L78 because it's used by phi nodes +info: Not removing empty block block@3: // for_header_2_L78 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.tuple_support.bytes_combine debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -510,6 +580,7 @@ debug: Optimizing subroutine examples.tuple_support.addw2 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -519,6 +590,7 @@ debug: Optimizing subroutine examples.tuple_support.bytes_multiply debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -528,6 +600,17 @@ debug: Optimizing subroutine examples.tuple_support.test_tuple_swap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.tuple_support.slicing +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -537,6 +620,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.__init__ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -546,6 +630,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -557,6 +642,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.approval_progra debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -566,17 +652,19 @@ debug: Optimizing subroutine examples.tuple_support.add_three_values debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -info: Not removing empty block block@2: // for_header_1_L67 because it's used by phi nodes -info: Not removing empty block block@3: // for_header_2_L67 because it's used by phi nodes +info: Not removing empty block block@2: // for_header_1_L78 because it's used by phi nodes +info: Not removing empty block block@3: // for_header_2_L78 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.tuple_support.bytes_combine debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -586,6 +674,7 @@ debug: Optimizing subroutine examples.tuple_support.addw2 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -595,6 +684,7 @@ debug: Optimizing subroutine examples.tuple_support.bytes_multiply debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -604,6 +694,17 @@ debug: Optimizing subroutine examples.tuple_support.test_tuple_swap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.tuple_support.slicing +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -613,6 +714,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.__init__ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -622,6 +724,7 @@ debug: Optimizing subroutine examples.tuple_support.TupleSupport.clear_state_pro debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -635,6 +738,7 @@ debug: Removing Phis from examples.tuple_support.bytes_combine debug: Removing Phis from examples.tuple_support.addw2 debug: Removing Phis from examples.tuple_support.bytes_multiply debug: Removing Phis from examples.tuple_support.test_tuple_swap +debug: Removing Phis from examples.tuple_support.slicing debug: Removing Phis from examples.tuple_support.TupleSupport.__init__ debug: Removing Phis from examples.tuple_support.TupleSupport.clear_state_program debug: Output IR to /examples/out/tuple_support_TupleSupport.post_ssa.ir @@ -726,6 +830,7 @@ debug: * avail result#2 debug: * to_do _i#1 debug: * to_do result#5 debug: Sequentializing parallel copies in examples.tuple_support.test_tuple_swap +debug: Sequentializing parallel copies in examples.tuple_support.slicing debug: Sequentializing parallel copies in examples.tuple_support.TupleSupport.__init__ debug: Sequentializing parallel copies in examples.tuple_support.TupleSupport.clear_state_program debug: Output IR to /examples/out/tuple_support_TupleSupport.parallel_copies.ir @@ -748,101 +853,111 @@ debug: Coalescing _i#0 with [_i#1] debug: Coalescing resulted in 13 replacement/s debug: Coalescing local variables in examples.tuple_support.test_tuple_swap using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.tuple_support.slicing using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in examples.tuple_support.TupleSupport.__init__ using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in examples.tuple_support.TupleSupport.clear_state_program using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/out/tuple_support_TupleSupport.final.ir debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[3]: 'load app_id%0#0 from scratch' with 'load app_id%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[4]: 'store total#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[6]: 'load total#0 from scratch' with 'load total#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[6]: 'load total#0' with 'load total#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[22]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[24]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[24]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[30]: 'store result.0#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[32]: 'load result.0#0 from scratch' with 'load result.0#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[32]: 'load result.0#0' with 'load result.0#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[34]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[36]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[49]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[51]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[70]: 'store hi#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[72]: 'load hi#0 from scratch' with 'load hi#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[74]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[76]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[80]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[82]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[86]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[88]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[93]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[95]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[36]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[41]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[43]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[62]: 'store hi#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[64]: 'load hi#0' with 'load hi#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[66]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[68]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[72]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[74]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[78]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[80]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[85]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[87]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[15]: 'store tuple_assignment%3#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[19]: 'load tuple_assignment%3#0 from scratch' with 'load tuple_assignment%3#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[63]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[67]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[19]: 'load tuple_assignment%3#0' with 'load tuple_assignment%3#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[55]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[59]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted main_entrypoint@2.ops[17]: 'store did_overflow#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[22]: 'load did_overflow#0 from scratch' with 'load did_overflow#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[63]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[70]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[59]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[68]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[74]: 'store mid#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[84]: 'load mid#0 from scratch' with 'load mid#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[58]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[70]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' -debug: Inserted main_entrypoint@2.ops[74]: 'store lo#0 to l-stack (copy)' -debug: Replaced main_entrypoint@2.ops[92]: 'load lo#0 from scratch' with 'load lo#0 from l-stack (no copy)' +debug: Replaced main_entrypoint@2.ops[22]: 'load did_overflow#0' with 'load did_overflow#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[55]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[62]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[51]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[60]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[66]: 'store mid#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[76]: 'load mid#0' with 'load mid#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[50]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[62]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[66]: 'store lo#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[84]: 'load lo#0' with 'load lo#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.tuple_support.TupleSupport.approval_program debug: Inserted add_three_values_for_body@4.ops[5]: 'store tuple_index%0#0 to l-stack (copy)' -debug: Replaced add_three_values_for_body@4.ops[9]: 'load tuple_index%0#0 from scratch' with 'load tuple_index%0#0 from l-stack (no copy)' +debug: Replaced add_three_values_for_body@4.ops[9]: 'load tuple_index%0#0' with 'load tuple_index%0#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.tuple_support.add_three_values -debug: Eliminated scratch slots for 1 variable/s: value#3 -info: shared x-stack for add_three_values_block@0 -> add_three_values_for_body@4: value#3 -info: shared x-stack for add_three_values_for_header_1@2 -> add_three_values_for_body@4: value#3 -info: shared x-stack for add_three_values_for_header_2@3 -> add_three_values_for_body@4: value#3 +debug: Allocated 1 variable/s to x-stack: value#3 +debug: shared x-stack for add_three_values_block@0 -> add_three_values_for_body@4: value#3 +debug: shared x-stack for add_three_values_for_header_1@2 -> add_three_values_for_body@4: value#3 +debug: shared x-stack for add_three_values_for_header_2@3 -> add_three_values_for_body@4: value#3 debug: examples.tuple_support.add_three_values f-stack entry: ['tuple_index%0#4'] debug: examples.tuple_support.add_three_values f-stack on first store: ['total#0', 'tuple_index%0#0'] debug: Inserted bytes_combine_block@0.ops[3]: 'store result#0 to l-stack (copy)' -debug: Replaced bytes_combine_block@0.ops[5]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced bytes_combine_block@0.ops[5]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[19]: 'store did_overflow#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[21]: 'load did_overflow#0 from scratch' with 'load did_overflow#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[21]: 'load did_overflow#0' with 'load did_overflow#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[23]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[25]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[25]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[8]: 'store c_mid#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[11]: 'load c_mid#0 from scratch' with 'load c_mid#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[11]: 'load c_mid#0' with 'load c_mid#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[15]: 'store hi_carry2#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[18]: 'load hi_carry2#0 from scratch' with 'load hi_carry2#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[18]: 'load hi_carry2#0' with 'load hi_carry2#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[10]: 'store hi_carry1#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[18]: 'load hi_carry1#0 from scratch' with 'load hi_carry1#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[18]: 'load hi_carry1#0' with 'load hi_carry1#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[4]: 'store lo_carry#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[14]: 'load lo_carry#0 from scratch' with 'load lo_carry#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[14]: 'load lo_carry#0' with 'load lo_carry#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[22]: 'store c_hi#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[32]: 'load c_hi#0 from scratch' with 'load c_hi#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[32]: 'load c_hi#0' with 'load c_hi#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[16]: 'store c_mid#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[34]: 'load c_mid#0 from scratch' with 'load c_mid#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[34]: 'load c_mid#0' with 'load c_mid#0 from l-stack (no copy)' debug: Inserted addw2_block@0.ops[3]: 'store c_lo#0 to l-stack (copy)' -debug: Replaced addw2_block@0.ops[36]: 'load c_lo#0 from scratch' with 'load c_lo#0 from l-stack (no copy)' +debug: Replaced addw2_block@0.ops[36]: 'load c_lo#0' with 'load c_lo#0 from l-stack (no copy)' debug: Inserted bytes_multiply_block@0.ops[3]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced bytes_multiply_block@0.ops[5]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced bytes_multiply_block@0.ops[5]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted bytes_multiply_for_header@1.ops[3]: 'store continue_looping%1#0 to l-stack (copy)' -debug: Replaced bytes_multiply_for_header@1.ops[5]: 'load continue_looping%1#0 from scratch' with 'load continue_looping%1#0 from l-stack (no copy)' +debug: Replaced bytes_multiply_for_header@1.ops[5]: 'load continue_looping%1#0' with 'load continue_looping%1#0 from l-stack (no copy)' debug: Inserted bytes_multiply_for_body@2.ops[7]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced bytes_multiply_for_body@2.ops[9]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced bytes_multiply_for_body@2.ops[9]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.tuple_support.bytes_multiply debug: examples.tuple_support.bytes_multiply f-stack entry: [] debug: examples.tuple_support.bytes_multiply f-stack on first store: ['result#0', '_i#0'] debug: Simplified frame_dig 0; frame_bury 0; retsub to retsub debug: Inserted test_tuple_swap_block@0.ops[7]: 'store b#0 to l-stack (copy)' -debug: Replaced test_tuple_swap_block@0.ops[9]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced test_tuple_swap_block@0.ops[9]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted test_tuple_swap_block@0.ops[12]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_tuple_swap_block@0.ops[14]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_tuple_swap_block@0.ops[14]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted test_tuple_swap_block@0.ops[19]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced test_tuple_swap_block@0.ops[21]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced test_tuple_swap_block@0.ops[21]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted test_tuple_swap_block@0.ops[3]: 'store a#0 to l-stack (copy)' -debug: Replaced test_tuple_swap_block@0.ops[17]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' -info: Writing /examples/out/tuple_support.approval.teal -info: Writing /examples/out/tuple_support.approval.debug.teal -info: Writing /examples/out/tuple_support.clear.teal -info: Writing /examples/out/tuple_support.clear.debug.teal +debug: Replaced test_tuple_swap_block@0.ops[17]: 'load a#0' with 'load a#0 from l-stack (no copy)' +debug: Inserted slicing_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced slicing_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted slicing_block@0.ops[17]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced slicing_block@0.ops[19]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted slicing_block@0.ops[13]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced slicing_block@0.ops[16]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted slicing_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced slicing_block@0.ops[16]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +info: Writing out/tuple_support.approval.teal +info: Writing out/tuple_support.approval.debug.teal +info: Writing out/tuple_support.clear.teal +info: Writing out/tuple_support.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/tuple_support.py b/examples/tuple_support.py index 70c195cc8d..a9b055015f 100644 --- a/examples/tuple_support.py +++ b/examples/tuple_support.py @@ -38,6 +38,18 @@ def approval_program(self) -> UInt64: log(itob(lo)) log(bytes_multiply((Bytes(b"na"), UInt64(5)))) test_tuple_swap(zero=UInt64(0)) + slicing( + ( + UInt64(1), + UInt64(2), + UInt64(3), + UInt64(4), + UInt64(5), + UInt64(6), + UInt64(7), + UInt64(8), + ) + ) return a + b def clear_state_program(self) -> UInt64: @@ -53,11 +65,10 @@ def bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: @subroutine def bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: - # TODO: this codgen breaks for some reason, outputs uninitialised variable code b, count = arg result = Bytes(b"") # TODO: allow no-args -> empty for _i in urange(count): # TODO: allow _ - result = result + b # TODO: replace with and support augmented assignment + result += b return result @@ -91,3 +102,11 @@ def test_tuple_swap(zero: UInt64) -> None: (a, b) = (b, a) assert a == 2, "a should be two" assert b == 1, "b should be one" + + +@subroutine +def slicing(values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64]) -> None: + one_to_three = values[0:3] + assert add_three_values(one_to_three) == values[0] + values[1] + values[2] + + assert one_to_three[-2:-1][0] == one_to_three[1] diff --git a/examples/typing_interactions.algopy.log b/examples/typing_interactions.algopy.log index 763a7d3ec9..13180f5ce9 100644 --- a/examples/typing_interactions.algopy.log +++ b/examples/typing_interactions.algopy.log @@ -1,13 +1,14 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 typing_interactions.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug typing_interactions.py typing_interactions.py:11 info: Revealed type is "algopy._primitives.UInt64" typing_interactions.py:12 info: Revealed type is "tuple[algopy._primitives.UInt64, algopy._primitives.Bytes]" -info: Building AWST for __init__.py -info: Building AWST for typing_interactions.py +debug: Building AWST for __init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for typing_interactions.py typing_interactions.py:11 info: algopy type is "uint64" typing_interactions.py:12 info: algopy type is "tuple" typing_interactions.py:13 warning: use of typing.assert_type has no effect on compilation typing_interactions.py:13 warning: expression result is ignored typing_interactions.py:15 warning: use of typing.cast, output may be invalid or insecure TEAL -warning: No contracts found in explicitly named source file: /examples/typing_interactions.py -error: No contracts discovered in any source files ->> exit code = 0 \ No newline at end of file +typing_interactions.py:15 error: Unsupported comparison == between types +error: Build failed +>> exit code = 1 \ No newline at end of file diff --git a/examples/typing_interactions.py b/examples/typing_interactions.py index 7d7cefd9c3..7ca130fc43 100644 --- a/examples/typing_interactions.py +++ b/examples/typing_interactions.py @@ -1,6 +1,6 @@ import typing -from algopy import Address, Bytes, UInt64, subroutine +from algopy import Account, Bytes, UInt64, subroutine SOME_ADDRESS = "VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA" SOME_ADDRESS_PADDED = SOME_ADDRESS + "==" @@ -12,4 +12,4 @@ def typing_interactions() -> None: typing.reveal_type((UInt64(1), Bytes(b""))) typing.assert_type(UInt64(1), UInt64) # Note this is technically invalid, we're just here to get our warning and leave - assert typing.cast(Bytes, Address(SOME_ADDRESS)) == Bytes.from_base64(SOME_ADDRESS_PADDED) + assert typing.cast(Bytes, Account(SOME_ADDRESS)) == Bytes.from_base64(SOME_ADDRESS_PADDED) diff --git a/examples/unary/algopy.log b/examples/unary/algopy.log index be0850dc8d..379c8c8154 100644 --- a/examples/unary/algopy.log +++ b/examples/unary/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 unary -info: Building AWST for __init__.py -info: Building AWST for unary -info: Building AWST for unary/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug unary +debug: Building AWST for __init__.py +debug: Building AWST for unary +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for unary/contract.py debug: Sealing block@0: // L26 debug: Terminated block@0: // L26 debug: Sealing block@1: // for_header_0_L31 @@ -62,6 +63,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -73,6 +75,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded !0 to 1u debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%0#0 debug: Optimizer: Simplify Conditional Branches @@ -89,9 +92,12 @@ debug: Optimizer: Remove Unreachable Blocks debug: Optimizing subroutine examples.unary.contract.biguint_unary debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification +debug: Folded 0 b== 0 to 1 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%0#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -100,10 +106,15 @@ debug: Optimizing subroutine examples.unary.contract.bytes_unary debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Folded len("") to 0 +debug: Folded ~b'/xff' to b'/x00' +debug: Folded ~b'/x00/x00' to b'/xff/xff' debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%0#0 +debug: Removing unused variable tmp%2#0 +debug: Removing unused variable tmp%4#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -113,6 +124,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -124,6 +136,7 @@ debug: Optimizing subroutine examples.unary.contract.UnaryContract.approval_prog debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -133,6 +146,7 @@ debug: Optimizing subroutine examples.unary.contract.uint_unary debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -142,6 +156,7 @@ debug: Optimizing subroutine examples.unary.contract.biguint_unary debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -152,8 +167,11 @@ debug: Optimizer: Arithmetic Simplification debug: Folded !0 to 1u debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable tmp%1#0 +debug: Removing unused variable tmp%3#0 +debug: Removing unused variable tmp%5#0 debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -162,6 +180,7 @@ debug: Optimizing subroutine examples.unary.contract.UnaryContract.clear_state_p debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -173,6 +192,7 @@ debug: Optimizing subroutine examples.unary.contract.UnaryContract.approval_prog debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -182,6 +202,7 @@ debug: Optimizing subroutine examples.unary.contract.uint_unary debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -191,6 +212,7 @@ debug: Optimizing subroutine examples.unary.contract.biguint_unary debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -200,6 +222,7 @@ debug: Optimizing subroutine examples.unary.contract.bytes_unary debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -209,6 +232,7 @@ debug: Optimizing subroutine examples.unary.contract.UnaryContract.clear_state_p debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -292,35 +316,25 @@ debug: Coalescing local variables in examples.unary.contract.UnaryContract.clear debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/unary/out/contract_UnaryContract.final.ir debug: Inserted uint_unary_for_body@5.ops[3]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced uint_unary_for_body@5.ops[5]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced uint_unary_for_body@5.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted uint_unary_for_body@5.ops[7]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced uint_unary_for_body@5.ops[9]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced uint_unary_for_body@5.ops[9]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted uint_unary_for_body@5.ops[12]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced uint_unary_for_body@5.ops[14]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced uint_unary_for_body@5.ops[14]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted uint_unary_for_body@5.ops[17]: 'store tuple_index%1#0 to l-stack (copy)' -debug: Replaced uint_unary_for_body@5.ops[21]: 'load tuple_index%1#0 from scratch' with 'load tuple_index%1#0 from l-stack (no copy)' +debug: Replaced uint_unary_for_body@5.ops[21]: 'load tuple_index%1#0' with 'load tuple_index%1#0 from l-stack (no copy)' debug: Inserted uint_unary_for_body@5.ops[2]: 'store i#0 to l-stack (copy)' -debug: Replaced uint_unary_for_body@5.ops[11]: 'load i#0 from scratch' with 'load i#0 from l-stack (no copy)' +debug: Replaced uint_unary_for_body@5.ops[11]: 'load i#0' with 'load i#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.unary.contract.uint_unary -debug: Eliminated scratch slots for 1 variable/s: tuple_index%1#0 -info: shared x-stack for uint_unary_block@0 -> uint_unary_for_body@5: tuple_index%1#0 -info: shared x-stack for uint_unary_for_header_1@2 -> uint_unary_for_body@5: tuple_index%1#0 -info: shared x-stack for uint_unary_for_header_2@3 -> uint_unary_for_body@5: tuple_index%1#0 -info: shared x-stack for uint_unary_for_header_3@4 -> uint_unary_for_body@5: tuple_index%1#0 +debug: Allocated 1 variable/s to x-stack: tuple_index%1#0 +debug: shared x-stack for uint_unary_block@0 -> uint_unary_for_body@5: tuple_index%1#0 +debug: shared x-stack for uint_unary_for_header_1@2 -> uint_unary_for_body@5: tuple_index%1#0 +debug: shared x-stack for uint_unary_for_header_2@3 -> uint_unary_for_body@5: tuple_index%1#0 +debug: shared x-stack for uint_unary_for_header_3@4 -> uint_unary_for_body@5: tuple_index%1#0 debug: examples.unary.contract.uint_unary f-stack entry: ['tuple_index%1#5'] debug: examples.unary.contract.uint_unary f-stack on first store: ['i#0'] -debug: Inserted biguint_unary_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced biguint_unary_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' -debug: Inserted bytes_unary_block@0.ops[4]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced bytes_unary_block@0.ops[6]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' -debug: Inserted bytes_unary_block@0.ops[9]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced bytes_unary_block@0.ops[11]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' -debug: Inserted bytes_unary_block@0.ops[15]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced bytes_unary_block@0.ops[17]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' -debug: Inserted bytes_unary_block@0.ops[20]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced bytes_unary_block@0.ops[22]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' -info: Writing /examples/unary/out/contract.approval.teal -info: Writing /examples/unary/out/contract.approval.debug.teal -info: Writing /examples/unary/out/contract.clear.teal -info: Writing /examples/unary/out/contract.clear.debug.teal +info: Writing unary/out/contract.approval.teal +info: Writing unary/out/contract.approval.debug.teal +info: Writing unary/out/contract.clear.teal +info: Writing unary/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/unary/out/contract.approval.debug.teal b/examples/unary/out/contract.approval.debug.teal index 4956e2b07a..0494d9c7dd 100644 --- a/examples/unary/out/contract.approval.debug.teal +++ b/examples/unary/out/contract.approval.debug.teal @@ -1,95 +1,77 @@ -// Op // Op Description Stack (out) X stack Source code Source line +// Op // Op Description Stack (out) X stack Source code Source line #pragma version 8 // examples.unary.contract.UnaryContract.approval_program() -> uint64: main_block@0: - callsub uint_unary // uint_unary() File "unary/contract.py", line 15 - callsub biguint_unary // biguint_unary() File "unary/contract.py", line 16 - callsub bytes_unary // bytes_unary() File "unary/contract.py", line 17 - int 1 // 1 True File "unary/contract.py", line 19 - return // return True File "unary/contract.py", line 19 + callsub uint_unary // uint_unary() File "unary/contract.py", line 15 + callsub biguint_unary // biguint_unary() File "unary/contract.py", line 16 + callsub bytes_unary // bytes_unary() File "unary/contract.py", line 17 + int 1 // 1 True File "unary/contract.py", line 19 + return // return True File "unary/contract.py", line 19 -// examples.unary.contract.uint_unary() -> : +// examples.unary.contract.uint_unary() -> void: uint_unary: - proto 0 0 // def uint_unary() -> None: File "unary/contract.py", line 26 + proto 0 0 // def uint_unary() -> None: File "unary/contract.py", line 26 byte "" // allocate 1 to stack (𝕗) tuple_index%1#5 | uint_unary_block@0: - int 1 // (𝕗) tuple_index%1#5 | 1 not UInt64(0) File "unary/contract.py", line 28 - assert // (𝕗) tuple_index%1#5 | assert not UInt64(0), "not uint" File "unary/contract.py", line 28 int 0 // (𝕗) tuple_index%1#5 | 0 - int 1 // (𝕗) tuple_index%1#5 | (𝕏) tuple_index%1#0 | 1 1 File "unary/contract.py", line 31 - cover 1 // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i File "unary/contract.py", line 31 + int 1 // (𝕗) tuple_index%1#5 | (𝕏) tuple_index%1#0 | 1 1 File "unary/contract.py", line 31 + swap // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i File "unary/contract.py", line 31 b uint_unary_for_body@5 // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | tuple_index%1#0 uint_unary_for_header_1@2: - int 2 // (𝕗) tuple_index%1#5,i#0 | 2 2 File "unary/contract.py", line 31 - frame_bury 1 // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | i File "unary/contract.py", line 31 + int 2 // (𝕗) tuple_index%1#5,i#0 | 2 2 File "unary/contract.py", line 31 + frame_bury 1 // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | i File "unary/contract.py", line 31 frame_dig 0 // load tuple_index%1#5 from f-stack (𝕗) tuple_index%1#5,i#0 | tuple_index%1#5 b uint_unary_for_body@5 // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | tuple_index%1#0 uint_unary_for_header_2@3: - int 150 // (𝕗) tuple_index%1#5,i#0 | 150 150 File "unary/contract.py", line 31 - frame_bury 1 // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | i File "unary/contract.py", line 31 + int 150 // (𝕗) tuple_index%1#5,i#0 | 150 150 File "unary/contract.py", line 31 + frame_bury 1 // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | i File "unary/contract.py", line 31 frame_dig 0 // load tuple_index%1#5 from f-stack (𝕗) tuple_index%1#5,i#0 | tuple_index%1#5 b uint_unary_for_body@5 // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | tuple_index%1#0 uint_unary_for_header_3@4: - int 18446744073709551615 // (𝕗) tuple_index%1#5,i#0 | 18446744073709551615 MAX_UINT64 File "unary/contract.py", line 31 - frame_bury 1 // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | i File "unary/contract.py", line 31 + int 18446744073709551615 // (𝕗) tuple_index%1#5,i#0 | 18446744073709551615 MAX_UINT64 File "unary/contract.py", line 31 + frame_bury 1 // store i#0 to f-stack (𝕗) tuple_index%1#5,i#0 | i File "unary/contract.py", line 31 frame_dig 0 // load tuple_index%1#5 from f-stack (𝕗) tuple_index%1#5,i#0 | tuple_index%1#5 // Implicit fall through to uint_unary_for_body@5 // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | tuple_index%1#0 uint_unary_for_body@5: - int 18446744073709551615 // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | 18446744073709551615 tuple_index%1#0 MAX_UINT64 File "unary/contract.py", line 32 - frame_dig 1 // load i#0 from f-stack (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | 18446744073709551615,i#0 i File "unary/contract.py", line 31 + int 18446744073709551615 // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | 18446744073709551615 tuple_index%1#0 MAX_UINT64 File "unary/contract.py", line 32 + frame_dig 1 // load i#0 from f-stack (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | 18446744073709551615,i#0 i File "unary/contract.py", line 31 dup - cover 2 // store i#0 to l-stack (copy) (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i#0,18446744073709551615,i#0 i File "unary/contract.py", line 31 - - // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i#0,{-} MAX_UINT64 - i File "unary/contract.py", line 32 - ~ // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i#0,{~} ~(MAX_UINT64 - i) File "unary/contract.py", line 32 - == // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | {==} ~(MAX_UINT64 - i) == i, "~ uint" File "unary/contract.py", line 32 - assert // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | assert ~(MAX_UINT64 - i) == i, "~ uint" File "unary/contract.py", line 32 + cover 2 // store i#0 to l-stack (copy) (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i#0,18446744073709551615,i#0 i File "unary/contract.py", line 31 + - // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i#0,{-} MAX_UINT64 - i File "unary/contract.py", line 32 + ~ // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | i#0,{~} ~(MAX_UINT64 - i) File "unary/contract.py", line 32 + == // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | {==} ~(MAX_UINT64 - i) == i, "~ uint" File "unary/contract.py", line 32 + assert // ~ uint // (𝕗) tuple_index%1#5,i#0 | (𝕏) tuple_index%1#0 | assert ~(MAX_UINT64 - i) == i, "~ uint" File "unary/contract.py", line 32 dup // store tuple_index%1#0 to l-stack (copy) (𝕗) tuple_index%1#5,i#0 | tuple_index%1#0,tuple_index%1#0 int 1 // (𝕗) tuple_index%1#5,i#0 | tuple_index%1#0,tuple_index%1#0,1 + // (𝕗) tuple_index%1#5,i#0 | tuple_index%1#0,{+} frame_bury 0 // store tuple_index%1#5 to f-stack (𝕗) tuple_index%1#5,i#0 | tuple_index%1#0 - switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 // (𝕗) tuple_index%1#5,i#0 | for i in (UInt64(1), UInt64(2), UInt64(150), UInt64(MAX_UINT64)): File "unary/contract.py", line 31 - // Implicit fall through to uint_unary_after_for@7 // (𝕗) tuple_index%1#5,i#0 | for i in (UInt64(1), UInt64(2), UInt64(150), UInt64(MAX_UINT64)): File "unary/contract.py", line 31 + switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 // (𝕗) tuple_index%1#5,i#0 | for i in (UInt64(1), UInt64(2), UInt64(150), UInt64(MAX_UINT64)): File "unary/contract.py", line 31 + // Implicit fall through to uint_unary_after_for@7 // (𝕗) tuple_index%1#5,i#0 | for i in (UInt64(1), UInt64(2), UInt64(150), UInt64(MAX_UINT64)): File "unary/contract.py", line 31 uint_unary_after_for@7: retsub // -// examples.unary.contract.biguint_unary() -> : +// examples.unary.contract.biguint_unary() -> void: biguint_unary: - proto 0 0 // def biguint_unary() -> None: File "unary/contract.py", line 36 + proto 0 0 // def biguint_unary() -> None: File "unary/contract.py", line 36 biguint_unary_block@0: - byte 0x // 0x 0 File "unary/contract.py", line 38 - byte 0x // 0x,0x not BigUInt(0) File "unary/contract.py", line 38 - b== // {b==} not BigUInt(0) File "unary/contract.py", line 38 - assert // assert not BigUInt(0), "not biguint" File "unary/contract.py", line 38 retsub // -// examples.unary.contract.bytes_unary() -> : +// examples.unary.contract.bytes_unary() -> void: bytes_unary: - proto 0 0 // def bytes_unary() -> None: File "unary/contract.py", line 42 + proto 0 0 // def bytes_unary() -> None: File "unary/contract.py", line 42 bytes_unary_block@0: - int 1 // 1 not Bytes(b"") File "unary/contract.py", line 44 - assert // assert not Bytes(b""), "not bytes" File "unary/contract.py", line 44 - byte 0xff // 0xff Bytes.from_hex("FF") File "unary/contract.py", line 47 - b~ // {b~} ~Bytes.from_hex("FF") File "unary/contract.py", line 47 - byte 0x00 // tmp%2#0,0x00 Bytes.from_hex("00") File "unary/contract.py", line 47 - == // {==} ~Bytes.from_hex("FF") == Bytes.from_hex("00"), "~ bytes" File "unary/contract.py", line 47 - assert // assert ~Bytes.from_hex("FF") == Bytes.from_hex("00"), "~ bytes" File "unary/contract.py", line 47 - byte 0x0000 // 0x0000 Bytes.from_hex("0000") File "unary/contract.py", line 48 - b~ // {b~} ~Bytes.from_hex("0000") File "unary/contract.py", line 48 - byte 0xffff // tmp%4#0,0xffff Bytes.from_hex("FFFF") File "unary/contract.py", line 48 - == // {==} ~Bytes.from_hex("0000") == Bytes.from_hex("FFFF"), "~ bytes" File "unary/contract.py", line 48 - assert // assert ~Bytes.from_hex("0000") == Bytes.from_hex("FFFF"), "~ bytes" File "unary/contract.py", line 48 retsub // diff --git a/examples/unary/out/contract.approval.teal b/examples/unary/out/contract.approval.teal index a1314f1c6f..3aa7e2de92 100644 --- a/examples/unary/out/contract.approval.teal +++ b/examples/unary/out/contract.approval.teal @@ -9,17 +9,15 @@ main_block@0: return -// examples.unary.contract.uint_unary() -> : +// examples.unary.contract.uint_unary() -> void: uint_unary: proto 0 0 byte "" uint_unary_block@0: - int 1 - assert int 0 int 1 - cover 1 + swap b uint_unary_for_body@5 uint_unary_for_header_1@2: @@ -47,7 +45,7 @@ uint_unary_for_body@5: - ~ == - assert + assert // ~ uint dup int 1 + @@ -58,34 +56,18 @@ uint_unary_after_for@7: retsub -// examples.unary.contract.biguint_unary() -> : +// examples.unary.contract.biguint_unary() -> void: biguint_unary: proto 0 0 biguint_unary_block@0: - byte 0x - byte 0x - b== - assert retsub -// examples.unary.contract.bytes_unary() -> : +// examples.unary.contract.bytes_unary() -> void: bytes_unary: proto 0 0 bytes_unary_block@0: - int 1 - assert - byte 0xff - b~ - byte 0x00 - == - assert - byte 0x0000 - b~ - byte 0xffff - == - assert retsub diff --git a/examples/unary/out/contract.approval_unoptimized.debug.teal b/examples/unary/out/contract.approval_unoptimized.debug.teal index 12ef3aa733..cee79a0b55 100644 --- a/examples/unary/out/contract.approval_unoptimized.debug.teal +++ b/examples/unary/out/contract.approval_unoptimized.debug.teal @@ -11,7 +11,7 @@ main_block@0: return // return True File "unary/contract.py", line 19 -// examples.unary.contract.uint_unary() -> : +// examples.unary.contract.uint_unary() -> void: uint_unary: proto 0 0 // def uint_unary() -> None: File "unary/contract.py", line 26 byte "" @@ -20,7 +20,7 @@ uint_unary: uint_unary_block@0: int 0 // (𝕗) tuple_index%1#0,tuple_index%1#5 | 0 0 File "unary/contract.py", line 28 ! // (𝕗) tuple_index%1#0,tuple_index%1#5 | {!} not UInt64(0) File "unary/contract.py", line 28 - assert // (𝕗) tuple_index%1#0,tuple_index%1#5 | assert not UInt64(0), "not uint" File "unary/contract.py", line 28 + assert // not uint // (𝕗) tuple_index%1#0,tuple_index%1#5 | assert not UInt64(0), "not uint" File "unary/contract.py", line 28 // Implicit fall through to uint_unary_for_header_0@1 // (𝕗) tuple_index%1#0,tuple_index%1#5 | uint_unary_for_header_0@1: @@ -49,13 +49,13 @@ uint_unary_for_header_3@4: uint_unary_for_body@5: int 18446744073709551615 // (𝕗) tuple_index%1#0,tuple_index%1#5 | (𝕏) i#0 | 18446744073709551615 i#0 MAX_UINT64 File "unary/contract.py", line 32 - uncover 1 // load i#0 from x-stack (𝕗) tuple_index%1#0,tuple_index%1#5 | 18446744073709551615,i#0 i File "unary/contract.py", line 31 + swap // load i#0 from x-stack (𝕗) tuple_index%1#0,tuple_index%1#5 | 18446744073709551615,i#0 i File "unary/contract.py", line 31 dup cover 2 // store i#0 to l-stack (copy) (𝕗) tuple_index%1#0,tuple_index%1#5 | i#0,18446744073709551615,i#0 i File "unary/contract.py", line 31 - // (𝕗) tuple_index%1#0,tuple_index%1#5 | i#0,{-} MAX_UINT64 - i File "unary/contract.py", line 32 ~ // (𝕗) tuple_index%1#0,tuple_index%1#5 | i#0,{~} ~(MAX_UINT64 - i) File "unary/contract.py", line 32 == // (𝕗) tuple_index%1#0,tuple_index%1#5 | {==} ~(MAX_UINT64 - i) == i, "~ uint" File "unary/contract.py", line 32 - assert // (𝕗) tuple_index%1#0,tuple_index%1#5 | assert ~(MAX_UINT64 - i) == i, "~ uint" File "unary/contract.py", line 32 + assert // ~ uint // (𝕗) tuple_index%1#0,tuple_index%1#5 | assert ~(MAX_UINT64 - i) == i, "~ uint" File "unary/contract.py", line 32 // Implicit fall through to uint_unary_for_footer@6 // (𝕗) tuple_index%1#0,tuple_index%1#5 | uint_unary_for_footer@6: @@ -71,7 +71,7 @@ uint_unary_after_for@7: retsub // -// examples.unary.contract.biguint_unary() -> : +// examples.unary.contract.biguint_unary() -> void: biguint_unary: proto 0 0 // def biguint_unary() -> None: File "unary/contract.py", line 36 @@ -79,11 +79,11 @@ biguint_unary_block@0: byte 0x // 0x 0 File "unary/contract.py", line 38 byte 0x // 0x,0x not BigUInt(0) File "unary/contract.py", line 38 b== // {b==} not BigUInt(0) File "unary/contract.py", line 38 - assert // assert not BigUInt(0), "not biguint" File "unary/contract.py", line 38 + assert // not biguint // assert not BigUInt(0), "not biguint" File "unary/contract.py", line 38 retsub // -// examples.unary.contract.bytes_unary() -> : +// examples.unary.contract.bytes_unary() -> void: bytes_unary: proto 0 0 // def bytes_unary() -> None: File "unary/contract.py", line 42 @@ -91,16 +91,16 @@ bytes_unary_block@0: byte "" // "" b"" File "unary/contract.py", line 44 len // {len} not Bytes(b"") File "unary/contract.py", line 44 ! // {!} not Bytes(b"") File "unary/contract.py", line 44 - assert // assert not Bytes(b""), "not bytes" File "unary/contract.py", line 44 + assert // not bytes // assert not Bytes(b""), "not bytes" File "unary/contract.py", line 44 byte 0xff // 0xff Bytes.from_hex("FF") File "unary/contract.py", line 47 b~ // {b~} ~Bytes.from_hex("FF") File "unary/contract.py", line 47 byte 0x00 // tmp%2#0,0x00 Bytes.from_hex("00") File "unary/contract.py", line 47 == // {==} ~Bytes.from_hex("FF") == Bytes.from_hex("00"), "~ bytes" File "unary/contract.py", line 47 - assert // assert ~Bytes.from_hex("FF") == Bytes.from_hex("00"), "~ bytes" File "unary/contract.py", line 47 + assert // ~ bytes // assert ~Bytes.from_hex("FF") == Bytes.from_hex("00"), "~ bytes" File "unary/contract.py", line 47 byte 0x0000 // 0x0000 Bytes.from_hex("0000") File "unary/contract.py", line 48 b~ // {b~} ~Bytes.from_hex("0000") File "unary/contract.py", line 48 byte 0xffff // tmp%4#0,0xffff Bytes.from_hex("FFFF") File "unary/contract.py", line 48 == // {==} ~Bytes.from_hex("0000") == Bytes.from_hex("FFFF"), "~ bytes" File "unary/contract.py", line 48 - assert // assert ~Bytes.from_hex("0000") == Bytes.from_hex("FFFF"), "~ bytes" File "unary/contract.py", line 48 + assert // ~ bytes // assert ~Bytes.from_hex("0000") == Bytes.from_hex("FFFF"), "~ bytes" File "unary/contract.py", line 48 retsub // diff --git a/examples/unary/out/contract.approval_unoptimized.teal b/examples/unary/out/contract.approval_unoptimized.teal index 2bf0ebb367..590e51d774 100644 --- a/examples/unary/out/contract.approval_unoptimized.teal +++ b/examples/unary/out/contract.approval_unoptimized.teal @@ -9,7 +9,7 @@ main_block@0: return -// examples.unary.contract.uint_unary() -> : +// examples.unary.contract.uint_unary() -> void: uint_unary: proto 0 0 byte "" @@ -18,7 +18,7 @@ uint_unary: uint_unary_block@0: int 0 ! - assert + assert // not uint uint_unary_for_header_0@1: int 0 @@ -45,13 +45,13 @@ uint_unary_for_header_3@4: uint_unary_for_body@5: int 18446744073709551615 - uncover 1 + swap dup cover 2 - ~ == - assert + assert // ~ uint uint_unary_for_footer@6: frame_dig 0 @@ -65,7 +65,7 @@ uint_unary_after_for@7: retsub -// examples.unary.contract.biguint_unary() -> : +// examples.unary.contract.biguint_unary() -> void: biguint_unary: proto 0 0 @@ -73,11 +73,11 @@ biguint_unary_block@0: byte 0x byte 0x b== - assert + assert // not biguint retsub -// examples.unary.contract.bytes_unary() -> : +// examples.unary.contract.bytes_unary() -> void: bytes_unary: proto 0 0 @@ -85,16 +85,16 @@ bytes_unary_block@0: byte "" len ! - assert + assert // not bytes byte 0xff b~ byte 0x00 == - assert + assert // ~ bytes byte 0x0000 b~ byte 0xffff == - assert + assert // ~ bytes retsub diff --git a/examples/unary/out/contract.awst b/examples/unary/out/contract.awst index 2c6978af86..cc89113c5a 100644 --- a/examples/unary/out/contract.awst +++ b/examples/unary/out/contract.awst @@ -33,6 +33,6 @@ subroutine biguint_unary(): None subroutine bytes_unary(): None { assert(!(reinterpret_cast(len(''))), comment="not bytes") - assert(b~(Bytes.from_base16("FF")) == Bytes.from_base16("00"), comment="~ bytes") - assert(b~(Bytes.from_base16("0000")) == Bytes.from_base16("FFFF"), comment="~ bytes") + assert(b~(hex<"FF">) == hex<"00">, comment="~ bytes") + assert(b~(hex<"0000">) == hex<"FFFF">, comment="~ bytes") } \ No newline at end of file diff --git a/examples/unary/out/contract_UnaryContract.cssa.ir b/examples/unary/out/contract_UnaryContract.cssa.ir index a58941a422..7c550237c1 100644 --- a/examples/unary/out/contract_UnaryContract.cssa.ir +++ b/examples/unary/out/contract_UnaryContract.cssa.ir @@ -9,7 +9,6 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.uint_unary() -> void: block@0: // L26 - (assert 1u) // not uint let tuple_index%1#0: uint64 = 0u let i#0: uint64 = 1u let (tuple_index%1#6: uint64, i#5: uint64) = (tuple_index%1#0, i#0) @@ -41,19 +40,10 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.biguint_unary() -> void: block@0: // L36 - let tmp%0#0: uint64 = (b== 0b 0b) - (assert tmp%0#0) // not biguint return subroutine examples.unary.contract.bytes_unary() -> void: block@0: // L42 - (assert 1u) // not bytes - let tmp%2#0: bytes = (b~ 0xff) - let tmp%3#0: uint64 = (== tmp%2#0 0x00) - (assert tmp%3#0) // ~ bytes - let tmp%4#0: bytes = (b~ 0x0000) - let tmp%5#0: uint64 = (== tmp%4#0 0xffff) - (assert tmp%5#0) // ~ bytes return program clear-state: diff --git a/examples/unary/out/contract_UnaryContract.final.ir b/examples/unary/out/contract_UnaryContract.final.ir index 0d421e391f..3b5eca637a 100644 --- a/examples/unary/out/contract_UnaryContract.final.ir +++ b/examples/unary/out/contract_UnaryContract.final.ir @@ -9,7 +9,6 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.uint_unary() -> void: block@0: // L26 - (assert 1u) // not uint let tuple_index%1#0: uint64 = 0u let i#0: uint64 = 1u goto block@5 @@ -37,19 +36,10 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.biguint_unary() -> void: block@0: // L36 - let tmp%0#0: uint64 = (b== 0b 0b) - (assert tmp%0#0) // not biguint return subroutine examples.unary.contract.bytes_unary() -> void: block@0: // L42 - (assert 1u) // not bytes - let tmp%2#0: bytes = (b~ 0xff) - let tmp%3#0: uint64 = (== tmp%2#0 0x00) - (assert tmp%3#0) // ~ bytes - let tmp%4#0: bytes = (b~ 0x0000) - let tmp%5#0: uint64 = (== tmp%4#0 0xffff) - (assert tmp%5#0) // ~ bytes return program clear-state: diff --git a/examples/unary/out/contract_UnaryContract.parallel_copies.ir b/examples/unary/out/contract_UnaryContract.parallel_copies.ir index 1e85a01baf..1bbbf3c7c5 100644 --- a/examples/unary/out/contract_UnaryContract.parallel_copies.ir +++ b/examples/unary/out/contract_UnaryContract.parallel_copies.ir @@ -9,7 +9,6 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.uint_unary() -> void: block@0: // L26 - (assert 1u) // not uint let tuple_index%1#0: uint64 = 0u let i#0: uint64 = 1u let i#9: uint64 = i#0 @@ -44,19 +43,10 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.biguint_unary() -> void: block@0: // L36 - let tmp%0#0: uint64 = (b== 0b 0b) - (assert tmp%0#0) // not biguint return subroutine examples.unary.contract.bytes_unary() -> void: block@0: // L42 - (assert 1u) // not bytes - let tmp%2#0: bytes = (b~ 0xff) - let tmp%3#0: uint64 = (== tmp%2#0 0x00) - (assert tmp%3#0) // ~ bytes - let tmp%4#0: bytes = (b~ 0x0000) - let tmp%5#0: uint64 = (== tmp%4#0 0xffff) - (assert tmp%5#0) // ~ bytes return program clear-state: diff --git a/examples/unary/out/contract_UnaryContract.post_ssa.ir b/examples/unary/out/contract_UnaryContract.post_ssa.ir index ad8897bfab..52514f958d 100644 --- a/examples/unary/out/contract_UnaryContract.post_ssa.ir +++ b/examples/unary/out/contract_UnaryContract.post_ssa.ir @@ -9,7 +9,6 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.uint_unary() -> void: block@0: // L26 - (assert 1u) // not uint let tuple_index%1#0: uint64 = 0u let i#0: uint64 = 1u let (tuple_index%1#10: uint64, i#9: uint64) = (tuple_index%1#0, i#0) @@ -39,19 +38,10 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.biguint_unary() -> void: block@0: // L36 - let tmp%0#0: uint64 = (b== 0b 0b) - (assert tmp%0#0) // not biguint return subroutine examples.unary.contract.bytes_unary() -> void: block@0: // L42 - (assert 1u) // not bytes - let tmp%2#0: bytes = (b~ 0xff) - let tmp%3#0: uint64 = (== tmp%2#0 0x00) - (assert tmp%3#0) // ~ bytes - let tmp%4#0: bytes = (b~ 0x0000) - let tmp%5#0: uint64 = (== tmp%4#0 0xffff) - (assert tmp%5#0) // ~ bytes return program clear-state: diff --git a/examples/unary/out/contract_UnaryContract.ssa.opt_pass_1.ir b/examples/unary/out/contract_UnaryContract.ssa.opt_pass_1.ir index cf9ba7af0e..f060c43d90 100644 --- a/examples/unary/out/contract_UnaryContract.ssa.opt_pass_1.ir +++ b/examples/unary/out/contract_UnaryContract.ssa.opt_pass_1.ir @@ -9,7 +9,6 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.uint_unary() -> void: block@0: // L26 - (assert 1u) // not uint let tuple_index%1#0: uint64 = 0u let i#0: uint64 = 1u goto block@5 @@ -36,19 +35,15 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.biguint_unary() -> void: block@0: // L36 - let tmp%0#0: uint64 = (b== 0b 0b) - (assert tmp%0#0) // not biguint return subroutine examples.unary.contract.bytes_unary() -> void: block@0: // L42 let tmp%1#0: uint64 = (! 0u) (assert tmp%1#0) // not bytes - let tmp%2#0: bytes = (b~ 0xff) - let tmp%3#0: uint64 = (== tmp%2#0 0x00) + let tmp%3#0: uint64 = (== 0x00 0x00) (assert tmp%3#0) // ~ bytes - let tmp%4#0: bytes = (b~ 0x0000) - let tmp%5#0: uint64 = (== tmp%4#0 0xffff) + let tmp%5#0: uint64 = (== 0xffff 0xffff) (assert tmp%5#0) // ~ bytes return diff --git a/examples/unary/out/contract_UnaryContract.ssa.opt_pass_2.ir b/examples/unary/out/contract_UnaryContract.ssa.opt_pass_2.ir index 272a09686e..b10f620368 100644 --- a/examples/unary/out/contract_UnaryContract.ssa.opt_pass_2.ir +++ b/examples/unary/out/contract_UnaryContract.ssa.opt_pass_2.ir @@ -9,7 +9,6 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.uint_unary() -> void: block@0: // L26 - (assert 1u) // not uint let tuple_index%1#0: uint64 = 0u let i#0: uint64 = 1u goto block@5 @@ -36,19 +35,10 @@ contract examples.unary.contract.UnaryContract: subroutine examples.unary.contract.biguint_unary() -> void: block@0: // L36 - let tmp%0#0: uint64 = (b== 0b 0b) - (assert tmp%0#0) // not biguint return subroutine examples.unary.contract.bytes_unary() -> void: block@0: // L42 - (assert 1u) // not bytes - let tmp%2#0: bytes = (b~ 0xff) - let tmp%3#0: uint64 = (== tmp%2#0 0x00) - (assert tmp%3#0) // ~ bytes - let tmp%4#0: bytes = (b~ 0x0000) - let tmp%5#0: uint64 = (== tmp%4#0 0xffff) - (assert tmp%5#0) // ~ bytes return program clear-state: diff --git a/examples/unary/out/execution_trace.O0.log b/examples/unary/out/execution_trace.O0.log index c5eca2e524..87815f431c 100644 --- a/examples/unary/out/execution_trace.O0.log +++ b/examples/unary/out/execution_trace.O0.log @@ -3,106 +3,106 @@ PC Teal 15 18 callsub uint_unary 29 proto 0 0 -32 byte "" -33 dup , -34 int 0 , , 0 -35 ! , , 1 -36 assert , -37 int 0 , , 0 -38 frame_bury 0 0, -40 int 1 0, , 1 -41 b uint_unary_for_body@5 0, , 1 -68 int 18446744073709551615 0, , 1, 18446744073709551615 -69 uncover 1 0, , 18446744073709551615, 1 -71 dup 0, , 18446744073709551615, 1, 1 -72 cover 2 0, , 1, 18446744073709551615, 1 -74 - 0, , 1, 18446744073709551614 -75 ~ 0, , 1, 1 -76 == 0, , 1 -77 assert 0, -78 frame_dig 0 0, , 0 -80 dup 0, , 0, 0 -81 int 1 0, , 0, 0, 1 -82 + 0, , 0, 1 -83 frame_bury 1 0, 1, 0 -85 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 0, 1 +32 byte "" 0x +33 dup 0x, 0x +34 int 0 0x, 0x, 0 +35 ! 0x, 0x, 1 +36 assert 0x, 0x +37 int 0 0x, 0x, 0 +38 frame_bury 0 0, 0x +40 int 1 0, 0x, 1 +41 b uint_unary_for_body@5 0, 0x, 1 +68 int 18446744073709551615 0, 0x, 1, 18446744073709551615 +69 swap 0, 0x, 18446744073709551615, 1 +70 dup 0, 0x, 18446744073709551615, 1, 1 +71 cover 2 0, 0x, 1, 18446744073709551615, 1 +73 - 0, 0x, 1, 18446744073709551614 +74 ~ 0, 0x, 1, 1 +75 == 0, 0x, 1 +76 assert 0, 0x +77 frame_dig 0 0, 0x, 0 +79 dup 0, 0x, 0, 0 +80 int 1 0, 0x, 0, 0, 1 +81 + 0, 0x, 0, 1 +82 frame_bury 1 0, 1, 0 +84 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 0, 1 44 int 2 0, 1, 2 46 frame_dig 1 0, 1, 2, 1 48 frame_bury 0 1, 1, 2 50 b uint_unary_for_body@5 1, 1, 2 68 int 18446744073709551615 1, 1, 2, 18446744073709551615 -69 uncover 1 1, 1, 18446744073709551615, 2 -71 dup 1, 1, 18446744073709551615, 2, 2 -72 cover 2 1, 1, 2, 18446744073709551615, 2 -74 - 1, 1, 2, 18446744073709551613 -75 ~ 1, 1, 2, 2 -76 == 1, 1, 1 -77 assert 1, 1 -78 frame_dig 0 1, 1, 1 -80 dup 1, 1, 1, 1 -81 int 1 1, 1, 1, 1, 1 -82 + 1, 1, 1, 2 -83 frame_bury 1 1, 2, 1 -85 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 1, 2 +69 swap 1, 1, 18446744073709551615, 2 +70 dup 1, 1, 18446744073709551615, 2, 2 +71 cover 2 1, 1, 2, 18446744073709551615, 2 +73 - 1, 1, 2, 18446744073709551613 +74 ~ 1, 1, 2, 2 +75 == 1, 1, 1 +76 assert 1, 1 +77 frame_dig 0 1, 1, 1 +79 dup 1, 1, 1, 1 +80 int 1 1, 1, 1, 1, 1 +81 + 1, 1, 1, 2 +82 frame_bury 1 1, 2, 1 +84 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 1, 2 53 int 150 1, 2, 150 56 frame_dig 1 1, 2, 150, 2 58 frame_bury 0 2, 2, 150 60 b uint_unary_for_body@5 2, 2, 150 68 int 18446744073709551615 2, 2, 150, 18446744073709551615 -69 uncover 1 2, 2, 18446744073709551615, 150 -71 dup 2, 2, 18446744073709551615, 150, 150 -72 cover 2 2, 2, 150, 18446744073709551615, 150 -74 - 2, 2, 150, 18446744073709551465 -75 ~ 2, 2, 150, 150 -76 == 2, 2, 1 -77 assert 2, 2 -78 frame_dig 0 2, 2, 2 -80 dup 2, 2, 2, 2 -81 int 1 2, 2, 2, 2, 1 -82 + 2, 2, 2, 3 -83 frame_bury 1 2, 3, 2 -85 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 2, 3 +69 swap 2, 2, 18446744073709551615, 150 +70 dup 2, 2, 18446744073709551615, 150, 150 +71 cover 2 2, 2, 150, 18446744073709551615, 150 +73 - 2, 2, 150, 18446744073709551465 +74 ~ 2, 2, 150, 150 +75 == 2, 2, 1 +76 assert 2, 2 +77 frame_dig 0 2, 2, 2 +79 dup 2, 2, 2, 2 +80 int 1 2, 2, 2, 2, 1 +81 + 2, 2, 2, 3 +82 frame_bury 1 2, 3, 2 +84 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 2, 3 63 int 18446744073709551615 2, 3, 18446744073709551615 64 frame_dig 1 2, 3, 18446744073709551615, 3 66 frame_bury 0 3, 3, 18446744073709551615 68 int 18446744073709551615 3, 3, 18446744073709551615, 18446744073709551615 -69 uncover 1 3, 3, 18446744073709551615, 18446744073709551615 -71 dup 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 -72 cover 2 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 -74 - 3, 3, 18446744073709551615, 0 -75 ~ 3, 3, 18446744073709551615, 18446744073709551615 -76 == 3, 3, 1 -77 assert 3, 3 -78 frame_dig 0 3, 3, 3 -80 dup 3, 3, 3, 3 -81 int 1 3, 3, 3, 3, 1 -82 + 3, 3, 3, 4 -83 frame_bury 1 3, 4, 3 -85 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 3, 4 -93 retsub +69 swap 3, 3, 18446744073709551615, 18446744073709551615 +70 dup 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 +71 cover 2 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 +73 - 3, 3, 18446744073709551615, 0 +74 ~ 3, 3, 18446744073709551615, 18446744073709551615 +75 == 3, 3, 1 +76 assert 3, 3 +77 frame_dig 0 3, 3, 3 +79 dup 3, 3, 3, 3 +80 int 1 3, 3, 3, 3, 1 +81 + 3, 3, 3, 4 +82 frame_bury 1 3, 4, 3 +84 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 3, 4 +92 retsub 21 callsub biguint_unary -94 proto 0 0 -97 byte 0x -98 byte 0x , -99 b== 1 -100 assert -101 retsub +93 proto 0 0 +96 byte 0x 0x +97 byte 0x 0x, 0x +98 b== 1 +99 assert +100 retsub 24 callsub bytes_unary -102 proto 0 0 -105 byte "" -106 len 0 -107 ! 1 -108 assert -109 byte 0xff /w== -112 b~ AA== -113 byte 0x00 AA==, AA== -116 == 1 -117 assert -118 byte 0x0000 AAA= -122 b~ //8= -123 byte 0xffff //8=, //8= -127 == 1 -128 assert -129 retsub +101 proto 0 0 +104 byte "" 0x +105 len 0 +106 ! 1 +107 assert +108 byte 0xff 0xFF +111 b~ 0x00 +112 byte 0x00 0x00, 0x00 +115 == 1 +116 assert +117 byte 0x0000 0x0000 +121 b~ 0xFFFF +122 byte 0xffff 0xFFFF, 0xFFFF +126 == 1 +127 assert +128 retsub 27 int 1 1 28 return 1 \ No newline at end of file diff --git a/examples/unary/out/execution_trace.O1.log b/examples/unary/out/execution_trace.O1.log index ccb3e6c47f..95e2502ec7 100644 --- a/examples/unary/out/execution_trace.O1.log +++ b/examples/unary/out/execution_trace.O1.log @@ -1,100 +1,81 @@ -PC Teal Stack +PC Teal Stack 1 -14 -17 callsub uint_unary -28 proto 0 0 -31 byte "" -32 int 1 , 1 -33 assert -34 int 0 , 0 -36 int 1 , 0, 1 -37 cover 1 , 1, 0 -39 b uint_unary_for_body@5 , 1, 0 -66 int 18446744073709551615 , 1, 0, 18446744073709551615 -67 frame_dig 1 , 1, 0, 18446744073709551615, 1 -69 dup , 1, 0, 18446744073709551615, 1, 1 -70 cover 2 , 1, 0, 1, 18446744073709551615, 1 -72 - , 1, 0, 1, 18446744073709551614 -73 ~ , 1, 0, 1, 1 -74 == , 1, 0, 1 -75 assert , 1, 0 -76 dup , 1, 0, 0 -77 int 1 , 1, 0, 0, 1 -78 + , 1, 0, 1 -79 frame_bury 0 1, 1, 0 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 1, 1 -42 int 2 1, 1, 2 -44 frame_bury 1 1, 2 -46 frame_dig 0 1, 2, 1 -48 b uint_unary_for_body@5 1, 2, 1 -66 int 18446744073709551615 1, 2, 1, 18446744073709551615 -67 frame_dig 1 1, 2, 1, 18446744073709551615, 2 -69 dup 1, 2, 1, 18446744073709551615, 2, 2 -70 cover 2 1, 2, 1, 2, 18446744073709551615, 2 -72 - 1, 2, 1, 2, 18446744073709551613 -73 ~ 1, 2, 1, 2, 2 -74 == 1, 2, 1, 1 -75 assert 1, 2, 1 -76 dup 1, 2, 1, 1 -77 int 1 1, 2, 1, 1, 1 -78 + 1, 2, 1, 2 -79 frame_bury 0 2, 2, 1 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 2, 2 -51 int 150 2, 2, 150 -54 frame_bury 1 2, 150 -56 frame_dig 0 2, 150, 2 -58 b uint_unary_for_body@5 2, 150, 2 -66 int 18446744073709551615 2, 150, 2, 18446744073709551615 -67 frame_dig 1 2, 150, 2, 18446744073709551615, 150 -69 dup 2, 150, 2, 18446744073709551615, 150, 150 -70 cover 2 2, 150, 2, 150, 18446744073709551615, 150 -72 - 2, 150, 2, 150, 18446744073709551465 -73 ~ 2, 150, 2, 150, 150 -74 == 2, 150, 2, 1 -75 assert 2, 150, 2 -76 dup 2, 150, 2, 2 -77 int 1 2, 150, 2, 2, 1 -78 + 2, 150, 2, 3 -79 frame_bury 0 3, 150, 2 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 3, 150 -61 int 18446744073709551615 3, 150, 18446744073709551615 -62 frame_bury 1 3, 18446744073709551615 -64 frame_dig 0 3, 18446744073709551615, 3 -66 int 18446744073709551615 3, 18446744073709551615, 3, 18446744073709551615 -67 frame_dig 1 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615 -69 dup 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 -70 cover 2 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 -72 - 3, 18446744073709551615, 3, 18446744073709551615, 0 -73 ~ 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615 -74 == 3, 18446744073709551615, 3, 1 -75 assert 3, 18446744073709551615, 3 -76 dup 3, 18446744073709551615, 3, 3 -77 int 1 3, 18446744073709551615, 3, 3, 1 -78 + 3, 18446744073709551615, 3, 4 -79 frame_bury 0 4, 18446744073709551615, 3 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 4, 18446744073709551615 -89 retsub -20 callsub biguint_unary -90 proto 0 0 -93 byte 0x -94 byte 0x , -95 b== 1 -96 assert -97 retsub -23 callsub bytes_unary -98 proto 0 0 -101 int 1 1 -102 assert -103 byte 0xff /w== -106 b~ AA== -107 byte 0x00 AA==, AA== -110 == 1 -111 assert -112 byte 0x0000 AAA= -116 b~ //8= -117 byte 0xffff //8=, //8= -121 == 1 -122 assert -123 retsub -26 int 1 1 -27 return 1 \ No newline at end of file +14 callsub uint_unary +25 proto 0 0 +28 byte "" 0x +30 int 0 0x, 0 +32 int 1 0x, 0, 1 +33 swap 0x, 1, 0 +34 b uint_unary_for_body@5 0x, 1, 0 +61 int 18446744073709551615 0x, 1, 0, 18446744073709551615 +62 frame_dig 1 0x, 1, 0, 18446744073709551615, 1 +64 dup 0x, 1, 0, 18446744073709551615, 1, 1 +65 cover 2 0x, 1, 0, 1, 18446744073709551615, 1 +67 - 0x, 1, 0, 1, 18446744073709551614 +68 ~ 0x, 1, 0, 1, 1 +69 == 0x, 1, 0, 1 +70 assert 0x, 1, 0 +71 dup 0x, 1, 0, 0 +72 int 1 0x, 1, 0, 0, 1 +73 + 0x, 1, 0, 1 +74 frame_bury 0 1, 1, 0 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 1, 1 +37 int 2 1, 1, 2 +39 frame_bury 1 1, 2 +41 frame_dig 0 1, 2, 1 +43 b uint_unary_for_body@5 1, 2, 1 +61 int 18446744073709551615 1, 2, 1, 18446744073709551615 +62 frame_dig 1 1, 2, 1, 18446744073709551615, 2 +64 dup 1, 2, 1, 18446744073709551615, 2, 2 +65 cover 2 1, 2, 1, 2, 18446744073709551615, 2 +67 - 1, 2, 1, 2, 18446744073709551613 +68 ~ 1, 2, 1, 2, 2 +69 == 1, 2, 1, 1 +70 assert 1, 2, 1 +71 dup 1, 2, 1, 1 +72 int 1 1, 2, 1, 1, 1 +73 + 1, 2, 1, 2 +74 frame_bury 0 2, 2, 1 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 2, 2 +46 int 150 2, 2, 150 +49 frame_bury 1 2, 150 +51 frame_dig 0 2, 150, 2 +53 b uint_unary_for_body@5 2, 150, 2 +61 int 18446744073709551615 2, 150, 2, 18446744073709551615 +62 frame_dig 1 2, 150, 2, 18446744073709551615, 150 +64 dup 2, 150, 2, 18446744073709551615, 150, 150 +65 cover 2 2, 150, 2, 150, 18446744073709551615, 150 +67 - 2, 150, 2, 150, 18446744073709551465 +68 ~ 2, 150, 2, 150, 150 +69 == 2, 150, 2, 1 +70 assert 2, 150, 2 +71 dup 2, 150, 2, 2 +72 int 1 2, 150, 2, 2, 1 +73 + 2, 150, 2, 3 +74 frame_bury 0 3, 150, 2 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 3, 150 +56 int 18446744073709551615 3, 150, 18446744073709551615 +57 frame_bury 1 3, 18446744073709551615 +59 frame_dig 0 3, 18446744073709551615, 3 +61 int 18446744073709551615 3, 18446744073709551615, 3, 18446744073709551615 +62 frame_dig 1 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615 +64 dup 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 +65 cover 2 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 +67 - 3, 18446744073709551615, 3, 18446744073709551615, 0 +68 ~ 3, 18446744073709551615, 3, 18446744073709551615, 18446744073709551615 +69 == 3, 18446744073709551615, 3, 1 +70 assert 3, 18446744073709551615, 3 +71 dup 3, 18446744073709551615, 3, 3 +72 int 1 3, 18446744073709551615, 3, 3, 1 +73 + 3, 18446744073709551615, 3, 4 +74 frame_bury 0 4, 18446744073709551615, 3 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 4, 18446744073709551615 +84 retsub +17 callsub biguint_unary +85 proto 0 0 +88 retsub +20 callsub bytes_unary +89 proto 0 0 +92 retsub +23 int 1 1 +24 return 1 \ No newline at end of file diff --git a/examples/unary/out/execution_trace.O2.log b/examples/unary/out/execution_trace.O2.log index 5b3c99ca38..002507c2b5 100644 --- a/examples/unary/out/execution_trace.O2.log +++ b/examples/unary/out/execution_trace.O2.log @@ -1,103 +1,84 @@ -PC Teal Stack +PC Teal Stack 1 -14 -17 callsub uint_unary -28 proto 0 0 -31 byte "" -32 int 1 , 1 -33 assert -34 int 0 , 0 -36 int 1 , 0, 1 -37 b uint_unary_for_body@5 , 0, 1 -64 int 18446744073709551615 , 0, 1, 18446744073709551615 -65 uncover 1 , 0, 18446744073709551615, 1 -67 dup , 0, 18446744073709551615, 1, 1 -68 cover 2 , 0, 1, 18446744073709551615, 1 -70 - , 0, 1, 18446744073709551614 -71 ~ , 0, 1, 1 -72 == , 0, 1 -73 assert , 0 -74 frame_dig 1 , 0, 0 -76 dup , 0, 0, 0 -77 int 1 , 0, 0, 0, 1 -78 + , 0, 0, 1 -79 frame_bury 0 1, 0, 0 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 1, 0 -40 int 2 1, 0, 2 -42 frame_dig 0 1, 0, 2, 1 -44 frame_bury 1 1, 1, 2 -46 b uint_unary_for_body@5 1, 1, 2 -64 int 18446744073709551615 1, 1, 2, 18446744073709551615 -65 uncover 1 1, 1, 18446744073709551615, 2 -67 dup 1, 1, 18446744073709551615, 2, 2 -68 cover 2 1, 1, 2, 18446744073709551615, 2 -70 - 1, 1, 2, 18446744073709551613 -71 ~ 1, 1, 2, 2 -72 == 1, 1, 1 -73 assert 1, 1 -74 frame_dig 1 1, 1, 1 -76 dup 1, 1, 1, 1 -77 int 1 1, 1, 1, 1, 1 -78 + 1, 1, 1, 2 -79 frame_bury 0 2, 1, 1 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 2, 1 -49 int 150 2, 1, 150 -52 frame_dig 0 2, 1, 150, 2 -54 frame_bury 1 2, 2, 150 -56 b uint_unary_for_body@5 2, 2, 150 -64 int 18446744073709551615 2, 2, 150, 18446744073709551615 -65 uncover 1 2, 2, 18446744073709551615, 150 -67 dup 2, 2, 18446744073709551615, 150, 150 -68 cover 2 2, 2, 150, 18446744073709551615, 150 -70 - 2, 2, 150, 18446744073709551465 -71 ~ 2, 2, 150, 150 -72 == 2, 2, 1 -73 assert 2, 2 -74 frame_dig 1 2, 2, 2 -76 dup 2, 2, 2, 2 -77 int 1 2, 2, 2, 2, 1 -78 + 2, 2, 2, 3 -79 frame_bury 0 3, 2, 2 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 3, 2 -59 int 18446744073709551615 3, 2, 18446744073709551615 -60 frame_dig 0 3, 2, 18446744073709551615, 3 -62 frame_bury 1 3, 3, 18446744073709551615 -64 int 18446744073709551615 3, 3, 18446744073709551615, 18446744073709551615 -65 uncover 1 3, 3, 18446744073709551615, 18446744073709551615 -67 dup 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 -68 cover 2 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 -70 - 3, 3, 18446744073709551615, 0 -71 ~ 3, 3, 18446744073709551615, 18446744073709551615 -72 == 3, 3, 1 -73 assert 3, 3 -74 frame_dig 1 3, 3, 3 -76 dup 3, 3, 3, 3 -77 int 1 3, 3, 3, 3, 1 -78 + 3, 3, 3, 4 -79 frame_bury 0 4, 3, 3 -81 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 4, 3 -89 retsub -20 callsub biguint_unary -90 proto 0 0 -93 byte 0x -94 byte 0x , -95 b== 1 -96 assert -97 retsub -23 callsub bytes_unary -98 proto 0 0 -101 int 1 1 -102 assert -103 byte 0xff /w== -106 b~ AA== -107 byte 0x00 AA==, AA== -110 == 1 -111 assert -112 byte 0x0000 AAA= -116 b~ //8= -117 byte 0xffff //8=, //8= -121 == 1 -122 assert -123 retsub -26 int 1 1 -27 return 1 \ No newline at end of file +14 callsub uint_unary +25 proto 0 0 +28 byte "" 0x +30 int 0 0x, 0 +32 int 1 0x, 0, 1 +33 b uint_unary_for_body@5 0x, 0, 1 +60 int 18446744073709551615 0x, 0, 1, 18446744073709551615 +61 swap 0x, 0, 18446744073709551615, 1 +62 dup 0x, 0, 18446744073709551615, 1, 1 +63 cover 2 0x, 0, 1, 18446744073709551615, 1 +65 - 0x, 0, 1, 18446744073709551614 +66 ~ 0x, 0, 1, 1 +67 == 0x, 0, 1 +68 assert 0x, 0 +69 frame_dig 1 0x, 0, 0 +71 dup 0x, 0, 0, 0 +72 int 1 0x, 0, 0, 0, 1 +73 + 0x, 0, 0, 1 +74 frame_bury 0 1, 0, 0 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 1, 0 +36 int 2 1, 0, 2 +38 frame_dig 0 1, 0, 2, 1 +40 frame_bury 1 1, 1, 2 +42 b uint_unary_for_body@5 1, 1, 2 +60 int 18446744073709551615 1, 1, 2, 18446744073709551615 +61 swap 1, 1, 18446744073709551615, 2 +62 dup 1, 1, 18446744073709551615, 2, 2 +63 cover 2 1, 1, 2, 18446744073709551615, 2 +65 - 1, 1, 2, 18446744073709551613 +66 ~ 1, 1, 2, 2 +67 == 1, 1, 1 +68 assert 1, 1 +69 frame_dig 1 1, 1, 1 +71 dup 1, 1, 1, 1 +72 int 1 1, 1, 1, 1, 1 +73 + 1, 1, 1, 2 +74 frame_bury 0 2, 1, 1 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 2, 1 +45 int 150 2, 1, 150 +48 frame_dig 0 2, 1, 150, 2 +50 frame_bury 1 2, 2, 150 +52 b uint_unary_for_body@5 2, 2, 150 +60 int 18446744073709551615 2, 2, 150, 18446744073709551615 +61 swap 2, 2, 18446744073709551615, 150 +62 dup 2, 2, 18446744073709551615, 150, 150 +63 cover 2 2, 2, 150, 18446744073709551615, 150 +65 - 2, 2, 150, 18446744073709551465 +66 ~ 2, 2, 150, 150 +67 == 2, 2, 1 +68 assert 2, 2 +69 frame_dig 1 2, 2, 2 +71 dup 2, 2, 2, 2 +72 int 1 2, 2, 2, 2, 1 +73 + 2, 2, 2, 3 +74 frame_bury 0 3, 2, 2 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 3, 2 +55 int 18446744073709551615 3, 2, 18446744073709551615 +56 frame_dig 0 3, 2, 18446744073709551615, 3 +58 frame_bury 1 3, 3, 18446744073709551615 +60 int 18446744073709551615 3, 3, 18446744073709551615, 18446744073709551615 +61 swap 3, 3, 18446744073709551615, 18446744073709551615 +62 dup 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 +63 cover 2 3, 3, 18446744073709551615, 18446744073709551615, 18446744073709551615 +65 - 3, 3, 18446744073709551615, 0 +66 ~ 3, 3, 18446744073709551615, 18446744073709551615 +67 == 3, 3, 1 +68 assert 3, 3 +69 frame_dig 1 3, 3, 3 +71 dup 3, 3, 3, 3 +72 int 1 3, 3, 3, 3, 1 +73 + 3, 3, 3, 4 +74 frame_bury 0 4, 3, 3 +76 switch uint_unary_for_header_1@2 uint_unary_for_header_2@3 uint_unary_for_header_3@4 4, 3 +84 retsub +17 callsub biguint_unary +85 proto 0 0 +88 retsub +20 callsub bytes_unary +89 proto 0 0 +92 retsub +23 int 1 1 +24 return 1 \ No newline at end of file diff --git a/examples/undefined_phi_args/algopy.log b/examples/undefined_phi_args/algopy.log index cd8338117f..5e3950459b 100644 --- a/examples/undefined_phi_args/algopy.log +++ b/examples/undefined_phi_args/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 undefined_phi_args -info: Building AWST for __init__.py -info: Building AWST for undefined_phi_args -info: Building AWST for undefined_phi_args/baddie.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug undefined_phi_args +debug: Building AWST for __init__.py +debug: Building AWST for undefined_phi_args +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for undefined_phi_args/baddie.py debug: Sealing block@0: // L38 debug: Terminated block@0: // L38 debug: Sealing block@None: // if_body_L39 @@ -231,6 +232,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: and_result%5#2, invert_second_condition#0 debug: Replacing {and_result%5#2} with invert_second_condition#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -243,6 +245,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -253,6 +256,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -263,6 +267,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -273,6 +278,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -284,6 +290,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.Baddie.approval_ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -295,6 +302,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.test_uint_undefi debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -304,6 +312,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.test_bytes_undef debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -313,6 +322,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.test_mixed_undef debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -322,6 +332,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.Baddie.clear_sta debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -333,6 +344,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.Baddie.approval_ debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -342,6 +354,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.test_uint_undefi debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -351,6 +364,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.test_bytes_undef debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -360,6 +374,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.test_mixed_undef debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -369,6 +384,7 @@ debug: Optimizing subroutine examples.undefined_phi_args.baddie.Baddie.clear_sta debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -411,103 +427,103 @@ debug: Coalescing local variables in examples.undefined_phi_args.baddie.Baddie.c debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/undefined_phi_args/out/baddie_Baddie.final.ir debug: Inserted main_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_and_contd@1.ops[1]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_and_contd@1.ops[3]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_and_contd@1.ops[3]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_and_contd@1.ops[5]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced main_and_contd@1.ops[7]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced main_and_contd@1.ops[7]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted main_and_contd@1.ops[10]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_and_contd@1.ops[12]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_and_contd@1.ops[12]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_bool_true@2.ops[1]: 'store and_result%5#0 to l-stack (copy)' -debug: Replaced main_bool_true@2.ops[3]: 'load and_result%5#0 from scratch' with 'load and_result%5#0 from l-stack (no copy)' +debug: Replaced main_bool_true@2.ops[3]: 'load and_result%5#0' with 'load and_result%5#0 from l-stack (no copy)' debug: Inserted main_bool_false@3.ops[1]: 'store and_result%5#0 to l-stack (copy)' -debug: Replaced main_bool_false@3.ops[3]: 'load and_result%5#0 from scratch' with 'load and_result%5#0 from l-stack (no copy)' +debug: Replaced main_bool_false@3.ops[3]: 'load and_result%5#0' with 'load and_result%5#0 from l-stack (no copy)' debug: Inserted main_if_body@5.ops[3]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_if_body@5.ops[5]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_if_body@5.ops[5]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[3]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[5]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[5]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[8]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[10]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[10]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[15]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[17]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[17]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_if_body@6.ops[20]: 'store tmp%10#0 to l-stack (copy)' -debug: Replaced main_if_body@6.ops[22]: 'load tmp%10#0 from scratch' with 'load tmp%10#0 from l-stack (no copy)' +debug: Replaced main_if_body@6.ops[22]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' debug: Inserted main_else_body@7.ops[3]: 'store tmp%11#0 to l-stack (copy)' -debug: Replaced main_else_body@7.ops[5]: 'load tmp%11#0 from scratch' with 'load tmp%11#0 from l-stack (no copy)' +debug: Replaced main_else_body@7.ops[5]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' debug: Inserted main_if_body@8.ops[3]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_if_body@8.ops[5]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced main_if_body@8.ops[5]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted main_if_body@8.ops[8]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_if_body@8.ops[10]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced main_if_body@8.ops[10]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted main_if_body@8.ops[15]: 'store tmp%14#0 to l-stack (copy)' -debug: Replaced main_if_body@8.ops[17]: 'load tmp%14#0 from scratch' with 'load tmp%14#0 from l-stack (no copy)' +debug: Replaced main_if_body@8.ops[17]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' debug: Inserted main_if_body@8.ops[20]: 'store tmp%15#0 to l-stack (copy)' -debug: Replaced main_if_body@8.ops[22]: 'load tmp%15#0 from scratch' with 'load tmp%15#0 from l-stack (no copy)' +debug: Replaced main_if_body@8.ops[22]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' debug: Inserted main_else_body@9.ops[3]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_else_body@9.ops[5]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_else_body@9.ops[5]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_else_body@9.ops[8]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_else_body@9.ops[10]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_else_body@9.ops[10]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_else_body@9.ops[15]: 'store tmp%18#0 to l-stack (copy)' -debug: Replaced main_else_body@9.ops[17]: 'load tmp%18#0 from scratch' with 'load tmp%18#0 from l-stack (no copy)' +debug: Replaced main_else_body@9.ops[17]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted main_else_body@9.ops[20]: 'store tmp%19#0 to l-stack (copy)' -debug: Replaced main_else_body@9.ops[22]: 'load tmp%19#0 from scratch' with 'load tmp%19#0 from l-stack (no copy)' +debug: Replaced main_else_body@9.ops[22]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' debug: Inserted main_else_body@12.ops[3]: 'store tmp%20#0 to l-stack (copy)' -debug: Replaced main_else_body@12.ops[5]: 'load tmp%20#0 from scratch' with 'load tmp%20#0 from l-stack (no copy)' +debug: Replaced main_else_body@12.ops[5]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' debug: Inserted main_if_body@13.ops[3]: 'store tmp%21#0 to l-stack (copy)' -debug: Replaced main_if_body@13.ops[5]: 'load tmp%21#0 from scratch' with 'load tmp%21#0 from l-stack (no copy)' +debug: Replaced main_if_body@13.ops[5]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' debug: Inserted main_if_body@13.ops[8]: 'store tmp%22#0 to l-stack (copy)' -debug: Replaced main_if_body@13.ops[10]: 'load tmp%22#0 from scratch' with 'load tmp%22#0 from l-stack (no copy)' +debug: Replaced main_if_body@13.ops[10]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' debug: Inserted main_if_body@13.ops[15]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced main_if_body@13.ops[17]: 'load tmp%23#0 from scratch' with 'load tmp%23#0 from l-stack (no copy)' +debug: Replaced main_if_body@13.ops[17]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' debug: Inserted main_if_body@13.ops[20]: 'store tmp%24#0 to l-stack (copy)' -debug: Replaced main_if_body@13.ops[22]: 'load tmp%24#0 from scratch' with 'load tmp%24#0 from l-stack (no copy)' +debug: Replaced main_if_body@13.ops[22]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' debug: Inserted main_else_body@14.ops[3]: 'store tmp%25#0 to l-stack (copy)' -debug: Replaced main_else_body@14.ops[5]: 'load tmp%25#0 from scratch' with 'load tmp%25#0 from l-stack (no copy)' +debug: Replaced main_else_body@14.ops[5]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' debug: Inserted main_if_body@15.ops[3]: 'store tmp%26#0 to l-stack (copy)' -debug: Replaced main_if_body@15.ops[5]: 'load tmp%26#0 from scratch' with 'load tmp%26#0 from l-stack (no copy)' +debug: Replaced main_if_body@15.ops[5]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' debug: Inserted main_if_body@15.ops[8]: 'store tmp%27#0 to l-stack (copy)' -debug: Replaced main_if_body@15.ops[10]: 'load tmp%27#0 from scratch' with 'load tmp%27#0 from l-stack (no copy)' +debug: Replaced main_if_body@15.ops[10]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' debug: Inserted main_if_body@15.ops[15]: 'store tmp%28#0 to l-stack (copy)' -debug: Replaced main_if_body@15.ops[17]: 'load tmp%28#0 from scratch' with 'load tmp%28#0 from l-stack (no copy)' +debug: Replaced main_if_body@15.ops[17]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' debug: Inserted main_if_body@15.ops[20]: 'store tmp%29#0 to l-stack (copy)' -debug: Replaced main_if_body@15.ops[22]: 'load tmp%29#0 from scratch' with 'load tmp%29#0 from l-stack (no copy)' +debug: Replaced main_if_body@15.ops[22]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' debug: Inserted main_else_body@16.ops[3]: 'store tmp%30#0 to l-stack (copy)' -debug: Replaced main_else_body@16.ops[5]: 'load tmp%30#0 from scratch' with 'load tmp%30#0 from l-stack (no copy)' +debug: Replaced main_else_body@16.ops[5]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' debug: Inserted main_else_body@16.ops[8]: 'store tmp%31#0 to l-stack (copy)' -debug: Replaced main_else_body@16.ops[10]: 'load tmp%31#0 from scratch' with 'load tmp%31#0 from l-stack (no copy)' +debug: Replaced main_else_body@16.ops[10]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' debug: Inserted main_else_body@16.ops[15]: 'store tmp%32#0 to l-stack (copy)' -debug: Replaced main_else_body@16.ops[17]: 'load tmp%32#0 from scratch' with 'load tmp%32#0 from l-stack (no copy)' +debug: Replaced main_else_body@16.ops[17]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' debug: Inserted main_else_body@16.ops[20]: 'store tmp%33#0 to l-stack (copy)' -debug: Replaced main_else_body@16.ops[22]: 'load tmp%33#0 from scratch' with 'load tmp%33#0 from l-stack (no copy)' +debug: Replaced main_else_body@16.ops[22]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' debug: Found 8 edge set/s for examples.undefined_phi_args.baddie.Baddie.approval_program -debug: Eliminated scratch slots for 1 variable/s: invert_second_condition#0 -info: shared x-stack for main_bool_true@2 -> main_bool_merge@4: invert_second_condition#0 -info: shared x-stack for main_bool_false@3 -> main_bool_merge@4: invert_second_condition#0 +debug: Allocated 1 variable/s to x-stack: invert_second_condition#0 +debug: shared x-stack for main_bool_true@2 -> main_bool_merge@4: invert_second_condition#0 +debug: shared x-stack for main_bool_false@3 -> main_bool_merge@4: invert_second_condition#0 debug: examples.undefined_phi_args.baddie.Baddie.approval_program f-stack entry: [] debug: examples.undefined_phi_args.baddie.Baddie.approval_program f-stack on first store: ['test_case#0'] debug: Found 5 edge set/s for examples.undefined_phi_args.baddie.test_uint_undefined -debug: Eliminated scratch slots for 1 variable/s: c#0 -info: shared x-stack for test_uint_undefined_if_body@6 -> test_uint_undefined_after_if_else@8: c#0 -info: shared x-stack for test_uint_undefined_else_body@7 -> test_uint_undefined_after_if_else@8: c#0 +debug: Allocated 1 variable/s to x-stack: c#0 +debug: shared x-stack for test_uint_undefined_if_body@6 -> test_uint_undefined_after_if_else@8: c#0 +debug: shared x-stack for test_uint_undefined_else_body@7 -> test_uint_undefined_after_if_else@8: c#0 debug: examples.undefined_phi_args.baddie.test_uint_undefined f-stack entry: ['a#0', 'b#0'] debug: examples.undefined_phi_args.baddie.test_uint_undefined f-stack on first store: [] debug: Found 5 edge set/s for examples.undefined_phi_args.baddie.test_bytes_undefined -debug: Eliminated scratch slots for 1 variable/s: c#0 -info: shared x-stack for test_bytes_undefined_if_body@6 -> test_bytes_undefined_after_if_else@8: c#0 -info: shared x-stack for test_bytes_undefined_else_body@7 -> test_bytes_undefined_after_if_else@8: c#0 +debug: Allocated 1 variable/s to x-stack: c#0 +debug: shared x-stack for test_bytes_undefined_if_body@6 -> test_bytes_undefined_after_if_else@8: c#0 +debug: shared x-stack for test_bytes_undefined_else_body@7 -> test_bytes_undefined_after_if_else@8: c#0 debug: examples.undefined_phi_args.baddie.test_bytes_undefined f-stack entry: ['a#0', 'b#0'] debug: examples.undefined_phi_args.baddie.test_bytes_undefined f-stack on first store: [] debug: Inserted test_mixed_undefined_if_body@6.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_mixed_undefined_if_body@6.ops[4]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_mixed_undefined_if_body@6.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Found 5 edge set/s for examples.undefined_phi_args.baddie.test_mixed_undefined -debug: Eliminated scratch slots for 1 variable/s: c#0 -info: shared x-stack for test_mixed_undefined_if_body@6 -> test_mixed_undefined_after_if_else@8: c#0 -info: shared x-stack for test_mixed_undefined_else_body@7 -> test_mixed_undefined_after_if_else@8: c#0 +debug: Allocated 1 variable/s to x-stack: c#0 +debug: shared x-stack for test_mixed_undefined_if_body@6 -> test_mixed_undefined_after_if_else@8: c#0 +debug: shared x-stack for test_mixed_undefined_else_body@7 -> test_mixed_undefined_after_if_else@8: c#0 debug: examples.undefined_phi_args.baddie.test_mixed_undefined f-stack entry: ['b#0', 'a#0'] debug: examples.undefined_phi_args.baddie.test_mixed_undefined f-stack on first store: [] -info: Writing /examples/undefined_phi_args/out/baddie.approval.teal -info: Writing /examples/undefined_phi_args/out/baddie.approval.debug.teal -info: Writing /examples/undefined_phi_args/out/baddie.clear.teal -info: Writing /examples/undefined_phi_args/out/baddie.clear.debug.teal +info: Writing undefined_phi_args/out/baddie.approval.teal +info: Writing undefined_phi_args/out/baddie.approval.debug.teal +info: Writing undefined_phi_args/out/baddie.clear.teal +info: Writing undefined_phi_args/out/baddie.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/unreachable.algopy.log b/examples/unreachable.algopy.log index 061e005fc4..8a6e9afb47 100644 --- a/examples/unreachable.algopy.log +++ b/examples/unreachable.algopy.log @@ -1,6 +1,7 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 unreachable.py -info: Building AWST for __init__.py -info: Building AWST for unreachable.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug unreachable.py +debug: Building AWST for __init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for unreachable.py debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@None: // if_body_L7 diff --git a/examples/unssa/algopy.log b/examples/unssa/algopy.log index 32b9ddf4e8..5e0ec90e8b 100644 --- a/examples/unssa/algopy.log +++ b/examples/unssa/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 unssa -info: Building AWST for __init__.py -info: Building AWST for unssa -info: Building AWST for unssa/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug unssa +debug: Building AWST for __init__.py +debug: Building AWST for unssa +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for unssa/contract.py unssa/contract.py:6 warning: expression result is ignored unssa/contract.py:13 warning: expression result is ignored unssa/contract.py:15 warning: expression result is ignored @@ -231,6 +232,7 @@ debug: Found equivalence set: tuple_assignment%14#0, a#1 debug: Replacing {tuple_assignment%14#0} with a#1 made 1 modifications debug: Found equivalence set: tuple_assignment%15#0, b#1 debug: Replacing {tuple_assignment%15#0} with b#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -241,6 +243,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -257,6 +260,7 @@ debug: Found equivalence set: x#1, tmp#0, y#2 debug: Replacing {tmp#0, y#2} with x#1 made 1 modifications debug: Found equivalence set: y#1, x#2 debug: Replacing {x#2} with y#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -271,6 +275,7 @@ debug: Found equivalence set: x#1, tmp#0, y#2 debug: Replacing {tmp#0, y#2} with x#1 made 1 modifications debug: Found equivalence set: y#1, x#2 debug: Replacing {x#2} with y#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -282,6 +287,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: ConditionalBranch goto 1u ? block@2 : block@5 simplified to goto block@2 @@ -301,6 +307,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: ConditionalBranch goto 1u ? block@2 : block@5 simplified to goto block@2 @@ -318,6 +325,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: ConditionalBranch goto 1u ? block@2 : block@5 simplified to goto block@2 @@ -336,6 +344,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -350,6 +359,7 @@ debug: Found equivalence set: tuple_assignment%2#0, a#1 debug: Replacing {tuple_assignment%2#0} with a#1 made 1 modifications debug: Found equivalence set: tuple_assignment%3#0, b#1 debug: Replacing {tuple_assignment%3#0} with b#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -360,6 +370,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -376,6 +387,7 @@ debug: Found equivalence set: b#1, a#2 debug: Replacing {a#2} with b#1 made 1 modifications debug: Found equivalence set: a#1, b#2 debug: Replacing {b#2} with a#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -388,6 +400,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -399,6 +412,7 @@ debug: Optimizing subroutine examples.unssa.contract.UnSSAContract.approval_prog debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -408,6 +422,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_self_ref_phi debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -418,6 +433,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_swap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -427,6 +443,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_swap_loop debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -437,6 +454,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_param_update_with_reen debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -448,6 +466,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_param_update_with_reen debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -457,6 +476,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_param_update_with_reen debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -466,6 +486,7 @@ debug: Optimizing subroutine examples.unssa.contract.one debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -475,6 +496,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_swap_args debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -484,6 +506,7 @@ debug: Optimizing subroutine examples.unssa.contract.swap_args debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -493,6 +516,7 @@ debug: Optimizing subroutine examples.unssa.contract.test_tuple_swap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -502,6 +526,7 @@ debug: Optimizing subroutine examples.unssa.contract.UnSSAContract.clear_state_p debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -746,124 +771,124 @@ debug: Coalescing local variables in examples.unssa.contract.UnSSAContract.clear debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/unssa/out/contract_UnSSAContract.final.ir debug: Inserted main_block@0.ops[4]: 'store result1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[6]: 'load result1#0 from scratch' with 'load result1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[6]: 'load result1#0' with 'load result1#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[8]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[10]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[10]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[15]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[17]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[17]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[7]: 'store result1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[13]: 'load result1#0 from scratch' with 'load result1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[13]: 'load result1#0' with 'load result1#0 from l-stack (no copy)' debug: Inserted main_and_contd@1.ops[3]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced main_and_contd@1.ops[5]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced main_and_contd@1.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted main_bool_merge@4.ops[4]: 'store result2#0 to l-stack (copy)' -debug: Replaced main_bool_merge@4.ops[6]: 'load result2#0 from scratch' with 'load result2#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@4.ops[6]: 'load result2#0' with 'load result2#0 from l-stack (no copy)' debug: Inserted main_bool_merge@4.ops[8]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced main_bool_merge@4.ops[10]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@4.ops[10]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted main_bool_merge@4.ops[15]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced main_bool_merge@4.ops[17]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@4.ops[17]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted main_bool_merge@4.ops[7]: 'store result2#0 to l-stack (copy)' -debug: Replaced main_bool_merge@4.ops[13]: 'load result2#0 from scratch' with 'load result2#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@4.ops[13]: 'load result2#0' with 'load result2#0 from l-stack (no copy)' debug: Inserted main_and_contd@5.ops[3]: 'store tmp%6#0 to l-stack (copy)' -debug: Replaced main_and_contd@5.ops[5]: 'load tmp%6#0 from scratch' with 'load tmp%6#0 from l-stack (no copy)' +debug: Replaced main_and_contd@5.ops[5]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[8]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[10]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[10]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[13]: 'store tmp%9#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[15]: 'load tmp%9#0 from scratch' with 'load tmp%9#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[15]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[27]: 'store a#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[29]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[29]: 'load a#0' with 'load a#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[32]: 'store tmp%12#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[34]: 'load tmp%12#0 from scratch' with 'load tmp%12#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[34]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[39]: 'store tmp%13#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[41]: 'load tmp%13#0 from scratch' with 'load tmp%13#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[41]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[48]: 'store a#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[50]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[50]: 'load a#0' with 'load a#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[53]: 'store tmp%16#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[55]: 'load tmp%16#0 from scratch' with 'load tmp%16#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[55]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[60]: 'store tmp%17#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[62]: 'load tmp%17#0 from scratch' with 'load tmp%17#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[62]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[26]: 'store b#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[37]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[37]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted main_bool_merge@8.ops[48]: 'store b#0 to l-stack (copy)' -debug: Replaced main_bool_merge@8.ops[59]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced main_bool_merge@8.ops[59]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.unssa.contract.UnSSAContract.approval_program -debug: Eliminated scratch slots for 2 variable/s: and_result%3#0, and_result%7#0 -info: shared x-stack for main_bool_true@2 -> main_bool_merge@4: and_result%3#0 -info: shared x-stack for main_bool_false@3 -> main_bool_merge@4: and_result%3#0 -info: shared x-stack for main_bool_true@6 -> main_bool_merge@8: and_result%7#0 -info: shared x-stack for main_bool_false@7 -> main_bool_merge@8: and_result%7#0 +debug: Allocated 2 variable/s to x-stack: and_result%3#0, and_result%7#0 +debug: shared x-stack for main_bool_true@2 -> main_bool_merge@4: and_result%3#0 +debug: shared x-stack for main_bool_false@3 -> main_bool_merge@4: and_result%3#0 +debug: shared x-stack for main_bool_true@6 -> main_bool_merge@8: and_result%7#0 +debug: shared x-stack for main_bool_false@7 -> main_bool_merge@8: and_result%7#0 debug: examples.unssa.contract.UnSSAContract.approval_program f-stack entry: ['result2#0'] debug: examples.unssa.contract.UnSSAContract.approval_program f-stack on first store: ['result1#0'] debug: Inserted test_self_ref_phi_while_top@1.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_self_ref_phi_while_top@1.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_self_ref_phi_while_top@1.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted test_self_ref_phi_while_body@2.ops[3]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced test_self_ref_phi_while_body@2.ops[5]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced test_self_ref_phi_while_body@2.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted test_self_ref_phi_while_body@2.ops[7]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced test_self_ref_phi_while_body@2.ops[9]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced test_self_ref_phi_while_body@2.ops[9]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted test_self_ref_phi_after_if_else@4.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced test_self_ref_phi_after_if_else@4.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced test_self_ref_phi_after_if_else@4.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Found 3 edge set/s for examples.unssa.contract.test_self_ref_phi debug: examples.unssa.contract.test_self_ref_phi f-stack entry: [] debug: examples.unssa.contract.test_self_ref_phi f-stack on first store: ['a#0'] debug: Inserted test_swap_while_top@1.ops[5]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_swap_while_top@1.ops[7]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_swap_while_top@1.ops[7]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.unssa.contract.test_swap -debug: Eliminated scratch slots for 2 variable/s: x#0, x#1 -info: shared x-stack for test_swap_block@0 -> test_swap_while_top@1: x#0 -info: shared x-stack for test_swap_while_body@2 -> test_swap_while_top@1: x#0 -info: shared x-stack for test_swap_while_top@1 -> test_swap_while_body@2: x#1 -info: shared x-stack for test_swap_while_top@1 -> test_swap_after_while@3: x#1 +debug: Allocated 2 variable/s to x-stack: x#0, x#1 +debug: shared x-stack for test_swap_block@0 -> test_swap_while_top@1: x#0 +debug: shared x-stack for test_swap_while_body@2 -> test_swap_while_top@1: x#0 +debug: shared x-stack for test_swap_while_top@1 -> test_swap_while_body@2: x#1 +debug: shared x-stack for test_swap_while_top@1 -> test_swap_after_while@3: x#1 debug: examples.unssa.contract.test_swap f-stack entry: [] debug: examples.unssa.contract.test_swap f-stack on first store: ['y#0'] debug: Inserted test_swap_loop_while_top@1.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_swap_loop_while_top@1.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_swap_loop_while_top@1.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted test_swap_loop_while_top@3.ops[5]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced test_swap_loop_while_top@3.ops[7]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced test_swap_loop_while_top@3.ops[7]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Found 4 edge set/s for examples.unssa.contract.test_swap_loop -debug: Eliminated scratch slots for 1 variable/s: x#1 -info: shared x-stack for test_swap_loop_while_top@3 -> test_swap_loop_while_body@4: x#1 -info: shared x-stack for test_swap_loop_while_top@3 -> test_swap_loop_after_while@5: x#1 +debug: Allocated 1 variable/s to x-stack: x#1 +debug: shared x-stack for test_swap_loop_while_top@3 -> test_swap_loop_while_body@4: x#1 +debug: shared x-stack for test_swap_loop_while_top@3 -> test_swap_loop_after_while@5: x#1 debug: examples.unssa.contract.test_swap_loop f-stack entry: [] debug: examples.unssa.contract.test_swap_loop f-stack on first store: ['x#0', 'y#0'] debug: Simplified frame_dig 0; frame_bury 0; retsub to retsub debug: Inserted test_param_update_with_reentrant_entry_block_while_top@1.ops[6]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_param_update_with_reentrant_entry_block_while_top@1.ops[8]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_param_update_with_reentrant_entry_block_while_top@1.ops[8]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.unssa.contract.test_param_update_with_reentrant_entry_block debug: Inserted test_param_update_with_reentrant_entry_block_v2_while_top@1.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_param_update_with_reentrant_entry_block_v2_while_top@1.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_param_update_with_reentrant_entry_block_v2_while_top@1.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.unssa.contract.test_param_update_with_reentrant_entry_block_v2 debug: Inserted test_param_update_with_reentrant_entry_block_v3_while_top@1.ops[1]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_param_update_with_reentrant_entry_block_v3_while_top@1.ops[3]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_param_update_with_reentrant_entry_block_v3_while_top@1.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3 debug: Inserted test_swap_args_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[3]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted test_swap_args_block@0.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted test_swap_args_block@0.ops[18]: 'store a#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[20]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[20]: 'load a#0' with 'load a#0 from l-stack (no copy)' debug: Inserted test_swap_args_block@0.ops[23]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[25]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[25]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted test_swap_args_block@0.ops[30]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[32]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[32]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted test_swap_args_block@0.ops[13]: 'store b#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[16]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[16]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted test_swap_args_block@0.ops[6]: 'store a#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[16]: 'load a#0 from scratch' with 'load a#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[16]: 'load a#0' with 'load a#0 from l-stack (no copy)' debug: Inserted test_swap_args_block@0.ops[19]: 'store b#0 to l-stack (copy)' -debug: Replaced test_swap_args_block@0.ops[30]: 'load b#0 from scratch' with 'load b#0 from l-stack (no copy)' +debug: Replaced test_swap_args_block@0.ops[30]: 'load b#0' with 'load b#0 from l-stack (no copy)' debug: Inserted test_tuple_swap_block@0.ops[1]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced test_tuple_swap_block@0.ops[3]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced test_tuple_swap_block@0.ops[3]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Inserted test_tuple_swap_for_header@1.ops[5]: 'store continue_looping%1#0 to l-stack (copy)' -debug: Replaced test_tuple_swap_for_header@1.ops[7]: 'load continue_looping%1#0 from scratch' with 'load continue_looping%1#0 from l-stack (no copy)' +debug: Replaced test_tuple_swap_for_header@1.ops[7]: 'load continue_looping%1#0' with 'load continue_looping%1#0 from l-stack (no copy)' debug: Inserted test_tuple_swap_for_body@2.ops[3]: 'store range_item%0#0 to l-stack (copy)' -debug: Replaced test_tuple_swap_for_body@2.ops[5]: 'load range_item%0#0 from scratch' with 'load range_item%0#0 from l-stack (no copy)' +debug: Replaced test_tuple_swap_for_body@2.ops[5]: 'load range_item%0#0' with 'load range_item%0#0 from l-stack (no copy)' debug: Found 2 edge set/s for examples.unssa.contract.test_tuple_swap -debug: Eliminated scratch slots for 1 variable/s: b#1 -info: shared x-stack for test_tuple_swap_for_header@1 -> test_tuple_swap_for_body@2: b#1 -info: shared x-stack for test_tuple_swap_for_header@1 -> test_tuple_swap_after_for@4: b#1 +debug: Allocated 1 variable/s to x-stack: b#1 +debug: shared x-stack for test_tuple_swap_for_header@1 -> test_tuple_swap_for_body@2: b#1 +debug: shared x-stack for test_tuple_swap_for_header@1 -> test_tuple_swap_after_for@4: b#1 debug: examples.unssa.contract.test_tuple_swap f-stack entry: [] debug: examples.unssa.contract.test_tuple_swap f-stack on first store: ['item#0'] -info: Writing /examples/unssa/out/contract.approval.teal -info: Writing /examples/unssa/out/contract.approval.debug.teal -info: Writing /examples/unssa/out/contract.clear.teal -info: Writing /examples/unssa/out/contract.clear.debug.teal +info: Writing unssa/out/contract.approval.teal +info: Writing unssa/out/contract.approval.debug.teal +info: Writing unssa/out/contract.clear.teal +info: Writing unssa/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/unssa/out/contract.approval.debug.teal b/examples/unssa/out/contract.approval.debug.teal index 551d7ff28b..ffa5bbac0a 100644 --- a/examples/unssa/out/contract.approval.debug.teal +++ b/examples/unssa/out/contract.approval.debug.teal @@ -12,7 +12,7 @@ main_block@0: int 1 // (𝕗) result2#0 | 1 1 File "unssa/contract.py", line 7 callsub test_swap // (𝕗) result2#0 | {test_swap} test_swap(UInt64(1)) File "unssa/contract.py", line 7 dup // store result1#0 to l-stack (copy) (𝕗) result2#0 | result1#0,result1#0 result1 File "unssa/contract.py", line 7 - cover 1 // store result1#0 to f-stack (𝕗) result2#0,result1#0 | result1#0 result1 File "unssa/contract.py", line 7 + swap // store result1#0 to f-stack (𝕗) result2#0,result1#0 | result1#0 result1 File "unssa/contract.py", line 7 dup // load result1#0 from l-stack (copy) (𝕗) result2#0,result1#0 | result1#0,result1#0 result1 File "unssa/contract.py", line 7 itob // (𝕗) result2#0,result1#0 | result1#0,{itob} itob(result1) File "unssa/contract.py", line 8 log // (𝕗) result2#0,result1#0 | result1#0 log(itob(result1)) File "unssa/contract.py", line 8 @@ -85,7 +85,7 @@ main_bool_merge@8: int 200 // (𝕗) result2#0,result1#0 | 100,200 200 File "unssa/contract.py", line 19 int 0 // (𝕗) result2#0,result1#0 | 100,200,0 0 File "unssa/contract.py", line 19 callsub test_tuple_swap // (𝕗) result2#0,result1#0 | {test_tuple_swap}.0,{test_tuple_swap}.1 test_tuple_swap(UInt64(100), UInt64(200), UInt64(0)) File "unssa/contract.py", line 19 - cover 1 // store b#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | b#0,{test_tuple_swap}.0 b File "unssa/contract.py", line 19 + swap // store b#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | b#0,{test_tuple_swap}.0 b File "unssa/contract.py", line 19 int 100 // (𝕗) result2#0,result1#0 | b#0,a#0,100 100 File "unssa/contract.py", line 20 == // (𝕗) result2#0,result1#0 | b#0,{==} a == UInt64(100) File "unssa/contract.py", line 20 assert // (𝕗) result2#0,result1#0 | b#0 assert a == UInt64(100) File "unssa/contract.py", line 20 @@ -96,7 +96,7 @@ main_bool_merge@8: int 200 // (𝕗) result2#0,result1#0 | 100,200 200 File "unssa/contract.py", line 22 int 1 // (𝕗) result2#0,result1#0 | 100,200,1 1 File "unssa/contract.py", line 22 callsub test_tuple_swap // (𝕗) result2#0,result1#0 | {test_tuple_swap}.0,{test_tuple_swap}.1 test_tuple_swap(UInt64(100), UInt64(200), UInt64(1)) File "unssa/contract.py", line 22 - cover 1 // store b#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | b#0,{test_tuple_swap}.0 b File "unssa/contract.py", line 19 + swap // store b#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | b#0,{test_tuple_swap}.0 b File "unssa/contract.py", line 19 int 200 // (𝕗) result2#0,result1#0 | b#0,a#0,200 200 File "unssa/contract.py", line 23 == // (𝕗) result2#0,result1#0 | b#0,{==} a == UInt64(200) File "unssa/contract.py", line 23 assert // (𝕗) result2#0,result1#0 | b#0 assert a == UInt64(200) File "unssa/contract.py", line 23 @@ -149,7 +149,7 @@ test_self_ref_phi_after_if_else@6: test_self_ref_phi_after_while@7: frame_dig 0 // load a#0 from f-stack (𝕗) a#0 | a#0 a File "unssa/contract.py", line 34 - uncover 1 + swap retsub // a#0 return a File "unssa/contract.py", line 41 @@ -160,7 +160,7 @@ test_swap: test_swap_block@0: int 1 // (𝕡) i#0 | 1 1 File "unssa/contract.py", line 46 int 2 // (𝕡) i#0 | (𝕏) x#0 | 2 2 File "unssa/contract.py", line 47 - cover 1 // store y#0 to f-stack (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#0 | y File "unssa/contract.py", line 47 + swap // store y#0 to f-stack (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#0 | y File "unssa/contract.py", line 47 // Implicit fall through to test_swap_while_top@1 // (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#0 | x#0 test_swap_while_top@1: @@ -176,12 +176,12 @@ test_swap_while_body@2: - // (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#1 | {-} i - 1 File "unssa/contract.py", line 52 frame_bury -1 // store i#0 to parameters (no copy) (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#1 | i: UInt64 File "unssa/contract.py", line 45 frame_dig 0 // load y#0 from f-stack (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#1 | y#0 y File "unssa/contract.py", line 47 - cover 1 // store x#0 to x-stack (no copy) (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#0,x#1 | x File "unssa/contract.py", line 46 + swap // store x#0 to x-stack (no copy) (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#0,x#1 | x File "unssa/contract.py", line 46 frame_bury 0 // store y#0 to f-stack (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#0 | y File "unssa/contract.py", line 47 b test_swap_while_top@1 // (𝕡) i#0 | (𝕗) y#0 | (𝕏) x#0 | x#0 test_swap_after_while@3: - uncover 1 + swap retsub // x#1 x#1 return x File "unssa/contract.py", line 53 @@ -283,7 +283,7 @@ test_param_update_with_reentrant_entry_block_v2_if_body@3: retsub // x#0 return x File "unssa/contract.py", line 92 -// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> : +// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> void: test_param_update_with_reentrant_entry_block_v3: proto 0 0 // def test_param_update_with_reentrant_entry_block_v3() -> None: File "unssa/contract.py", line 96 @@ -305,7 +305,7 @@ one_block@0: retsub // 1 return UInt64(1) File "unssa/contract.py", line 104 -// examples.unssa.contract.test_swap_args() -> : +// examples.unssa.contract.test_swap_args() -> void: test_swap_args: proto 0 0 // def test_swap_args() -> None: File "unssa/contract.py", line 113 @@ -317,13 +317,13 @@ test_swap_args_block@0: int 234 // a#0,tmp%1#0,234 234 File "unssa/contract.py", line 115 + // a#0,{+} one() + 234 File "unssa/contract.py", line 115 callsub swap_args // {swap_args}.0,{swap_args}.1 swap_args(a, b) File "unssa/contract.py", line 116 - cover 1 // store b#0 to l-stack (no copy) b#0,{swap_args}.0 b File "unssa/contract.py", line 115 + swap // store b#0 to l-stack (no copy) b#0,{swap_args}.0 b File "unssa/contract.py", line 115 int 235 // b#0,a#0,235 235 File "unssa/contract.py", line 117 == // b#0,{==} a == 235, "a == 235" File "unssa/contract.py", line 117 - assert // b#0 assert a == 235, "a == 235" File "unssa/contract.py", line 117 + assert // a == 235 // b#0 assert a == 235, "a == 235" File "unssa/contract.py", line 117 int 124 // b#0,124 124 File "unssa/contract.py", line 118 == // {==} b == 124, "b = 124" File "unssa/contract.py", line 118 - assert // assert b == 124, "b = 124" File "unssa/contract.py", line 118 + assert // b = 124 // assert b == 124, "b = 124" File "unssa/contract.py", line 118 retsub // @@ -365,7 +365,7 @@ test_tuple_swap_for_body@2: test_tuple_swap_after_for@4: frame_dig -3 // load a#0 from parameters (𝕡) a#0,b#0,i#0 | (𝕗) item#0 | (𝕏) b#1 | a#0 b#1 a: UInt64 File "unssa/contract.py", line 71 - uncover 1 // load b#1 from x-stack (𝕡) a#0,b#0,i#0 | (𝕗) item#0 | a#0,b#1 + swap // load b#1 from x-stack (𝕡) a#0,b#0,i#0 | (𝕗) item#0 | a#0,b#1 uncover 2 retsub // a#0,b#1 return a, b File "unssa/contract.py", line 74 diff --git a/examples/unssa/out/contract.approval.teal b/examples/unssa/out/contract.approval.teal index a2f422fdbd..3b8a2bdba1 100644 --- a/examples/unssa/out/contract.approval.teal +++ b/examples/unssa/out/contract.approval.teal @@ -10,7 +10,7 @@ main_block@0: int 1 callsub test_swap dup - cover 1 + swap dup itob log @@ -77,7 +77,7 @@ main_bool_merge@8: int 200 int 0 callsub test_tuple_swap - cover 1 + swap int 100 == assert @@ -88,7 +88,7 @@ main_bool_merge@8: int 200 int 1 callsub test_tuple_swap - cover 1 + swap int 200 == assert @@ -137,7 +137,7 @@ test_self_ref_phi_after_if_else@6: test_self_ref_phi_after_while@7: frame_dig 0 - uncover 1 + swap retsub @@ -148,7 +148,7 @@ test_swap: test_swap_block@0: int 1 int 2 - cover 1 + swap test_swap_while_top@1: frame_dig -1 @@ -162,12 +162,12 @@ test_swap_while_body@2: - frame_bury -1 frame_dig 0 - cover 1 + swap frame_bury 0 b test_swap_while_top@1 test_swap_after_while@3: - uncover 1 + swap retsub @@ -261,7 +261,7 @@ test_param_update_with_reentrant_entry_block_v2_if_body@3: retsub -// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> : +// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> void: test_param_update_with_reentrant_entry_block_v3: proto 0 0 @@ -282,7 +282,7 @@ one_block@0: retsub -// examples.unssa.contract.test_swap_args() -> : +// examples.unssa.contract.test_swap_args() -> void: test_swap_args: proto 0 0 @@ -294,13 +294,13 @@ test_swap_args_block@0: int 234 + callsub swap_args - cover 1 + swap int 235 == - assert + assert // a == 235 int 124 == - assert + assert // b = 124 retsub @@ -340,7 +340,7 @@ test_tuple_swap_for_body@2: test_tuple_swap_after_for@4: frame_dig -3 - uncover 1 + swap uncover 2 retsub diff --git a/examples/unssa/out/contract.approval_unoptimized.debug.teal b/examples/unssa/out/contract.approval_unoptimized.debug.teal index 5464dc47e1..987acac59e 100644 --- a/examples/unssa/out/contract.approval_unoptimized.debug.teal +++ b/examples/unssa/out/contract.approval_unoptimized.debug.teal @@ -12,7 +12,7 @@ main_block@0: int 1 // (𝕗) result2#0 | 1 1 File "unssa/contract.py", line 7 callsub test_swap // (𝕗) result2#0 | {test_swap} test_swap(UInt64(1)) File "unssa/contract.py", line 7 dup // store result1#0 to l-stack (copy) (𝕗) result2#0 | result1#0,result1#0 result1 File "unssa/contract.py", line 7 - cover 1 // store result1#0 to f-stack (𝕗) result2#0,result1#0 | result1#0 result1 File "unssa/contract.py", line 7 + swap // store result1#0 to f-stack (𝕗) result2#0,result1#0 | result1#0 result1 File "unssa/contract.py", line 7 dup // load result1#0 from l-stack (copy) (𝕗) result2#0,result1#0 | result1#0,result1#0 result1 File "unssa/contract.py", line 7 itob // (𝕗) result2#0,result1#0 | result1#0,{itob} itob(result1) File "unssa/contract.py", line 8 log // (𝕗) result2#0,result1#0 | result1#0 log(itob(result1)) File "unssa/contract.py", line 8 @@ -85,7 +85,7 @@ main_bool_merge@8: int 200 // (𝕗) result2#0,result1#0 | 100,200 200 File "unssa/contract.py", line 19 int 0 // (𝕗) result2#0,result1#0 | 100,200,0 0 File "unssa/contract.py", line 19 callsub test_tuple_swap // (𝕗) result2#0,result1#0 | {test_tuple_swap}.0,{test_tuple_swap}.1 test_tuple_swap(UInt64(100), UInt64(200), UInt64(0)) File "unssa/contract.py", line 19 - cover 1 // store tuple_assignment%11#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | tuple_assignment%11#0,{test_tuple_swap}.0 test_tuple_swap(UInt64(100), UInt64(200), UInt64(0)) File "unssa/contract.py", line 19 + swap // store tuple_assignment%11#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | tuple_assignment%11#0,{test_tuple_swap}.0 test_tuple_swap(UInt64(100), UInt64(200), UInt64(0)) File "unssa/contract.py", line 19 int 100 // (𝕗) result2#0,result1#0 | b#0,a#0,100 100 File "unssa/contract.py", line 20 == // (𝕗) result2#0,result1#0 | b#0,{==} a == UInt64(100) File "unssa/contract.py", line 20 assert // (𝕗) result2#0,result1#0 | b#0 assert a == UInt64(100) File "unssa/contract.py", line 20 @@ -96,7 +96,7 @@ main_bool_merge@8: int 200 // (𝕗) result2#0,result1#0 | 100,200 200 File "unssa/contract.py", line 22 int 1 // (𝕗) result2#0,result1#0 | 100,200,1 1 File "unssa/contract.py", line 22 callsub test_tuple_swap // (𝕗) result2#0,result1#0 | {test_tuple_swap}.0,{test_tuple_swap}.1 test_tuple_swap(UInt64(100), UInt64(200), UInt64(1)) File "unssa/contract.py", line 22 - cover 1 // store tuple_assignment%15#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | tuple_assignment%15#0,{test_tuple_swap}.0 test_tuple_swap(UInt64(100), UInt64(200), UInt64(1)) File "unssa/contract.py", line 22 + swap // store tuple_assignment%15#0 to l-stack (no copy) (𝕗) result2#0,result1#0 | tuple_assignment%15#0,{test_tuple_swap}.0 test_tuple_swap(UInt64(100), UInt64(200), UInt64(1)) File "unssa/contract.py", line 22 int 200 // (𝕗) result2#0,result1#0 | b#0,a#0,200 200 File "unssa/contract.py", line 23 == // (𝕗) result2#0,result1#0 | b#0,{==} a == UInt64(200) File "unssa/contract.py", line 23 assert // (𝕗) result2#0,result1#0 | b#0 assert a == UInt64(200) File "unssa/contract.py", line 23 @@ -153,7 +153,7 @@ test_self_ref_phi_after_if_else@6: test_self_ref_phi_after_while@7: frame_dig 0 // load a#0 from f-stack (𝕗) a#0 | a#0 a File "unssa/contract.py", line 34 - uncover 1 + swap retsub // a#0 return a File "unssa/contract.py", line 41 @@ -274,7 +274,7 @@ test_param_update_with_reentrant_entry_block_after_while@5: frame_dig 0 // load x#9 from f-stack (𝕡) x#0 | (𝕗) x#9 | x#9 dup frame_bury -1 // store x#0 to parameters (copy) (𝕡) x#0 | (𝕗) x#9 | x#0 x: UInt64 File "unssa/contract.py", line 78 - uncover 1 + swap retsub // x#0 return x File "unssa/contract.py", line 83 @@ -312,7 +312,7 @@ test_param_update_with_reentrant_entry_block_v2_after_while@5: retsub // x#0 return x File "unssa/contract.py", line 92 -// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> : +// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> void: test_param_update_with_reentrant_entry_block_v3: proto 0 0 // def test_param_update_with_reentrant_entry_block_v3() -> None: File "unssa/contract.py", line 96 @@ -348,7 +348,7 @@ one_block@0: retsub // 1 return UInt64(1) File "unssa/contract.py", line 104 -// examples.unssa.contract.test_swap_args() -> : +// examples.unssa.contract.test_swap_args() -> void: test_swap_args: proto 0 0 // def test_swap_args() -> None: File "unssa/contract.py", line 113 @@ -360,13 +360,13 @@ test_swap_args_block@0: int 234 // a#0,tmp%1#0,234 234 File "unssa/contract.py", line 115 + // a#0,{+} one() + 234 File "unssa/contract.py", line 115 callsub swap_args // {swap_args}.0,{swap_args}.1 swap_args(a, b) File "unssa/contract.py", line 116 - cover 1 // store tuple_assignment%3#0 to l-stack (no copy) tuple_assignment%3#0,{swap_args}.0 swap_args(a, b) File "unssa/contract.py", line 116 + swap // store tuple_assignment%3#0 to l-stack (no copy) tuple_assignment%3#0,{swap_args}.0 swap_args(a, b) File "unssa/contract.py", line 116 int 235 // b#0,a#0,235 235 File "unssa/contract.py", line 117 == // b#0,{==} a == 235, "a == 235" File "unssa/contract.py", line 117 - assert // b#0 assert a == 235, "a == 235" File "unssa/contract.py", line 117 + assert // a == 235 // b#0 assert a == 235, "a == 235" File "unssa/contract.py", line 117 int 124 // b#0,124 124 File "unssa/contract.py", line 118 == // {==} b == 124, "b = 124" File "unssa/contract.py", line 118 - assert // assert b == 124, "b = 124" File "unssa/contract.py", line 118 + assert // b = 124 // assert b == 124, "b = 124" File "unssa/contract.py", line 118 retsub // diff --git a/examples/unssa/out/contract.approval_unoptimized.teal b/examples/unssa/out/contract.approval_unoptimized.teal index f91ea54990..954def7384 100644 --- a/examples/unssa/out/contract.approval_unoptimized.teal +++ b/examples/unssa/out/contract.approval_unoptimized.teal @@ -10,7 +10,7 @@ main_block@0: int 1 callsub test_swap dup - cover 1 + swap dup itob log @@ -77,7 +77,7 @@ main_bool_merge@8: int 200 int 0 callsub test_tuple_swap - cover 1 + swap int 100 == assert @@ -88,7 +88,7 @@ main_bool_merge@8: int 200 int 1 callsub test_tuple_swap - cover 1 + swap int 200 == assert @@ -141,7 +141,7 @@ test_self_ref_phi_after_if_else@6: test_self_ref_phi_after_while@7: frame_dig 0 - uncover 1 + swap retsub @@ -253,7 +253,7 @@ test_param_update_with_reentrant_entry_block_after_while@5: frame_dig 0 dup frame_bury -1 - uncover 1 + swap retsub @@ -288,7 +288,7 @@ test_param_update_with_reentrant_entry_block_v2_after_while@5: retsub -// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> : +// examples.unssa.contract.test_param_update_with_reentrant_entry_block_v3() -> void: test_param_update_with_reentrant_entry_block_v3: proto 0 0 @@ -321,7 +321,7 @@ one_block@0: retsub -// examples.unssa.contract.test_swap_args() -> : +// examples.unssa.contract.test_swap_args() -> void: test_swap_args: proto 0 0 @@ -333,13 +333,13 @@ test_swap_args_block@0: int 234 + callsub swap_args - cover 1 + swap int 235 == - assert + assert // a == 235 int 124 == - assert + assert // b = 124 retsub diff --git a/examples/unssa/out/execution_trace.O0.log b/examples/unssa/out/execution_trace.O0.log index b6f0f65163..007ce3bfb5 100644 --- a/examples/unssa/out/execution_trace.O0.log +++ b/examples/unssa/out/execution_trace.O0.log @@ -1,997 +1,997 @@ PC Teal Stack 1 10 -13 byte "" -14 callsub test_self_ref_phi -134 proto 0 1 -137 int 1 , 1 -138 frame_dig 0 , 1, 1 -140 int 100 , 1, 1, 100 -141 < , 1, 1 -142 bz test_self_ref_phi_after_while@7 , 1 -145 frame_dig 0 , 1, 1 -147 int 105 , 1, 1, 105 -149 % , 1, 1 -150 int 0 , 1, 1, 0 -151 == , 1, 0 -152 bz test_self_ref_phi_after_if_else@4 , 1 -158 frame_dig 0 , 1, 1 -160 int 21 , 1, 1, 21 -162 % , 1, 1 -163 bnz test_self_ref_phi_after_if_else@6 , 1 -169 frame_dig 0 , 1, 1 -171 int 1 , 1, 1, 1 -172 + , 1, 2 -173 frame_bury 0 , 2 -175 b test_self_ref_phi_while_top@1 , 2 -138 frame_dig 0 , 2, 2 -140 int 100 , 2, 2, 100 -141 < , 2, 1 -142 bz test_self_ref_phi_after_while@7 , 2 -145 frame_dig 0 , 2, 2 -147 int 105 , 2, 2, 105 -149 % , 2, 2 -150 int 0 , 2, 2, 0 -151 == , 2, 0 -152 bz test_self_ref_phi_after_if_else@4 , 2 -158 frame_dig 0 , 2, 2 -160 int 21 , 2, 2, 21 -162 % , 2, 2 -163 bnz test_self_ref_phi_after_if_else@6 , 2 -169 frame_dig 0 , 2, 2 -171 int 1 , 2, 2, 1 -172 + , 2, 3 -173 frame_bury 0 , 3 -175 b test_self_ref_phi_while_top@1 , 3 -138 frame_dig 0 , 3, 3 -140 int 100 , 3, 3, 100 -141 < , 3, 1 -142 bz test_self_ref_phi_after_while@7 , 3 -145 frame_dig 0 , 3, 3 -147 int 105 , 3, 3, 105 -149 % , 3, 3 -150 int 0 , 3, 3, 0 -151 == , 3, 0 -152 bz test_self_ref_phi_after_if_else@4 , 3 -158 frame_dig 0 , 3, 3 -160 int 21 , 3, 3, 21 -162 % , 3, 3 -163 bnz test_self_ref_phi_after_if_else@6 , 3 -169 frame_dig 0 , 3, 3 -171 int 1 , 3, 3, 1 -172 + , 3, 4 -173 frame_bury 0 , 4 -175 b test_self_ref_phi_while_top@1 , 4 -138 frame_dig 0 , 4, 4 -140 int 100 , 4, 4, 100 -141 < , 4, 1 -142 bz test_self_ref_phi_after_while@7 , 4 -145 frame_dig 0 , 4, 4 -147 int 105 , 4, 4, 105 -149 % , 4, 4 -150 int 0 , 4, 4, 0 -151 == , 4, 0 -152 bz test_self_ref_phi_after_if_else@4 , 4 -158 frame_dig 0 , 4, 4 -160 int 21 , 4, 4, 21 -162 % , 4, 4 -163 bnz test_self_ref_phi_after_if_else@6 , 4 -169 frame_dig 0 , 4, 4 -171 int 1 , 4, 4, 1 -172 + , 4, 5 -173 frame_bury 0 , 5 -175 b test_self_ref_phi_while_top@1 , 5 -138 frame_dig 0 , 5, 5 -140 int 100 , 5, 5, 100 -141 < , 5, 1 -142 bz test_self_ref_phi_after_while@7 , 5 -145 frame_dig 0 , 5, 5 -147 int 105 , 5, 5, 105 -149 % , 5, 5 -150 int 0 , 5, 5, 0 -151 == , 5, 0 -152 bz test_self_ref_phi_after_if_else@4 , 5 -158 frame_dig 0 , 5, 5 -160 int 21 , 5, 5, 21 -162 % , 5, 5 -163 bnz test_self_ref_phi_after_if_else@6 , 5 -169 frame_dig 0 , 5, 5 -171 int 1 , 5, 5, 1 -172 + , 5, 6 -173 frame_bury 0 , 6 -175 b test_self_ref_phi_while_top@1 , 6 -138 frame_dig 0 , 6, 6 -140 int 100 , 6, 6, 100 -141 < , 6, 1 -142 bz test_self_ref_phi_after_while@7 , 6 -145 frame_dig 0 , 6, 6 -147 int 105 , 6, 6, 105 -149 % , 6, 6 -150 int 0 , 6, 6, 0 -151 == , 6, 0 -152 bz test_self_ref_phi_after_if_else@4 , 6 -158 frame_dig 0 , 6, 6 -160 int 21 , 6, 6, 21 -162 % , 6, 6 -163 bnz test_self_ref_phi_after_if_else@6 , 6 -169 frame_dig 0 , 6, 6 -171 int 1 , 6, 6, 1 -172 + , 6, 7 -173 frame_bury 0 , 7 -175 b test_self_ref_phi_while_top@1 , 7 -138 frame_dig 0 , 7, 7 -140 int 100 , 7, 7, 100 -141 < , 7, 1 -142 bz test_self_ref_phi_after_while@7 , 7 -145 frame_dig 0 , 7, 7 -147 int 105 , 7, 7, 105 -149 % , 7, 7 -150 int 0 , 7, 7, 0 -151 == , 7, 0 -152 bz test_self_ref_phi_after_if_else@4 , 7 -158 frame_dig 0 , 7, 7 -160 int 21 , 7, 7, 21 -162 % , 7, 7 -163 bnz test_self_ref_phi_after_if_else@6 , 7 -169 frame_dig 0 , 7, 7 -171 int 1 , 7, 7, 1 -172 + , 7, 8 -173 frame_bury 0 , 8 -175 b test_self_ref_phi_while_top@1 , 8 -138 frame_dig 0 , 8, 8 -140 int 100 , 8, 8, 100 -141 < , 8, 1 -142 bz test_self_ref_phi_after_while@7 , 8 -145 frame_dig 0 , 8, 8 -147 int 105 , 8, 8, 105 -149 % , 8, 8 -150 int 0 , 8, 8, 0 -151 == , 8, 0 -152 bz test_self_ref_phi_after_if_else@4 , 8 -158 frame_dig 0 , 8, 8 -160 int 21 , 8, 8, 21 -162 % , 8, 8 -163 bnz test_self_ref_phi_after_if_else@6 , 8 -169 frame_dig 0 , 8, 8 -171 int 1 , 8, 8, 1 -172 + , 8, 9 -173 frame_bury 0 , 9 -175 b test_self_ref_phi_while_top@1 , 9 -138 frame_dig 0 , 9, 9 -140 int 100 , 9, 9, 100 -141 < , 9, 1 -142 bz test_self_ref_phi_after_while@7 , 9 -145 frame_dig 0 , 9, 9 -147 int 105 , 9, 9, 105 -149 % , 9, 9 -150 int 0 , 9, 9, 0 -151 == , 9, 0 -152 bz test_self_ref_phi_after_if_else@4 , 9 -158 frame_dig 0 , 9, 9 -160 int 21 , 9, 9, 21 -162 % , 9, 9 -163 bnz test_self_ref_phi_after_if_else@6 , 9 -169 frame_dig 0 , 9, 9 -171 int 1 , 9, 9, 1 -172 + , 9, 10 -173 frame_bury 0 , 10 -175 b test_self_ref_phi_while_top@1 , 10 -138 frame_dig 0 , 10, 10 -140 int 100 , 10, 10, 100 -141 < , 10, 1 -142 bz test_self_ref_phi_after_while@7 , 10 -145 frame_dig 0 , 10, 10 -147 int 105 , 10, 10, 105 -149 % , 10, 10 -150 int 0 , 10, 10, 0 -151 == , 10, 0 -152 bz test_self_ref_phi_after_if_else@4 , 10 -158 frame_dig 0 , 10, 10 -160 int 21 , 10, 10, 21 -162 % , 10, 10 -163 bnz test_self_ref_phi_after_if_else@6 , 10 -169 frame_dig 0 , 10, 10 -171 int 1 , 10, 10, 1 -172 + , 10, 11 -173 frame_bury 0 , 11 -175 b test_self_ref_phi_while_top@1 , 11 -138 frame_dig 0 , 11, 11 -140 int 100 , 11, 11, 100 -141 < , 11, 1 -142 bz test_self_ref_phi_after_while@7 , 11 -145 frame_dig 0 , 11, 11 -147 int 105 , 11, 11, 105 -149 % , 11, 11 -150 int 0 , 11, 11, 0 -151 == , 11, 0 -152 bz test_self_ref_phi_after_if_else@4 , 11 -158 frame_dig 0 , 11, 11 -160 int 21 , 11, 11, 21 -162 % , 11, 11 -163 bnz test_self_ref_phi_after_if_else@6 , 11 -169 frame_dig 0 , 11, 11 -171 int 1 , 11, 11, 1 -172 + , 11, 12 -173 frame_bury 0 , 12 -175 b test_self_ref_phi_while_top@1 , 12 -138 frame_dig 0 , 12, 12 -140 int 100 , 12, 12, 100 -141 < , 12, 1 -142 bz test_self_ref_phi_after_while@7 , 12 -145 frame_dig 0 , 12, 12 -147 int 105 , 12, 12, 105 -149 % , 12, 12 -150 int 0 , 12, 12, 0 -151 == , 12, 0 -152 bz test_self_ref_phi_after_if_else@4 , 12 -158 frame_dig 0 , 12, 12 -160 int 21 , 12, 12, 21 -162 % , 12, 12 -163 bnz test_self_ref_phi_after_if_else@6 , 12 -169 frame_dig 0 , 12, 12 -171 int 1 , 12, 12, 1 -172 + , 12, 13 -173 frame_bury 0 , 13 -175 b test_self_ref_phi_while_top@1 , 13 -138 frame_dig 0 , 13, 13 -140 int 100 , 13, 13, 100 -141 < , 13, 1 -142 bz test_self_ref_phi_after_while@7 , 13 -145 frame_dig 0 , 13, 13 -147 int 105 , 13, 13, 105 -149 % , 13, 13 -150 int 0 , 13, 13, 0 -151 == , 13, 0 -152 bz test_self_ref_phi_after_if_else@4 , 13 -158 frame_dig 0 , 13, 13 -160 int 21 , 13, 13, 21 -162 % , 13, 13 -163 bnz test_self_ref_phi_after_if_else@6 , 13 -169 frame_dig 0 , 13, 13 -171 int 1 , 13, 13, 1 -172 + , 13, 14 -173 frame_bury 0 , 14 -175 b test_self_ref_phi_while_top@1 , 14 -138 frame_dig 0 , 14, 14 -140 int 100 , 14, 14, 100 -141 < , 14, 1 -142 bz test_self_ref_phi_after_while@7 , 14 -145 frame_dig 0 , 14, 14 -147 int 105 , 14, 14, 105 -149 % , 14, 14 -150 int 0 , 14, 14, 0 -151 == , 14, 0 -152 bz test_self_ref_phi_after_if_else@4 , 14 -158 frame_dig 0 , 14, 14 -160 int 21 , 14, 14, 21 -162 % , 14, 14 -163 bnz test_self_ref_phi_after_if_else@6 , 14 -169 frame_dig 0 , 14, 14 -171 int 1 , 14, 14, 1 -172 + , 14, 15 -173 frame_bury 0 , 15 -175 b test_self_ref_phi_while_top@1 , 15 -138 frame_dig 0 , 15, 15 -140 int 100 , 15, 15, 100 -141 < , 15, 1 -142 bz test_self_ref_phi_after_while@7 , 15 -145 frame_dig 0 , 15, 15 -147 int 105 , 15, 15, 105 -149 % , 15, 15 -150 int 0 , 15, 15, 0 -151 == , 15, 0 -152 bz test_self_ref_phi_after_if_else@4 , 15 -158 frame_dig 0 , 15, 15 -160 int 21 , 15, 15, 21 -162 % , 15, 15 -163 bnz test_self_ref_phi_after_if_else@6 , 15 -169 frame_dig 0 , 15, 15 -171 int 1 , 15, 15, 1 -172 + , 15, 16 -173 frame_bury 0 , 16 -175 b test_self_ref_phi_while_top@1 , 16 -138 frame_dig 0 , 16, 16 -140 int 100 , 16, 16, 100 -141 < , 16, 1 -142 bz test_self_ref_phi_after_while@7 , 16 -145 frame_dig 0 , 16, 16 -147 int 105 , 16, 16, 105 -149 % , 16, 16 -150 int 0 , 16, 16, 0 -151 == , 16, 0 -152 bz test_self_ref_phi_after_if_else@4 , 16 -158 frame_dig 0 , 16, 16 -160 int 21 , 16, 16, 21 -162 % , 16, 16 -163 bnz test_self_ref_phi_after_if_else@6 , 16 -169 frame_dig 0 , 16, 16 -171 int 1 , 16, 16, 1 -172 + , 16, 17 -173 frame_bury 0 , 17 -175 b test_self_ref_phi_while_top@1 , 17 -138 frame_dig 0 , 17, 17 -140 int 100 , 17, 17, 100 -141 < , 17, 1 -142 bz test_self_ref_phi_after_while@7 , 17 -145 frame_dig 0 , 17, 17 -147 int 105 , 17, 17, 105 -149 % , 17, 17 -150 int 0 , 17, 17, 0 -151 == , 17, 0 -152 bz test_self_ref_phi_after_if_else@4 , 17 -158 frame_dig 0 , 17, 17 -160 int 21 , 17, 17, 21 -162 % , 17, 17 -163 bnz test_self_ref_phi_after_if_else@6 , 17 -169 frame_dig 0 , 17, 17 -171 int 1 , 17, 17, 1 -172 + , 17, 18 -173 frame_bury 0 , 18 -175 b test_self_ref_phi_while_top@1 , 18 -138 frame_dig 0 , 18, 18 -140 int 100 , 18, 18, 100 -141 < , 18, 1 -142 bz test_self_ref_phi_after_while@7 , 18 -145 frame_dig 0 , 18, 18 -147 int 105 , 18, 18, 105 -149 % , 18, 18 -150 int 0 , 18, 18, 0 -151 == , 18, 0 -152 bz test_self_ref_phi_after_if_else@4 , 18 -158 frame_dig 0 , 18, 18 -160 int 21 , 18, 18, 21 -162 % , 18, 18 -163 bnz test_self_ref_phi_after_if_else@6 , 18 -169 frame_dig 0 , 18, 18 -171 int 1 , 18, 18, 1 -172 + , 18, 19 -173 frame_bury 0 , 19 -175 b test_self_ref_phi_while_top@1 , 19 -138 frame_dig 0 , 19, 19 -140 int 100 , 19, 19, 100 -141 < , 19, 1 -142 bz test_self_ref_phi_after_while@7 , 19 -145 frame_dig 0 , 19, 19 -147 int 105 , 19, 19, 105 -149 % , 19, 19 -150 int 0 , 19, 19, 0 -151 == , 19, 0 -152 bz test_self_ref_phi_after_if_else@4 , 19 -158 frame_dig 0 , 19, 19 -160 int 21 , 19, 19, 21 -162 % , 19, 19 -163 bnz test_self_ref_phi_after_if_else@6 , 19 -169 frame_dig 0 , 19, 19 -171 int 1 , 19, 19, 1 -172 + , 19, 20 -173 frame_bury 0 , 20 -175 b test_self_ref_phi_while_top@1 , 20 -138 frame_dig 0 , 20, 20 -140 int 100 , 20, 20, 100 -141 < , 20, 1 -142 bz test_self_ref_phi_after_while@7 , 20 -145 frame_dig 0 , 20, 20 -147 int 105 , 20, 20, 105 -149 % , 20, 20 -150 int 0 , 20, 20, 0 -151 == , 20, 0 -152 bz test_self_ref_phi_after_if_else@4 , 20 -158 frame_dig 0 , 20, 20 -160 int 21 , 20, 20, 21 -162 % , 20, 20 -163 bnz test_self_ref_phi_after_if_else@6 , 20 -169 frame_dig 0 , 20, 20 -171 int 1 , 20, 20, 1 -172 + , 20, 21 -173 frame_bury 0 , 21 -175 b test_self_ref_phi_while_top@1 , 21 -138 frame_dig 0 , 21, 21 -140 int 100 , 21, 21, 100 -141 < , 21, 1 -142 bz test_self_ref_phi_after_while@7 , 21 -145 frame_dig 0 , 21, 21 -147 int 105 , 21, 21, 105 -149 % , 21, 21 -150 int 0 , 21, 21, 0 -151 == , 21, 0 -152 bz test_self_ref_phi_after_if_else@4 , 21 -158 frame_dig 0 , 21, 21 -160 int 21 , 21, 21, 21 -162 % , 21, 0 -163 bnz test_self_ref_phi_after_if_else@6 , 21 -166 b test_self_ref_phi_after_while@7 , 21 -178 frame_dig 0 , 21, 21 -180 uncover 1 , 21, 21 -182 retsub , 21 -17 pop -18 int 1 , 1 -19 callsub test_swap , 1 -183 proto 1 1 , 1 -186 int 1 , 1, 1 -187 int 2 , 1, 1, 2 -188 frame_dig -1 , 1, 1, 2, 1 -190 int 0 , 1, 1, 2, 1, 0 -191 > , 1, 1, 2, 1 -192 bz test_swap_after_while@3 , 1, 1, 2 -195 frame_dig 0 , 1, 1, 2, 1 -197 frame_dig 1 , 1, 1, 2, 1, 2 -199 frame_bury 0 , 1, 2, 2, 1 -201 frame_bury 1 , 1, 2, 1 -203 frame_dig -1 , 1, 2, 1, 1 -205 int 1 , 1, 2, 1, 1, 1 -206 - , 1, 2, 1, 0 -207 frame_bury -1 , 0, 2, 1 -209 b test_swap_while_top@1 , 0, 2, 1 -188 frame_dig -1 , 0, 2, 1, 0 -190 int 0 , 0, 2, 1, 0, 0 -191 > , 0, 2, 1, 0 -192 bz test_swap_after_while@3 , 0, 2, 1 -212 retsub , 2 -22 dup , 2, 2 -23 cover 1 , 2, 2 -25 dup , 2, 2, 2 -26 itob , 2, 2, AAAAAAAAAAI= -27 log , 2, 2 -28 int 1 , 2, 2, 1 -29 >= , 2, 1 -30 bz main_bool_false@3 , 2 -33 dup , 2, 2 -34 int 2 , 2, 2, 2 -35 <= , 2, 1 -36 bz main_bool_false@3 , 2 -39 int 1 , 2, 1 -40 b main_bool_merge@4 , 2, 1 -44 assert , 2 -45 int 2 , 2, 2 -46 callsub test_swap , 2, 2 -183 proto 1 1 , 2, 2 -186 int 1 , 2, 2, 1 -187 int 2 , 2, 2, 1, 2 -188 frame_dig -1 , 2, 2, 1, 2, 2 -190 int 0 , 2, 2, 1, 2, 2, 0 -191 > , 2, 2, 1, 2, 1 -192 bz test_swap_after_while@3 , 2, 2, 1, 2 -195 frame_dig 0 , 2, 2, 1, 2, 1 -197 frame_dig 1 , 2, 2, 1, 2, 1, 2 -199 frame_bury 0 , 2, 2, 2, 2, 1 -201 frame_bury 1 , 2, 2, 2, 1 -203 frame_dig -1 , 2, 2, 2, 1, 2 -205 int 1 , 2, 2, 2, 1, 2, 1 -206 - , 2, 2, 2, 1, 1 -207 frame_bury -1 , 2, 1, 2, 1 -209 b test_swap_while_top@1 , 2, 1, 2, 1 -188 frame_dig -1 , 2, 1, 2, 1, 1 -190 int 0 , 2, 1, 2, 1, 1, 0 -191 > , 2, 1, 2, 1, 1 -192 bz test_swap_after_while@3 , 2, 1, 2, 1 -195 frame_dig 0 , 2, 1, 2, 1, 2 -197 frame_dig 1 , 2, 1, 2, 1, 2, 1 -199 frame_bury 0 , 2, 1, 1, 1, 2 -201 frame_bury 1 , 2, 1, 1, 2 -203 frame_dig -1 , 2, 1, 1, 2, 1 -205 int 1 , 2, 1, 1, 2, 1, 1 -206 - , 2, 1, 1, 2, 0 -207 frame_bury -1 , 2, 0, 1, 2 -209 b test_swap_while_top@1 , 2, 0, 1, 2 -188 frame_dig -1 , 2, 0, 1, 2, 0 -190 int 0 , 2, 0, 1, 2, 0, 0 -191 > , 2, 0, 1, 2, 0 -192 bz test_swap_after_while@3 , 2, 0, 1, 2 -212 retsub , 2, 1 -49 dup , 2, 1, 1 -50 bury 3 1, 2, 1 -52 dup 1, 2, 1, 1 -53 itob 1, 2, 1, AAAAAAAAAAE= -54 log 1, 2, 1 -55 int 1 1, 2, 1, 1 -56 >= 1, 2, 1 -57 bz main_bool_false@7 1, 2 -60 dig 1 1, 2, 1 -62 int 2 1, 2, 1, 2 -63 <= 1, 2, 1 -64 bz main_bool_false@7 1, 2 -67 int 1 1, 2, 1 -68 b main_bool_merge@8 1, 2, 1 -72 assert 1, 2 -73 int 7 1, 2, 7 -75 int 11 1, 2, 7, 11 -77 callsub test_swap_loop 1, 2, 7, 11 -213 proto 2 1 1, 2, 7, 11 -216 int 1 1, 2, 7, 11, 1 -217 int 2 1, 2, 7, 11, 1, 2 -218 frame_dig -2 1, 2, 7, 11, 1, 2, 7 -220 int 0 1, 2, 7, 11, 1, 2, 7, 0 -221 > 1, 2, 7, 11, 1, 2, 1 -222 bz test_swap_loop_after_while@6 1, 2, 7, 11, 1, 2 -225 frame_dig -1 1, 2, 7, 11, 1, 2, 11 -227 int 0 1, 2, 7, 11, 1, 2, 11, 0 -228 > 1, 2, 7, 11, 1, 2, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 11, 1, 2 -232 frame_dig 0 1, 2, 7, 11, 1, 2, 1 -234 frame_dig 1 1, 2, 7, 11, 1, 2, 1, 2 -236 frame_bury 0 1, 2, 7, 11, 2, 2, 1 -238 frame_bury 1 1, 2, 7, 11, 2, 1 -240 frame_dig -1 1, 2, 7, 11, 2, 1, 11 -242 int 1 1, 2, 7, 11, 2, 1, 11, 1 -243 - 1, 2, 7, 11, 2, 1, 10 -244 frame_bury -1 1, 2, 7, 10, 2, 1 -246 b test_swap_loop_while_top@3 1, 2, 7, 10, 2, 1 -225 frame_dig -1 1, 2, 7, 10, 2, 1, 10 -227 int 0 1, 2, 7, 10, 2, 1, 10, 0 -228 > 1, 2, 7, 10, 2, 1, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 10, 2, 1 -232 frame_dig 0 1, 2, 7, 10, 2, 1, 2 -234 frame_dig 1 1, 2, 7, 10, 2, 1, 2, 1 -236 frame_bury 0 1, 2, 7, 10, 1, 1, 2 -238 frame_bury 1 1, 2, 7, 10, 1, 2 -240 frame_dig -1 1, 2, 7, 10, 1, 2, 10 -242 int 1 1, 2, 7, 10, 1, 2, 10, 1 -243 - 1, 2, 7, 10, 1, 2, 9 -244 frame_bury -1 1, 2, 7, 9, 1, 2 -246 b test_swap_loop_while_top@3 1, 2, 7, 9, 1, 2 -225 frame_dig -1 1, 2, 7, 9, 1, 2, 9 -227 int 0 1, 2, 7, 9, 1, 2, 9, 0 -228 > 1, 2, 7, 9, 1, 2, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 9, 1, 2 -232 frame_dig 0 1, 2, 7, 9, 1, 2, 1 -234 frame_dig 1 1, 2, 7, 9, 1, 2, 1, 2 -236 frame_bury 0 1, 2, 7, 9, 2, 2, 1 -238 frame_bury 1 1, 2, 7, 9, 2, 1 -240 frame_dig -1 1, 2, 7, 9, 2, 1, 9 -242 int 1 1, 2, 7, 9, 2, 1, 9, 1 -243 - 1, 2, 7, 9, 2, 1, 8 -244 frame_bury -1 1, 2, 7, 8, 2, 1 -246 b test_swap_loop_while_top@3 1, 2, 7, 8, 2, 1 -225 frame_dig -1 1, 2, 7, 8, 2, 1, 8 -227 int 0 1, 2, 7, 8, 2, 1, 8, 0 -228 > 1, 2, 7, 8, 2, 1, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 8, 2, 1 -232 frame_dig 0 1, 2, 7, 8, 2, 1, 2 -234 frame_dig 1 1, 2, 7, 8, 2, 1, 2, 1 -236 frame_bury 0 1, 2, 7, 8, 1, 1, 2 -238 frame_bury 1 1, 2, 7, 8, 1, 2 -240 frame_dig -1 1, 2, 7, 8, 1, 2, 8 -242 int 1 1, 2, 7, 8, 1, 2, 8, 1 -243 - 1, 2, 7, 8, 1, 2, 7 -244 frame_bury -1 1, 2, 7, 7, 1, 2 -246 b test_swap_loop_while_top@3 1, 2, 7, 7, 1, 2 -225 frame_dig -1 1, 2, 7, 7, 1, 2, 7 -227 int 0 1, 2, 7, 7, 1, 2, 7, 0 -228 > 1, 2, 7, 7, 1, 2, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 7, 1, 2 -232 frame_dig 0 1, 2, 7, 7, 1, 2, 1 -234 frame_dig 1 1, 2, 7, 7, 1, 2, 1, 2 -236 frame_bury 0 1, 2, 7, 7, 2, 2, 1 -238 frame_bury 1 1, 2, 7, 7, 2, 1 -240 frame_dig -1 1, 2, 7, 7, 2, 1, 7 -242 int 1 1, 2, 7, 7, 2, 1, 7, 1 -243 - 1, 2, 7, 7, 2, 1, 6 -244 frame_bury -1 1, 2, 7, 6, 2, 1 -246 b test_swap_loop_while_top@3 1, 2, 7, 6, 2, 1 -225 frame_dig -1 1, 2, 7, 6, 2, 1, 6 -227 int 0 1, 2, 7, 6, 2, 1, 6, 0 -228 > 1, 2, 7, 6, 2, 1, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 6, 2, 1 -232 frame_dig 0 1, 2, 7, 6, 2, 1, 2 -234 frame_dig 1 1, 2, 7, 6, 2, 1, 2, 1 -236 frame_bury 0 1, 2, 7, 6, 1, 1, 2 -238 frame_bury 1 1, 2, 7, 6, 1, 2 -240 frame_dig -1 1, 2, 7, 6, 1, 2, 6 -242 int 1 1, 2, 7, 6, 1, 2, 6, 1 -243 - 1, 2, 7, 6, 1, 2, 5 -244 frame_bury -1 1, 2, 7, 5, 1, 2 -246 b test_swap_loop_while_top@3 1, 2, 7, 5, 1, 2 -225 frame_dig -1 1, 2, 7, 5, 1, 2, 5 -227 int 0 1, 2, 7, 5, 1, 2, 5, 0 -228 > 1, 2, 7, 5, 1, 2, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 5, 1, 2 -232 frame_dig 0 1, 2, 7, 5, 1, 2, 1 -234 frame_dig 1 1, 2, 7, 5, 1, 2, 1, 2 -236 frame_bury 0 1, 2, 7, 5, 2, 2, 1 -238 frame_bury 1 1, 2, 7, 5, 2, 1 -240 frame_dig -1 1, 2, 7, 5, 2, 1, 5 -242 int 1 1, 2, 7, 5, 2, 1, 5, 1 -243 - 1, 2, 7, 5, 2, 1, 4 -244 frame_bury -1 1, 2, 7, 4, 2, 1 -246 b test_swap_loop_while_top@3 1, 2, 7, 4, 2, 1 -225 frame_dig -1 1, 2, 7, 4, 2, 1, 4 -227 int 0 1, 2, 7, 4, 2, 1, 4, 0 -228 > 1, 2, 7, 4, 2, 1, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 4, 2, 1 -232 frame_dig 0 1, 2, 7, 4, 2, 1, 2 -234 frame_dig 1 1, 2, 7, 4, 2, 1, 2, 1 -236 frame_bury 0 1, 2, 7, 4, 1, 1, 2 -238 frame_bury 1 1, 2, 7, 4, 1, 2 -240 frame_dig -1 1, 2, 7, 4, 1, 2, 4 -242 int 1 1, 2, 7, 4, 1, 2, 4, 1 -243 - 1, 2, 7, 4, 1, 2, 3 -244 frame_bury -1 1, 2, 7, 3, 1, 2 -246 b test_swap_loop_while_top@3 1, 2, 7, 3, 1, 2 -225 frame_dig -1 1, 2, 7, 3, 1, 2, 3 -227 int 0 1, 2, 7, 3, 1, 2, 3, 0 -228 > 1, 2, 7, 3, 1, 2, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 3, 1, 2 -232 frame_dig 0 1, 2, 7, 3, 1, 2, 1 -234 frame_dig 1 1, 2, 7, 3, 1, 2, 1, 2 -236 frame_bury 0 1, 2, 7, 3, 2, 2, 1 -238 frame_bury 1 1, 2, 7, 3, 2, 1 -240 frame_dig -1 1, 2, 7, 3, 2, 1, 3 -242 int 1 1, 2, 7, 3, 2, 1, 3, 1 -243 - 1, 2, 7, 3, 2, 1, 2 -244 frame_bury -1 1, 2, 7, 2, 2, 1 -246 b test_swap_loop_while_top@3 1, 2, 7, 2, 2, 1 -225 frame_dig -1 1, 2, 7, 2, 2, 1, 2 -227 int 0 1, 2, 7, 2, 2, 1, 2, 0 -228 > 1, 2, 7, 2, 2, 1, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 2, 2, 1 -232 frame_dig 0 1, 2, 7, 2, 2, 1, 2 -234 frame_dig 1 1, 2, 7, 2, 2, 1, 2, 1 -236 frame_bury 0 1, 2, 7, 2, 1, 1, 2 -238 frame_bury 1 1, 2, 7, 2, 1, 2 -240 frame_dig -1 1, 2, 7, 2, 1, 2, 2 -242 int 1 1, 2, 7, 2, 1, 2, 2, 1 -243 - 1, 2, 7, 2, 1, 2, 1 -244 frame_bury -1 1, 2, 7, 1, 1, 2 -246 b test_swap_loop_while_top@3 1, 2, 7, 1, 1, 2 -225 frame_dig -1 1, 2, 7, 1, 1, 2, 1 -227 int 0 1, 2, 7, 1, 1, 2, 1, 0 -228 > 1, 2, 7, 1, 1, 2, 1 -229 bz test_swap_loop_after_while@5 1, 2, 7, 1, 1, 2 -232 frame_dig 0 1, 2, 7, 1, 1, 2, 1 -234 frame_dig 1 1, 2, 7, 1, 1, 2, 1, 2 -236 frame_bury 0 1, 2, 7, 1, 2, 2, 1 -238 frame_bury 1 1, 2, 7, 1, 2, 1 -240 frame_dig -1 1, 2, 7, 1, 2, 1, 1 -242 int 1 1, 2, 7, 1, 2, 1, 1, 1 -243 - 1, 2, 7, 1, 2, 1, 0 -244 frame_bury -1 1, 2, 7, 0, 2, 1 -246 b test_swap_loop_while_top@3 1, 2, 7, 0, 2, 1 -225 frame_dig -1 1, 2, 7, 0, 2, 1, 0 -227 int 0 1, 2, 7, 0, 2, 1, 0, 0 -228 > 1, 2, 7, 0, 2, 1, 0 -229 bz test_swap_loop_after_while@5 1, 2, 7, 0, 2, 1 -249 frame_dig -2 1, 2, 7, 0, 2, 1, 7 -251 int 1 1, 2, 7, 0, 2, 1, 7, 1 -252 - 1, 2, 7, 0, 2, 1, 6 -253 frame_bury -2 1, 2, 6, 0, 2, 1 -255 b test_swap_loop_while_top@1 1, 2, 6, 0, 2, 1 -218 frame_dig -2 1, 2, 6, 0, 2, 1, 6 -220 int 0 1, 2, 6, 0, 2, 1, 6, 0 -221 > 1, 2, 6, 0, 2, 1, 1 -222 bz test_swap_loop_after_while@6 1, 2, 6, 0, 2, 1 -225 frame_dig -1 1, 2, 6, 0, 2, 1, 0 -227 int 0 1, 2, 6, 0, 2, 1, 0, 0 -228 > 1, 2, 6, 0, 2, 1, 0 -229 bz test_swap_loop_after_while@5 1, 2, 6, 0, 2, 1 -249 frame_dig -2 1, 2, 6, 0, 2, 1, 6 -251 int 1 1, 2, 6, 0, 2, 1, 6, 1 -252 - 1, 2, 6, 0, 2, 1, 5 -253 frame_bury -2 1, 2, 5, 0, 2, 1 -255 b test_swap_loop_while_top@1 1, 2, 5, 0, 2, 1 -218 frame_dig -2 1, 2, 5, 0, 2, 1, 5 -220 int 0 1, 2, 5, 0, 2, 1, 5, 0 -221 > 1, 2, 5, 0, 2, 1, 1 -222 bz test_swap_loop_after_while@6 1, 2, 5, 0, 2, 1 -225 frame_dig -1 1, 2, 5, 0, 2, 1, 0 -227 int 0 1, 2, 5, 0, 2, 1, 0, 0 -228 > 1, 2, 5, 0, 2, 1, 0 -229 bz test_swap_loop_after_while@5 1, 2, 5, 0, 2, 1 -249 frame_dig -2 1, 2, 5, 0, 2, 1, 5 -251 int 1 1, 2, 5, 0, 2, 1, 5, 1 -252 - 1, 2, 5, 0, 2, 1, 4 -253 frame_bury -2 1, 2, 4, 0, 2, 1 -255 b test_swap_loop_while_top@1 1, 2, 4, 0, 2, 1 -218 frame_dig -2 1, 2, 4, 0, 2, 1, 4 -220 int 0 1, 2, 4, 0, 2, 1, 4, 0 -221 > 1, 2, 4, 0, 2, 1, 1 -222 bz test_swap_loop_after_while@6 1, 2, 4, 0, 2, 1 -225 frame_dig -1 1, 2, 4, 0, 2, 1, 0 -227 int 0 1, 2, 4, 0, 2, 1, 0, 0 -228 > 1, 2, 4, 0, 2, 1, 0 -229 bz test_swap_loop_after_while@5 1, 2, 4, 0, 2, 1 -249 frame_dig -2 1, 2, 4, 0, 2, 1, 4 -251 int 1 1, 2, 4, 0, 2, 1, 4, 1 -252 - 1, 2, 4, 0, 2, 1, 3 -253 frame_bury -2 1, 2, 3, 0, 2, 1 -255 b test_swap_loop_while_top@1 1, 2, 3, 0, 2, 1 -218 frame_dig -2 1, 2, 3, 0, 2, 1, 3 -220 int 0 1, 2, 3, 0, 2, 1, 3, 0 -221 > 1, 2, 3, 0, 2, 1, 1 -222 bz test_swap_loop_after_while@6 1, 2, 3, 0, 2, 1 -225 frame_dig -1 1, 2, 3, 0, 2, 1, 0 -227 int 0 1, 2, 3, 0, 2, 1, 0, 0 -228 > 1, 2, 3, 0, 2, 1, 0 -229 bz test_swap_loop_after_while@5 1, 2, 3, 0, 2, 1 -249 frame_dig -2 1, 2, 3, 0, 2, 1, 3 -251 int 1 1, 2, 3, 0, 2, 1, 3, 1 -252 - 1, 2, 3, 0, 2, 1, 2 -253 frame_bury -2 1, 2, 2, 0, 2, 1 -255 b test_swap_loop_while_top@1 1, 2, 2, 0, 2, 1 -218 frame_dig -2 1, 2, 2, 0, 2, 1, 2 -220 int 0 1, 2, 2, 0, 2, 1, 2, 0 -221 > 1, 2, 2, 0, 2, 1, 1 -222 bz test_swap_loop_after_while@6 1, 2, 2, 0, 2, 1 -225 frame_dig -1 1, 2, 2, 0, 2, 1, 0 -227 int 0 1, 2, 2, 0, 2, 1, 0, 0 -228 > 1, 2, 2, 0, 2, 1, 0 -229 bz test_swap_loop_after_while@5 1, 2, 2, 0, 2, 1 -249 frame_dig -2 1, 2, 2, 0, 2, 1, 2 -251 int 1 1, 2, 2, 0, 2, 1, 2, 1 -252 - 1, 2, 2, 0, 2, 1, 1 -253 frame_bury -2 1, 2, 1, 0, 2, 1 -255 b test_swap_loop_while_top@1 1, 2, 1, 0, 2, 1 -218 frame_dig -2 1, 2, 1, 0, 2, 1, 1 -220 int 0 1, 2, 1, 0, 2, 1, 1, 0 -221 > 1, 2, 1, 0, 2, 1, 1 -222 bz test_swap_loop_after_while@6 1, 2, 1, 0, 2, 1 -225 frame_dig -1 1, 2, 1, 0, 2, 1, 0 -227 int 0 1, 2, 1, 0, 2, 1, 0, 0 -228 > 1, 2, 1, 0, 2, 1, 0 -229 bz test_swap_loop_after_while@5 1, 2, 1, 0, 2, 1 -249 frame_dig -2 1, 2, 1, 0, 2, 1, 1 -251 int 1 1, 2, 1, 0, 2, 1, 1, 1 -252 - 1, 2, 1, 0, 2, 1, 0 -253 frame_bury -2 1, 2, 0, 0, 2, 1 -255 b test_swap_loop_while_top@1 1, 2, 0, 0, 2, 1 -218 frame_dig -2 1, 2, 0, 0, 2, 1, 0 -220 int 0 1, 2, 0, 0, 2, 1, 0, 0 -221 > 1, 2, 0, 0, 2, 1, 0 -222 bz test_swap_loop_after_while@6 1, 2, 0, 0, 2, 1 -258 retsub 1, 2, 2 -80 pop 1, 2 -81 int 0 1, 2, 0 -82 callsub test_param_update_with_reentrant_entry_block 1, 2, 0 -259 proto 1 1 1, 2, 0 -262 byte "" 1, 2, 0, -263 frame_dig -1 1, 2, 0, , 0 -265 frame_bury 0 1, 2, 0, 0 -267 int 1 1, 2, 0, 0, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 0, 0 -271 frame_dig -1 1, 2, 0, 0, 0 -273 int 1 1, 2, 0, 0, 0, 1 -274 + 1, 2, 0, 0, 1 -275 dup 1, 2, 0, 0, 1, 1 -276 frame_bury -1 1, 2, 1, 0, 1 -278 int 10 1, 2, 1, 0, 1, 10 -280 >= 1, 2, 1, 0, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 1, 0 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 1, 0 -263 frame_dig -1 1, 2, 1, 0, 1 -265 frame_bury 0 1, 2, 1, 1 -267 int 1 1, 2, 1, 1, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 1, 1 -271 frame_dig -1 1, 2, 1, 1, 1 -273 int 1 1, 2, 1, 1, 1, 1 -274 + 1, 2, 1, 1, 2 -275 dup 1, 2, 1, 1, 2, 2 -276 frame_bury -1 1, 2, 2, 1, 2 -278 int 10 1, 2, 2, 1, 2, 10 -280 >= 1, 2, 2, 1, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 2, 1 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 2, 1 -263 frame_dig -1 1, 2, 2, 1, 2 -265 frame_bury 0 1, 2, 2, 2 -267 int 1 1, 2, 2, 2, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 2, 2 -271 frame_dig -1 1, 2, 2, 2, 2 -273 int 1 1, 2, 2, 2, 2, 1 -274 + 1, 2, 2, 2, 3 -275 dup 1, 2, 2, 2, 3, 3 -276 frame_bury -1 1, 2, 3, 2, 3 -278 int 10 1, 2, 3, 2, 3, 10 -280 >= 1, 2, 3, 2, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 3, 2 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 3, 2 -263 frame_dig -1 1, 2, 3, 2, 3 -265 frame_bury 0 1, 2, 3, 3 -267 int 1 1, 2, 3, 3, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 3, 3 -271 frame_dig -1 1, 2, 3, 3, 3 -273 int 1 1, 2, 3, 3, 3, 1 -274 + 1, 2, 3, 3, 4 -275 dup 1, 2, 3, 3, 4, 4 -276 frame_bury -1 1, 2, 4, 3, 4 -278 int 10 1, 2, 4, 3, 4, 10 -280 >= 1, 2, 4, 3, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 4, 3 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 4, 3 -263 frame_dig -1 1, 2, 4, 3, 4 -265 frame_bury 0 1, 2, 4, 4 -267 int 1 1, 2, 4, 4, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 4, 4 -271 frame_dig -1 1, 2, 4, 4, 4 -273 int 1 1, 2, 4, 4, 4, 1 -274 + 1, 2, 4, 4, 5 -275 dup 1, 2, 4, 4, 5, 5 -276 frame_bury -1 1, 2, 5, 4, 5 -278 int 10 1, 2, 5, 4, 5, 10 -280 >= 1, 2, 5, 4, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 5, 4 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 5, 4 -263 frame_dig -1 1, 2, 5, 4, 5 -265 frame_bury 0 1, 2, 5, 5 -267 int 1 1, 2, 5, 5, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 5, 5 -271 frame_dig -1 1, 2, 5, 5, 5 -273 int 1 1, 2, 5, 5, 5, 1 -274 + 1, 2, 5, 5, 6 -275 dup 1, 2, 5, 5, 6, 6 -276 frame_bury -1 1, 2, 6, 5, 6 -278 int 10 1, 2, 6, 5, 6, 10 -280 >= 1, 2, 6, 5, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 6, 5 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 6, 5 -263 frame_dig -1 1, 2, 6, 5, 6 -265 frame_bury 0 1, 2, 6, 6 -267 int 1 1, 2, 6, 6, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 6, 6 -271 frame_dig -1 1, 2, 6, 6, 6 -273 int 1 1, 2, 6, 6, 6, 1 -274 + 1, 2, 6, 6, 7 -275 dup 1, 2, 6, 6, 7, 7 -276 frame_bury -1 1, 2, 7, 6, 7 -278 int 10 1, 2, 7, 6, 7, 10 -280 >= 1, 2, 7, 6, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 7, 6 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 7, 6 -263 frame_dig -1 1, 2, 7, 6, 7 -265 frame_bury 0 1, 2, 7, 7 -267 int 1 1, 2, 7, 7, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 7, 7 -271 frame_dig -1 1, 2, 7, 7, 7 -273 int 1 1, 2, 7, 7, 7, 1 -274 + 1, 2, 7, 7, 8 -275 dup 1, 2, 7, 7, 8, 8 -276 frame_bury -1 1, 2, 8, 7, 8 -278 int 10 1, 2, 8, 7, 8, 10 -280 >= 1, 2, 8, 7, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 8, 7 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 8, 7 -263 frame_dig -1 1, 2, 8, 7, 8 -265 frame_bury 0 1, 2, 8, 8 -267 int 1 1, 2, 8, 8, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 8, 8 -271 frame_dig -1 1, 2, 8, 8, 8 -273 int 1 1, 2, 8, 8, 8, 1 -274 + 1, 2, 8, 8, 9 -275 dup 1, 2, 8, 8, 9, 9 -276 frame_bury -1 1, 2, 9, 8, 9 -278 int 10 1, 2, 9, 8, 9, 10 -280 >= 1, 2, 9, 8, 0 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 9, 8 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 9, 8 -263 frame_dig -1 1, 2, 9, 8, 9 -265 frame_bury 0 1, 2, 9, 9 -267 int 1 1, 2, 9, 9, 1 -268 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 9, 9 -271 frame_dig -1 1, 2, 9, 9, 9 -273 int 1 1, 2, 9, 9, 9, 1 -274 + 1, 2, 9, 9, 10 -275 dup 1, 2, 9, 9, 10, 10 -276 frame_bury -1 1, 2, 10, 9, 10 -278 int 10 1, 2, 10, 9, 10, 10 -280 >= 1, 2, 10, 9, 1 -281 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 10, 9 -284 frame_dig -1 1, 2, 10, 9, 10 -286 frame_bury 0 1, 2, 10, 10 -288 b test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 10, 10 -294 frame_dig 0 1, 2, 10, 10, 10 -296 dup 1, 2, 10, 10, 10, 10 -297 frame_bury -1 1, 2, 10, 10, 10 -299 uncover 1 1, 2, 10, 10, 10 -301 retsub 1, 2, 10 -85 int 10 1, 2, 10, 10 -87 == 1, 2, 1 -88 assert 1, 2 -89 int 0 1, 2, 0 -90 callsub test_param_update_with_reentrant_entry_block_v2 1, 2, 0 -302 proto 1 1 1, 2, 0 -305 frame_dig -1 1, 2, 0, 0 -307 int 1 1, 2, 0, 0, 1 -308 + 1, 2, 0, 1 -309 frame_bury -1 1, 2, 1 -311 int 1 1, 2, 1, 1 -312 bz test_param_update_with_reentrant_entry_block_v2_after_while@5 1, 2, 1 -315 frame_dig -1 1, 2, 1, 1 -317 int 1 1, 2, 1, 1, 1 -318 >= 1, 2, 1, 1 -319 bz test_param_update_with_reentrant_entry_block_v2_after_if_else@4 1, 2, 1 -322 b test_param_update_with_reentrant_entry_block_v2_after_while@5 1, 2, 1 -328 frame_dig -1 1, 2, 1, 1 -330 retsub 1, 2, 1 -93 pop 1, 2 -94 callsub test_param_update_with_reentrant_entry_block_v3 1, 2 -331 proto 0 0 1, 2 -334 int 1 1, 2, 1 -335 bz test_param_update_with_reentrant_entry_block_v3_after_while@5 1, 2 -338 callsub one 1, 2 -351 proto 0 1 1, 2 -354 int 1 1, 2, 1 -355 retsub 1, 2, 1 -341 bz test_param_update_with_reentrant_entry_block_v3_after_if_else@4 1, 2 -344 b test_param_update_with_reentrant_entry_block_v3_after_while@5 1, 2 -350 retsub 1, 2 -97 callsub test_swap_args 1, 2 -356 proto 0 0 1, 2 -359 callsub one 1, 2 -351 proto 0 1 1, 2 -354 int 1 1, 2, 1 -355 retsub 1, 2, 1 -362 int 123 1, 2, 1, 123 -364 + 1, 2, 124 -365 callsub one 1, 2, 124 -351 proto 0 1 1, 2, 124 -354 int 1 1, 2, 124, 1 -355 retsub 1, 2, 124, 1 -368 int 234 1, 2, 124, 1, 234 -371 + 1, 2, 124, 235 -372 callsub swap_args 1, 2, 124, 235 -387 proto 2 2 1, 2, 124, 235 -390 frame_dig -1 1, 2, 124, 235, 235 -392 frame_dig -2 1, 2, 124, 235, 235, 124 -394 retsub 1, 2, 235, 124 -375 cover 1 1, 2, 124, 235 -377 int 235 1, 2, 124, 235, 235 -380 == 1, 2, 124, 1 -381 assert 1, 2, 124 -382 int 124 1, 2, 124, 124 -384 == 1, 2, 1 -385 assert 1, 2 -386 retsub 1, 2 -100 int 100 1, 2, 100 -101 int 200 1, 2, 100, 200 -103 int 0 1, 2, 100, 200, 0 -104 callsub test_tuple_swap 1, 2, 100, 200, 0 -395 proto 3 2 1, 2, 100, 200, 0 -398 int 0 1, 2, 100, 200, 0, 0 -399 frame_dig 0 1, 2, 100, 200, 0, 0, 0 -401 frame_dig -1 1, 2, 100, 200, 0, 0, 0, 0 -403 < 1, 2, 100, 200, 0, 0, 0 -404 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 0, 0 -424 frame_dig -3 1, 2, 100, 200, 0, 0, 100 -426 frame_dig -2 1, 2, 100, 200, 0, 0, 100, 200 -428 uncover 2 1, 2, 100, 200, 0, 100, 200, 0 -430 retsub 1, 2, 100, 200 -107 cover 1 1, 2, 200, 100 -109 int 100 1, 2, 200, 100, 100 -110 == 1, 2, 200, 1 -111 assert 1, 2, 200 -112 int 200 1, 2, 200, 200 -114 == 1, 2, 1 -115 assert 1, 2 -116 int 100 1, 2, 100 -117 int 200 1, 2, 100, 200 -119 int 1 1, 2, 100, 200, 1 -120 callsub test_tuple_swap 1, 2, 100, 200, 1 -395 proto 3 2 1, 2, 100, 200, 1 -398 int 0 1, 2, 100, 200, 1, 0 -399 frame_dig 0 1, 2, 100, 200, 1, 0, 0 -401 frame_dig -1 1, 2, 100, 200, 1, 0, 0, 1 -403 < 1, 2, 100, 200, 1, 0, 1 -404 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 1, 0 -407 frame_dig -2 1, 2, 100, 200, 1, 0, 200 -409 frame_dig -3 1, 2, 100, 200, 1, 0, 200, 100 -411 frame_bury -2 1, 2, 100, 100, 1, 0, 200 -413 frame_dig 0 1, 2, 100, 100, 1, 0, 200, 0 -415 int 1 1, 2, 100, 100, 1, 0, 200, 0, 1 -416 + 1, 2, 100, 100, 1, 0, 200, 1 -417 frame_bury 0 1, 2, 100, 100, 1, 1, 200 -419 frame_bury -3 1, 2, 200, 100, 1, 1 -421 b test_tuple_swap_for_header@1 1, 2, 200, 100, 1, 1 -399 frame_dig 0 1, 2, 200, 100, 1, 1, 1 -401 frame_dig -1 1, 2, 200, 100, 1, 1, 1, 1 -403 < 1, 2, 200, 100, 1, 1, 0 -404 bz test_tuple_swap_after_for@4 1, 2, 200, 100, 1, 1 -424 frame_dig -3 1, 2, 200, 100, 1, 1, 200 -426 frame_dig -2 1, 2, 200, 100, 1, 1, 200, 100 -428 uncover 2 1, 2, 200, 100, 1, 200, 100, 1 -430 retsub 1, 2, 200, 100 -123 cover 1 1, 2, 100, 200 -125 int 200 1, 2, 100, 200, 200 -127 == 1, 2, 100, 1 -128 assert 1, 2, 100 -129 int 100 1, 2, 100, 100 -130 == 1, 2, 1 -131 assert 1, 2 -132 int 1 1, 2, 1 -133 return 1 \ No newline at end of file +13 byte "" 0x +14 callsub test_self_ref_phi 0x +131 proto 0 1 0x +134 int 1 0x, 1 +135 frame_dig 0 0x, 1, 1 +137 int 100 0x, 1, 1, 100 +138 < 0x, 1, 1 +139 bz test_self_ref_phi_after_while@7 0x, 1 +142 frame_dig 0 0x, 1, 1 +144 int 105 0x, 1, 1, 105 +146 % 0x, 1, 1 +147 int 0 0x, 1, 1, 0 +148 == 0x, 1, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 1 +155 frame_dig 0 0x, 1, 1 +157 int 21 0x, 1, 1, 21 +159 % 0x, 1, 1 +160 bnz test_self_ref_phi_after_if_else@6 0x, 1 +166 frame_dig 0 0x, 1, 1 +168 int 1 0x, 1, 1, 1 +169 + 0x, 1, 2 +170 frame_bury 0 0x, 2 +172 b test_self_ref_phi_while_top@1 0x, 2 +135 frame_dig 0 0x, 2, 2 +137 int 100 0x, 2, 2, 100 +138 < 0x, 2, 1 +139 bz test_self_ref_phi_after_while@7 0x, 2 +142 frame_dig 0 0x, 2, 2 +144 int 105 0x, 2, 2, 105 +146 % 0x, 2, 2 +147 int 0 0x, 2, 2, 0 +148 == 0x, 2, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 2 +155 frame_dig 0 0x, 2, 2 +157 int 21 0x, 2, 2, 21 +159 % 0x, 2, 2 +160 bnz test_self_ref_phi_after_if_else@6 0x, 2 +166 frame_dig 0 0x, 2, 2 +168 int 1 0x, 2, 2, 1 +169 + 0x, 2, 3 +170 frame_bury 0 0x, 3 +172 b test_self_ref_phi_while_top@1 0x, 3 +135 frame_dig 0 0x, 3, 3 +137 int 100 0x, 3, 3, 100 +138 < 0x, 3, 1 +139 bz test_self_ref_phi_after_while@7 0x, 3 +142 frame_dig 0 0x, 3, 3 +144 int 105 0x, 3, 3, 105 +146 % 0x, 3, 3 +147 int 0 0x, 3, 3, 0 +148 == 0x, 3, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 3 +155 frame_dig 0 0x, 3, 3 +157 int 21 0x, 3, 3, 21 +159 % 0x, 3, 3 +160 bnz test_self_ref_phi_after_if_else@6 0x, 3 +166 frame_dig 0 0x, 3, 3 +168 int 1 0x, 3, 3, 1 +169 + 0x, 3, 4 +170 frame_bury 0 0x, 4 +172 b test_self_ref_phi_while_top@1 0x, 4 +135 frame_dig 0 0x, 4, 4 +137 int 100 0x, 4, 4, 100 +138 < 0x, 4, 1 +139 bz test_self_ref_phi_after_while@7 0x, 4 +142 frame_dig 0 0x, 4, 4 +144 int 105 0x, 4, 4, 105 +146 % 0x, 4, 4 +147 int 0 0x, 4, 4, 0 +148 == 0x, 4, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 4 +155 frame_dig 0 0x, 4, 4 +157 int 21 0x, 4, 4, 21 +159 % 0x, 4, 4 +160 bnz test_self_ref_phi_after_if_else@6 0x, 4 +166 frame_dig 0 0x, 4, 4 +168 int 1 0x, 4, 4, 1 +169 + 0x, 4, 5 +170 frame_bury 0 0x, 5 +172 b test_self_ref_phi_while_top@1 0x, 5 +135 frame_dig 0 0x, 5, 5 +137 int 100 0x, 5, 5, 100 +138 < 0x, 5, 1 +139 bz test_self_ref_phi_after_while@7 0x, 5 +142 frame_dig 0 0x, 5, 5 +144 int 105 0x, 5, 5, 105 +146 % 0x, 5, 5 +147 int 0 0x, 5, 5, 0 +148 == 0x, 5, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 5 +155 frame_dig 0 0x, 5, 5 +157 int 21 0x, 5, 5, 21 +159 % 0x, 5, 5 +160 bnz test_self_ref_phi_after_if_else@6 0x, 5 +166 frame_dig 0 0x, 5, 5 +168 int 1 0x, 5, 5, 1 +169 + 0x, 5, 6 +170 frame_bury 0 0x, 6 +172 b test_self_ref_phi_while_top@1 0x, 6 +135 frame_dig 0 0x, 6, 6 +137 int 100 0x, 6, 6, 100 +138 < 0x, 6, 1 +139 bz test_self_ref_phi_after_while@7 0x, 6 +142 frame_dig 0 0x, 6, 6 +144 int 105 0x, 6, 6, 105 +146 % 0x, 6, 6 +147 int 0 0x, 6, 6, 0 +148 == 0x, 6, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 6 +155 frame_dig 0 0x, 6, 6 +157 int 21 0x, 6, 6, 21 +159 % 0x, 6, 6 +160 bnz test_self_ref_phi_after_if_else@6 0x, 6 +166 frame_dig 0 0x, 6, 6 +168 int 1 0x, 6, 6, 1 +169 + 0x, 6, 7 +170 frame_bury 0 0x, 7 +172 b test_self_ref_phi_while_top@1 0x, 7 +135 frame_dig 0 0x, 7, 7 +137 int 100 0x, 7, 7, 100 +138 < 0x, 7, 1 +139 bz test_self_ref_phi_after_while@7 0x, 7 +142 frame_dig 0 0x, 7, 7 +144 int 105 0x, 7, 7, 105 +146 % 0x, 7, 7 +147 int 0 0x, 7, 7, 0 +148 == 0x, 7, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 7 +155 frame_dig 0 0x, 7, 7 +157 int 21 0x, 7, 7, 21 +159 % 0x, 7, 7 +160 bnz test_self_ref_phi_after_if_else@6 0x, 7 +166 frame_dig 0 0x, 7, 7 +168 int 1 0x, 7, 7, 1 +169 + 0x, 7, 8 +170 frame_bury 0 0x, 8 +172 b test_self_ref_phi_while_top@1 0x, 8 +135 frame_dig 0 0x, 8, 8 +137 int 100 0x, 8, 8, 100 +138 < 0x, 8, 1 +139 bz test_self_ref_phi_after_while@7 0x, 8 +142 frame_dig 0 0x, 8, 8 +144 int 105 0x, 8, 8, 105 +146 % 0x, 8, 8 +147 int 0 0x, 8, 8, 0 +148 == 0x, 8, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 8 +155 frame_dig 0 0x, 8, 8 +157 int 21 0x, 8, 8, 21 +159 % 0x, 8, 8 +160 bnz test_self_ref_phi_after_if_else@6 0x, 8 +166 frame_dig 0 0x, 8, 8 +168 int 1 0x, 8, 8, 1 +169 + 0x, 8, 9 +170 frame_bury 0 0x, 9 +172 b test_self_ref_phi_while_top@1 0x, 9 +135 frame_dig 0 0x, 9, 9 +137 int 100 0x, 9, 9, 100 +138 < 0x, 9, 1 +139 bz test_self_ref_phi_after_while@7 0x, 9 +142 frame_dig 0 0x, 9, 9 +144 int 105 0x, 9, 9, 105 +146 % 0x, 9, 9 +147 int 0 0x, 9, 9, 0 +148 == 0x, 9, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 9 +155 frame_dig 0 0x, 9, 9 +157 int 21 0x, 9, 9, 21 +159 % 0x, 9, 9 +160 bnz test_self_ref_phi_after_if_else@6 0x, 9 +166 frame_dig 0 0x, 9, 9 +168 int 1 0x, 9, 9, 1 +169 + 0x, 9, 10 +170 frame_bury 0 0x, 10 +172 b test_self_ref_phi_while_top@1 0x, 10 +135 frame_dig 0 0x, 10, 10 +137 int 100 0x, 10, 10, 100 +138 < 0x, 10, 1 +139 bz test_self_ref_phi_after_while@7 0x, 10 +142 frame_dig 0 0x, 10, 10 +144 int 105 0x, 10, 10, 105 +146 % 0x, 10, 10 +147 int 0 0x, 10, 10, 0 +148 == 0x, 10, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 10 +155 frame_dig 0 0x, 10, 10 +157 int 21 0x, 10, 10, 21 +159 % 0x, 10, 10 +160 bnz test_self_ref_phi_after_if_else@6 0x, 10 +166 frame_dig 0 0x, 10, 10 +168 int 1 0x, 10, 10, 1 +169 + 0x, 10, 11 +170 frame_bury 0 0x, 11 +172 b test_self_ref_phi_while_top@1 0x, 11 +135 frame_dig 0 0x, 11, 11 +137 int 100 0x, 11, 11, 100 +138 < 0x, 11, 1 +139 bz test_self_ref_phi_after_while@7 0x, 11 +142 frame_dig 0 0x, 11, 11 +144 int 105 0x, 11, 11, 105 +146 % 0x, 11, 11 +147 int 0 0x, 11, 11, 0 +148 == 0x, 11, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 11 +155 frame_dig 0 0x, 11, 11 +157 int 21 0x, 11, 11, 21 +159 % 0x, 11, 11 +160 bnz test_self_ref_phi_after_if_else@6 0x, 11 +166 frame_dig 0 0x, 11, 11 +168 int 1 0x, 11, 11, 1 +169 + 0x, 11, 12 +170 frame_bury 0 0x, 12 +172 b test_self_ref_phi_while_top@1 0x, 12 +135 frame_dig 0 0x, 12, 12 +137 int 100 0x, 12, 12, 100 +138 < 0x, 12, 1 +139 bz test_self_ref_phi_after_while@7 0x, 12 +142 frame_dig 0 0x, 12, 12 +144 int 105 0x, 12, 12, 105 +146 % 0x, 12, 12 +147 int 0 0x, 12, 12, 0 +148 == 0x, 12, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 12 +155 frame_dig 0 0x, 12, 12 +157 int 21 0x, 12, 12, 21 +159 % 0x, 12, 12 +160 bnz test_self_ref_phi_after_if_else@6 0x, 12 +166 frame_dig 0 0x, 12, 12 +168 int 1 0x, 12, 12, 1 +169 + 0x, 12, 13 +170 frame_bury 0 0x, 13 +172 b test_self_ref_phi_while_top@1 0x, 13 +135 frame_dig 0 0x, 13, 13 +137 int 100 0x, 13, 13, 100 +138 < 0x, 13, 1 +139 bz test_self_ref_phi_after_while@7 0x, 13 +142 frame_dig 0 0x, 13, 13 +144 int 105 0x, 13, 13, 105 +146 % 0x, 13, 13 +147 int 0 0x, 13, 13, 0 +148 == 0x, 13, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 13 +155 frame_dig 0 0x, 13, 13 +157 int 21 0x, 13, 13, 21 +159 % 0x, 13, 13 +160 bnz test_self_ref_phi_after_if_else@6 0x, 13 +166 frame_dig 0 0x, 13, 13 +168 int 1 0x, 13, 13, 1 +169 + 0x, 13, 14 +170 frame_bury 0 0x, 14 +172 b test_self_ref_phi_while_top@1 0x, 14 +135 frame_dig 0 0x, 14, 14 +137 int 100 0x, 14, 14, 100 +138 < 0x, 14, 1 +139 bz test_self_ref_phi_after_while@7 0x, 14 +142 frame_dig 0 0x, 14, 14 +144 int 105 0x, 14, 14, 105 +146 % 0x, 14, 14 +147 int 0 0x, 14, 14, 0 +148 == 0x, 14, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 14 +155 frame_dig 0 0x, 14, 14 +157 int 21 0x, 14, 14, 21 +159 % 0x, 14, 14 +160 bnz test_self_ref_phi_after_if_else@6 0x, 14 +166 frame_dig 0 0x, 14, 14 +168 int 1 0x, 14, 14, 1 +169 + 0x, 14, 15 +170 frame_bury 0 0x, 15 +172 b test_self_ref_phi_while_top@1 0x, 15 +135 frame_dig 0 0x, 15, 15 +137 int 100 0x, 15, 15, 100 +138 < 0x, 15, 1 +139 bz test_self_ref_phi_after_while@7 0x, 15 +142 frame_dig 0 0x, 15, 15 +144 int 105 0x, 15, 15, 105 +146 % 0x, 15, 15 +147 int 0 0x, 15, 15, 0 +148 == 0x, 15, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 15 +155 frame_dig 0 0x, 15, 15 +157 int 21 0x, 15, 15, 21 +159 % 0x, 15, 15 +160 bnz test_self_ref_phi_after_if_else@6 0x, 15 +166 frame_dig 0 0x, 15, 15 +168 int 1 0x, 15, 15, 1 +169 + 0x, 15, 16 +170 frame_bury 0 0x, 16 +172 b test_self_ref_phi_while_top@1 0x, 16 +135 frame_dig 0 0x, 16, 16 +137 int 100 0x, 16, 16, 100 +138 < 0x, 16, 1 +139 bz test_self_ref_phi_after_while@7 0x, 16 +142 frame_dig 0 0x, 16, 16 +144 int 105 0x, 16, 16, 105 +146 % 0x, 16, 16 +147 int 0 0x, 16, 16, 0 +148 == 0x, 16, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 16 +155 frame_dig 0 0x, 16, 16 +157 int 21 0x, 16, 16, 21 +159 % 0x, 16, 16 +160 bnz test_self_ref_phi_after_if_else@6 0x, 16 +166 frame_dig 0 0x, 16, 16 +168 int 1 0x, 16, 16, 1 +169 + 0x, 16, 17 +170 frame_bury 0 0x, 17 +172 b test_self_ref_phi_while_top@1 0x, 17 +135 frame_dig 0 0x, 17, 17 +137 int 100 0x, 17, 17, 100 +138 < 0x, 17, 1 +139 bz test_self_ref_phi_after_while@7 0x, 17 +142 frame_dig 0 0x, 17, 17 +144 int 105 0x, 17, 17, 105 +146 % 0x, 17, 17 +147 int 0 0x, 17, 17, 0 +148 == 0x, 17, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 17 +155 frame_dig 0 0x, 17, 17 +157 int 21 0x, 17, 17, 21 +159 % 0x, 17, 17 +160 bnz test_self_ref_phi_after_if_else@6 0x, 17 +166 frame_dig 0 0x, 17, 17 +168 int 1 0x, 17, 17, 1 +169 + 0x, 17, 18 +170 frame_bury 0 0x, 18 +172 b test_self_ref_phi_while_top@1 0x, 18 +135 frame_dig 0 0x, 18, 18 +137 int 100 0x, 18, 18, 100 +138 < 0x, 18, 1 +139 bz test_self_ref_phi_after_while@7 0x, 18 +142 frame_dig 0 0x, 18, 18 +144 int 105 0x, 18, 18, 105 +146 % 0x, 18, 18 +147 int 0 0x, 18, 18, 0 +148 == 0x, 18, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 18 +155 frame_dig 0 0x, 18, 18 +157 int 21 0x, 18, 18, 21 +159 % 0x, 18, 18 +160 bnz test_self_ref_phi_after_if_else@6 0x, 18 +166 frame_dig 0 0x, 18, 18 +168 int 1 0x, 18, 18, 1 +169 + 0x, 18, 19 +170 frame_bury 0 0x, 19 +172 b test_self_ref_phi_while_top@1 0x, 19 +135 frame_dig 0 0x, 19, 19 +137 int 100 0x, 19, 19, 100 +138 < 0x, 19, 1 +139 bz test_self_ref_phi_after_while@7 0x, 19 +142 frame_dig 0 0x, 19, 19 +144 int 105 0x, 19, 19, 105 +146 % 0x, 19, 19 +147 int 0 0x, 19, 19, 0 +148 == 0x, 19, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 19 +155 frame_dig 0 0x, 19, 19 +157 int 21 0x, 19, 19, 21 +159 % 0x, 19, 19 +160 bnz test_self_ref_phi_after_if_else@6 0x, 19 +166 frame_dig 0 0x, 19, 19 +168 int 1 0x, 19, 19, 1 +169 + 0x, 19, 20 +170 frame_bury 0 0x, 20 +172 b test_self_ref_phi_while_top@1 0x, 20 +135 frame_dig 0 0x, 20, 20 +137 int 100 0x, 20, 20, 100 +138 < 0x, 20, 1 +139 bz test_self_ref_phi_after_while@7 0x, 20 +142 frame_dig 0 0x, 20, 20 +144 int 105 0x, 20, 20, 105 +146 % 0x, 20, 20 +147 int 0 0x, 20, 20, 0 +148 == 0x, 20, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 20 +155 frame_dig 0 0x, 20, 20 +157 int 21 0x, 20, 20, 21 +159 % 0x, 20, 20 +160 bnz test_self_ref_phi_after_if_else@6 0x, 20 +166 frame_dig 0 0x, 20, 20 +168 int 1 0x, 20, 20, 1 +169 + 0x, 20, 21 +170 frame_bury 0 0x, 21 +172 b test_self_ref_phi_while_top@1 0x, 21 +135 frame_dig 0 0x, 21, 21 +137 int 100 0x, 21, 21, 100 +138 < 0x, 21, 1 +139 bz test_self_ref_phi_after_while@7 0x, 21 +142 frame_dig 0 0x, 21, 21 +144 int 105 0x, 21, 21, 105 +146 % 0x, 21, 21 +147 int 0 0x, 21, 21, 0 +148 == 0x, 21, 0 +149 bz test_self_ref_phi_after_if_else@4 0x, 21 +155 frame_dig 0 0x, 21, 21 +157 int 21 0x, 21, 21, 21 +159 % 0x, 21, 0 +160 bnz test_self_ref_phi_after_if_else@6 0x, 21 +163 b test_self_ref_phi_after_while@7 0x, 21 +175 frame_dig 0 0x, 21, 21 +177 swap 0x, 21, 21 +178 retsub 0x, 21 +17 pop 0x +18 int 1 0x, 1 +19 callsub test_swap 0x, 1 +179 proto 1 1 0x, 1 +182 int 1 0x, 1, 1 +183 int 2 0x, 1, 1, 2 +184 frame_dig -1 0x, 1, 1, 2, 1 +186 int 0 0x, 1, 1, 2, 1, 0 +187 > 0x, 1, 1, 2, 1 +188 bz test_swap_after_while@3 0x, 1, 1, 2 +191 frame_dig 0 0x, 1, 1, 2, 1 +193 frame_dig 1 0x, 1, 1, 2, 1, 2 +195 frame_bury 0 0x, 1, 2, 2, 1 +197 frame_bury 1 0x, 1, 2, 1 +199 frame_dig -1 0x, 1, 2, 1, 1 +201 int 1 0x, 1, 2, 1, 1, 1 +202 - 0x, 1, 2, 1, 0 +203 frame_bury -1 0x, 0, 2, 1 +205 b test_swap_while_top@1 0x, 0, 2, 1 +184 frame_dig -1 0x, 0, 2, 1, 0 +186 int 0 0x, 0, 2, 1, 0, 0 +187 > 0x, 0, 2, 1, 0 +188 bz test_swap_after_while@3 0x, 0, 2, 1 +208 retsub 0x, 2 +22 dup 0x, 2, 2 +23 swap 0x, 2, 2 +24 dup 0x, 2, 2, 2 +25 itob 0x, 2, 2, 0x0000000000000002 +26 log 0x, 2, 2 +27 int 1 0x, 2, 2, 1 +28 >= 0x, 2, 1 +29 bz main_bool_false@3 0x, 2 +32 dup 0x, 2, 2 +33 int 2 0x, 2, 2, 2 +34 <= 0x, 2, 1 +35 bz main_bool_false@3 0x, 2 +38 int 1 0x, 2, 1 +39 b main_bool_merge@4 0x, 2, 1 +43 assert 0x, 2 +44 int 2 0x, 2, 2 +45 callsub test_swap 0x, 2, 2 +179 proto 1 1 0x, 2, 2 +182 int 1 0x, 2, 2, 1 +183 int 2 0x, 2, 2, 1, 2 +184 frame_dig -1 0x, 2, 2, 1, 2, 2 +186 int 0 0x, 2, 2, 1, 2, 2, 0 +187 > 0x, 2, 2, 1, 2, 1 +188 bz test_swap_after_while@3 0x, 2, 2, 1, 2 +191 frame_dig 0 0x, 2, 2, 1, 2, 1 +193 frame_dig 1 0x, 2, 2, 1, 2, 1, 2 +195 frame_bury 0 0x, 2, 2, 2, 2, 1 +197 frame_bury 1 0x, 2, 2, 2, 1 +199 frame_dig -1 0x, 2, 2, 2, 1, 2 +201 int 1 0x, 2, 2, 2, 1, 2, 1 +202 - 0x, 2, 2, 2, 1, 1 +203 frame_bury -1 0x, 2, 1, 2, 1 +205 b test_swap_while_top@1 0x, 2, 1, 2, 1 +184 frame_dig -1 0x, 2, 1, 2, 1, 1 +186 int 0 0x, 2, 1, 2, 1, 1, 0 +187 > 0x, 2, 1, 2, 1, 1 +188 bz test_swap_after_while@3 0x, 2, 1, 2, 1 +191 frame_dig 0 0x, 2, 1, 2, 1, 2 +193 frame_dig 1 0x, 2, 1, 2, 1, 2, 1 +195 frame_bury 0 0x, 2, 1, 1, 1, 2 +197 frame_bury 1 0x, 2, 1, 1, 2 +199 frame_dig -1 0x, 2, 1, 1, 2, 1 +201 int 1 0x, 2, 1, 1, 2, 1, 1 +202 - 0x, 2, 1, 1, 2, 0 +203 frame_bury -1 0x, 2, 0, 1, 2 +205 b test_swap_while_top@1 0x, 2, 0, 1, 2 +184 frame_dig -1 0x, 2, 0, 1, 2, 0 +186 int 0 0x, 2, 0, 1, 2, 0, 0 +187 > 0x, 2, 0, 1, 2, 0 +188 bz test_swap_after_while@3 0x, 2, 0, 1, 2 +208 retsub 0x, 2, 1 +48 dup 0x, 2, 1, 1 +49 bury 3 1, 2, 1 +51 dup 1, 2, 1, 1 +52 itob 1, 2, 1, 0x0000000000000001 +53 log 1, 2, 1 +54 int 1 1, 2, 1, 1 +55 >= 1, 2, 1 +56 bz main_bool_false@7 1, 2 +59 dig 1 1, 2, 1 +61 int 2 1, 2, 1, 2 +62 <= 1, 2, 1 +63 bz main_bool_false@7 1, 2 +66 int 1 1, 2, 1 +67 b main_bool_merge@8 1, 2, 1 +71 assert 1, 2 +72 int 7 1, 2, 7 +74 int 11 1, 2, 7, 11 +76 callsub test_swap_loop 1, 2, 7, 11 +209 proto 2 1 1, 2, 7, 11 +212 int 1 1, 2, 7, 11, 1 +213 int 2 1, 2, 7, 11, 1, 2 +214 frame_dig -2 1, 2, 7, 11, 1, 2, 7 +216 int 0 1, 2, 7, 11, 1, 2, 7, 0 +217 > 1, 2, 7, 11, 1, 2, 1 +218 bz test_swap_loop_after_while@6 1, 2, 7, 11, 1, 2 +221 frame_dig -1 1, 2, 7, 11, 1, 2, 11 +223 int 0 1, 2, 7, 11, 1, 2, 11, 0 +224 > 1, 2, 7, 11, 1, 2, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 11, 1, 2 +228 frame_dig 0 1, 2, 7, 11, 1, 2, 1 +230 frame_dig 1 1, 2, 7, 11, 1, 2, 1, 2 +232 frame_bury 0 1, 2, 7, 11, 2, 2, 1 +234 frame_bury 1 1, 2, 7, 11, 2, 1 +236 frame_dig -1 1, 2, 7, 11, 2, 1, 11 +238 int 1 1, 2, 7, 11, 2, 1, 11, 1 +239 - 1, 2, 7, 11, 2, 1, 10 +240 frame_bury -1 1, 2, 7, 10, 2, 1 +242 b test_swap_loop_while_top@3 1, 2, 7, 10, 2, 1 +221 frame_dig -1 1, 2, 7, 10, 2, 1, 10 +223 int 0 1, 2, 7, 10, 2, 1, 10, 0 +224 > 1, 2, 7, 10, 2, 1, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 10, 2, 1 +228 frame_dig 0 1, 2, 7, 10, 2, 1, 2 +230 frame_dig 1 1, 2, 7, 10, 2, 1, 2, 1 +232 frame_bury 0 1, 2, 7, 10, 1, 1, 2 +234 frame_bury 1 1, 2, 7, 10, 1, 2 +236 frame_dig -1 1, 2, 7, 10, 1, 2, 10 +238 int 1 1, 2, 7, 10, 1, 2, 10, 1 +239 - 1, 2, 7, 10, 1, 2, 9 +240 frame_bury -1 1, 2, 7, 9, 1, 2 +242 b test_swap_loop_while_top@3 1, 2, 7, 9, 1, 2 +221 frame_dig -1 1, 2, 7, 9, 1, 2, 9 +223 int 0 1, 2, 7, 9, 1, 2, 9, 0 +224 > 1, 2, 7, 9, 1, 2, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 9, 1, 2 +228 frame_dig 0 1, 2, 7, 9, 1, 2, 1 +230 frame_dig 1 1, 2, 7, 9, 1, 2, 1, 2 +232 frame_bury 0 1, 2, 7, 9, 2, 2, 1 +234 frame_bury 1 1, 2, 7, 9, 2, 1 +236 frame_dig -1 1, 2, 7, 9, 2, 1, 9 +238 int 1 1, 2, 7, 9, 2, 1, 9, 1 +239 - 1, 2, 7, 9, 2, 1, 8 +240 frame_bury -1 1, 2, 7, 8, 2, 1 +242 b test_swap_loop_while_top@3 1, 2, 7, 8, 2, 1 +221 frame_dig -1 1, 2, 7, 8, 2, 1, 8 +223 int 0 1, 2, 7, 8, 2, 1, 8, 0 +224 > 1, 2, 7, 8, 2, 1, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 8, 2, 1 +228 frame_dig 0 1, 2, 7, 8, 2, 1, 2 +230 frame_dig 1 1, 2, 7, 8, 2, 1, 2, 1 +232 frame_bury 0 1, 2, 7, 8, 1, 1, 2 +234 frame_bury 1 1, 2, 7, 8, 1, 2 +236 frame_dig -1 1, 2, 7, 8, 1, 2, 8 +238 int 1 1, 2, 7, 8, 1, 2, 8, 1 +239 - 1, 2, 7, 8, 1, 2, 7 +240 frame_bury -1 1, 2, 7, 7, 1, 2 +242 b test_swap_loop_while_top@3 1, 2, 7, 7, 1, 2 +221 frame_dig -1 1, 2, 7, 7, 1, 2, 7 +223 int 0 1, 2, 7, 7, 1, 2, 7, 0 +224 > 1, 2, 7, 7, 1, 2, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 7, 1, 2 +228 frame_dig 0 1, 2, 7, 7, 1, 2, 1 +230 frame_dig 1 1, 2, 7, 7, 1, 2, 1, 2 +232 frame_bury 0 1, 2, 7, 7, 2, 2, 1 +234 frame_bury 1 1, 2, 7, 7, 2, 1 +236 frame_dig -1 1, 2, 7, 7, 2, 1, 7 +238 int 1 1, 2, 7, 7, 2, 1, 7, 1 +239 - 1, 2, 7, 7, 2, 1, 6 +240 frame_bury -1 1, 2, 7, 6, 2, 1 +242 b test_swap_loop_while_top@3 1, 2, 7, 6, 2, 1 +221 frame_dig -1 1, 2, 7, 6, 2, 1, 6 +223 int 0 1, 2, 7, 6, 2, 1, 6, 0 +224 > 1, 2, 7, 6, 2, 1, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 6, 2, 1 +228 frame_dig 0 1, 2, 7, 6, 2, 1, 2 +230 frame_dig 1 1, 2, 7, 6, 2, 1, 2, 1 +232 frame_bury 0 1, 2, 7, 6, 1, 1, 2 +234 frame_bury 1 1, 2, 7, 6, 1, 2 +236 frame_dig -1 1, 2, 7, 6, 1, 2, 6 +238 int 1 1, 2, 7, 6, 1, 2, 6, 1 +239 - 1, 2, 7, 6, 1, 2, 5 +240 frame_bury -1 1, 2, 7, 5, 1, 2 +242 b test_swap_loop_while_top@3 1, 2, 7, 5, 1, 2 +221 frame_dig -1 1, 2, 7, 5, 1, 2, 5 +223 int 0 1, 2, 7, 5, 1, 2, 5, 0 +224 > 1, 2, 7, 5, 1, 2, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 5, 1, 2 +228 frame_dig 0 1, 2, 7, 5, 1, 2, 1 +230 frame_dig 1 1, 2, 7, 5, 1, 2, 1, 2 +232 frame_bury 0 1, 2, 7, 5, 2, 2, 1 +234 frame_bury 1 1, 2, 7, 5, 2, 1 +236 frame_dig -1 1, 2, 7, 5, 2, 1, 5 +238 int 1 1, 2, 7, 5, 2, 1, 5, 1 +239 - 1, 2, 7, 5, 2, 1, 4 +240 frame_bury -1 1, 2, 7, 4, 2, 1 +242 b test_swap_loop_while_top@3 1, 2, 7, 4, 2, 1 +221 frame_dig -1 1, 2, 7, 4, 2, 1, 4 +223 int 0 1, 2, 7, 4, 2, 1, 4, 0 +224 > 1, 2, 7, 4, 2, 1, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 4, 2, 1 +228 frame_dig 0 1, 2, 7, 4, 2, 1, 2 +230 frame_dig 1 1, 2, 7, 4, 2, 1, 2, 1 +232 frame_bury 0 1, 2, 7, 4, 1, 1, 2 +234 frame_bury 1 1, 2, 7, 4, 1, 2 +236 frame_dig -1 1, 2, 7, 4, 1, 2, 4 +238 int 1 1, 2, 7, 4, 1, 2, 4, 1 +239 - 1, 2, 7, 4, 1, 2, 3 +240 frame_bury -1 1, 2, 7, 3, 1, 2 +242 b test_swap_loop_while_top@3 1, 2, 7, 3, 1, 2 +221 frame_dig -1 1, 2, 7, 3, 1, 2, 3 +223 int 0 1, 2, 7, 3, 1, 2, 3, 0 +224 > 1, 2, 7, 3, 1, 2, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 3, 1, 2 +228 frame_dig 0 1, 2, 7, 3, 1, 2, 1 +230 frame_dig 1 1, 2, 7, 3, 1, 2, 1, 2 +232 frame_bury 0 1, 2, 7, 3, 2, 2, 1 +234 frame_bury 1 1, 2, 7, 3, 2, 1 +236 frame_dig -1 1, 2, 7, 3, 2, 1, 3 +238 int 1 1, 2, 7, 3, 2, 1, 3, 1 +239 - 1, 2, 7, 3, 2, 1, 2 +240 frame_bury -1 1, 2, 7, 2, 2, 1 +242 b test_swap_loop_while_top@3 1, 2, 7, 2, 2, 1 +221 frame_dig -1 1, 2, 7, 2, 2, 1, 2 +223 int 0 1, 2, 7, 2, 2, 1, 2, 0 +224 > 1, 2, 7, 2, 2, 1, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 2, 2, 1 +228 frame_dig 0 1, 2, 7, 2, 2, 1, 2 +230 frame_dig 1 1, 2, 7, 2, 2, 1, 2, 1 +232 frame_bury 0 1, 2, 7, 2, 1, 1, 2 +234 frame_bury 1 1, 2, 7, 2, 1, 2 +236 frame_dig -1 1, 2, 7, 2, 1, 2, 2 +238 int 1 1, 2, 7, 2, 1, 2, 2, 1 +239 - 1, 2, 7, 2, 1, 2, 1 +240 frame_bury -1 1, 2, 7, 1, 1, 2 +242 b test_swap_loop_while_top@3 1, 2, 7, 1, 1, 2 +221 frame_dig -1 1, 2, 7, 1, 1, 2, 1 +223 int 0 1, 2, 7, 1, 1, 2, 1, 0 +224 > 1, 2, 7, 1, 1, 2, 1 +225 bz test_swap_loop_after_while@5 1, 2, 7, 1, 1, 2 +228 frame_dig 0 1, 2, 7, 1, 1, 2, 1 +230 frame_dig 1 1, 2, 7, 1, 1, 2, 1, 2 +232 frame_bury 0 1, 2, 7, 1, 2, 2, 1 +234 frame_bury 1 1, 2, 7, 1, 2, 1 +236 frame_dig -1 1, 2, 7, 1, 2, 1, 1 +238 int 1 1, 2, 7, 1, 2, 1, 1, 1 +239 - 1, 2, 7, 1, 2, 1, 0 +240 frame_bury -1 1, 2, 7, 0, 2, 1 +242 b test_swap_loop_while_top@3 1, 2, 7, 0, 2, 1 +221 frame_dig -1 1, 2, 7, 0, 2, 1, 0 +223 int 0 1, 2, 7, 0, 2, 1, 0, 0 +224 > 1, 2, 7, 0, 2, 1, 0 +225 bz test_swap_loop_after_while@5 1, 2, 7, 0, 2, 1 +245 frame_dig -2 1, 2, 7, 0, 2, 1, 7 +247 int 1 1, 2, 7, 0, 2, 1, 7, 1 +248 - 1, 2, 7, 0, 2, 1, 6 +249 frame_bury -2 1, 2, 6, 0, 2, 1 +251 b test_swap_loop_while_top@1 1, 2, 6, 0, 2, 1 +214 frame_dig -2 1, 2, 6, 0, 2, 1, 6 +216 int 0 1, 2, 6, 0, 2, 1, 6, 0 +217 > 1, 2, 6, 0, 2, 1, 1 +218 bz test_swap_loop_after_while@6 1, 2, 6, 0, 2, 1 +221 frame_dig -1 1, 2, 6, 0, 2, 1, 0 +223 int 0 1, 2, 6, 0, 2, 1, 0, 0 +224 > 1, 2, 6, 0, 2, 1, 0 +225 bz test_swap_loop_after_while@5 1, 2, 6, 0, 2, 1 +245 frame_dig -2 1, 2, 6, 0, 2, 1, 6 +247 int 1 1, 2, 6, 0, 2, 1, 6, 1 +248 - 1, 2, 6, 0, 2, 1, 5 +249 frame_bury -2 1, 2, 5, 0, 2, 1 +251 b test_swap_loop_while_top@1 1, 2, 5, 0, 2, 1 +214 frame_dig -2 1, 2, 5, 0, 2, 1, 5 +216 int 0 1, 2, 5, 0, 2, 1, 5, 0 +217 > 1, 2, 5, 0, 2, 1, 1 +218 bz test_swap_loop_after_while@6 1, 2, 5, 0, 2, 1 +221 frame_dig -1 1, 2, 5, 0, 2, 1, 0 +223 int 0 1, 2, 5, 0, 2, 1, 0, 0 +224 > 1, 2, 5, 0, 2, 1, 0 +225 bz test_swap_loop_after_while@5 1, 2, 5, 0, 2, 1 +245 frame_dig -2 1, 2, 5, 0, 2, 1, 5 +247 int 1 1, 2, 5, 0, 2, 1, 5, 1 +248 - 1, 2, 5, 0, 2, 1, 4 +249 frame_bury -2 1, 2, 4, 0, 2, 1 +251 b test_swap_loop_while_top@1 1, 2, 4, 0, 2, 1 +214 frame_dig -2 1, 2, 4, 0, 2, 1, 4 +216 int 0 1, 2, 4, 0, 2, 1, 4, 0 +217 > 1, 2, 4, 0, 2, 1, 1 +218 bz test_swap_loop_after_while@6 1, 2, 4, 0, 2, 1 +221 frame_dig -1 1, 2, 4, 0, 2, 1, 0 +223 int 0 1, 2, 4, 0, 2, 1, 0, 0 +224 > 1, 2, 4, 0, 2, 1, 0 +225 bz test_swap_loop_after_while@5 1, 2, 4, 0, 2, 1 +245 frame_dig -2 1, 2, 4, 0, 2, 1, 4 +247 int 1 1, 2, 4, 0, 2, 1, 4, 1 +248 - 1, 2, 4, 0, 2, 1, 3 +249 frame_bury -2 1, 2, 3, 0, 2, 1 +251 b test_swap_loop_while_top@1 1, 2, 3, 0, 2, 1 +214 frame_dig -2 1, 2, 3, 0, 2, 1, 3 +216 int 0 1, 2, 3, 0, 2, 1, 3, 0 +217 > 1, 2, 3, 0, 2, 1, 1 +218 bz test_swap_loop_after_while@6 1, 2, 3, 0, 2, 1 +221 frame_dig -1 1, 2, 3, 0, 2, 1, 0 +223 int 0 1, 2, 3, 0, 2, 1, 0, 0 +224 > 1, 2, 3, 0, 2, 1, 0 +225 bz test_swap_loop_after_while@5 1, 2, 3, 0, 2, 1 +245 frame_dig -2 1, 2, 3, 0, 2, 1, 3 +247 int 1 1, 2, 3, 0, 2, 1, 3, 1 +248 - 1, 2, 3, 0, 2, 1, 2 +249 frame_bury -2 1, 2, 2, 0, 2, 1 +251 b test_swap_loop_while_top@1 1, 2, 2, 0, 2, 1 +214 frame_dig -2 1, 2, 2, 0, 2, 1, 2 +216 int 0 1, 2, 2, 0, 2, 1, 2, 0 +217 > 1, 2, 2, 0, 2, 1, 1 +218 bz test_swap_loop_after_while@6 1, 2, 2, 0, 2, 1 +221 frame_dig -1 1, 2, 2, 0, 2, 1, 0 +223 int 0 1, 2, 2, 0, 2, 1, 0, 0 +224 > 1, 2, 2, 0, 2, 1, 0 +225 bz test_swap_loop_after_while@5 1, 2, 2, 0, 2, 1 +245 frame_dig -2 1, 2, 2, 0, 2, 1, 2 +247 int 1 1, 2, 2, 0, 2, 1, 2, 1 +248 - 1, 2, 2, 0, 2, 1, 1 +249 frame_bury -2 1, 2, 1, 0, 2, 1 +251 b test_swap_loop_while_top@1 1, 2, 1, 0, 2, 1 +214 frame_dig -2 1, 2, 1, 0, 2, 1, 1 +216 int 0 1, 2, 1, 0, 2, 1, 1, 0 +217 > 1, 2, 1, 0, 2, 1, 1 +218 bz test_swap_loop_after_while@6 1, 2, 1, 0, 2, 1 +221 frame_dig -1 1, 2, 1, 0, 2, 1, 0 +223 int 0 1, 2, 1, 0, 2, 1, 0, 0 +224 > 1, 2, 1, 0, 2, 1, 0 +225 bz test_swap_loop_after_while@5 1, 2, 1, 0, 2, 1 +245 frame_dig -2 1, 2, 1, 0, 2, 1, 1 +247 int 1 1, 2, 1, 0, 2, 1, 1, 1 +248 - 1, 2, 1, 0, 2, 1, 0 +249 frame_bury -2 1, 2, 0, 0, 2, 1 +251 b test_swap_loop_while_top@1 1, 2, 0, 0, 2, 1 +214 frame_dig -2 1, 2, 0, 0, 2, 1, 0 +216 int 0 1, 2, 0, 0, 2, 1, 0, 0 +217 > 1, 2, 0, 0, 2, 1, 0 +218 bz test_swap_loop_after_while@6 1, 2, 0, 0, 2, 1 +254 retsub 1, 2, 2 +79 pop 1, 2 +80 int 0 1, 2, 0 +81 callsub test_param_update_with_reentrant_entry_block 1, 2, 0 +255 proto 1 1 1, 2, 0 +258 byte "" 1, 2, 0, 0x +259 frame_dig -1 1, 2, 0, 0x, 0 +261 frame_bury 0 1, 2, 0, 0 +263 int 1 1, 2, 0, 0, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 0, 0 +267 frame_dig -1 1, 2, 0, 0, 0 +269 int 1 1, 2, 0, 0, 0, 1 +270 + 1, 2, 0, 0, 1 +271 dup 1, 2, 0, 0, 1, 1 +272 frame_bury -1 1, 2, 1, 0, 1 +274 int 10 1, 2, 1, 0, 1, 10 +276 >= 1, 2, 1, 0, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 1, 0 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 1, 0 +259 frame_dig -1 1, 2, 1, 0, 1 +261 frame_bury 0 1, 2, 1, 1 +263 int 1 1, 2, 1, 1, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 1, 1 +267 frame_dig -1 1, 2, 1, 1, 1 +269 int 1 1, 2, 1, 1, 1, 1 +270 + 1, 2, 1, 1, 2 +271 dup 1, 2, 1, 1, 2, 2 +272 frame_bury -1 1, 2, 2, 1, 2 +274 int 10 1, 2, 2, 1, 2, 10 +276 >= 1, 2, 2, 1, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 2, 1 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 2, 1 +259 frame_dig -1 1, 2, 2, 1, 2 +261 frame_bury 0 1, 2, 2, 2 +263 int 1 1, 2, 2, 2, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 2, 2 +267 frame_dig -1 1, 2, 2, 2, 2 +269 int 1 1, 2, 2, 2, 2, 1 +270 + 1, 2, 2, 2, 3 +271 dup 1, 2, 2, 2, 3, 3 +272 frame_bury -1 1, 2, 3, 2, 3 +274 int 10 1, 2, 3, 2, 3, 10 +276 >= 1, 2, 3, 2, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 3, 2 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 3, 2 +259 frame_dig -1 1, 2, 3, 2, 3 +261 frame_bury 0 1, 2, 3, 3 +263 int 1 1, 2, 3, 3, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 3, 3 +267 frame_dig -1 1, 2, 3, 3, 3 +269 int 1 1, 2, 3, 3, 3, 1 +270 + 1, 2, 3, 3, 4 +271 dup 1, 2, 3, 3, 4, 4 +272 frame_bury -1 1, 2, 4, 3, 4 +274 int 10 1, 2, 4, 3, 4, 10 +276 >= 1, 2, 4, 3, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 4, 3 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 4, 3 +259 frame_dig -1 1, 2, 4, 3, 4 +261 frame_bury 0 1, 2, 4, 4 +263 int 1 1, 2, 4, 4, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 4, 4 +267 frame_dig -1 1, 2, 4, 4, 4 +269 int 1 1, 2, 4, 4, 4, 1 +270 + 1, 2, 4, 4, 5 +271 dup 1, 2, 4, 4, 5, 5 +272 frame_bury -1 1, 2, 5, 4, 5 +274 int 10 1, 2, 5, 4, 5, 10 +276 >= 1, 2, 5, 4, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 5, 4 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 5, 4 +259 frame_dig -1 1, 2, 5, 4, 5 +261 frame_bury 0 1, 2, 5, 5 +263 int 1 1, 2, 5, 5, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 5, 5 +267 frame_dig -1 1, 2, 5, 5, 5 +269 int 1 1, 2, 5, 5, 5, 1 +270 + 1, 2, 5, 5, 6 +271 dup 1, 2, 5, 5, 6, 6 +272 frame_bury -1 1, 2, 6, 5, 6 +274 int 10 1, 2, 6, 5, 6, 10 +276 >= 1, 2, 6, 5, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 6, 5 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 6, 5 +259 frame_dig -1 1, 2, 6, 5, 6 +261 frame_bury 0 1, 2, 6, 6 +263 int 1 1, 2, 6, 6, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 6, 6 +267 frame_dig -1 1, 2, 6, 6, 6 +269 int 1 1, 2, 6, 6, 6, 1 +270 + 1, 2, 6, 6, 7 +271 dup 1, 2, 6, 6, 7, 7 +272 frame_bury -1 1, 2, 7, 6, 7 +274 int 10 1, 2, 7, 6, 7, 10 +276 >= 1, 2, 7, 6, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 7, 6 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 7, 6 +259 frame_dig -1 1, 2, 7, 6, 7 +261 frame_bury 0 1, 2, 7, 7 +263 int 1 1, 2, 7, 7, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 7, 7 +267 frame_dig -1 1, 2, 7, 7, 7 +269 int 1 1, 2, 7, 7, 7, 1 +270 + 1, 2, 7, 7, 8 +271 dup 1, 2, 7, 7, 8, 8 +272 frame_bury -1 1, 2, 8, 7, 8 +274 int 10 1, 2, 8, 7, 8, 10 +276 >= 1, 2, 8, 7, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 8, 7 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 8, 7 +259 frame_dig -1 1, 2, 8, 7, 8 +261 frame_bury 0 1, 2, 8, 8 +263 int 1 1, 2, 8, 8, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 8, 8 +267 frame_dig -1 1, 2, 8, 8, 8 +269 int 1 1, 2, 8, 8, 8, 1 +270 + 1, 2, 8, 8, 9 +271 dup 1, 2, 8, 8, 9, 9 +272 frame_bury -1 1, 2, 9, 8, 9 +274 int 10 1, 2, 9, 8, 9, 10 +276 >= 1, 2, 9, 8, 0 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 9, 8 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 9, 8 +259 frame_dig -1 1, 2, 9, 8, 9 +261 frame_bury 0 1, 2, 9, 9 +263 int 1 1, 2, 9, 9, 1 +264 bz test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 9, 9 +267 frame_dig -1 1, 2, 9, 9, 9 +269 int 1 1, 2, 9, 9, 9, 1 +270 + 1, 2, 9, 9, 10 +271 dup 1, 2, 9, 9, 10, 10 +272 frame_bury -1 1, 2, 10, 9, 10 +274 int 10 1, 2, 10, 9, 10, 10 +276 >= 1, 2, 10, 9, 1 +277 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 10, 9 +280 frame_dig -1 1, 2, 10, 9, 10 +282 frame_bury 0 1, 2, 10, 10 +284 b test_param_update_with_reentrant_entry_block_after_while@5 1, 2, 10, 10 +290 frame_dig 0 1, 2, 10, 10, 10 +292 dup 1, 2, 10, 10, 10, 10 +293 frame_bury -1 1, 2, 10, 10, 10 +295 swap 1, 2, 10, 10, 10 +296 retsub 1, 2, 10 +84 int 10 1, 2, 10, 10 +86 == 1, 2, 1 +87 assert 1, 2 +88 int 0 1, 2, 0 +89 callsub test_param_update_with_reentrant_entry_block_v2 1, 2, 0 +297 proto 1 1 1, 2, 0 +300 frame_dig -1 1, 2, 0, 0 +302 int 1 1, 2, 0, 0, 1 +303 + 1, 2, 0, 1 +304 frame_bury -1 1, 2, 1 +306 int 1 1, 2, 1, 1 +307 bz test_param_update_with_reentrant_entry_block_v2_after_while@5 1, 2, 1 +310 frame_dig -1 1, 2, 1, 1 +312 int 1 1, 2, 1, 1, 1 +313 >= 1, 2, 1, 1 +314 bz test_param_update_with_reentrant_entry_block_v2_after_if_else@4 1, 2, 1 +317 b test_param_update_with_reentrant_entry_block_v2_after_while@5 1, 2, 1 +323 frame_dig -1 1, 2, 1, 1 +325 retsub 1, 2, 1 +92 pop 1, 2 +93 callsub test_param_update_with_reentrant_entry_block_v3 1, 2 +326 proto 0 0 1, 2 +329 int 1 1, 2, 1 +330 bz test_param_update_with_reentrant_entry_block_v3_after_while@5 1, 2 +333 callsub one 1, 2 +346 proto 0 1 1, 2 +349 int 1 1, 2, 1 +350 retsub 1, 2, 1 +336 bz test_param_update_with_reentrant_entry_block_v3_after_if_else@4 1, 2 +339 b test_param_update_with_reentrant_entry_block_v3_after_while@5 1, 2 +345 retsub 1, 2 +96 callsub test_swap_args 1, 2 +351 proto 0 0 1, 2 +354 callsub one 1, 2 +346 proto 0 1 1, 2 +349 int 1 1, 2, 1 +350 retsub 1, 2, 1 +357 int 123 1, 2, 1, 123 +359 + 1, 2, 124 +360 callsub one 1, 2, 124 +346 proto 0 1 1, 2, 124 +349 int 1 1, 2, 124, 1 +350 retsub 1, 2, 124, 1 +363 int 234 1, 2, 124, 1, 234 +366 + 1, 2, 124, 235 +367 callsub swap_args 1, 2, 124, 235 +381 proto 2 2 1, 2, 124, 235 +384 frame_dig -1 1, 2, 124, 235, 235 +386 frame_dig -2 1, 2, 124, 235, 235, 124 +388 retsub 1, 2, 235, 124 +370 swap 1, 2, 124, 235 +371 int 235 1, 2, 124, 235, 235 +374 == 1, 2, 124, 1 +375 assert 1, 2, 124 +376 int 124 1, 2, 124, 124 +378 == 1, 2, 1 +379 assert 1, 2 +380 retsub 1, 2 +99 int 100 1, 2, 100 +100 int 200 1, 2, 100, 200 +102 int 0 1, 2, 100, 200, 0 +103 callsub test_tuple_swap 1, 2, 100, 200, 0 +389 proto 3 2 1, 2, 100, 200, 0 +392 int 0 1, 2, 100, 200, 0, 0 +393 frame_dig 0 1, 2, 100, 200, 0, 0, 0 +395 frame_dig -1 1, 2, 100, 200, 0, 0, 0, 0 +397 < 1, 2, 100, 200, 0, 0, 0 +398 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 0, 0 +418 frame_dig -3 1, 2, 100, 200, 0, 0, 100 +420 frame_dig -2 1, 2, 100, 200, 0, 0, 100, 200 +422 uncover 2 1, 2, 100, 200, 0, 100, 200, 0 +424 retsub 1, 2, 100, 200 +106 swap 1, 2, 200, 100 +107 int 100 1, 2, 200, 100, 100 +108 == 1, 2, 200, 1 +109 assert 1, 2, 200 +110 int 200 1, 2, 200, 200 +112 == 1, 2, 1 +113 assert 1, 2 +114 int 100 1, 2, 100 +115 int 200 1, 2, 100, 200 +117 int 1 1, 2, 100, 200, 1 +118 callsub test_tuple_swap 1, 2, 100, 200, 1 +389 proto 3 2 1, 2, 100, 200, 1 +392 int 0 1, 2, 100, 200, 1, 0 +393 frame_dig 0 1, 2, 100, 200, 1, 0, 0 +395 frame_dig -1 1, 2, 100, 200, 1, 0, 0, 1 +397 < 1, 2, 100, 200, 1, 0, 1 +398 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 1, 0 +401 frame_dig -2 1, 2, 100, 200, 1, 0, 200 +403 frame_dig -3 1, 2, 100, 200, 1, 0, 200, 100 +405 frame_bury -2 1, 2, 100, 100, 1, 0, 200 +407 frame_dig 0 1, 2, 100, 100, 1, 0, 200, 0 +409 int 1 1, 2, 100, 100, 1, 0, 200, 0, 1 +410 + 1, 2, 100, 100, 1, 0, 200, 1 +411 frame_bury 0 1, 2, 100, 100, 1, 1, 200 +413 frame_bury -3 1, 2, 200, 100, 1, 1 +415 b test_tuple_swap_for_header@1 1, 2, 200, 100, 1, 1 +393 frame_dig 0 1, 2, 200, 100, 1, 1, 1 +395 frame_dig -1 1, 2, 200, 100, 1, 1, 1, 1 +397 < 1, 2, 200, 100, 1, 1, 0 +398 bz test_tuple_swap_after_for@4 1, 2, 200, 100, 1, 1 +418 frame_dig -3 1, 2, 200, 100, 1, 1, 200 +420 frame_dig -2 1, 2, 200, 100, 1, 1, 200, 100 +422 uncover 2 1, 2, 200, 100, 1, 200, 100, 1 +424 retsub 1, 2, 200, 100 +121 swap 1, 2, 100, 200 +122 int 200 1, 2, 100, 200, 200 +124 == 1, 2, 100, 1 +125 assert 1, 2, 100 +126 int 100 1, 2, 100, 100 +127 == 1, 2, 1 +128 assert 1, 2 +129 int 1 1, 2, 1 +130 return 1 \ No newline at end of file diff --git a/examples/unssa/out/execution_trace.O1.log b/examples/unssa/out/execution_trace.O1.log index 5cd9096c5a..b57ccbee63 100644 --- a/examples/unssa/out/execution_trace.O1.log +++ b/examples/unssa/out/execution_trace.O1.log @@ -1,938 +1,938 @@ PC Teal Stack 1 -10 byte "" -12 callsub test_self_ref_phi -132 proto 0 1 -135 int 1 , 1 -136 frame_dig 0 , 1, 1 -138 int 100 , 1, 1, 100 -139 < , 1, 1 -140 bz test_self_ref_phi_after_while@7 , 1 -143 frame_dig 0 , 1, 1 -145 int 105 , 1, 1, 105 -147 % , 1, 1 -148 ! , 1, 0 -149 bz test_self_ref_phi_after_if_else@4 , 1 -155 frame_dig 0 , 1, 1 -157 int 21 , 1, 1, 21 -159 % , 1, 1 -160 bz test_self_ref_phi_after_while@7 , 1 -163 frame_dig 0 , 1, 1 -165 int 1 , 1, 1, 1 -166 + , 1, 2 -167 frame_bury 0 , 2 -169 b test_self_ref_phi_while_top@1 , 2 -136 frame_dig 0 , 2, 2 -138 int 100 , 2, 2, 100 -139 < , 2, 1 -140 bz test_self_ref_phi_after_while@7 , 2 -143 frame_dig 0 , 2, 2 -145 int 105 , 2, 2, 105 -147 % , 2, 2 -148 ! , 2, 0 -149 bz test_self_ref_phi_after_if_else@4 , 2 -155 frame_dig 0 , 2, 2 -157 int 21 , 2, 2, 21 -159 % , 2, 2 -160 bz test_self_ref_phi_after_while@7 , 2 -163 frame_dig 0 , 2, 2 -165 int 1 , 2, 2, 1 -166 + , 2, 3 -167 frame_bury 0 , 3 -169 b test_self_ref_phi_while_top@1 , 3 -136 frame_dig 0 , 3, 3 -138 int 100 , 3, 3, 100 -139 < , 3, 1 -140 bz test_self_ref_phi_after_while@7 , 3 -143 frame_dig 0 , 3, 3 -145 int 105 , 3, 3, 105 -147 % , 3, 3 -148 ! , 3, 0 -149 bz test_self_ref_phi_after_if_else@4 , 3 -155 frame_dig 0 , 3, 3 -157 int 21 , 3, 3, 21 -159 % , 3, 3 -160 bz test_self_ref_phi_after_while@7 , 3 -163 frame_dig 0 , 3, 3 -165 int 1 , 3, 3, 1 -166 + , 3, 4 -167 frame_bury 0 , 4 -169 b test_self_ref_phi_while_top@1 , 4 -136 frame_dig 0 , 4, 4 -138 int 100 , 4, 4, 100 -139 < , 4, 1 -140 bz test_self_ref_phi_after_while@7 , 4 -143 frame_dig 0 , 4, 4 -145 int 105 , 4, 4, 105 -147 % , 4, 4 -148 ! , 4, 0 -149 bz test_self_ref_phi_after_if_else@4 , 4 -155 frame_dig 0 , 4, 4 -157 int 21 , 4, 4, 21 -159 % , 4, 4 -160 bz test_self_ref_phi_after_while@7 , 4 -163 frame_dig 0 , 4, 4 -165 int 1 , 4, 4, 1 -166 + , 4, 5 -167 frame_bury 0 , 5 -169 b test_self_ref_phi_while_top@1 , 5 -136 frame_dig 0 , 5, 5 -138 int 100 , 5, 5, 100 -139 < , 5, 1 -140 bz test_self_ref_phi_after_while@7 , 5 -143 frame_dig 0 , 5, 5 -145 int 105 , 5, 5, 105 -147 % , 5, 5 -148 ! , 5, 0 -149 bz test_self_ref_phi_after_if_else@4 , 5 -155 frame_dig 0 , 5, 5 -157 int 21 , 5, 5, 21 -159 % , 5, 5 -160 bz test_self_ref_phi_after_while@7 , 5 -163 frame_dig 0 , 5, 5 -165 int 1 , 5, 5, 1 -166 + , 5, 6 -167 frame_bury 0 , 6 -169 b test_self_ref_phi_while_top@1 , 6 -136 frame_dig 0 , 6, 6 -138 int 100 , 6, 6, 100 -139 < , 6, 1 -140 bz test_self_ref_phi_after_while@7 , 6 -143 frame_dig 0 , 6, 6 -145 int 105 , 6, 6, 105 -147 % , 6, 6 -148 ! , 6, 0 -149 bz test_self_ref_phi_after_if_else@4 , 6 -155 frame_dig 0 , 6, 6 -157 int 21 , 6, 6, 21 -159 % , 6, 6 -160 bz test_self_ref_phi_after_while@7 , 6 -163 frame_dig 0 , 6, 6 -165 int 1 , 6, 6, 1 -166 + , 6, 7 -167 frame_bury 0 , 7 -169 b test_self_ref_phi_while_top@1 , 7 -136 frame_dig 0 , 7, 7 -138 int 100 , 7, 7, 100 -139 < , 7, 1 -140 bz test_self_ref_phi_after_while@7 , 7 -143 frame_dig 0 , 7, 7 -145 int 105 , 7, 7, 105 -147 % , 7, 7 -148 ! , 7, 0 -149 bz test_self_ref_phi_after_if_else@4 , 7 -155 frame_dig 0 , 7, 7 -157 int 21 , 7, 7, 21 -159 % , 7, 7 -160 bz test_self_ref_phi_after_while@7 , 7 -163 frame_dig 0 , 7, 7 -165 int 1 , 7, 7, 1 -166 + , 7, 8 -167 frame_bury 0 , 8 -169 b test_self_ref_phi_while_top@1 , 8 -136 frame_dig 0 , 8, 8 -138 int 100 , 8, 8, 100 -139 < , 8, 1 -140 bz test_self_ref_phi_after_while@7 , 8 -143 frame_dig 0 , 8, 8 -145 int 105 , 8, 8, 105 -147 % , 8, 8 -148 ! , 8, 0 -149 bz test_self_ref_phi_after_if_else@4 , 8 -155 frame_dig 0 , 8, 8 -157 int 21 , 8, 8, 21 -159 % , 8, 8 -160 bz test_self_ref_phi_after_while@7 , 8 -163 frame_dig 0 , 8, 8 -165 int 1 , 8, 8, 1 -166 + , 8, 9 -167 frame_bury 0 , 9 -169 b test_self_ref_phi_while_top@1 , 9 -136 frame_dig 0 , 9, 9 -138 int 100 , 9, 9, 100 -139 < , 9, 1 -140 bz test_self_ref_phi_after_while@7 , 9 -143 frame_dig 0 , 9, 9 -145 int 105 , 9, 9, 105 -147 % , 9, 9 -148 ! , 9, 0 -149 bz test_self_ref_phi_after_if_else@4 , 9 -155 frame_dig 0 , 9, 9 -157 int 21 , 9, 9, 21 -159 % , 9, 9 -160 bz test_self_ref_phi_after_while@7 , 9 -163 frame_dig 0 , 9, 9 -165 int 1 , 9, 9, 1 -166 + , 9, 10 -167 frame_bury 0 , 10 -169 b test_self_ref_phi_while_top@1 , 10 -136 frame_dig 0 , 10, 10 -138 int 100 , 10, 10, 100 -139 < , 10, 1 -140 bz test_self_ref_phi_after_while@7 , 10 -143 frame_dig 0 , 10, 10 -145 int 105 , 10, 10, 105 -147 % , 10, 10 -148 ! , 10, 0 -149 bz test_self_ref_phi_after_if_else@4 , 10 -155 frame_dig 0 , 10, 10 -157 int 21 , 10, 10, 21 -159 % , 10, 10 -160 bz test_self_ref_phi_after_while@7 , 10 -163 frame_dig 0 , 10, 10 -165 int 1 , 10, 10, 1 -166 + , 10, 11 -167 frame_bury 0 , 11 -169 b test_self_ref_phi_while_top@1 , 11 -136 frame_dig 0 , 11, 11 -138 int 100 , 11, 11, 100 -139 < , 11, 1 -140 bz test_self_ref_phi_after_while@7 , 11 -143 frame_dig 0 , 11, 11 -145 int 105 , 11, 11, 105 -147 % , 11, 11 -148 ! , 11, 0 -149 bz test_self_ref_phi_after_if_else@4 , 11 -155 frame_dig 0 , 11, 11 -157 int 21 , 11, 11, 21 -159 % , 11, 11 -160 bz test_self_ref_phi_after_while@7 , 11 -163 frame_dig 0 , 11, 11 -165 int 1 , 11, 11, 1 -166 + , 11, 12 -167 frame_bury 0 , 12 -169 b test_self_ref_phi_while_top@1 , 12 -136 frame_dig 0 , 12, 12 -138 int 100 , 12, 12, 100 -139 < , 12, 1 -140 bz test_self_ref_phi_after_while@7 , 12 -143 frame_dig 0 , 12, 12 -145 int 105 , 12, 12, 105 -147 % , 12, 12 -148 ! , 12, 0 -149 bz test_self_ref_phi_after_if_else@4 , 12 -155 frame_dig 0 , 12, 12 -157 int 21 , 12, 12, 21 -159 % , 12, 12 -160 bz test_self_ref_phi_after_while@7 , 12 -163 frame_dig 0 , 12, 12 -165 int 1 , 12, 12, 1 -166 + , 12, 13 -167 frame_bury 0 , 13 -169 b test_self_ref_phi_while_top@1 , 13 -136 frame_dig 0 , 13, 13 -138 int 100 , 13, 13, 100 -139 < , 13, 1 -140 bz test_self_ref_phi_after_while@7 , 13 -143 frame_dig 0 , 13, 13 -145 int 105 , 13, 13, 105 -147 % , 13, 13 -148 ! , 13, 0 -149 bz test_self_ref_phi_after_if_else@4 , 13 -155 frame_dig 0 , 13, 13 -157 int 21 , 13, 13, 21 -159 % , 13, 13 -160 bz test_self_ref_phi_after_while@7 , 13 -163 frame_dig 0 , 13, 13 -165 int 1 , 13, 13, 1 -166 + , 13, 14 -167 frame_bury 0 , 14 -169 b test_self_ref_phi_while_top@1 , 14 -136 frame_dig 0 , 14, 14 -138 int 100 , 14, 14, 100 -139 < , 14, 1 -140 bz test_self_ref_phi_after_while@7 , 14 -143 frame_dig 0 , 14, 14 -145 int 105 , 14, 14, 105 -147 % , 14, 14 -148 ! , 14, 0 -149 bz test_self_ref_phi_after_if_else@4 , 14 -155 frame_dig 0 , 14, 14 -157 int 21 , 14, 14, 21 -159 % , 14, 14 -160 bz test_self_ref_phi_after_while@7 , 14 -163 frame_dig 0 , 14, 14 -165 int 1 , 14, 14, 1 -166 + , 14, 15 -167 frame_bury 0 , 15 -169 b test_self_ref_phi_while_top@1 , 15 -136 frame_dig 0 , 15, 15 -138 int 100 , 15, 15, 100 -139 < , 15, 1 -140 bz test_self_ref_phi_after_while@7 , 15 -143 frame_dig 0 , 15, 15 -145 int 105 , 15, 15, 105 -147 % , 15, 15 -148 ! , 15, 0 -149 bz test_self_ref_phi_after_if_else@4 , 15 -155 frame_dig 0 , 15, 15 -157 int 21 , 15, 15, 21 -159 % , 15, 15 -160 bz test_self_ref_phi_after_while@7 , 15 -163 frame_dig 0 , 15, 15 -165 int 1 , 15, 15, 1 -166 + , 15, 16 -167 frame_bury 0 , 16 -169 b test_self_ref_phi_while_top@1 , 16 -136 frame_dig 0 , 16, 16 -138 int 100 , 16, 16, 100 -139 < , 16, 1 -140 bz test_self_ref_phi_after_while@7 , 16 -143 frame_dig 0 , 16, 16 -145 int 105 , 16, 16, 105 -147 % , 16, 16 -148 ! , 16, 0 -149 bz test_self_ref_phi_after_if_else@4 , 16 -155 frame_dig 0 , 16, 16 -157 int 21 , 16, 16, 21 -159 % , 16, 16 -160 bz test_self_ref_phi_after_while@7 , 16 -163 frame_dig 0 , 16, 16 -165 int 1 , 16, 16, 1 -166 + , 16, 17 -167 frame_bury 0 , 17 -169 b test_self_ref_phi_while_top@1 , 17 -136 frame_dig 0 , 17, 17 -138 int 100 , 17, 17, 100 -139 < , 17, 1 -140 bz test_self_ref_phi_after_while@7 , 17 -143 frame_dig 0 , 17, 17 -145 int 105 , 17, 17, 105 -147 % , 17, 17 -148 ! , 17, 0 -149 bz test_self_ref_phi_after_if_else@4 , 17 -155 frame_dig 0 , 17, 17 -157 int 21 , 17, 17, 21 -159 % , 17, 17 -160 bz test_self_ref_phi_after_while@7 , 17 -163 frame_dig 0 , 17, 17 -165 int 1 , 17, 17, 1 -166 + , 17, 18 -167 frame_bury 0 , 18 -169 b test_self_ref_phi_while_top@1 , 18 -136 frame_dig 0 , 18, 18 -138 int 100 , 18, 18, 100 -139 < , 18, 1 -140 bz test_self_ref_phi_after_while@7 , 18 -143 frame_dig 0 , 18, 18 -145 int 105 , 18, 18, 105 -147 % , 18, 18 -148 ! , 18, 0 -149 bz test_self_ref_phi_after_if_else@4 , 18 -155 frame_dig 0 , 18, 18 -157 int 21 , 18, 18, 21 -159 % , 18, 18 -160 bz test_self_ref_phi_after_while@7 , 18 -163 frame_dig 0 , 18, 18 -165 int 1 , 18, 18, 1 -166 + , 18, 19 -167 frame_bury 0 , 19 -169 b test_self_ref_phi_while_top@1 , 19 -136 frame_dig 0 , 19, 19 -138 int 100 , 19, 19, 100 -139 < , 19, 1 -140 bz test_self_ref_phi_after_while@7 , 19 -143 frame_dig 0 , 19, 19 -145 int 105 , 19, 19, 105 -147 % , 19, 19 -148 ! , 19, 0 -149 bz test_self_ref_phi_after_if_else@4 , 19 -155 frame_dig 0 , 19, 19 -157 int 21 , 19, 19, 21 -159 % , 19, 19 -160 bz test_self_ref_phi_after_while@7 , 19 -163 frame_dig 0 , 19, 19 -165 int 1 , 19, 19, 1 -166 + , 19, 20 -167 frame_bury 0 , 20 -169 b test_self_ref_phi_while_top@1 , 20 -136 frame_dig 0 , 20, 20 -138 int 100 , 20, 20, 100 -139 < , 20, 1 -140 bz test_self_ref_phi_after_while@7 , 20 -143 frame_dig 0 , 20, 20 -145 int 105 , 20, 20, 105 -147 % , 20, 20 -148 ! , 20, 0 -149 bz test_self_ref_phi_after_if_else@4 , 20 -155 frame_dig 0 , 20, 20 -157 int 21 , 20, 20, 21 -159 % , 20, 20 -160 bz test_self_ref_phi_after_while@7 , 20 -163 frame_dig 0 , 20, 20 -165 int 1 , 20, 20, 1 -166 + , 20, 21 -167 frame_bury 0 , 21 -169 b test_self_ref_phi_while_top@1 , 21 -136 frame_dig 0 , 21, 21 -138 int 100 , 21, 21, 100 -139 < , 21, 1 -140 bz test_self_ref_phi_after_while@7 , 21 -143 frame_dig 0 , 21, 21 -145 int 105 , 21, 21, 105 -147 % , 21, 21 -148 ! , 21, 0 -149 bz test_self_ref_phi_after_if_else@4 , 21 -155 frame_dig 0 , 21, 21 -157 int 21 , 21, 21, 21 -159 % , 21, 0 -160 bz test_self_ref_phi_after_while@7 , 21 -172 frame_dig 0 , 21, 21 -174 uncover 1 , 21, 21 -176 retsub , 21 -15 pop -16 int 1 , 1 -17 callsub test_swap , 1 -177 proto 1 1 , 1 -180 int 1 , 1, 1 -181 int 2 , 1, 1, 2 -182 cover 1 , 1, 2, 1 -184 frame_dig -1 , 1, 2, 1, 1 -186 int 0 , 1, 2, 1, 1, 0 -187 > , 1, 2, 1, 1 -188 bz test_swap_after_while@3 , 1, 2, 1 -191 frame_dig -1 , 1, 2, 1, 1 -193 int 1 , 1, 2, 1, 1, 1 -194 - , 1, 2, 1, 0 -195 frame_bury -1 , 0, 2, 1 -197 frame_dig 0 , 0, 2, 1, 2 -199 cover 1 , 0, 2, 2, 1 -201 frame_bury 0 , 0, 1, 2 -203 b test_swap_while_top@1 , 0, 1, 2 -184 frame_dig -1 , 0, 1, 2, 0 -186 int 0 , 0, 1, 2, 0, 0 -187 > , 0, 1, 2, 0 -188 bz test_swap_after_while@3 , 0, 1, 2 -206 uncover 1 , 0, 2, 1 -208 retsub , 2 -20 dup , 2, 2 -21 cover 1 , 2, 2 -23 dup , 2, 2, 2 -24 itob , 2, 2, AAAAAAAAAAI= -25 log , 2, 2 -26 int 1 , 2, 2, 1 -27 >= , 2, 1 -28 bz main_bool_false@3 , 2 -31 dup , 2, 2 -32 int 2 , 2, 2, 2 -33 <= , 2, 1 -34 bz main_bool_false@3 , 2 -37 int 1 , 2, 1 -38 b main_bool_merge@4 , 2, 1 -42 assert , 2 -43 int 2 , 2, 2 -44 callsub test_swap , 2, 2 -177 proto 1 1 , 2, 2 -180 int 1 , 2, 2, 1 -181 int 2 , 2, 2, 1, 2 -182 cover 1 , 2, 2, 2, 1 -184 frame_dig -1 , 2, 2, 2, 1, 2 -186 int 0 , 2, 2, 2, 1, 2, 0 -187 > , 2, 2, 2, 1, 1 -188 bz test_swap_after_while@3 , 2, 2, 2, 1 -191 frame_dig -1 , 2, 2, 2, 1, 2 -193 int 1 , 2, 2, 2, 1, 2, 1 -194 - , 2, 2, 2, 1, 1 -195 frame_bury -1 , 2, 1, 2, 1 -197 frame_dig 0 , 2, 1, 2, 1, 2 -199 cover 1 , 2, 1, 2, 2, 1 -201 frame_bury 0 , 2, 1, 1, 2 -203 b test_swap_while_top@1 , 2, 1, 1, 2 -184 frame_dig -1 , 2, 1, 1, 2, 1 -186 int 0 , 2, 1, 1, 2, 1, 0 -187 > , 2, 1, 1, 2, 1 -188 bz test_swap_after_while@3 , 2, 1, 1, 2 -191 frame_dig -1 , 2, 1, 1, 2, 1 -193 int 1 , 2, 1, 1, 2, 1, 1 -194 - , 2, 1, 1, 2, 0 -195 frame_bury -1 , 2, 0, 1, 2 -197 frame_dig 0 , 2, 0, 1, 2, 1 -199 cover 1 , 2, 0, 1, 1, 2 -201 frame_bury 0 , 2, 0, 2, 1 -203 b test_swap_while_top@1 , 2, 0, 2, 1 -184 frame_dig -1 , 2, 0, 2, 1, 0 -186 int 0 , 2, 0, 2, 1, 0, 0 -187 > , 2, 0, 2, 1, 0 -188 bz test_swap_after_while@3 , 2, 0, 2, 1 -206 uncover 1 , 2, 0, 1, 2 -208 retsub , 2, 1 -47 dup , 2, 1, 1 -48 bury 3 1, 2, 1 -50 dup 1, 2, 1, 1 -51 itob 1, 2, 1, AAAAAAAAAAE= -52 log 1, 2, 1 -53 int 1 1, 2, 1, 1 -54 >= 1, 2, 1 -55 bz main_bool_false@7 1, 2 -58 dig 1 1, 2, 1 -60 int 2 1, 2, 1, 2 -61 <= 1, 2, 1 -62 bz main_bool_false@7 1, 2 -65 int 1 1, 2, 1 -66 b main_bool_merge@8 1, 2, 1 -70 assert 1, 2 -71 int 7 1, 2, 7 -73 int 11 1, 2, 7, 11 -75 callsub test_swap_loop 1, 2, 7, 11 -209 proto 2 1 1, 2, 7, 11 -212 int 1 1, 2, 7, 11, 1 -213 int 2 1, 2, 7, 11, 1, 2 -214 frame_dig -2 1, 2, 7, 11, 1, 2, 7 -216 int 0 1, 2, 7, 11, 1, 2, 7, 0 -217 > 1, 2, 7, 11, 1, 2, 1 -218 bz test_swap_loop_after_while@6 1, 2, 7, 11, 1, 2 -221 frame_dig 0 1, 2, 7, 11, 1, 2, 1 +10 byte "" 0x +12 callsub test_self_ref_phi 0x +129 proto 0 1 0x +132 int 1 0x, 1 +133 frame_dig 0 0x, 1, 1 +135 int 100 0x, 1, 1, 100 +136 < 0x, 1, 1 +137 bz test_self_ref_phi_after_while@7 0x, 1 +140 frame_dig 0 0x, 1, 1 +142 int 105 0x, 1, 1, 105 +144 % 0x, 1, 1 +145 ! 0x, 1, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 1 +152 frame_dig 0 0x, 1, 1 +154 int 21 0x, 1, 1, 21 +156 % 0x, 1, 1 +157 bz test_self_ref_phi_after_while@7 0x, 1 +160 frame_dig 0 0x, 1, 1 +162 int 1 0x, 1, 1, 1 +163 + 0x, 1, 2 +164 frame_bury 0 0x, 2 +166 b test_self_ref_phi_while_top@1 0x, 2 +133 frame_dig 0 0x, 2, 2 +135 int 100 0x, 2, 2, 100 +136 < 0x, 2, 1 +137 bz test_self_ref_phi_after_while@7 0x, 2 +140 frame_dig 0 0x, 2, 2 +142 int 105 0x, 2, 2, 105 +144 % 0x, 2, 2 +145 ! 0x, 2, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 2 +152 frame_dig 0 0x, 2, 2 +154 int 21 0x, 2, 2, 21 +156 % 0x, 2, 2 +157 bz test_self_ref_phi_after_while@7 0x, 2 +160 frame_dig 0 0x, 2, 2 +162 int 1 0x, 2, 2, 1 +163 + 0x, 2, 3 +164 frame_bury 0 0x, 3 +166 b test_self_ref_phi_while_top@1 0x, 3 +133 frame_dig 0 0x, 3, 3 +135 int 100 0x, 3, 3, 100 +136 < 0x, 3, 1 +137 bz test_self_ref_phi_after_while@7 0x, 3 +140 frame_dig 0 0x, 3, 3 +142 int 105 0x, 3, 3, 105 +144 % 0x, 3, 3 +145 ! 0x, 3, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 3 +152 frame_dig 0 0x, 3, 3 +154 int 21 0x, 3, 3, 21 +156 % 0x, 3, 3 +157 bz test_self_ref_phi_after_while@7 0x, 3 +160 frame_dig 0 0x, 3, 3 +162 int 1 0x, 3, 3, 1 +163 + 0x, 3, 4 +164 frame_bury 0 0x, 4 +166 b test_self_ref_phi_while_top@1 0x, 4 +133 frame_dig 0 0x, 4, 4 +135 int 100 0x, 4, 4, 100 +136 < 0x, 4, 1 +137 bz test_self_ref_phi_after_while@7 0x, 4 +140 frame_dig 0 0x, 4, 4 +142 int 105 0x, 4, 4, 105 +144 % 0x, 4, 4 +145 ! 0x, 4, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 4 +152 frame_dig 0 0x, 4, 4 +154 int 21 0x, 4, 4, 21 +156 % 0x, 4, 4 +157 bz test_self_ref_phi_after_while@7 0x, 4 +160 frame_dig 0 0x, 4, 4 +162 int 1 0x, 4, 4, 1 +163 + 0x, 4, 5 +164 frame_bury 0 0x, 5 +166 b test_self_ref_phi_while_top@1 0x, 5 +133 frame_dig 0 0x, 5, 5 +135 int 100 0x, 5, 5, 100 +136 < 0x, 5, 1 +137 bz test_self_ref_phi_after_while@7 0x, 5 +140 frame_dig 0 0x, 5, 5 +142 int 105 0x, 5, 5, 105 +144 % 0x, 5, 5 +145 ! 0x, 5, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 5 +152 frame_dig 0 0x, 5, 5 +154 int 21 0x, 5, 5, 21 +156 % 0x, 5, 5 +157 bz test_self_ref_phi_after_while@7 0x, 5 +160 frame_dig 0 0x, 5, 5 +162 int 1 0x, 5, 5, 1 +163 + 0x, 5, 6 +164 frame_bury 0 0x, 6 +166 b test_self_ref_phi_while_top@1 0x, 6 +133 frame_dig 0 0x, 6, 6 +135 int 100 0x, 6, 6, 100 +136 < 0x, 6, 1 +137 bz test_self_ref_phi_after_while@7 0x, 6 +140 frame_dig 0 0x, 6, 6 +142 int 105 0x, 6, 6, 105 +144 % 0x, 6, 6 +145 ! 0x, 6, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 6 +152 frame_dig 0 0x, 6, 6 +154 int 21 0x, 6, 6, 21 +156 % 0x, 6, 6 +157 bz test_self_ref_phi_after_while@7 0x, 6 +160 frame_dig 0 0x, 6, 6 +162 int 1 0x, 6, 6, 1 +163 + 0x, 6, 7 +164 frame_bury 0 0x, 7 +166 b test_self_ref_phi_while_top@1 0x, 7 +133 frame_dig 0 0x, 7, 7 +135 int 100 0x, 7, 7, 100 +136 < 0x, 7, 1 +137 bz test_self_ref_phi_after_while@7 0x, 7 +140 frame_dig 0 0x, 7, 7 +142 int 105 0x, 7, 7, 105 +144 % 0x, 7, 7 +145 ! 0x, 7, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 7 +152 frame_dig 0 0x, 7, 7 +154 int 21 0x, 7, 7, 21 +156 % 0x, 7, 7 +157 bz test_self_ref_phi_after_while@7 0x, 7 +160 frame_dig 0 0x, 7, 7 +162 int 1 0x, 7, 7, 1 +163 + 0x, 7, 8 +164 frame_bury 0 0x, 8 +166 b test_self_ref_phi_while_top@1 0x, 8 +133 frame_dig 0 0x, 8, 8 +135 int 100 0x, 8, 8, 100 +136 < 0x, 8, 1 +137 bz test_self_ref_phi_after_while@7 0x, 8 +140 frame_dig 0 0x, 8, 8 +142 int 105 0x, 8, 8, 105 +144 % 0x, 8, 8 +145 ! 0x, 8, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 8 +152 frame_dig 0 0x, 8, 8 +154 int 21 0x, 8, 8, 21 +156 % 0x, 8, 8 +157 bz test_self_ref_phi_after_while@7 0x, 8 +160 frame_dig 0 0x, 8, 8 +162 int 1 0x, 8, 8, 1 +163 + 0x, 8, 9 +164 frame_bury 0 0x, 9 +166 b test_self_ref_phi_while_top@1 0x, 9 +133 frame_dig 0 0x, 9, 9 +135 int 100 0x, 9, 9, 100 +136 < 0x, 9, 1 +137 bz test_self_ref_phi_after_while@7 0x, 9 +140 frame_dig 0 0x, 9, 9 +142 int 105 0x, 9, 9, 105 +144 % 0x, 9, 9 +145 ! 0x, 9, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 9 +152 frame_dig 0 0x, 9, 9 +154 int 21 0x, 9, 9, 21 +156 % 0x, 9, 9 +157 bz test_self_ref_phi_after_while@7 0x, 9 +160 frame_dig 0 0x, 9, 9 +162 int 1 0x, 9, 9, 1 +163 + 0x, 9, 10 +164 frame_bury 0 0x, 10 +166 b test_self_ref_phi_while_top@1 0x, 10 +133 frame_dig 0 0x, 10, 10 +135 int 100 0x, 10, 10, 100 +136 < 0x, 10, 1 +137 bz test_self_ref_phi_after_while@7 0x, 10 +140 frame_dig 0 0x, 10, 10 +142 int 105 0x, 10, 10, 105 +144 % 0x, 10, 10 +145 ! 0x, 10, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 10 +152 frame_dig 0 0x, 10, 10 +154 int 21 0x, 10, 10, 21 +156 % 0x, 10, 10 +157 bz test_self_ref_phi_after_while@7 0x, 10 +160 frame_dig 0 0x, 10, 10 +162 int 1 0x, 10, 10, 1 +163 + 0x, 10, 11 +164 frame_bury 0 0x, 11 +166 b test_self_ref_phi_while_top@1 0x, 11 +133 frame_dig 0 0x, 11, 11 +135 int 100 0x, 11, 11, 100 +136 < 0x, 11, 1 +137 bz test_self_ref_phi_after_while@7 0x, 11 +140 frame_dig 0 0x, 11, 11 +142 int 105 0x, 11, 11, 105 +144 % 0x, 11, 11 +145 ! 0x, 11, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 11 +152 frame_dig 0 0x, 11, 11 +154 int 21 0x, 11, 11, 21 +156 % 0x, 11, 11 +157 bz test_self_ref_phi_after_while@7 0x, 11 +160 frame_dig 0 0x, 11, 11 +162 int 1 0x, 11, 11, 1 +163 + 0x, 11, 12 +164 frame_bury 0 0x, 12 +166 b test_self_ref_phi_while_top@1 0x, 12 +133 frame_dig 0 0x, 12, 12 +135 int 100 0x, 12, 12, 100 +136 < 0x, 12, 1 +137 bz test_self_ref_phi_after_while@7 0x, 12 +140 frame_dig 0 0x, 12, 12 +142 int 105 0x, 12, 12, 105 +144 % 0x, 12, 12 +145 ! 0x, 12, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 12 +152 frame_dig 0 0x, 12, 12 +154 int 21 0x, 12, 12, 21 +156 % 0x, 12, 12 +157 bz test_self_ref_phi_after_while@7 0x, 12 +160 frame_dig 0 0x, 12, 12 +162 int 1 0x, 12, 12, 1 +163 + 0x, 12, 13 +164 frame_bury 0 0x, 13 +166 b test_self_ref_phi_while_top@1 0x, 13 +133 frame_dig 0 0x, 13, 13 +135 int 100 0x, 13, 13, 100 +136 < 0x, 13, 1 +137 bz test_self_ref_phi_after_while@7 0x, 13 +140 frame_dig 0 0x, 13, 13 +142 int 105 0x, 13, 13, 105 +144 % 0x, 13, 13 +145 ! 0x, 13, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 13 +152 frame_dig 0 0x, 13, 13 +154 int 21 0x, 13, 13, 21 +156 % 0x, 13, 13 +157 bz test_self_ref_phi_after_while@7 0x, 13 +160 frame_dig 0 0x, 13, 13 +162 int 1 0x, 13, 13, 1 +163 + 0x, 13, 14 +164 frame_bury 0 0x, 14 +166 b test_self_ref_phi_while_top@1 0x, 14 +133 frame_dig 0 0x, 14, 14 +135 int 100 0x, 14, 14, 100 +136 < 0x, 14, 1 +137 bz test_self_ref_phi_after_while@7 0x, 14 +140 frame_dig 0 0x, 14, 14 +142 int 105 0x, 14, 14, 105 +144 % 0x, 14, 14 +145 ! 0x, 14, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 14 +152 frame_dig 0 0x, 14, 14 +154 int 21 0x, 14, 14, 21 +156 % 0x, 14, 14 +157 bz test_self_ref_phi_after_while@7 0x, 14 +160 frame_dig 0 0x, 14, 14 +162 int 1 0x, 14, 14, 1 +163 + 0x, 14, 15 +164 frame_bury 0 0x, 15 +166 b test_self_ref_phi_while_top@1 0x, 15 +133 frame_dig 0 0x, 15, 15 +135 int 100 0x, 15, 15, 100 +136 < 0x, 15, 1 +137 bz test_self_ref_phi_after_while@7 0x, 15 +140 frame_dig 0 0x, 15, 15 +142 int 105 0x, 15, 15, 105 +144 % 0x, 15, 15 +145 ! 0x, 15, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 15 +152 frame_dig 0 0x, 15, 15 +154 int 21 0x, 15, 15, 21 +156 % 0x, 15, 15 +157 bz test_self_ref_phi_after_while@7 0x, 15 +160 frame_dig 0 0x, 15, 15 +162 int 1 0x, 15, 15, 1 +163 + 0x, 15, 16 +164 frame_bury 0 0x, 16 +166 b test_self_ref_phi_while_top@1 0x, 16 +133 frame_dig 0 0x, 16, 16 +135 int 100 0x, 16, 16, 100 +136 < 0x, 16, 1 +137 bz test_self_ref_phi_after_while@7 0x, 16 +140 frame_dig 0 0x, 16, 16 +142 int 105 0x, 16, 16, 105 +144 % 0x, 16, 16 +145 ! 0x, 16, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 16 +152 frame_dig 0 0x, 16, 16 +154 int 21 0x, 16, 16, 21 +156 % 0x, 16, 16 +157 bz test_self_ref_phi_after_while@7 0x, 16 +160 frame_dig 0 0x, 16, 16 +162 int 1 0x, 16, 16, 1 +163 + 0x, 16, 17 +164 frame_bury 0 0x, 17 +166 b test_self_ref_phi_while_top@1 0x, 17 +133 frame_dig 0 0x, 17, 17 +135 int 100 0x, 17, 17, 100 +136 < 0x, 17, 1 +137 bz test_self_ref_phi_after_while@7 0x, 17 +140 frame_dig 0 0x, 17, 17 +142 int 105 0x, 17, 17, 105 +144 % 0x, 17, 17 +145 ! 0x, 17, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 17 +152 frame_dig 0 0x, 17, 17 +154 int 21 0x, 17, 17, 21 +156 % 0x, 17, 17 +157 bz test_self_ref_phi_after_while@7 0x, 17 +160 frame_dig 0 0x, 17, 17 +162 int 1 0x, 17, 17, 1 +163 + 0x, 17, 18 +164 frame_bury 0 0x, 18 +166 b test_self_ref_phi_while_top@1 0x, 18 +133 frame_dig 0 0x, 18, 18 +135 int 100 0x, 18, 18, 100 +136 < 0x, 18, 1 +137 bz test_self_ref_phi_after_while@7 0x, 18 +140 frame_dig 0 0x, 18, 18 +142 int 105 0x, 18, 18, 105 +144 % 0x, 18, 18 +145 ! 0x, 18, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 18 +152 frame_dig 0 0x, 18, 18 +154 int 21 0x, 18, 18, 21 +156 % 0x, 18, 18 +157 bz test_self_ref_phi_after_while@7 0x, 18 +160 frame_dig 0 0x, 18, 18 +162 int 1 0x, 18, 18, 1 +163 + 0x, 18, 19 +164 frame_bury 0 0x, 19 +166 b test_self_ref_phi_while_top@1 0x, 19 +133 frame_dig 0 0x, 19, 19 +135 int 100 0x, 19, 19, 100 +136 < 0x, 19, 1 +137 bz test_self_ref_phi_after_while@7 0x, 19 +140 frame_dig 0 0x, 19, 19 +142 int 105 0x, 19, 19, 105 +144 % 0x, 19, 19 +145 ! 0x, 19, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 19 +152 frame_dig 0 0x, 19, 19 +154 int 21 0x, 19, 19, 21 +156 % 0x, 19, 19 +157 bz test_self_ref_phi_after_while@7 0x, 19 +160 frame_dig 0 0x, 19, 19 +162 int 1 0x, 19, 19, 1 +163 + 0x, 19, 20 +164 frame_bury 0 0x, 20 +166 b test_self_ref_phi_while_top@1 0x, 20 +133 frame_dig 0 0x, 20, 20 +135 int 100 0x, 20, 20, 100 +136 < 0x, 20, 1 +137 bz test_self_ref_phi_after_while@7 0x, 20 +140 frame_dig 0 0x, 20, 20 +142 int 105 0x, 20, 20, 105 +144 % 0x, 20, 20 +145 ! 0x, 20, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 20 +152 frame_dig 0 0x, 20, 20 +154 int 21 0x, 20, 20, 21 +156 % 0x, 20, 20 +157 bz test_self_ref_phi_after_while@7 0x, 20 +160 frame_dig 0 0x, 20, 20 +162 int 1 0x, 20, 20, 1 +163 + 0x, 20, 21 +164 frame_bury 0 0x, 21 +166 b test_self_ref_phi_while_top@1 0x, 21 +133 frame_dig 0 0x, 21, 21 +135 int 100 0x, 21, 21, 100 +136 < 0x, 21, 1 +137 bz test_self_ref_phi_after_while@7 0x, 21 +140 frame_dig 0 0x, 21, 21 +142 int 105 0x, 21, 21, 105 +144 % 0x, 21, 21 +145 ! 0x, 21, 0 +146 bz test_self_ref_phi_after_if_else@4 0x, 21 +152 frame_dig 0 0x, 21, 21 +154 int 21 0x, 21, 21, 21 +156 % 0x, 21, 0 +157 bz test_self_ref_phi_after_while@7 0x, 21 +169 frame_dig 0 0x, 21, 21 +171 swap 0x, 21, 21 +172 retsub 0x, 21 +15 pop 0x +16 int 1 0x, 1 +17 callsub test_swap 0x, 1 +173 proto 1 1 0x, 1 +176 int 1 0x, 1, 1 +177 int 2 0x, 1, 1, 2 +178 swap 0x, 1, 2, 1 +179 frame_dig -1 0x, 1, 2, 1, 1 +181 int 0 0x, 1, 2, 1, 1, 0 +182 > 0x, 1, 2, 1, 1 +183 bz test_swap_after_while@3 0x, 1, 2, 1 +186 frame_dig -1 0x, 1, 2, 1, 1 +188 int 1 0x, 1, 2, 1, 1, 1 +189 - 0x, 1, 2, 1, 0 +190 frame_bury -1 0x, 0, 2, 1 +192 frame_dig 0 0x, 0, 2, 1, 2 +194 swap 0x, 0, 2, 2, 1 +195 frame_bury 0 0x, 0, 1, 2 +197 b test_swap_while_top@1 0x, 0, 1, 2 +179 frame_dig -1 0x, 0, 1, 2, 0 +181 int 0 0x, 0, 1, 2, 0, 0 +182 > 0x, 0, 1, 2, 0 +183 bz test_swap_after_while@3 0x, 0, 1, 2 +200 swap 0x, 0, 2, 1 +201 retsub 0x, 2 +20 dup 0x, 2, 2 +21 swap 0x, 2, 2 +22 dup 0x, 2, 2, 2 +23 itob 0x, 2, 2, 0x0000000000000002 +24 log 0x, 2, 2 +25 int 1 0x, 2, 2, 1 +26 >= 0x, 2, 1 +27 bz main_bool_false@3 0x, 2 +30 dup 0x, 2, 2 +31 int 2 0x, 2, 2, 2 +32 <= 0x, 2, 1 +33 bz main_bool_false@3 0x, 2 +36 int 1 0x, 2, 1 +37 b main_bool_merge@4 0x, 2, 1 +41 assert 0x, 2 +42 int 2 0x, 2, 2 +43 callsub test_swap 0x, 2, 2 +173 proto 1 1 0x, 2, 2 +176 int 1 0x, 2, 2, 1 +177 int 2 0x, 2, 2, 1, 2 +178 swap 0x, 2, 2, 2, 1 +179 frame_dig -1 0x, 2, 2, 2, 1, 2 +181 int 0 0x, 2, 2, 2, 1, 2, 0 +182 > 0x, 2, 2, 2, 1, 1 +183 bz test_swap_after_while@3 0x, 2, 2, 2, 1 +186 frame_dig -1 0x, 2, 2, 2, 1, 2 +188 int 1 0x, 2, 2, 2, 1, 2, 1 +189 - 0x, 2, 2, 2, 1, 1 +190 frame_bury -1 0x, 2, 1, 2, 1 +192 frame_dig 0 0x, 2, 1, 2, 1, 2 +194 swap 0x, 2, 1, 2, 2, 1 +195 frame_bury 0 0x, 2, 1, 1, 2 +197 b test_swap_while_top@1 0x, 2, 1, 1, 2 +179 frame_dig -1 0x, 2, 1, 1, 2, 1 +181 int 0 0x, 2, 1, 1, 2, 1, 0 +182 > 0x, 2, 1, 1, 2, 1 +183 bz test_swap_after_while@3 0x, 2, 1, 1, 2 +186 frame_dig -1 0x, 2, 1, 1, 2, 1 +188 int 1 0x, 2, 1, 1, 2, 1, 1 +189 - 0x, 2, 1, 1, 2, 0 +190 frame_bury -1 0x, 2, 0, 1, 2 +192 frame_dig 0 0x, 2, 0, 1, 2, 1 +194 swap 0x, 2, 0, 1, 1, 2 +195 frame_bury 0 0x, 2, 0, 2, 1 +197 b test_swap_while_top@1 0x, 2, 0, 2, 1 +179 frame_dig -1 0x, 2, 0, 2, 1, 0 +181 int 0 0x, 2, 0, 2, 1, 0, 0 +182 > 0x, 2, 0, 2, 1, 0 +183 bz test_swap_after_while@3 0x, 2, 0, 2, 1 +200 swap 0x, 2, 0, 1, 2 +201 retsub 0x, 2, 1 +46 dup 0x, 2, 1, 1 +47 bury 3 1, 2, 1 +49 dup 1, 2, 1, 1 +50 itob 1, 2, 1, 0x0000000000000001 +51 log 1, 2, 1 +52 int 1 1, 2, 1, 1 +53 >= 1, 2, 1 +54 bz main_bool_false@7 1, 2 +57 dig 1 1, 2, 1 +59 int 2 1, 2, 1, 2 +60 <= 1, 2, 1 +61 bz main_bool_false@7 1, 2 +64 int 1 1, 2, 1 +65 b main_bool_merge@8 1, 2, 1 +69 assert 1, 2 +70 int 7 1, 2, 7 +72 int 11 1, 2, 7, 11 +74 callsub test_swap_loop 1, 2, 7, 11 +202 proto 2 1 1, 2, 7, 11 +205 int 1 1, 2, 7, 11, 1 +206 int 2 1, 2, 7, 11, 1, 2 +207 frame_dig -2 1, 2, 7, 11, 1, 2, 7 +209 int 0 1, 2, 7, 11, 1, 2, 7, 0 +210 > 1, 2, 7, 11, 1, 2, 1 +211 bz test_swap_loop_after_while@6 1, 2, 7, 11, 1, 2 +214 frame_dig 0 1, 2, 7, 11, 1, 2, 1 +216 frame_dig -1 1, 2, 7, 11, 1, 2, 1, 11 +218 int 0 1, 2, 7, 11, 1, 2, 1, 11, 0 +219 > 1, 2, 7, 11, 1, 2, 1, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 11, 1, 2, 1 223 frame_dig -1 1, 2, 7, 11, 1, 2, 1, 11 -225 int 0 1, 2, 7, 11, 1, 2, 1, 11, 0 -226 > 1, 2, 7, 11, 1, 2, 1, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 11, 1, 2, 1 -230 frame_dig -1 1, 2, 7, 11, 1, 2, 1, 11 -232 int 1 1, 2, 7, 11, 1, 2, 1, 11, 1 -233 - 1, 2, 7, 11, 1, 2, 1, 10 -234 frame_bury -1 1, 2, 7, 10, 1, 2, 1 -236 frame_dig 1 1, 2, 7, 10, 1, 2, 1, 2 -238 frame_bury 0 1, 2, 7, 10, 2, 2, 1 -240 frame_bury 1 1, 2, 7, 10, 2, 1 -242 b test_swap_loop_while_top@3 1, 2, 7, 10, 2, 1 -221 frame_dig 0 1, 2, 7, 10, 2, 1, 2 +225 int 1 1, 2, 7, 11, 1, 2, 1, 11, 1 +226 - 1, 2, 7, 11, 1, 2, 1, 10 +227 frame_bury -1 1, 2, 7, 10, 1, 2, 1 +229 frame_dig 1 1, 2, 7, 10, 1, 2, 1, 2 +231 frame_bury 0 1, 2, 7, 10, 2, 2, 1 +233 frame_bury 1 1, 2, 7, 10, 2, 1 +235 b test_swap_loop_while_top@3 1, 2, 7, 10, 2, 1 +214 frame_dig 0 1, 2, 7, 10, 2, 1, 2 +216 frame_dig -1 1, 2, 7, 10, 2, 1, 2, 10 +218 int 0 1, 2, 7, 10, 2, 1, 2, 10, 0 +219 > 1, 2, 7, 10, 2, 1, 2, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 10, 2, 1, 2 223 frame_dig -1 1, 2, 7, 10, 2, 1, 2, 10 -225 int 0 1, 2, 7, 10, 2, 1, 2, 10, 0 -226 > 1, 2, 7, 10, 2, 1, 2, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 10, 2, 1, 2 -230 frame_dig -1 1, 2, 7, 10, 2, 1, 2, 10 -232 int 1 1, 2, 7, 10, 2, 1, 2, 10, 1 -233 - 1, 2, 7, 10, 2, 1, 2, 9 -234 frame_bury -1 1, 2, 7, 9, 2, 1, 2 -236 frame_dig 1 1, 2, 7, 9, 2, 1, 2, 1 -238 frame_bury 0 1, 2, 7, 9, 1, 1, 2 -240 frame_bury 1 1, 2, 7, 9, 1, 2 -242 b test_swap_loop_while_top@3 1, 2, 7, 9, 1, 2 -221 frame_dig 0 1, 2, 7, 9, 1, 2, 1 +225 int 1 1, 2, 7, 10, 2, 1, 2, 10, 1 +226 - 1, 2, 7, 10, 2, 1, 2, 9 +227 frame_bury -1 1, 2, 7, 9, 2, 1, 2 +229 frame_dig 1 1, 2, 7, 9, 2, 1, 2, 1 +231 frame_bury 0 1, 2, 7, 9, 1, 1, 2 +233 frame_bury 1 1, 2, 7, 9, 1, 2 +235 b test_swap_loop_while_top@3 1, 2, 7, 9, 1, 2 +214 frame_dig 0 1, 2, 7, 9, 1, 2, 1 +216 frame_dig -1 1, 2, 7, 9, 1, 2, 1, 9 +218 int 0 1, 2, 7, 9, 1, 2, 1, 9, 0 +219 > 1, 2, 7, 9, 1, 2, 1, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 9, 1, 2, 1 223 frame_dig -1 1, 2, 7, 9, 1, 2, 1, 9 -225 int 0 1, 2, 7, 9, 1, 2, 1, 9, 0 -226 > 1, 2, 7, 9, 1, 2, 1, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 9, 1, 2, 1 -230 frame_dig -1 1, 2, 7, 9, 1, 2, 1, 9 -232 int 1 1, 2, 7, 9, 1, 2, 1, 9, 1 -233 - 1, 2, 7, 9, 1, 2, 1, 8 -234 frame_bury -1 1, 2, 7, 8, 1, 2, 1 -236 frame_dig 1 1, 2, 7, 8, 1, 2, 1, 2 -238 frame_bury 0 1, 2, 7, 8, 2, 2, 1 -240 frame_bury 1 1, 2, 7, 8, 2, 1 -242 b test_swap_loop_while_top@3 1, 2, 7, 8, 2, 1 -221 frame_dig 0 1, 2, 7, 8, 2, 1, 2 +225 int 1 1, 2, 7, 9, 1, 2, 1, 9, 1 +226 - 1, 2, 7, 9, 1, 2, 1, 8 +227 frame_bury -1 1, 2, 7, 8, 1, 2, 1 +229 frame_dig 1 1, 2, 7, 8, 1, 2, 1, 2 +231 frame_bury 0 1, 2, 7, 8, 2, 2, 1 +233 frame_bury 1 1, 2, 7, 8, 2, 1 +235 b test_swap_loop_while_top@3 1, 2, 7, 8, 2, 1 +214 frame_dig 0 1, 2, 7, 8, 2, 1, 2 +216 frame_dig -1 1, 2, 7, 8, 2, 1, 2, 8 +218 int 0 1, 2, 7, 8, 2, 1, 2, 8, 0 +219 > 1, 2, 7, 8, 2, 1, 2, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 8, 2, 1, 2 223 frame_dig -1 1, 2, 7, 8, 2, 1, 2, 8 -225 int 0 1, 2, 7, 8, 2, 1, 2, 8, 0 -226 > 1, 2, 7, 8, 2, 1, 2, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 8, 2, 1, 2 -230 frame_dig -1 1, 2, 7, 8, 2, 1, 2, 8 -232 int 1 1, 2, 7, 8, 2, 1, 2, 8, 1 -233 - 1, 2, 7, 8, 2, 1, 2, 7 -234 frame_bury -1 1, 2, 7, 7, 2, 1, 2 -236 frame_dig 1 1, 2, 7, 7, 2, 1, 2, 1 -238 frame_bury 0 1, 2, 7, 7, 1, 1, 2 -240 frame_bury 1 1, 2, 7, 7, 1, 2 -242 b test_swap_loop_while_top@3 1, 2, 7, 7, 1, 2 -221 frame_dig 0 1, 2, 7, 7, 1, 2, 1 +225 int 1 1, 2, 7, 8, 2, 1, 2, 8, 1 +226 - 1, 2, 7, 8, 2, 1, 2, 7 +227 frame_bury -1 1, 2, 7, 7, 2, 1, 2 +229 frame_dig 1 1, 2, 7, 7, 2, 1, 2, 1 +231 frame_bury 0 1, 2, 7, 7, 1, 1, 2 +233 frame_bury 1 1, 2, 7, 7, 1, 2 +235 b test_swap_loop_while_top@3 1, 2, 7, 7, 1, 2 +214 frame_dig 0 1, 2, 7, 7, 1, 2, 1 +216 frame_dig -1 1, 2, 7, 7, 1, 2, 1, 7 +218 int 0 1, 2, 7, 7, 1, 2, 1, 7, 0 +219 > 1, 2, 7, 7, 1, 2, 1, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 7, 1, 2, 1 223 frame_dig -1 1, 2, 7, 7, 1, 2, 1, 7 -225 int 0 1, 2, 7, 7, 1, 2, 1, 7, 0 -226 > 1, 2, 7, 7, 1, 2, 1, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 7, 1, 2, 1 -230 frame_dig -1 1, 2, 7, 7, 1, 2, 1, 7 -232 int 1 1, 2, 7, 7, 1, 2, 1, 7, 1 -233 - 1, 2, 7, 7, 1, 2, 1, 6 -234 frame_bury -1 1, 2, 7, 6, 1, 2, 1 -236 frame_dig 1 1, 2, 7, 6, 1, 2, 1, 2 -238 frame_bury 0 1, 2, 7, 6, 2, 2, 1 -240 frame_bury 1 1, 2, 7, 6, 2, 1 -242 b test_swap_loop_while_top@3 1, 2, 7, 6, 2, 1 -221 frame_dig 0 1, 2, 7, 6, 2, 1, 2 +225 int 1 1, 2, 7, 7, 1, 2, 1, 7, 1 +226 - 1, 2, 7, 7, 1, 2, 1, 6 +227 frame_bury -1 1, 2, 7, 6, 1, 2, 1 +229 frame_dig 1 1, 2, 7, 6, 1, 2, 1, 2 +231 frame_bury 0 1, 2, 7, 6, 2, 2, 1 +233 frame_bury 1 1, 2, 7, 6, 2, 1 +235 b test_swap_loop_while_top@3 1, 2, 7, 6, 2, 1 +214 frame_dig 0 1, 2, 7, 6, 2, 1, 2 +216 frame_dig -1 1, 2, 7, 6, 2, 1, 2, 6 +218 int 0 1, 2, 7, 6, 2, 1, 2, 6, 0 +219 > 1, 2, 7, 6, 2, 1, 2, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 6, 2, 1, 2 223 frame_dig -1 1, 2, 7, 6, 2, 1, 2, 6 -225 int 0 1, 2, 7, 6, 2, 1, 2, 6, 0 -226 > 1, 2, 7, 6, 2, 1, 2, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 6, 2, 1, 2 -230 frame_dig -1 1, 2, 7, 6, 2, 1, 2, 6 -232 int 1 1, 2, 7, 6, 2, 1, 2, 6, 1 -233 - 1, 2, 7, 6, 2, 1, 2, 5 -234 frame_bury -1 1, 2, 7, 5, 2, 1, 2 -236 frame_dig 1 1, 2, 7, 5, 2, 1, 2, 1 -238 frame_bury 0 1, 2, 7, 5, 1, 1, 2 -240 frame_bury 1 1, 2, 7, 5, 1, 2 -242 b test_swap_loop_while_top@3 1, 2, 7, 5, 1, 2 -221 frame_dig 0 1, 2, 7, 5, 1, 2, 1 +225 int 1 1, 2, 7, 6, 2, 1, 2, 6, 1 +226 - 1, 2, 7, 6, 2, 1, 2, 5 +227 frame_bury -1 1, 2, 7, 5, 2, 1, 2 +229 frame_dig 1 1, 2, 7, 5, 2, 1, 2, 1 +231 frame_bury 0 1, 2, 7, 5, 1, 1, 2 +233 frame_bury 1 1, 2, 7, 5, 1, 2 +235 b test_swap_loop_while_top@3 1, 2, 7, 5, 1, 2 +214 frame_dig 0 1, 2, 7, 5, 1, 2, 1 +216 frame_dig -1 1, 2, 7, 5, 1, 2, 1, 5 +218 int 0 1, 2, 7, 5, 1, 2, 1, 5, 0 +219 > 1, 2, 7, 5, 1, 2, 1, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 5, 1, 2, 1 223 frame_dig -1 1, 2, 7, 5, 1, 2, 1, 5 -225 int 0 1, 2, 7, 5, 1, 2, 1, 5, 0 -226 > 1, 2, 7, 5, 1, 2, 1, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 5, 1, 2, 1 -230 frame_dig -1 1, 2, 7, 5, 1, 2, 1, 5 -232 int 1 1, 2, 7, 5, 1, 2, 1, 5, 1 -233 - 1, 2, 7, 5, 1, 2, 1, 4 -234 frame_bury -1 1, 2, 7, 4, 1, 2, 1 -236 frame_dig 1 1, 2, 7, 4, 1, 2, 1, 2 -238 frame_bury 0 1, 2, 7, 4, 2, 2, 1 -240 frame_bury 1 1, 2, 7, 4, 2, 1 -242 b test_swap_loop_while_top@3 1, 2, 7, 4, 2, 1 -221 frame_dig 0 1, 2, 7, 4, 2, 1, 2 +225 int 1 1, 2, 7, 5, 1, 2, 1, 5, 1 +226 - 1, 2, 7, 5, 1, 2, 1, 4 +227 frame_bury -1 1, 2, 7, 4, 1, 2, 1 +229 frame_dig 1 1, 2, 7, 4, 1, 2, 1, 2 +231 frame_bury 0 1, 2, 7, 4, 2, 2, 1 +233 frame_bury 1 1, 2, 7, 4, 2, 1 +235 b test_swap_loop_while_top@3 1, 2, 7, 4, 2, 1 +214 frame_dig 0 1, 2, 7, 4, 2, 1, 2 +216 frame_dig -1 1, 2, 7, 4, 2, 1, 2, 4 +218 int 0 1, 2, 7, 4, 2, 1, 2, 4, 0 +219 > 1, 2, 7, 4, 2, 1, 2, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 4, 2, 1, 2 223 frame_dig -1 1, 2, 7, 4, 2, 1, 2, 4 -225 int 0 1, 2, 7, 4, 2, 1, 2, 4, 0 -226 > 1, 2, 7, 4, 2, 1, 2, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 4, 2, 1, 2 -230 frame_dig -1 1, 2, 7, 4, 2, 1, 2, 4 -232 int 1 1, 2, 7, 4, 2, 1, 2, 4, 1 -233 - 1, 2, 7, 4, 2, 1, 2, 3 -234 frame_bury -1 1, 2, 7, 3, 2, 1, 2 -236 frame_dig 1 1, 2, 7, 3, 2, 1, 2, 1 -238 frame_bury 0 1, 2, 7, 3, 1, 1, 2 -240 frame_bury 1 1, 2, 7, 3, 1, 2 -242 b test_swap_loop_while_top@3 1, 2, 7, 3, 1, 2 -221 frame_dig 0 1, 2, 7, 3, 1, 2, 1 +225 int 1 1, 2, 7, 4, 2, 1, 2, 4, 1 +226 - 1, 2, 7, 4, 2, 1, 2, 3 +227 frame_bury -1 1, 2, 7, 3, 2, 1, 2 +229 frame_dig 1 1, 2, 7, 3, 2, 1, 2, 1 +231 frame_bury 0 1, 2, 7, 3, 1, 1, 2 +233 frame_bury 1 1, 2, 7, 3, 1, 2 +235 b test_swap_loop_while_top@3 1, 2, 7, 3, 1, 2 +214 frame_dig 0 1, 2, 7, 3, 1, 2, 1 +216 frame_dig -1 1, 2, 7, 3, 1, 2, 1, 3 +218 int 0 1, 2, 7, 3, 1, 2, 1, 3, 0 +219 > 1, 2, 7, 3, 1, 2, 1, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 3, 1, 2, 1 223 frame_dig -1 1, 2, 7, 3, 1, 2, 1, 3 -225 int 0 1, 2, 7, 3, 1, 2, 1, 3, 0 -226 > 1, 2, 7, 3, 1, 2, 1, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 3, 1, 2, 1 -230 frame_dig -1 1, 2, 7, 3, 1, 2, 1, 3 -232 int 1 1, 2, 7, 3, 1, 2, 1, 3, 1 -233 - 1, 2, 7, 3, 1, 2, 1, 2 -234 frame_bury -1 1, 2, 7, 2, 1, 2, 1 -236 frame_dig 1 1, 2, 7, 2, 1, 2, 1, 2 -238 frame_bury 0 1, 2, 7, 2, 2, 2, 1 -240 frame_bury 1 1, 2, 7, 2, 2, 1 -242 b test_swap_loop_while_top@3 1, 2, 7, 2, 2, 1 -221 frame_dig 0 1, 2, 7, 2, 2, 1, 2 +225 int 1 1, 2, 7, 3, 1, 2, 1, 3, 1 +226 - 1, 2, 7, 3, 1, 2, 1, 2 +227 frame_bury -1 1, 2, 7, 2, 1, 2, 1 +229 frame_dig 1 1, 2, 7, 2, 1, 2, 1, 2 +231 frame_bury 0 1, 2, 7, 2, 2, 2, 1 +233 frame_bury 1 1, 2, 7, 2, 2, 1 +235 b test_swap_loop_while_top@3 1, 2, 7, 2, 2, 1 +214 frame_dig 0 1, 2, 7, 2, 2, 1, 2 +216 frame_dig -1 1, 2, 7, 2, 2, 1, 2, 2 +218 int 0 1, 2, 7, 2, 2, 1, 2, 2, 0 +219 > 1, 2, 7, 2, 2, 1, 2, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 2, 2, 1, 2 223 frame_dig -1 1, 2, 7, 2, 2, 1, 2, 2 -225 int 0 1, 2, 7, 2, 2, 1, 2, 2, 0 -226 > 1, 2, 7, 2, 2, 1, 2, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 2, 2, 1, 2 -230 frame_dig -1 1, 2, 7, 2, 2, 1, 2, 2 -232 int 1 1, 2, 7, 2, 2, 1, 2, 2, 1 -233 - 1, 2, 7, 2, 2, 1, 2, 1 -234 frame_bury -1 1, 2, 7, 1, 2, 1, 2 -236 frame_dig 1 1, 2, 7, 1, 2, 1, 2, 1 -238 frame_bury 0 1, 2, 7, 1, 1, 1, 2 -240 frame_bury 1 1, 2, 7, 1, 1, 2 -242 b test_swap_loop_while_top@3 1, 2, 7, 1, 1, 2 -221 frame_dig 0 1, 2, 7, 1, 1, 2, 1 +225 int 1 1, 2, 7, 2, 2, 1, 2, 2, 1 +226 - 1, 2, 7, 2, 2, 1, 2, 1 +227 frame_bury -1 1, 2, 7, 1, 2, 1, 2 +229 frame_dig 1 1, 2, 7, 1, 2, 1, 2, 1 +231 frame_bury 0 1, 2, 7, 1, 1, 1, 2 +233 frame_bury 1 1, 2, 7, 1, 1, 2 +235 b test_swap_loop_while_top@3 1, 2, 7, 1, 1, 2 +214 frame_dig 0 1, 2, 7, 1, 1, 2, 1 +216 frame_dig -1 1, 2, 7, 1, 1, 2, 1, 1 +218 int 0 1, 2, 7, 1, 1, 2, 1, 1, 0 +219 > 1, 2, 7, 1, 1, 2, 1, 1 +220 bz test_swap_loop_after_while@5 1, 2, 7, 1, 1, 2, 1 223 frame_dig -1 1, 2, 7, 1, 1, 2, 1, 1 -225 int 0 1, 2, 7, 1, 1, 2, 1, 1, 0 -226 > 1, 2, 7, 1, 1, 2, 1, 1 -227 bz test_swap_loop_after_while@5 1, 2, 7, 1, 1, 2, 1 -230 frame_dig -1 1, 2, 7, 1, 1, 2, 1, 1 -232 int 1 1, 2, 7, 1, 1, 2, 1, 1, 1 -233 - 1, 2, 7, 1, 1, 2, 1, 0 -234 frame_bury -1 1, 2, 7, 0, 1, 2, 1 -236 frame_dig 1 1, 2, 7, 0, 1, 2, 1, 2 -238 frame_bury 0 1, 2, 7, 0, 2, 2, 1 -240 frame_bury 1 1, 2, 7, 0, 2, 1 -242 b test_swap_loop_while_top@3 1, 2, 7, 0, 2, 1 -221 frame_dig 0 1, 2, 7, 0, 2, 1, 2 -223 frame_dig -1 1, 2, 7, 0, 2, 1, 2, 0 -225 int 0 1, 2, 7, 0, 2, 1, 2, 0, 0 -226 > 1, 2, 7, 0, 2, 1, 2, 0 -227 bz test_swap_loop_after_while@5 1, 2, 7, 0, 2, 1, 2 -245 frame_dig -2 1, 2, 7, 0, 2, 1, 2, 7 -247 int 1 1, 2, 7, 0, 2, 1, 2, 7, 1 -248 - 1, 2, 7, 0, 2, 1, 2, 6 -249 frame_bury -2 1, 2, 6, 0, 2, 1, 2 -251 frame_bury 0 1, 2, 6, 0, 2, 1 -253 b test_swap_loop_while_top@1 1, 2, 6, 0, 2, 1 -214 frame_dig -2 1, 2, 6, 0, 2, 1, 6 -216 int 0 1, 2, 6, 0, 2, 1, 6, 0 -217 > 1, 2, 6, 0, 2, 1, 1 -218 bz test_swap_loop_after_while@6 1, 2, 6, 0, 2, 1 -221 frame_dig 0 1, 2, 6, 0, 2, 1, 2 -223 frame_dig -1 1, 2, 6, 0, 2, 1, 2, 0 -225 int 0 1, 2, 6, 0, 2, 1, 2, 0, 0 -226 > 1, 2, 6, 0, 2, 1, 2, 0 -227 bz test_swap_loop_after_while@5 1, 2, 6, 0, 2, 1, 2 -245 frame_dig -2 1, 2, 6, 0, 2, 1, 2, 6 -247 int 1 1, 2, 6, 0, 2, 1, 2, 6, 1 -248 - 1, 2, 6, 0, 2, 1, 2, 5 -249 frame_bury -2 1, 2, 5, 0, 2, 1, 2 -251 frame_bury 0 1, 2, 5, 0, 2, 1 -253 b test_swap_loop_while_top@1 1, 2, 5, 0, 2, 1 -214 frame_dig -2 1, 2, 5, 0, 2, 1, 5 -216 int 0 1, 2, 5, 0, 2, 1, 5, 0 -217 > 1, 2, 5, 0, 2, 1, 1 -218 bz test_swap_loop_after_while@6 1, 2, 5, 0, 2, 1 -221 frame_dig 0 1, 2, 5, 0, 2, 1, 2 -223 frame_dig -1 1, 2, 5, 0, 2, 1, 2, 0 -225 int 0 1, 2, 5, 0, 2, 1, 2, 0, 0 -226 > 1, 2, 5, 0, 2, 1, 2, 0 -227 bz test_swap_loop_after_while@5 1, 2, 5, 0, 2, 1, 2 -245 frame_dig -2 1, 2, 5, 0, 2, 1, 2, 5 -247 int 1 1, 2, 5, 0, 2, 1, 2, 5, 1 -248 - 1, 2, 5, 0, 2, 1, 2, 4 -249 frame_bury -2 1, 2, 4, 0, 2, 1, 2 -251 frame_bury 0 1, 2, 4, 0, 2, 1 -253 b test_swap_loop_while_top@1 1, 2, 4, 0, 2, 1 -214 frame_dig -2 1, 2, 4, 0, 2, 1, 4 -216 int 0 1, 2, 4, 0, 2, 1, 4, 0 -217 > 1, 2, 4, 0, 2, 1, 1 -218 bz test_swap_loop_after_while@6 1, 2, 4, 0, 2, 1 -221 frame_dig 0 1, 2, 4, 0, 2, 1, 2 -223 frame_dig -1 1, 2, 4, 0, 2, 1, 2, 0 -225 int 0 1, 2, 4, 0, 2, 1, 2, 0, 0 -226 > 1, 2, 4, 0, 2, 1, 2, 0 -227 bz test_swap_loop_after_while@5 1, 2, 4, 0, 2, 1, 2 -245 frame_dig -2 1, 2, 4, 0, 2, 1, 2, 4 -247 int 1 1, 2, 4, 0, 2, 1, 2, 4, 1 -248 - 1, 2, 4, 0, 2, 1, 2, 3 -249 frame_bury -2 1, 2, 3, 0, 2, 1, 2 -251 frame_bury 0 1, 2, 3, 0, 2, 1 -253 b test_swap_loop_while_top@1 1, 2, 3, 0, 2, 1 -214 frame_dig -2 1, 2, 3, 0, 2, 1, 3 -216 int 0 1, 2, 3, 0, 2, 1, 3, 0 -217 > 1, 2, 3, 0, 2, 1, 1 -218 bz test_swap_loop_after_while@6 1, 2, 3, 0, 2, 1 -221 frame_dig 0 1, 2, 3, 0, 2, 1, 2 -223 frame_dig -1 1, 2, 3, 0, 2, 1, 2, 0 -225 int 0 1, 2, 3, 0, 2, 1, 2, 0, 0 -226 > 1, 2, 3, 0, 2, 1, 2, 0 -227 bz test_swap_loop_after_while@5 1, 2, 3, 0, 2, 1, 2 -245 frame_dig -2 1, 2, 3, 0, 2, 1, 2, 3 -247 int 1 1, 2, 3, 0, 2, 1, 2, 3, 1 -248 - 1, 2, 3, 0, 2, 1, 2, 2 -249 frame_bury -2 1, 2, 2, 0, 2, 1, 2 -251 frame_bury 0 1, 2, 2, 0, 2, 1 -253 b test_swap_loop_while_top@1 1, 2, 2, 0, 2, 1 -214 frame_dig -2 1, 2, 2, 0, 2, 1, 2 -216 int 0 1, 2, 2, 0, 2, 1, 2, 0 -217 > 1, 2, 2, 0, 2, 1, 1 -218 bz test_swap_loop_after_while@6 1, 2, 2, 0, 2, 1 -221 frame_dig 0 1, 2, 2, 0, 2, 1, 2 -223 frame_dig -1 1, 2, 2, 0, 2, 1, 2, 0 -225 int 0 1, 2, 2, 0, 2, 1, 2, 0, 0 -226 > 1, 2, 2, 0, 2, 1, 2, 0 -227 bz test_swap_loop_after_while@5 1, 2, 2, 0, 2, 1, 2 -245 frame_dig -2 1, 2, 2, 0, 2, 1, 2, 2 -247 int 1 1, 2, 2, 0, 2, 1, 2, 2, 1 -248 - 1, 2, 2, 0, 2, 1, 2, 1 -249 frame_bury -2 1, 2, 1, 0, 2, 1, 2 -251 frame_bury 0 1, 2, 1, 0, 2, 1 -253 b test_swap_loop_while_top@1 1, 2, 1, 0, 2, 1 -214 frame_dig -2 1, 2, 1, 0, 2, 1, 1 -216 int 0 1, 2, 1, 0, 2, 1, 1, 0 -217 > 1, 2, 1, 0, 2, 1, 1 -218 bz test_swap_loop_after_while@6 1, 2, 1, 0, 2, 1 -221 frame_dig 0 1, 2, 1, 0, 2, 1, 2 -223 frame_dig -1 1, 2, 1, 0, 2, 1, 2, 0 -225 int 0 1, 2, 1, 0, 2, 1, 2, 0, 0 -226 > 1, 2, 1, 0, 2, 1, 2, 0 -227 bz test_swap_loop_after_while@5 1, 2, 1, 0, 2, 1, 2 -245 frame_dig -2 1, 2, 1, 0, 2, 1, 2, 1 -247 int 1 1, 2, 1, 0, 2, 1, 2, 1, 1 -248 - 1, 2, 1, 0, 2, 1, 2, 0 -249 frame_bury -2 1, 2, 0, 0, 2, 1, 2 -251 frame_bury 0 1, 2, 0, 0, 2, 1 -253 b test_swap_loop_while_top@1 1, 2, 0, 0, 2, 1 -214 frame_dig -2 1, 2, 0, 0, 2, 1, 0 -216 int 0 1, 2, 0, 0, 2, 1, 0, 0 -217 > 1, 2, 0, 0, 2, 1, 0 -218 bz test_swap_loop_after_while@6 1, 2, 0, 0, 2, 1 -256 retsub 1, 2, 2 -78 pop 1, 2 -79 int 0 1, 2, 0 -80 callsub test_param_update_with_reentrant_entry_block 1, 2, 0 -257 proto 1 1 1, 2, 0 -260 frame_dig -1 1, 2, 0, 0 -262 int 1 1, 2, 0, 0, 1 -263 + 1, 2, 0, 1 -264 dup 1, 2, 0, 1, 1 -265 frame_bury -1 1, 2, 1, 1 -267 int 10 1, 2, 1, 1, 10 -269 >= 1, 2, 1, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 1 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 1 -260 frame_dig -1 1, 2, 1, 1 -262 int 1 1, 2, 1, 1, 1 -263 + 1, 2, 1, 2 -264 dup 1, 2, 1, 2, 2 -265 frame_bury -1 1, 2, 2, 2 -267 int 10 1, 2, 2, 2, 10 -269 >= 1, 2, 2, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 2 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 2 -260 frame_dig -1 1, 2, 2, 2 -262 int 1 1, 2, 2, 2, 1 -263 + 1, 2, 2, 3 -264 dup 1, 2, 2, 3, 3 -265 frame_bury -1 1, 2, 3, 3 -267 int 10 1, 2, 3, 3, 10 -269 >= 1, 2, 3, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 3 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 3 -260 frame_dig -1 1, 2, 3, 3 -262 int 1 1, 2, 3, 3, 1 -263 + 1, 2, 3, 4 -264 dup 1, 2, 3, 4, 4 -265 frame_bury -1 1, 2, 4, 4 -267 int 10 1, 2, 4, 4, 10 -269 >= 1, 2, 4, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 4 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 4 -260 frame_dig -1 1, 2, 4, 4 -262 int 1 1, 2, 4, 4, 1 -263 + 1, 2, 4, 5 -264 dup 1, 2, 4, 5, 5 -265 frame_bury -1 1, 2, 5, 5 -267 int 10 1, 2, 5, 5, 10 -269 >= 1, 2, 5, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 5 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 5 -260 frame_dig -1 1, 2, 5, 5 -262 int 1 1, 2, 5, 5, 1 -263 + 1, 2, 5, 6 -264 dup 1, 2, 5, 6, 6 -265 frame_bury -1 1, 2, 6, 6 -267 int 10 1, 2, 6, 6, 10 -269 >= 1, 2, 6, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 6 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 6 -260 frame_dig -1 1, 2, 6, 6 -262 int 1 1, 2, 6, 6, 1 -263 + 1, 2, 6, 7 -264 dup 1, 2, 6, 7, 7 -265 frame_bury -1 1, 2, 7, 7 -267 int 10 1, 2, 7, 7, 10 -269 >= 1, 2, 7, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 7 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 7 -260 frame_dig -1 1, 2, 7, 7 -262 int 1 1, 2, 7, 7, 1 -263 + 1, 2, 7, 8 -264 dup 1, 2, 7, 8, 8 -265 frame_bury -1 1, 2, 8, 8 -267 int 10 1, 2, 8, 8, 10 -269 >= 1, 2, 8, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 8 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 8 -260 frame_dig -1 1, 2, 8, 8 -262 int 1 1, 2, 8, 8, 1 -263 + 1, 2, 8, 9 -264 dup 1, 2, 8, 9, 9 -265 frame_bury -1 1, 2, 9, 9 -267 int 10 1, 2, 9, 9, 10 -269 >= 1, 2, 9, 0 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 9 -276 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 9 -260 frame_dig -1 1, 2, 9, 9 -262 int 1 1, 2, 9, 9, 1 -263 + 1, 2, 9, 10 -264 dup 1, 2, 9, 10, 10 -265 frame_bury -1 1, 2, 10, 10 -267 int 10 1, 2, 10, 10, 10 -269 >= 1, 2, 10, 1 -270 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 10 -273 frame_dig -1 1, 2, 10, 10 -275 retsub 1, 2, 10 -83 int 10 1, 2, 10, 10 -85 == 1, 2, 1 -86 assert 1, 2 -87 int 0 1, 2, 0 -88 callsub test_param_update_with_reentrant_entry_block_v2 1, 2, 0 -279 proto 1 1 1, 2, 0 -282 frame_dig -1 1, 2, 0, 0 -284 int 1 1, 2, 0, 0, 1 -285 + 1, 2, 0, 1 -286 frame_bury -1 1, 2, 1 +225 int 1 1, 2, 7, 1, 1, 2, 1, 1, 1 +226 - 1, 2, 7, 1, 1, 2, 1, 0 +227 frame_bury -1 1, 2, 7, 0, 1, 2, 1 +229 frame_dig 1 1, 2, 7, 0, 1, 2, 1, 2 +231 frame_bury 0 1, 2, 7, 0, 2, 2, 1 +233 frame_bury 1 1, 2, 7, 0, 2, 1 +235 b test_swap_loop_while_top@3 1, 2, 7, 0, 2, 1 +214 frame_dig 0 1, 2, 7, 0, 2, 1, 2 +216 frame_dig -1 1, 2, 7, 0, 2, 1, 2, 0 +218 int 0 1, 2, 7, 0, 2, 1, 2, 0, 0 +219 > 1, 2, 7, 0, 2, 1, 2, 0 +220 bz test_swap_loop_after_while@5 1, 2, 7, 0, 2, 1, 2 +238 frame_dig -2 1, 2, 7, 0, 2, 1, 2, 7 +240 int 1 1, 2, 7, 0, 2, 1, 2, 7, 1 +241 - 1, 2, 7, 0, 2, 1, 2, 6 +242 frame_bury -2 1, 2, 6, 0, 2, 1, 2 +244 frame_bury 0 1, 2, 6, 0, 2, 1 +246 b test_swap_loop_while_top@1 1, 2, 6, 0, 2, 1 +207 frame_dig -2 1, 2, 6, 0, 2, 1, 6 +209 int 0 1, 2, 6, 0, 2, 1, 6, 0 +210 > 1, 2, 6, 0, 2, 1, 1 +211 bz test_swap_loop_after_while@6 1, 2, 6, 0, 2, 1 +214 frame_dig 0 1, 2, 6, 0, 2, 1, 2 +216 frame_dig -1 1, 2, 6, 0, 2, 1, 2, 0 +218 int 0 1, 2, 6, 0, 2, 1, 2, 0, 0 +219 > 1, 2, 6, 0, 2, 1, 2, 0 +220 bz test_swap_loop_after_while@5 1, 2, 6, 0, 2, 1, 2 +238 frame_dig -2 1, 2, 6, 0, 2, 1, 2, 6 +240 int 1 1, 2, 6, 0, 2, 1, 2, 6, 1 +241 - 1, 2, 6, 0, 2, 1, 2, 5 +242 frame_bury -2 1, 2, 5, 0, 2, 1, 2 +244 frame_bury 0 1, 2, 5, 0, 2, 1 +246 b test_swap_loop_while_top@1 1, 2, 5, 0, 2, 1 +207 frame_dig -2 1, 2, 5, 0, 2, 1, 5 +209 int 0 1, 2, 5, 0, 2, 1, 5, 0 +210 > 1, 2, 5, 0, 2, 1, 1 +211 bz test_swap_loop_after_while@6 1, 2, 5, 0, 2, 1 +214 frame_dig 0 1, 2, 5, 0, 2, 1, 2 +216 frame_dig -1 1, 2, 5, 0, 2, 1, 2, 0 +218 int 0 1, 2, 5, 0, 2, 1, 2, 0, 0 +219 > 1, 2, 5, 0, 2, 1, 2, 0 +220 bz test_swap_loop_after_while@5 1, 2, 5, 0, 2, 1, 2 +238 frame_dig -2 1, 2, 5, 0, 2, 1, 2, 5 +240 int 1 1, 2, 5, 0, 2, 1, 2, 5, 1 +241 - 1, 2, 5, 0, 2, 1, 2, 4 +242 frame_bury -2 1, 2, 4, 0, 2, 1, 2 +244 frame_bury 0 1, 2, 4, 0, 2, 1 +246 b test_swap_loop_while_top@1 1, 2, 4, 0, 2, 1 +207 frame_dig -2 1, 2, 4, 0, 2, 1, 4 +209 int 0 1, 2, 4, 0, 2, 1, 4, 0 +210 > 1, 2, 4, 0, 2, 1, 1 +211 bz test_swap_loop_after_while@6 1, 2, 4, 0, 2, 1 +214 frame_dig 0 1, 2, 4, 0, 2, 1, 2 +216 frame_dig -1 1, 2, 4, 0, 2, 1, 2, 0 +218 int 0 1, 2, 4, 0, 2, 1, 2, 0, 0 +219 > 1, 2, 4, 0, 2, 1, 2, 0 +220 bz test_swap_loop_after_while@5 1, 2, 4, 0, 2, 1, 2 +238 frame_dig -2 1, 2, 4, 0, 2, 1, 2, 4 +240 int 1 1, 2, 4, 0, 2, 1, 2, 4, 1 +241 - 1, 2, 4, 0, 2, 1, 2, 3 +242 frame_bury -2 1, 2, 3, 0, 2, 1, 2 +244 frame_bury 0 1, 2, 3, 0, 2, 1 +246 b test_swap_loop_while_top@1 1, 2, 3, 0, 2, 1 +207 frame_dig -2 1, 2, 3, 0, 2, 1, 3 +209 int 0 1, 2, 3, 0, 2, 1, 3, 0 +210 > 1, 2, 3, 0, 2, 1, 1 +211 bz test_swap_loop_after_while@6 1, 2, 3, 0, 2, 1 +214 frame_dig 0 1, 2, 3, 0, 2, 1, 2 +216 frame_dig -1 1, 2, 3, 0, 2, 1, 2, 0 +218 int 0 1, 2, 3, 0, 2, 1, 2, 0, 0 +219 > 1, 2, 3, 0, 2, 1, 2, 0 +220 bz test_swap_loop_after_while@5 1, 2, 3, 0, 2, 1, 2 +238 frame_dig -2 1, 2, 3, 0, 2, 1, 2, 3 +240 int 1 1, 2, 3, 0, 2, 1, 2, 3, 1 +241 - 1, 2, 3, 0, 2, 1, 2, 2 +242 frame_bury -2 1, 2, 2, 0, 2, 1, 2 +244 frame_bury 0 1, 2, 2, 0, 2, 1 +246 b test_swap_loop_while_top@1 1, 2, 2, 0, 2, 1 +207 frame_dig -2 1, 2, 2, 0, 2, 1, 2 +209 int 0 1, 2, 2, 0, 2, 1, 2, 0 +210 > 1, 2, 2, 0, 2, 1, 1 +211 bz test_swap_loop_after_while@6 1, 2, 2, 0, 2, 1 +214 frame_dig 0 1, 2, 2, 0, 2, 1, 2 +216 frame_dig -1 1, 2, 2, 0, 2, 1, 2, 0 +218 int 0 1, 2, 2, 0, 2, 1, 2, 0, 0 +219 > 1, 2, 2, 0, 2, 1, 2, 0 +220 bz test_swap_loop_after_while@5 1, 2, 2, 0, 2, 1, 2 +238 frame_dig -2 1, 2, 2, 0, 2, 1, 2, 2 +240 int 1 1, 2, 2, 0, 2, 1, 2, 2, 1 +241 - 1, 2, 2, 0, 2, 1, 2, 1 +242 frame_bury -2 1, 2, 1, 0, 2, 1, 2 +244 frame_bury 0 1, 2, 1, 0, 2, 1 +246 b test_swap_loop_while_top@1 1, 2, 1, 0, 2, 1 +207 frame_dig -2 1, 2, 1, 0, 2, 1, 1 +209 int 0 1, 2, 1, 0, 2, 1, 1, 0 +210 > 1, 2, 1, 0, 2, 1, 1 +211 bz test_swap_loop_after_while@6 1, 2, 1, 0, 2, 1 +214 frame_dig 0 1, 2, 1, 0, 2, 1, 2 +216 frame_dig -1 1, 2, 1, 0, 2, 1, 2, 0 +218 int 0 1, 2, 1, 0, 2, 1, 2, 0, 0 +219 > 1, 2, 1, 0, 2, 1, 2, 0 +220 bz test_swap_loop_after_while@5 1, 2, 1, 0, 2, 1, 2 +238 frame_dig -2 1, 2, 1, 0, 2, 1, 2, 1 +240 int 1 1, 2, 1, 0, 2, 1, 2, 1, 1 +241 - 1, 2, 1, 0, 2, 1, 2, 0 +242 frame_bury -2 1, 2, 0, 0, 2, 1, 2 +244 frame_bury 0 1, 2, 0, 0, 2, 1 +246 b test_swap_loop_while_top@1 1, 2, 0, 0, 2, 1 +207 frame_dig -2 1, 2, 0, 0, 2, 1, 0 +209 int 0 1, 2, 0, 0, 2, 1, 0, 0 +210 > 1, 2, 0, 0, 2, 1, 0 +211 bz test_swap_loop_after_while@6 1, 2, 0, 0, 2, 1 +249 retsub 1, 2, 2 +77 pop 1, 2 +78 int 0 1, 2, 0 +79 callsub test_param_update_with_reentrant_entry_block 1, 2, 0 +250 proto 1 1 1, 2, 0 +253 frame_dig -1 1, 2, 0, 0 +255 int 1 1, 2, 0, 0, 1 +256 + 1, 2, 0, 1 +257 dup 1, 2, 0, 1, 1 +258 frame_bury -1 1, 2, 1, 1 +260 int 10 1, 2, 1, 1, 10 +262 >= 1, 2, 1, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 1 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 1 +253 frame_dig -1 1, 2, 1, 1 +255 int 1 1, 2, 1, 1, 1 +256 + 1, 2, 1, 2 +257 dup 1, 2, 1, 2, 2 +258 frame_bury -1 1, 2, 2, 2 +260 int 10 1, 2, 2, 2, 10 +262 >= 1, 2, 2, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 2 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 2 +253 frame_dig -1 1, 2, 2, 2 +255 int 1 1, 2, 2, 2, 1 +256 + 1, 2, 2, 3 +257 dup 1, 2, 2, 3, 3 +258 frame_bury -1 1, 2, 3, 3 +260 int 10 1, 2, 3, 3, 10 +262 >= 1, 2, 3, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 3 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 3 +253 frame_dig -1 1, 2, 3, 3 +255 int 1 1, 2, 3, 3, 1 +256 + 1, 2, 3, 4 +257 dup 1, 2, 3, 4, 4 +258 frame_bury -1 1, 2, 4, 4 +260 int 10 1, 2, 4, 4, 10 +262 >= 1, 2, 4, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 4 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 4 +253 frame_dig -1 1, 2, 4, 4 +255 int 1 1, 2, 4, 4, 1 +256 + 1, 2, 4, 5 +257 dup 1, 2, 4, 5, 5 +258 frame_bury -1 1, 2, 5, 5 +260 int 10 1, 2, 5, 5, 10 +262 >= 1, 2, 5, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 5 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 5 +253 frame_dig -1 1, 2, 5, 5 +255 int 1 1, 2, 5, 5, 1 +256 + 1, 2, 5, 6 +257 dup 1, 2, 5, 6, 6 +258 frame_bury -1 1, 2, 6, 6 +260 int 10 1, 2, 6, 6, 10 +262 >= 1, 2, 6, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 6 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 6 +253 frame_dig -1 1, 2, 6, 6 +255 int 1 1, 2, 6, 6, 1 +256 + 1, 2, 6, 7 +257 dup 1, 2, 6, 7, 7 +258 frame_bury -1 1, 2, 7, 7 +260 int 10 1, 2, 7, 7, 10 +262 >= 1, 2, 7, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 7 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 7 +253 frame_dig -1 1, 2, 7, 7 +255 int 1 1, 2, 7, 7, 1 +256 + 1, 2, 7, 8 +257 dup 1, 2, 7, 8, 8 +258 frame_bury -1 1, 2, 8, 8 +260 int 10 1, 2, 8, 8, 10 +262 >= 1, 2, 8, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 8 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 8 +253 frame_dig -1 1, 2, 8, 8 +255 int 1 1, 2, 8, 8, 1 +256 + 1, 2, 8, 9 +257 dup 1, 2, 8, 9, 9 +258 frame_bury -1 1, 2, 9, 9 +260 int 10 1, 2, 9, 9, 10 +262 >= 1, 2, 9, 0 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 9 +269 b test_param_update_with_reentrant_entry_block_while_top@1 1, 2, 9 +253 frame_dig -1 1, 2, 9, 9 +255 int 1 1, 2, 9, 9, 1 +256 + 1, 2, 9, 10 +257 dup 1, 2, 9, 10, 10 +258 frame_bury -1 1, 2, 10, 10 +260 int 10 1, 2, 10, 10, 10 +262 >= 1, 2, 10, 1 +263 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 2, 10 +266 frame_dig -1 1, 2, 10, 10 +268 retsub 1, 2, 10 +82 int 10 1, 2, 10, 10 +84 == 1, 2, 1 +85 assert 1, 2 +86 int 0 1, 2, 0 +87 callsub test_param_update_with_reentrant_entry_block_v2 1, 2, 0 +272 proto 1 1 1, 2, 0 +275 frame_dig -1 1, 2, 0, 0 +277 int 1 1, 2, 0, 0, 1 +278 + 1, 2, 0, 1 +279 frame_bury -1 1, 2, 1 +281 frame_dig -1 1, 2, 1, 1 +283 int 1 1, 2, 1, 1, 1 +284 >= 1, 2, 1, 1 +285 bz test_param_update_with_reentrant_entry_block_v2_while_top@1 1, 2, 1 288 frame_dig -1 1, 2, 1, 1 -290 int 1 1, 2, 1, 1, 1 -291 >= 1, 2, 1, 1 -292 bz test_param_update_with_reentrant_entry_block_v2_while_top@1 1, 2, 1 -295 frame_dig -1 1, 2, 1, 1 -297 retsub 1, 2, 1 -91 pop 1, 2 -92 callsub test_param_update_with_reentrant_entry_block_v3 1, 2 -298 proto 0 0 1, 2 -301 callsub one 1, 2 -308 proto 0 1 1, 2 -311 int 1 1, 2, 1 -312 retsub 1, 2, 1 -304 bz test_param_update_with_reentrant_entry_block_v3_while_top@1 1, 2 -307 retsub 1, 2 -95 callsub test_swap_args 1, 2 -313 proto 0 0 1, 2 -316 callsub one 1, 2 -308 proto 0 1 1, 2 -311 int 1 1, 2, 1 -312 retsub 1, 2, 1 -319 int 123 1, 2, 1, 123 -321 + 1, 2, 124 -322 callsub one 1, 2, 124 -308 proto 0 1 1, 2, 124 -311 int 1 1, 2, 124, 1 -312 retsub 1, 2, 124, 1 -325 int 234 1, 2, 124, 1, 234 -328 + 1, 2, 124, 235 -329 callsub swap_args 1, 2, 124, 235 -344 proto 2 2 1, 2, 124, 235 -347 frame_dig -1 1, 2, 124, 235, 235 -349 frame_dig -2 1, 2, 124, 235, 235, 124 -351 retsub 1, 2, 235, 124 -332 cover 1 1, 2, 124, 235 -334 int 235 1, 2, 124, 235, 235 -337 == 1, 2, 124, 1 -338 assert 1, 2, 124 -339 int 124 1, 2, 124, 124 -341 == 1, 2, 1 -342 assert 1, 2 -343 retsub 1, 2 -98 int 100 1, 2, 100 -99 int 200 1, 2, 100, 200 -101 int 0 1, 2, 100, 200, 0 -102 callsub test_tuple_swap 1, 2, 100, 200, 0 -352 proto 3 2 1, 2, 100, 200, 0 -355 int 0 1, 2, 100, 200, 0, 0 -356 frame_dig -2 1, 2, 100, 200, 0, 0, 200 -358 frame_dig 0 1, 2, 100, 200, 0, 0, 200, 0 -360 frame_dig -1 1, 2, 100, 200, 0, 0, 200, 0, 0 -362 < 1, 2, 100, 200, 0, 0, 200, 0 -363 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 0, 0, 200 -381 frame_dig -3 1, 2, 100, 200, 0, 0, 200, 100 -383 uncover 1 1, 2, 100, 200, 0, 0, 100, 200 -385 uncover 2 1, 2, 100, 200, 0, 100, 200, 0 -387 retsub 1, 2, 100, 200 -105 cover 1 1, 2, 200, 100 -107 int 100 1, 2, 200, 100, 100 -108 == 1, 2, 200, 1 -109 assert 1, 2, 200 -110 int 200 1, 2, 200, 200 -112 == 1, 2, 1 -113 assert 1, 2 -114 int 100 1, 2, 100 -115 int 200 1, 2, 100, 200 -117 int 1 1, 2, 100, 200, 1 -118 callsub test_tuple_swap 1, 2, 100, 200, 1 -352 proto 3 2 1, 2, 100, 200, 1 -355 int 0 1, 2, 100, 200, 1, 0 -356 frame_dig -2 1, 2, 100, 200, 1, 0, 200 +290 retsub 1, 2, 1 +90 pop 1, 2 +91 callsub test_param_update_with_reentrant_entry_block_v3 1, 2 +291 proto 0 0 1, 2 +294 callsub one 1, 2 +301 proto 0 1 1, 2 +304 int 1 1, 2, 1 +305 retsub 1, 2, 1 +297 bz test_param_update_with_reentrant_entry_block_v3_while_top@1 1, 2 +300 retsub 1, 2 +94 callsub test_swap_args 1, 2 +306 proto 0 0 1, 2 +309 callsub one 1, 2 +301 proto 0 1 1, 2 +304 int 1 1, 2, 1 +305 retsub 1, 2, 1 +312 int 123 1, 2, 1, 123 +314 + 1, 2, 124 +315 callsub one 1, 2, 124 +301 proto 0 1 1, 2, 124 +304 int 1 1, 2, 124, 1 +305 retsub 1, 2, 124, 1 +318 int 234 1, 2, 124, 1, 234 +321 + 1, 2, 124, 235 +322 callsub swap_args 1, 2, 124, 235 +336 proto 2 2 1, 2, 124, 235 +339 frame_dig -1 1, 2, 124, 235, 235 +341 frame_dig -2 1, 2, 124, 235, 235, 124 +343 retsub 1, 2, 235, 124 +325 swap 1, 2, 124, 235 +326 int 235 1, 2, 124, 235, 235 +329 == 1, 2, 124, 1 +330 assert 1, 2, 124 +331 int 124 1, 2, 124, 124 +333 == 1, 2, 1 +334 assert 1, 2 +335 retsub 1, 2 +97 int 100 1, 2, 100 +98 int 200 1, 2, 100, 200 +100 int 0 1, 2, 100, 200, 0 +101 callsub test_tuple_swap 1, 2, 100, 200, 0 +344 proto 3 2 1, 2, 100, 200, 0 +347 int 0 1, 2, 100, 200, 0, 0 +348 frame_dig -2 1, 2, 100, 200, 0, 0, 200 +350 frame_dig 0 1, 2, 100, 200, 0, 0, 200, 0 +352 frame_dig -1 1, 2, 100, 200, 0, 0, 200, 0, 0 +354 < 1, 2, 100, 200, 0, 0, 200, 0 +355 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 0, 0, 200 +373 frame_dig -3 1, 2, 100, 200, 0, 0, 200, 100 +375 swap 1, 2, 100, 200, 0, 0, 100, 200 +376 uncover 2 1, 2, 100, 200, 0, 100, 200, 0 +378 retsub 1, 2, 100, 200 +104 swap 1, 2, 200, 100 +105 int 100 1, 2, 200, 100, 100 +106 == 1, 2, 200, 1 +107 assert 1, 2, 200 +108 int 200 1, 2, 200, 200 +110 == 1, 2, 1 +111 assert 1, 2 +112 int 100 1, 2, 100 +113 int 200 1, 2, 100, 200 +115 int 1 1, 2, 100, 200, 1 +116 callsub test_tuple_swap 1, 2, 100, 200, 1 +344 proto 3 2 1, 2, 100, 200, 1 +347 int 0 1, 2, 100, 200, 1, 0 +348 frame_dig -2 1, 2, 100, 200, 1, 0, 200 +350 frame_dig 0 1, 2, 100, 200, 1, 0, 200, 0 +352 frame_dig -1 1, 2, 100, 200, 1, 0, 200, 0, 1 +354 < 1, 2, 100, 200, 1, 0, 200, 1 +355 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 1, 0, 200 358 frame_dig 0 1, 2, 100, 200, 1, 0, 200, 0 -360 frame_dig -1 1, 2, 100, 200, 1, 0, 200, 0, 1 -362 < 1, 2, 100, 200, 1, 0, 200, 1 -363 bz test_tuple_swap_after_for@4 1, 2, 100, 200, 1, 0, 200 -366 frame_dig 0 1, 2, 100, 200, 1, 0, 200, 0 -368 int 1 1, 2, 100, 200, 1, 0, 200, 0, 1 -369 + 1, 2, 100, 200, 1, 0, 200, 1 -370 frame_bury 0 1, 2, 100, 200, 1, 1, 200 -372 frame_dig -3 1, 2, 100, 200, 1, 1, 200, 100 -374 frame_bury -2 1, 2, 100, 100, 1, 1, 200 -376 frame_bury -3 1, 2, 200, 100, 1, 1 -378 b test_tuple_swap_for_header@1 1, 2, 200, 100, 1, 1 -356 frame_dig -2 1, 2, 200, 100, 1, 1, 100 -358 frame_dig 0 1, 2, 200, 100, 1, 1, 100, 1 -360 frame_dig -1 1, 2, 200, 100, 1, 1, 100, 1, 1 -362 < 1, 2, 200, 100, 1, 1, 100, 0 -363 bz test_tuple_swap_after_for@4 1, 2, 200, 100, 1, 1, 100 -381 frame_dig -3 1, 2, 200, 100, 1, 1, 100, 200 -383 uncover 1 1, 2, 200, 100, 1, 1, 200, 100 -385 uncover 2 1, 2, 200, 100, 1, 200, 100, 1 -387 retsub 1, 2, 200, 100 -121 cover 1 1, 2, 100, 200 -123 int 200 1, 2, 100, 200, 200 -125 == 1, 2, 100, 1 -126 assert 1, 2, 100 -127 int 100 1, 2, 100, 100 -128 == 1, 2, 1 -129 assert 1, 2 -130 int 1 1, 2, 1 -131 return 1 \ No newline at end of file +360 int 1 1, 2, 100, 200, 1, 0, 200, 0, 1 +361 + 1, 2, 100, 200, 1, 0, 200, 1 +362 frame_bury 0 1, 2, 100, 200, 1, 1, 200 +364 frame_dig -3 1, 2, 100, 200, 1, 1, 200, 100 +366 frame_bury -2 1, 2, 100, 100, 1, 1, 200 +368 frame_bury -3 1, 2, 200, 100, 1, 1 +370 b test_tuple_swap_for_header@1 1, 2, 200, 100, 1, 1 +348 frame_dig -2 1, 2, 200, 100, 1, 1, 100 +350 frame_dig 0 1, 2, 200, 100, 1, 1, 100, 1 +352 frame_dig -1 1, 2, 200, 100, 1, 1, 100, 1, 1 +354 < 1, 2, 200, 100, 1, 1, 100, 0 +355 bz test_tuple_swap_after_for@4 1, 2, 200, 100, 1, 1, 100 +373 frame_dig -3 1, 2, 200, 100, 1, 1, 100, 200 +375 swap 1, 2, 200, 100, 1, 1, 200, 100 +376 uncover 2 1, 2, 200, 100, 1, 200, 100, 1 +378 retsub 1, 2, 200, 100 +119 swap 1, 2, 100, 200 +120 int 200 1, 2, 100, 200, 200 +122 == 1, 2, 100, 1 +123 assert 1, 2, 100 +124 int 100 1, 2, 100, 100 +125 == 1, 2, 1 +126 assert 1, 2 +127 int 1 1, 2, 1 +128 return 1 \ No newline at end of file diff --git a/examples/unssa/out/execution_trace.O2.log b/examples/unssa/out/execution_trace.O2.log index 07f461678e..f960f759b1 100644 --- a/examples/unssa/out/execution_trace.O2.log +++ b/examples/unssa/out/execution_trace.O2.log @@ -1,416 +1,416 @@ PC Teal Stack 1 10 callsub test_self_ref_phi -137 proto 0 1 -140 int 1 1 -141 frame_dig 0 1, 1 -143 int 100 1, 1, 100 -144 < 1, 1 -145 bz test_self_ref_phi_after_while@7 1 -148 frame_dig 0 1, 1 -150 int 105 1, 1, 105 -152 % 1, 1 -153 ! 1, 0 -154 bz test_self_ref_phi_after_if_else@4 1 -160 frame_dig 0 1, 1 -162 int 21 1, 1, 21 -164 % 1, 1 -165 bz test_self_ref_phi_after_while@7 1 -168 frame_dig 0 1, 1 -170 int 1 1, 1, 1 -171 + 1, 2 -172 frame_bury 0 2 -174 b test_self_ref_phi_while_top@1 2 -141 frame_dig 0 2, 2 -143 int 100 2, 2, 100 -144 < 2, 1 -145 bz test_self_ref_phi_after_while@7 2 -148 frame_dig 0 2, 2 -150 int 105 2, 2, 105 -152 % 2, 2 -153 ! 2, 0 -154 bz test_self_ref_phi_after_if_else@4 2 -160 frame_dig 0 2, 2 -162 int 21 2, 2, 21 -164 % 2, 2 -165 bz test_self_ref_phi_after_while@7 2 -168 frame_dig 0 2, 2 -170 int 1 2, 2, 1 -171 + 2, 3 -172 frame_bury 0 3 -174 b test_self_ref_phi_while_top@1 3 -141 frame_dig 0 3, 3 -143 int 100 3, 3, 100 -144 < 3, 1 -145 bz test_self_ref_phi_after_while@7 3 -148 frame_dig 0 3, 3 -150 int 105 3, 3, 105 -152 % 3, 3 -153 ! 3, 0 -154 bz test_self_ref_phi_after_if_else@4 3 -160 frame_dig 0 3, 3 -162 int 21 3, 3, 21 -164 % 3, 3 -165 bz test_self_ref_phi_after_while@7 3 -168 frame_dig 0 3, 3 -170 int 1 3, 3, 1 -171 + 3, 4 -172 frame_bury 0 4 -174 b test_self_ref_phi_while_top@1 4 -141 frame_dig 0 4, 4 -143 int 100 4, 4, 100 -144 < 4, 1 -145 bz test_self_ref_phi_after_while@7 4 -148 frame_dig 0 4, 4 -150 int 105 4, 4, 105 -152 % 4, 4 -153 ! 4, 0 -154 bz test_self_ref_phi_after_if_else@4 4 -160 frame_dig 0 4, 4 -162 int 21 4, 4, 21 -164 % 4, 4 -165 bz test_self_ref_phi_after_while@7 4 -168 frame_dig 0 4, 4 -170 int 1 4, 4, 1 -171 + 4, 5 -172 frame_bury 0 5 -174 b test_self_ref_phi_while_top@1 5 -141 frame_dig 0 5, 5 -143 int 100 5, 5, 100 -144 < 5, 1 -145 bz test_self_ref_phi_after_while@7 5 -148 frame_dig 0 5, 5 -150 int 105 5, 5, 105 -152 % 5, 5 -153 ! 5, 0 -154 bz test_self_ref_phi_after_if_else@4 5 -160 frame_dig 0 5, 5 -162 int 21 5, 5, 21 -164 % 5, 5 -165 bz test_self_ref_phi_after_while@7 5 -168 frame_dig 0 5, 5 -170 int 1 5, 5, 1 -171 + 5, 6 -172 frame_bury 0 6 -174 b test_self_ref_phi_while_top@1 6 -141 frame_dig 0 6, 6 -143 int 100 6, 6, 100 -144 < 6, 1 -145 bz test_self_ref_phi_after_while@7 6 -148 frame_dig 0 6, 6 -150 int 105 6, 6, 105 -152 % 6, 6 -153 ! 6, 0 -154 bz test_self_ref_phi_after_if_else@4 6 -160 frame_dig 0 6, 6 -162 int 21 6, 6, 21 -164 % 6, 6 -165 bz test_self_ref_phi_after_while@7 6 -168 frame_dig 0 6, 6 -170 int 1 6, 6, 1 -171 + 6, 7 -172 frame_bury 0 7 -174 b test_self_ref_phi_while_top@1 7 -141 frame_dig 0 7, 7 -143 int 100 7, 7, 100 -144 < 7, 1 -145 bz test_self_ref_phi_after_while@7 7 -148 frame_dig 0 7, 7 -150 int 105 7, 7, 105 -152 % 7, 7 -153 ! 7, 0 -154 bz test_self_ref_phi_after_if_else@4 7 -160 frame_dig 0 7, 7 -162 int 21 7, 7, 21 -164 % 7, 7 -165 bz test_self_ref_phi_after_while@7 7 -168 frame_dig 0 7, 7 -170 int 1 7, 7, 1 -171 + 7, 8 -172 frame_bury 0 8 -174 b test_self_ref_phi_while_top@1 8 -141 frame_dig 0 8, 8 -143 int 100 8, 8, 100 -144 < 8, 1 -145 bz test_self_ref_phi_after_while@7 8 -148 frame_dig 0 8, 8 -150 int 105 8, 8, 105 -152 % 8, 8 -153 ! 8, 0 -154 bz test_self_ref_phi_after_if_else@4 8 -160 frame_dig 0 8, 8 -162 int 21 8, 8, 21 -164 % 8, 8 -165 bz test_self_ref_phi_after_while@7 8 -168 frame_dig 0 8, 8 -170 int 1 8, 8, 1 -171 + 8, 9 -172 frame_bury 0 9 -174 b test_self_ref_phi_while_top@1 9 -141 frame_dig 0 9, 9 -143 int 100 9, 9, 100 -144 < 9, 1 -145 bz test_self_ref_phi_after_while@7 9 -148 frame_dig 0 9, 9 -150 int 105 9, 9, 105 -152 % 9, 9 -153 ! 9, 0 -154 bz test_self_ref_phi_after_if_else@4 9 -160 frame_dig 0 9, 9 -162 int 21 9, 9, 21 -164 % 9, 9 -165 bz test_self_ref_phi_after_while@7 9 -168 frame_dig 0 9, 9 -170 int 1 9, 9, 1 -171 + 9, 10 -172 frame_bury 0 10 -174 b test_self_ref_phi_while_top@1 10 -141 frame_dig 0 10, 10 -143 int 100 10, 10, 100 -144 < 10, 1 -145 bz test_self_ref_phi_after_while@7 10 -148 frame_dig 0 10, 10 -150 int 105 10, 10, 105 -152 % 10, 10 -153 ! 10, 0 -154 bz test_self_ref_phi_after_if_else@4 10 -160 frame_dig 0 10, 10 -162 int 21 10, 10, 21 -164 % 10, 10 -165 bz test_self_ref_phi_after_while@7 10 -168 frame_dig 0 10, 10 -170 int 1 10, 10, 1 -171 + 10, 11 -172 frame_bury 0 11 -174 b test_self_ref_phi_while_top@1 11 -141 frame_dig 0 11, 11 -143 int 100 11, 11, 100 -144 < 11, 1 -145 bz test_self_ref_phi_after_while@7 11 -148 frame_dig 0 11, 11 -150 int 105 11, 11, 105 -152 % 11, 11 -153 ! 11, 0 -154 bz test_self_ref_phi_after_if_else@4 11 -160 frame_dig 0 11, 11 -162 int 21 11, 11, 21 -164 % 11, 11 -165 bz test_self_ref_phi_after_while@7 11 -168 frame_dig 0 11, 11 -170 int 1 11, 11, 1 -171 + 11, 12 -172 frame_bury 0 12 -174 b test_self_ref_phi_while_top@1 12 -141 frame_dig 0 12, 12 -143 int 100 12, 12, 100 -144 < 12, 1 -145 bz test_self_ref_phi_after_while@7 12 -148 frame_dig 0 12, 12 -150 int 105 12, 12, 105 -152 % 12, 12 -153 ! 12, 0 -154 bz test_self_ref_phi_after_if_else@4 12 -160 frame_dig 0 12, 12 -162 int 21 12, 12, 21 -164 % 12, 12 -165 bz test_self_ref_phi_after_while@7 12 -168 frame_dig 0 12, 12 -170 int 1 12, 12, 1 -171 + 12, 13 -172 frame_bury 0 13 -174 b test_self_ref_phi_while_top@1 13 -141 frame_dig 0 13, 13 -143 int 100 13, 13, 100 -144 < 13, 1 -145 bz test_self_ref_phi_after_while@7 13 -148 frame_dig 0 13, 13 -150 int 105 13, 13, 105 -152 % 13, 13 -153 ! 13, 0 -154 bz test_self_ref_phi_after_if_else@4 13 -160 frame_dig 0 13, 13 -162 int 21 13, 13, 21 -164 % 13, 13 -165 bz test_self_ref_phi_after_while@7 13 -168 frame_dig 0 13, 13 -170 int 1 13, 13, 1 -171 + 13, 14 -172 frame_bury 0 14 -174 b test_self_ref_phi_while_top@1 14 -141 frame_dig 0 14, 14 -143 int 100 14, 14, 100 -144 < 14, 1 -145 bz test_self_ref_phi_after_while@7 14 -148 frame_dig 0 14, 14 -150 int 105 14, 14, 105 -152 % 14, 14 -153 ! 14, 0 -154 bz test_self_ref_phi_after_if_else@4 14 -160 frame_dig 0 14, 14 -162 int 21 14, 14, 21 -164 % 14, 14 -165 bz test_self_ref_phi_after_while@7 14 -168 frame_dig 0 14, 14 -170 int 1 14, 14, 1 -171 + 14, 15 -172 frame_bury 0 15 -174 b test_self_ref_phi_while_top@1 15 -141 frame_dig 0 15, 15 -143 int 100 15, 15, 100 -144 < 15, 1 -145 bz test_self_ref_phi_after_while@7 15 -148 frame_dig 0 15, 15 -150 int 105 15, 15, 105 -152 % 15, 15 -153 ! 15, 0 -154 bz test_self_ref_phi_after_if_else@4 15 -160 frame_dig 0 15, 15 -162 int 21 15, 15, 21 -164 % 15, 15 -165 bz test_self_ref_phi_after_while@7 15 -168 frame_dig 0 15, 15 -170 int 1 15, 15, 1 -171 + 15, 16 -172 frame_bury 0 16 -174 b test_self_ref_phi_while_top@1 16 -141 frame_dig 0 16, 16 -143 int 100 16, 16, 100 -144 < 16, 1 -145 bz test_self_ref_phi_after_while@7 16 -148 frame_dig 0 16, 16 -150 int 105 16, 16, 105 -152 % 16, 16 -153 ! 16, 0 -154 bz test_self_ref_phi_after_if_else@4 16 -160 frame_dig 0 16, 16 -162 int 21 16, 16, 21 -164 % 16, 16 -165 bz test_self_ref_phi_after_while@7 16 -168 frame_dig 0 16, 16 -170 int 1 16, 16, 1 -171 + 16, 17 -172 frame_bury 0 17 -174 b test_self_ref_phi_while_top@1 17 -141 frame_dig 0 17, 17 -143 int 100 17, 17, 100 -144 < 17, 1 -145 bz test_self_ref_phi_after_while@7 17 -148 frame_dig 0 17, 17 -150 int 105 17, 17, 105 -152 % 17, 17 -153 ! 17, 0 -154 bz test_self_ref_phi_after_if_else@4 17 -160 frame_dig 0 17, 17 -162 int 21 17, 17, 21 -164 % 17, 17 -165 bz test_self_ref_phi_after_while@7 17 -168 frame_dig 0 17, 17 -170 int 1 17, 17, 1 -171 + 17, 18 -172 frame_bury 0 18 -174 b test_self_ref_phi_while_top@1 18 -141 frame_dig 0 18, 18 -143 int 100 18, 18, 100 -144 < 18, 1 -145 bz test_self_ref_phi_after_while@7 18 -148 frame_dig 0 18, 18 -150 int 105 18, 18, 105 -152 % 18, 18 -153 ! 18, 0 -154 bz test_self_ref_phi_after_if_else@4 18 -160 frame_dig 0 18, 18 -162 int 21 18, 18, 21 -164 % 18, 18 -165 bz test_self_ref_phi_after_while@7 18 -168 frame_dig 0 18, 18 -170 int 1 18, 18, 1 -171 + 18, 19 -172 frame_bury 0 19 -174 b test_self_ref_phi_while_top@1 19 -141 frame_dig 0 19, 19 -143 int 100 19, 19, 100 -144 < 19, 1 -145 bz test_self_ref_phi_after_while@7 19 -148 frame_dig 0 19, 19 -150 int 105 19, 19, 105 -152 % 19, 19 -153 ! 19, 0 -154 bz test_self_ref_phi_after_if_else@4 19 -160 frame_dig 0 19, 19 -162 int 21 19, 19, 21 -164 % 19, 19 -165 bz test_self_ref_phi_after_while@7 19 -168 frame_dig 0 19, 19 -170 int 1 19, 19, 1 -171 + 19, 20 -172 frame_bury 0 20 -174 b test_self_ref_phi_while_top@1 20 -141 frame_dig 0 20, 20 -143 int 100 20, 20, 100 -144 < 20, 1 -145 bz test_self_ref_phi_after_while@7 20 -148 frame_dig 0 20, 20 -150 int 105 20, 20, 105 -152 % 20, 20 -153 ! 20, 0 -154 bz test_self_ref_phi_after_if_else@4 20 -160 frame_dig 0 20, 20 -162 int 21 20, 20, 21 -164 % 20, 20 -165 bz test_self_ref_phi_after_while@7 20 -168 frame_dig 0 20, 20 -170 int 1 20, 20, 1 -171 + 20, 21 -172 frame_bury 0 21 -174 b test_self_ref_phi_while_top@1 21 -141 frame_dig 0 21, 21 -143 int 100 21, 21, 100 -144 < 21, 1 -145 bz test_self_ref_phi_after_while@7 21 -148 frame_dig 0 21, 21 -150 int 105 21, 21, 105 -152 % 21, 21 -153 ! 21, 0 -154 bz test_self_ref_phi_after_if_else@4 21 -160 frame_dig 0 21, 21 -162 int 21 21, 21, 21 -164 % 21, 0 -165 bz test_self_ref_phi_after_while@7 21 -177 frame_dig 0 21, 21 -179 uncover 1 21, 21 -181 retsub 21 +135 proto 0 1 +138 int 1 1 +139 frame_dig 0 1, 1 +141 int 100 1, 1, 100 +142 < 1, 1 +143 bz test_self_ref_phi_after_while@7 1 +146 frame_dig 0 1, 1 +148 int 105 1, 1, 105 +150 % 1, 1 +151 ! 1, 0 +152 bz test_self_ref_phi_after_if_else@4 1 +158 frame_dig 0 1, 1 +160 int 21 1, 1, 21 +162 % 1, 1 +163 bz test_self_ref_phi_after_while@7 1 +166 frame_dig 0 1, 1 +168 int 1 1, 1, 1 +169 + 1, 2 +170 frame_bury 0 2 +172 b test_self_ref_phi_while_top@1 2 +139 frame_dig 0 2, 2 +141 int 100 2, 2, 100 +142 < 2, 1 +143 bz test_self_ref_phi_after_while@7 2 +146 frame_dig 0 2, 2 +148 int 105 2, 2, 105 +150 % 2, 2 +151 ! 2, 0 +152 bz test_self_ref_phi_after_if_else@4 2 +158 frame_dig 0 2, 2 +160 int 21 2, 2, 21 +162 % 2, 2 +163 bz test_self_ref_phi_after_while@7 2 +166 frame_dig 0 2, 2 +168 int 1 2, 2, 1 +169 + 2, 3 +170 frame_bury 0 3 +172 b test_self_ref_phi_while_top@1 3 +139 frame_dig 0 3, 3 +141 int 100 3, 3, 100 +142 < 3, 1 +143 bz test_self_ref_phi_after_while@7 3 +146 frame_dig 0 3, 3 +148 int 105 3, 3, 105 +150 % 3, 3 +151 ! 3, 0 +152 bz test_self_ref_phi_after_if_else@4 3 +158 frame_dig 0 3, 3 +160 int 21 3, 3, 21 +162 % 3, 3 +163 bz test_self_ref_phi_after_while@7 3 +166 frame_dig 0 3, 3 +168 int 1 3, 3, 1 +169 + 3, 4 +170 frame_bury 0 4 +172 b test_self_ref_phi_while_top@1 4 +139 frame_dig 0 4, 4 +141 int 100 4, 4, 100 +142 < 4, 1 +143 bz test_self_ref_phi_after_while@7 4 +146 frame_dig 0 4, 4 +148 int 105 4, 4, 105 +150 % 4, 4 +151 ! 4, 0 +152 bz test_self_ref_phi_after_if_else@4 4 +158 frame_dig 0 4, 4 +160 int 21 4, 4, 21 +162 % 4, 4 +163 bz test_self_ref_phi_after_while@7 4 +166 frame_dig 0 4, 4 +168 int 1 4, 4, 1 +169 + 4, 5 +170 frame_bury 0 5 +172 b test_self_ref_phi_while_top@1 5 +139 frame_dig 0 5, 5 +141 int 100 5, 5, 100 +142 < 5, 1 +143 bz test_self_ref_phi_after_while@7 5 +146 frame_dig 0 5, 5 +148 int 105 5, 5, 105 +150 % 5, 5 +151 ! 5, 0 +152 bz test_self_ref_phi_after_if_else@4 5 +158 frame_dig 0 5, 5 +160 int 21 5, 5, 21 +162 % 5, 5 +163 bz test_self_ref_phi_after_while@7 5 +166 frame_dig 0 5, 5 +168 int 1 5, 5, 1 +169 + 5, 6 +170 frame_bury 0 6 +172 b test_self_ref_phi_while_top@1 6 +139 frame_dig 0 6, 6 +141 int 100 6, 6, 100 +142 < 6, 1 +143 bz test_self_ref_phi_after_while@7 6 +146 frame_dig 0 6, 6 +148 int 105 6, 6, 105 +150 % 6, 6 +151 ! 6, 0 +152 bz test_self_ref_phi_after_if_else@4 6 +158 frame_dig 0 6, 6 +160 int 21 6, 6, 21 +162 % 6, 6 +163 bz test_self_ref_phi_after_while@7 6 +166 frame_dig 0 6, 6 +168 int 1 6, 6, 1 +169 + 6, 7 +170 frame_bury 0 7 +172 b test_self_ref_phi_while_top@1 7 +139 frame_dig 0 7, 7 +141 int 100 7, 7, 100 +142 < 7, 1 +143 bz test_self_ref_phi_after_while@7 7 +146 frame_dig 0 7, 7 +148 int 105 7, 7, 105 +150 % 7, 7 +151 ! 7, 0 +152 bz test_self_ref_phi_after_if_else@4 7 +158 frame_dig 0 7, 7 +160 int 21 7, 7, 21 +162 % 7, 7 +163 bz test_self_ref_phi_after_while@7 7 +166 frame_dig 0 7, 7 +168 int 1 7, 7, 1 +169 + 7, 8 +170 frame_bury 0 8 +172 b test_self_ref_phi_while_top@1 8 +139 frame_dig 0 8, 8 +141 int 100 8, 8, 100 +142 < 8, 1 +143 bz test_self_ref_phi_after_while@7 8 +146 frame_dig 0 8, 8 +148 int 105 8, 8, 105 +150 % 8, 8 +151 ! 8, 0 +152 bz test_self_ref_phi_after_if_else@4 8 +158 frame_dig 0 8, 8 +160 int 21 8, 8, 21 +162 % 8, 8 +163 bz test_self_ref_phi_after_while@7 8 +166 frame_dig 0 8, 8 +168 int 1 8, 8, 1 +169 + 8, 9 +170 frame_bury 0 9 +172 b test_self_ref_phi_while_top@1 9 +139 frame_dig 0 9, 9 +141 int 100 9, 9, 100 +142 < 9, 1 +143 bz test_self_ref_phi_after_while@7 9 +146 frame_dig 0 9, 9 +148 int 105 9, 9, 105 +150 % 9, 9 +151 ! 9, 0 +152 bz test_self_ref_phi_after_if_else@4 9 +158 frame_dig 0 9, 9 +160 int 21 9, 9, 21 +162 % 9, 9 +163 bz test_self_ref_phi_after_while@7 9 +166 frame_dig 0 9, 9 +168 int 1 9, 9, 1 +169 + 9, 10 +170 frame_bury 0 10 +172 b test_self_ref_phi_while_top@1 10 +139 frame_dig 0 10, 10 +141 int 100 10, 10, 100 +142 < 10, 1 +143 bz test_self_ref_phi_after_while@7 10 +146 frame_dig 0 10, 10 +148 int 105 10, 10, 105 +150 % 10, 10 +151 ! 10, 0 +152 bz test_self_ref_phi_after_if_else@4 10 +158 frame_dig 0 10, 10 +160 int 21 10, 10, 21 +162 % 10, 10 +163 bz test_self_ref_phi_after_while@7 10 +166 frame_dig 0 10, 10 +168 int 1 10, 10, 1 +169 + 10, 11 +170 frame_bury 0 11 +172 b test_self_ref_phi_while_top@1 11 +139 frame_dig 0 11, 11 +141 int 100 11, 11, 100 +142 < 11, 1 +143 bz test_self_ref_phi_after_while@7 11 +146 frame_dig 0 11, 11 +148 int 105 11, 11, 105 +150 % 11, 11 +151 ! 11, 0 +152 bz test_self_ref_phi_after_if_else@4 11 +158 frame_dig 0 11, 11 +160 int 21 11, 11, 21 +162 % 11, 11 +163 bz test_self_ref_phi_after_while@7 11 +166 frame_dig 0 11, 11 +168 int 1 11, 11, 1 +169 + 11, 12 +170 frame_bury 0 12 +172 b test_self_ref_phi_while_top@1 12 +139 frame_dig 0 12, 12 +141 int 100 12, 12, 100 +142 < 12, 1 +143 bz test_self_ref_phi_after_while@7 12 +146 frame_dig 0 12, 12 +148 int 105 12, 12, 105 +150 % 12, 12 +151 ! 12, 0 +152 bz test_self_ref_phi_after_if_else@4 12 +158 frame_dig 0 12, 12 +160 int 21 12, 12, 21 +162 % 12, 12 +163 bz test_self_ref_phi_after_while@7 12 +166 frame_dig 0 12, 12 +168 int 1 12, 12, 1 +169 + 12, 13 +170 frame_bury 0 13 +172 b test_self_ref_phi_while_top@1 13 +139 frame_dig 0 13, 13 +141 int 100 13, 13, 100 +142 < 13, 1 +143 bz test_self_ref_phi_after_while@7 13 +146 frame_dig 0 13, 13 +148 int 105 13, 13, 105 +150 % 13, 13 +151 ! 13, 0 +152 bz test_self_ref_phi_after_if_else@4 13 +158 frame_dig 0 13, 13 +160 int 21 13, 13, 21 +162 % 13, 13 +163 bz test_self_ref_phi_after_while@7 13 +166 frame_dig 0 13, 13 +168 int 1 13, 13, 1 +169 + 13, 14 +170 frame_bury 0 14 +172 b test_self_ref_phi_while_top@1 14 +139 frame_dig 0 14, 14 +141 int 100 14, 14, 100 +142 < 14, 1 +143 bz test_self_ref_phi_after_while@7 14 +146 frame_dig 0 14, 14 +148 int 105 14, 14, 105 +150 % 14, 14 +151 ! 14, 0 +152 bz test_self_ref_phi_after_if_else@4 14 +158 frame_dig 0 14, 14 +160 int 21 14, 14, 21 +162 % 14, 14 +163 bz test_self_ref_phi_after_while@7 14 +166 frame_dig 0 14, 14 +168 int 1 14, 14, 1 +169 + 14, 15 +170 frame_bury 0 15 +172 b test_self_ref_phi_while_top@1 15 +139 frame_dig 0 15, 15 +141 int 100 15, 15, 100 +142 < 15, 1 +143 bz test_self_ref_phi_after_while@7 15 +146 frame_dig 0 15, 15 +148 int 105 15, 15, 105 +150 % 15, 15 +151 ! 15, 0 +152 bz test_self_ref_phi_after_if_else@4 15 +158 frame_dig 0 15, 15 +160 int 21 15, 15, 21 +162 % 15, 15 +163 bz test_self_ref_phi_after_while@7 15 +166 frame_dig 0 15, 15 +168 int 1 15, 15, 1 +169 + 15, 16 +170 frame_bury 0 16 +172 b test_self_ref_phi_while_top@1 16 +139 frame_dig 0 16, 16 +141 int 100 16, 16, 100 +142 < 16, 1 +143 bz test_self_ref_phi_after_while@7 16 +146 frame_dig 0 16, 16 +148 int 105 16, 16, 105 +150 % 16, 16 +151 ! 16, 0 +152 bz test_self_ref_phi_after_if_else@4 16 +158 frame_dig 0 16, 16 +160 int 21 16, 16, 21 +162 % 16, 16 +163 bz test_self_ref_phi_after_while@7 16 +166 frame_dig 0 16, 16 +168 int 1 16, 16, 1 +169 + 16, 17 +170 frame_bury 0 17 +172 b test_self_ref_phi_while_top@1 17 +139 frame_dig 0 17, 17 +141 int 100 17, 17, 100 +142 < 17, 1 +143 bz test_self_ref_phi_after_while@7 17 +146 frame_dig 0 17, 17 +148 int 105 17, 17, 105 +150 % 17, 17 +151 ! 17, 0 +152 bz test_self_ref_phi_after_if_else@4 17 +158 frame_dig 0 17, 17 +160 int 21 17, 17, 21 +162 % 17, 17 +163 bz test_self_ref_phi_after_while@7 17 +166 frame_dig 0 17, 17 +168 int 1 17, 17, 1 +169 + 17, 18 +170 frame_bury 0 18 +172 b test_self_ref_phi_while_top@1 18 +139 frame_dig 0 18, 18 +141 int 100 18, 18, 100 +142 < 18, 1 +143 bz test_self_ref_phi_after_while@7 18 +146 frame_dig 0 18, 18 +148 int 105 18, 18, 105 +150 % 18, 18 +151 ! 18, 0 +152 bz test_self_ref_phi_after_if_else@4 18 +158 frame_dig 0 18, 18 +160 int 21 18, 18, 21 +162 % 18, 18 +163 bz test_self_ref_phi_after_while@7 18 +166 frame_dig 0 18, 18 +168 int 1 18, 18, 1 +169 + 18, 19 +170 frame_bury 0 19 +172 b test_self_ref_phi_while_top@1 19 +139 frame_dig 0 19, 19 +141 int 100 19, 19, 100 +142 < 19, 1 +143 bz test_self_ref_phi_after_while@7 19 +146 frame_dig 0 19, 19 +148 int 105 19, 19, 105 +150 % 19, 19 +151 ! 19, 0 +152 bz test_self_ref_phi_after_if_else@4 19 +158 frame_dig 0 19, 19 +160 int 21 19, 19, 21 +162 % 19, 19 +163 bz test_self_ref_phi_after_while@7 19 +166 frame_dig 0 19, 19 +168 int 1 19, 19, 1 +169 + 19, 20 +170 frame_bury 0 20 +172 b test_self_ref_phi_while_top@1 20 +139 frame_dig 0 20, 20 +141 int 100 20, 20, 100 +142 < 20, 1 +143 bz test_self_ref_phi_after_while@7 20 +146 frame_dig 0 20, 20 +148 int 105 20, 20, 105 +150 % 20, 20 +151 ! 20, 0 +152 bz test_self_ref_phi_after_if_else@4 20 +158 frame_dig 0 20, 20 +160 int 21 20, 20, 21 +162 % 20, 20 +163 bz test_self_ref_phi_after_while@7 20 +166 frame_dig 0 20, 20 +168 int 1 20, 20, 1 +169 + 20, 21 +170 frame_bury 0 21 +172 b test_self_ref_phi_while_top@1 21 +139 frame_dig 0 21, 21 +141 int 100 21, 21, 100 +142 < 21, 1 +143 bz test_self_ref_phi_after_while@7 21 +146 frame_dig 0 21, 21 +148 int 105 21, 21, 105 +150 % 21, 21 +151 ! 21, 0 +152 bz test_self_ref_phi_after_if_else@4 21 +158 frame_dig 0 21, 21 +160 int 21 21, 21, 21 +162 % 21, 0 +163 bz test_self_ref_phi_after_while@7 21 +175 frame_dig 0 21, 21 +177 swap 21, 21 +178 retsub 21 13 pop 14 int 1 1 15 callsub test_swap 1 -182 proto 1 1 1 -185 int 1 1, 1 -186 int 2 1, 1, 2 -187 frame_dig -1 1, 1, 2, 1 -189 frame_dig 0 1, 1, 2, 1, 1 -191 frame_dig 1 1, 1, 2, 1, 1, 2 -193 frame_bury 0 1, 2, 2, 1, 1 -195 frame_dig 2 1, 2, 2, 1, 1, 1 -197 int 0 1, 2, 2, 1, 1, 1, 0 -198 > 1, 2, 2, 1, 1, 1 -199 bz test_swap_after_while@3 1, 2, 2, 1, 1 -202 frame_dig 2 1, 2, 2, 1, 1, 1 -204 int 1 1, 2, 2, 1, 1, 1, 1 -205 - 1, 2, 2, 1, 1, 0 -206 frame_bury 2 1, 2, 2, 0, 1 -208 frame_bury 1 1, 2, 1, 0 -210 b test_swap_while_top@1 1, 2, 1, 0 -189 frame_dig 0 1, 2, 1, 0, 2 -191 frame_dig 1 1, 2, 1, 0, 2, 1 -193 frame_bury 0 1, 1, 1, 0, 2 -195 frame_dig 2 1, 1, 1, 0, 2, 0 -197 int 0 1, 1, 1, 0, 2, 0, 0 -198 > 1, 1, 1, 0, 2, 0 -199 bz test_swap_after_while@3 1, 1, 1, 0, 2 -213 frame_bury 0 1, 2, 1, 0 -215 retsub 2 +179 proto 1 1 1 +182 int 1 1, 1 +183 int 2 1, 1, 2 +184 frame_dig -1 1, 1, 2, 1 +186 frame_dig 0 1, 1, 2, 1, 1 +188 frame_dig 1 1, 1, 2, 1, 1, 2 +190 frame_bury 0 1, 2, 2, 1, 1 +192 frame_dig 2 1, 2, 2, 1, 1, 1 +194 int 0 1, 2, 2, 1, 1, 1, 0 +195 > 1, 2, 2, 1, 1, 1 +196 bz test_swap_after_while@3 1, 2, 2, 1, 1 +199 frame_dig 2 1, 2, 2, 1, 1, 1 +201 int 1 1, 2, 2, 1, 1, 1, 1 +202 - 1, 2, 2, 1, 1, 0 +203 frame_bury 2 1, 2, 2, 0, 1 +205 frame_bury 1 1, 2, 1, 0 +207 b test_swap_while_top@1 1, 2, 1, 0 +186 frame_dig 0 1, 2, 1, 0, 2 +188 frame_dig 1 1, 2, 1, 0, 2, 1 +190 frame_bury 0 1, 1, 1, 0, 2 +192 frame_dig 2 1, 1, 1, 0, 2, 0 +194 int 0 1, 1, 1, 0, 2, 0, 0 +195 > 1, 1, 1, 0, 2, 0 +196 bz test_swap_after_while@3 1, 1, 1, 0, 2 +210 frame_bury 0 1, 2, 1, 0 +212 retsub 2 18 dup 2, 2 19 dup 2, 2, 2 -20 itob 2, 2, AAAAAAAAAAI= +20 itob 2, 2, 0x0000000000000002 21 log 2, 2 22 int 1 2, 2, 1 23 >= 2, 1 @@ -426,49 +426,49 @@ PC Teal Stack 43 assert 1 44 int 2 1, 2 45 callsub test_swap 1, 2 -182 proto 1 1 1, 2 -185 int 1 1, 2, 1 -186 int 2 1, 2, 1, 2 -187 frame_dig -1 1, 2, 1, 2, 2 -189 frame_dig 0 1, 2, 1, 2, 2, 1 -191 frame_dig 1 1, 2, 1, 2, 2, 1, 2 -193 frame_bury 0 1, 2, 2, 2, 2, 1 -195 frame_dig 2 1, 2, 2, 2, 2, 1, 2 -197 int 0 1, 2, 2, 2, 2, 1, 2, 0 -198 > 1, 2, 2, 2, 2, 1, 1 -199 bz test_swap_after_while@3 1, 2, 2, 2, 2, 1 -202 frame_dig 2 1, 2, 2, 2, 2, 1, 2 -204 int 1 1, 2, 2, 2, 2, 1, 2, 1 -205 - 1, 2, 2, 2, 2, 1, 1 -206 frame_bury 2 1, 2, 2, 2, 1, 1 -208 frame_bury 1 1, 2, 2, 1, 1 -210 b test_swap_while_top@1 1, 2, 2, 1, 1 -189 frame_dig 0 1, 2, 2, 1, 1, 2 -191 frame_dig 1 1, 2, 2, 1, 1, 2, 1 -193 frame_bury 0 1, 2, 1, 1, 1, 2 -195 frame_dig 2 1, 2, 1, 1, 1, 2, 1 -197 int 0 1, 2, 1, 1, 1, 2, 1, 0 -198 > 1, 2, 1, 1, 1, 2, 1 -199 bz test_swap_after_while@3 1, 2, 1, 1, 1, 2 -202 frame_dig 2 1, 2, 1, 1, 1, 2, 1 -204 int 1 1, 2, 1, 1, 1, 2, 1, 1 -205 - 1, 2, 1, 1, 1, 2, 0 -206 frame_bury 2 1, 2, 1, 1, 0, 2 -208 frame_bury 1 1, 2, 1, 2, 0 -210 b test_swap_while_top@1 1, 2, 1, 2, 0 -189 frame_dig 0 1, 2, 1, 2, 0, 1 -191 frame_dig 1 1, 2, 1, 2, 0, 1, 2 -193 frame_bury 0 1, 2, 2, 2, 0, 1 -195 frame_dig 2 1, 2, 2, 2, 0, 1, 0 -197 int 0 1, 2, 2, 2, 0, 1, 0, 0 -198 > 1, 2, 2, 2, 0, 1, 0 -199 bz test_swap_after_while@3 1, 2, 2, 2, 0, 1 -213 frame_bury 0 1, 2, 1, 2, 0 -215 retsub 1, 1 +179 proto 1 1 1, 2 +182 int 1 1, 2, 1 +183 int 2 1, 2, 1, 2 +184 frame_dig -1 1, 2, 1, 2, 2 +186 frame_dig 0 1, 2, 1, 2, 2, 1 +188 frame_dig 1 1, 2, 1, 2, 2, 1, 2 +190 frame_bury 0 1, 2, 2, 2, 2, 1 +192 frame_dig 2 1, 2, 2, 2, 2, 1, 2 +194 int 0 1, 2, 2, 2, 2, 1, 2, 0 +195 > 1, 2, 2, 2, 2, 1, 1 +196 bz test_swap_after_while@3 1, 2, 2, 2, 2, 1 +199 frame_dig 2 1, 2, 2, 2, 2, 1, 2 +201 int 1 1, 2, 2, 2, 2, 1, 2, 1 +202 - 1, 2, 2, 2, 2, 1, 1 +203 frame_bury 2 1, 2, 2, 2, 1, 1 +205 frame_bury 1 1, 2, 2, 1, 1 +207 b test_swap_while_top@1 1, 2, 2, 1, 1 +186 frame_dig 0 1, 2, 2, 1, 1, 2 +188 frame_dig 1 1, 2, 2, 1, 1, 2, 1 +190 frame_bury 0 1, 2, 1, 1, 1, 2 +192 frame_dig 2 1, 2, 1, 1, 1, 2, 1 +194 int 0 1, 2, 1, 1, 1, 2, 1, 0 +195 > 1, 2, 1, 1, 1, 2, 1 +196 bz test_swap_after_while@3 1, 2, 1, 1, 1, 2 +199 frame_dig 2 1, 2, 1, 1, 1, 2, 1 +201 int 1 1, 2, 1, 1, 1, 2, 1, 1 +202 - 1, 2, 1, 1, 1, 2, 0 +203 frame_bury 2 1, 2, 1, 1, 0, 2 +205 frame_bury 1 1, 2, 1, 2, 0 +207 b test_swap_while_top@1 1, 2, 1, 2, 0 +186 frame_dig 0 1, 2, 1, 2, 0, 1 +188 frame_dig 1 1, 2, 1, 2, 0, 1, 2 +190 frame_bury 0 1, 2, 2, 2, 0, 1 +192 frame_dig 2 1, 2, 2, 2, 0, 1, 0 +194 int 0 1, 2, 2, 2, 0, 1, 0, 0 +195 > 1, 2, 2, 2, 0, 1, 0 +196 bz test_swap_after_while@3 1, 2, 2, 2, 0, 1 +210 frame_bury 0 1, 2, 1, 2, 0 +212 retsub 1, 1 48 dup 1, 1, 1 49 bury 2 1, 1 51 dup 1, 1, 1 -52 itob 1, 1, AAAAAAAAAAE= +52 itob 1, 1, 0x0000000000000001 53 log 1, 1 54 int 1 1, 1, 1 55 >= 1, 1 @@ -485,478 +485,478 @@ PC Teal Stack 76 int 7 1, 7 78 int 11 1, 7, 11 80 callsub test_swap_loop 1, 7, 11 -216 proto 2 1 1, 7, 11 -219 int 1 1, 7, 11, 1 -220 int 2 1, 7, 11, 1, 2 -221 frame_dig -2 1, 7, 11, 1, 2, 7 -223 frame_dig -1 1, 7, 11, 1, 2, 7, 11 -225 frame_dig 2 1, 7, 11, 1, 2, 7, 11, 7 -227 int 0 1, 7, 11, 1, 2, 7, 11, 7, 0 -228 > 1, 7, 11, 1, 2, 7, 11, 1 -229 bz test_swap_loop_after_while@6 1, 7, 11, 1, 2, 7, 11 -232 frame_dig 0 1, 7, 11, 1, 2, 7, 11, 1 -234 frame_dig 3 1, 7, 11, 1, 2, 7, 11, 1, 11 -236 int 0 1, 7, 11, 1, 2, 7, 11, 1, 11, 0 -237 > 1, 7, 11, 1, 2, 7, 11, 1, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 11, 1 -241 frame_dig 3 1, 7, 11, 1, 2, 7, 11, 1, 11 -243 int 1 1, 7, 11, 1, 2, 7, 11, 1, 11, 1 -244 - 1, 7, 11, 1, 2, 7, 11, 1, 10 -245 frame_bury 3 1, 7, 11, 1, 2, 7, 10, 1 -247 frame_dig 1 1, 7, 11, 1, 2, 7, 10, 1, 2 -249 frame_bury 0 1, 7, 11, 2, 2, 7, 10, 1 -251 frame_bury 1 1, 7, 11, 2, 1, 7, 10 -253 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 10 -232 frame_dig 0 1, 7, 11, 2, 1, 7, 10, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 7, 10, 2, 10 -236 int 0 1, 7, 11, 2, 1, 7, 10, 2, 10, 0 -237 > 1, 7, 11, 2, 1, 7, 10, 2, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 10, 2 -241 frame_dig 3 1, 7, 11, 2, 1, 7, 10, 2, 10 -243 int 1 1, 7, 11, 2, 1, 7, 10, 2, 10, 1 -244 - 1, 7, 11, 2, 1, 7, 10, 2, 9 -245 frame_bury 3 1, 7, 11, 2, 1, 7, 9, 2 -247 frame_dig 1 1, 7, 11, 2, 1, 7, 9, 2, 1 -249 frame_bury 0 1, 7, 11, 1, 1, 7, 9, 2 -251 frame_bury 1 1, 7, 11, 1, 2, 7, 9 -253 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 9 -232 frame_dig 0 1, 7, 11, 1, 2, 7, 9, 1 -234 frame_dig 3 1, 7, 11, 1, 2, 7, 9, 1, 9 -236 int 0 1, 7, 11, 1, 2, 7, 9, 1, 9, 0 -237 > 1, 7, 11, 1, 2, 7, 9, 1, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 9, 1 -241 frame_dig 3 1, 7, 11, 1, 2, 7, 9, 1, 9 -243 int 1 1, 7, 11, 1, 2, 7, 9, 1, 9, 1 -244 - 1, 7, 11, 1, 2, 7, 9, 1, 8 -245 frame_bury 3 1, 7, 11, 1, 2, 7, 8, 1 -247 frame_dig 1 1, 7, 11, 1, 2, 7, 8, 1, 2 -249 frame_bury 0 1, 7, 11, 2, 2, 7, 8, 1 -251 frame_bury 1 1, 7, 11, 2, 1, 7, 8 -253 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 8 -232 frame_dig 0 1, 7, 11, 2, 1, 7, 8, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 7, 8, 2, 8 -236 int 0 1, 7, 11, 2, 1, 7, 8, 2, 8, 0 -237 > 1, 7, 11, 2, 1, 7, 8, 2, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 8, 2 -241 frame_dig 3 1, 7, 11, 2, 1, 7, 8, 2, 8 -243 int 1 1, 7, 11, 2, 1, 7, 8, 2, 8, 1 -244 - 1, 7, 11, 2, 1, 7, 8, 2, 7 -245 frame_bury 3 1, 7, 11, 2, 1, 7, 7, 2 -247 frame_dig 1 1, 7, 11, 2, 1, 7, 7, 2, 1 -249 frame_bury 0 1, 7, 11, 1, 1, 7, 7, 2 -251 frame_bury 1 1, 7, 11, 1, 2, 7, 7 -253 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 7 -232 frame_dig 0 1, 7, 11, 1, 2, 7, 7, 1 -234 frame_dig 3 1, 7, 11, 1, 2, 7, 7, 1, 7 -236 int 0 1, 7, 11, 1, 2, 7, 7, 1, 7, 0 -237 > 1, 7, 11, 1, 2, 7, 7, 1, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 7, 1 -241 frame_dig 3 1, 7, 11, 1, 2, 7, 7, 1, 7 -243 int 1 1, 7, 11, 1, 2, 7, 7, 1, 7, 1 -244 - 1, 7, 11, 1, 2, 7, 7, 1, 6 -245 frame_bury 3 1, 7, 11, 1, 2, 7, 6, 1 -247 frame_dig 1 1, 7, 11, 1, 2, 7, 6, 1, 2 -249 frame_bury 0 1, 7, 11, 2, 2, 7, 6, 1 -251 frame_bury 1 1, 7, 11, 2, 1, 7, 6 -253 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 6 -232 frame_dig 0 1, 7, 11, 2, 1, 7, 6, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 7, 6, 2, 6 -236 int 0 1, 7, 11, 2, 1, 7, 6, 2, 6, 0 -237 > 1, 7, 11, 2, 1, 7, 6, 2, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 6, 2 -241 frame_dig 3 1, 7, 11, 2, 1, 7, 6, 2, 6 -243 int 1 1, 7, 11, 2, 1, 7, 6, 2, 6, 1 -244 - 1, 7, 11, 2, 1, 7, 6, 2, 5 -245 frame_bury 3 1, 7, 11, 2, 1, 7, 5, 2 -247 frame_dig 1 1, 7, 11, 2, 1, 7, 5, 2, 1 -249 frame_bury 0 1, 7, 11, 1, 1, 7, 5, 2 -251 frame_bury 1 1, 7, 11, 1, 2, 7, 5 -253 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 5 -232 frame_dig 0 1, 7, 11, 1, 2, 7, 5, 1 -234 frame_dig 3 1, 7, 11, 1, 2, 7, 5, 1, 5 -236 int 0 1, 7, 11, 1, 2, 7, 5, 1, 5, 0 -237 > 1, 7, 11, 1, 2, 7, 5, 1, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 5, 1 -241 frame_dig 3 1, 7, 11, 1, 2, 7, 5, 1, 5 -243 int 1 1, 7, 11, 1, 2, 7, 5, 1, 5, 1 -244 - 1, 7, 11, 1, 2, 7, 5, 1, 4 -245 frame_bury 3 1, 7, 11, 1, 2, 7, 4, 1 -247 frame_dig 1 1, 7, 11, 1, 2, 7, 4, 1, 2 -249 frame_bury 0 1, 7, 11, 2, 2, 7, 4, 1 -251 frame_bury 1 1, 7, 11, 2, 1, 7, 4 -253 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 4 -232 frame_dig 0 1, 7, 11, 2, 1, 7, 4, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 7, 4, 2, 4 -236 int 0 1, 7, 11, 2, 1, 7, 4, 2, 4, 0 -237 > 1, 7, 11, 2, 1, 7, 4, 2, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 4, 2 -241 frame_dig 3 1, 7, 11, 2, 1, 7, 4, 2, 4 -243 int 1 1, 7, 11, 2, 1, 7, 4, 2, 4, 1 -244 - 1, 7, 11, 2, 1, 7, 4, 2, 3 -245 frame_bury 3 1, 7, 11, 2, 1, 7, 3, 2 -247 frame_dig 1 1, 7, 11, 2, 1, 7, 3, 2, 1 -249 frame_bury 0 1, 7, 11, 1, 1, 7, 3, 2 -251 frame_bury 1 1, 7, 11, 1, 2, 7, 3 -253 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 3 -232 frame_dig 0 1, 7, 11, 1, 2, 7, 3, 1 -234 frame_dig 3 1, 7, 11, 1, 2, 7, 3, 1, 3 -236 int 0 1, 7, 11, 1, 2, 7, 3, 1, 3, 0 -237 > 1, 7, 11, 1, 2, 7, 3, 1, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 3, 1 -241 frame_dig 3 1, 7, 11, 1, 2, 7, 3, 1, 3 -243 int 1 1, 7, 11, 1, 2, 7, 3, 1, 3, 1 -244 - 1, 7, 11, 1, 2, 7, 3, 1, 2 -245 frame_bury 3 1, 7, 11, 1, 2, 7, 2, 1 -247 frame_dig 1 1, 7, 11, 1, 2, 7, 2, 1, 2 -249 frame_bury 0 1, 7, 11, 2, 2, 7, 2, 1 -251 frame_bury 1 1, 7, 11, 2, 1, 7, 2 -253 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 2 -232 frame_dig 0 1, 7, 11, 2, 1, 7, 2, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 7, 2, 2, 2 -236 int 0 1, 7, 11, 2, 1, 7, 2, 2, 2, 0 -237 > 1, 7, 11, 2, 1, 7, 2, 2, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 2, 2 -241 frame_dig 3 1, 7, 11, 2, 1, 7, 2, 2, 2 -243 int 1 1, 7, 11, 2, 1, 7, 2, 2, 2, 1 -244 - 1, 7, 11, 2, 1, 7, 2, 2, 1 -245 frame_bury 3 1, 7, 11, 2, 1, 7, 1, 2 -247 frame_dig 1 1, 7, 11, 2, 1, 7, 1, 2, 1 -249 frame_bury 0 1, 7, 11, 1, 1, 7, 1, 2 -251 frame_bury 1 1, 7, 11, 1, 2, 7, 1 -253 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 1 -232 frame_dig 0 1, 7, 11, 1, 2, 7, 1, 1 -234 frame_dig 3 1, 7, 11, 1, 2, 7, 1, 1, 1 -236 int 0 1, 7, 11, 1, 2, 7, 1, 1, 1, 0 -237 > 1, 7, 11, 1, 2, 7, 1, 1, 1 -238 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 1, 1 -241 frame_dig 3 1, 7, 11, 1, 2, 7, 1, 1, 1 -243 int 1 1, 7, 11, 1, 2, 7, 1, 1, 1, 1 -244 - 1, 7, 11, 1, 2, 7, 1, 1, 0 -245 frame_bury 3 1, 7, 11, 1, 2, 7, 0, 1 -247 frame_dig 1 1, 7, 11, 1, 2, 7, 0, 1, 2 -249 frame_bury 0 1, 7, 11, 2, 2, 7, 0, 1 -251 frame_bury 1 1, 7, 11, 2, 1, 7, 0 -253 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 0 -232 frame_dig 0 1, 7, 11, 2, 1, 7, 0, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 7, 0, 2, 0 -236 int 0 1, 7, 11, 2, 1, 7, 0, 2, 0, 0 -237 > 1, 7, 11, 2, 1, 7, 0, 2, 0 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 0, 2 -256 frame_dig 2 1, 7, 11, 2, 1, 7, 0, 2, 7 -258 int 1 1, 7, 11, 2, 1, 7, 0, 2, 7, 1 -259 - 1, 7, 11, 2, 1, 7, 0, 2, 6 -260 frame_bury 2 1, 7, 11, 2, 1, 6, 0, 2 -262 frame_bury 0 1, 7, 11, 2, 1, 6, 0 -264 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 6, 0 -225 frame_dig 2 1, 7, 11, 2, 1, 6, 0, 6 -227 int 0 1, 7, 11, 2, 1, 6, 0, 6, 0 -228 > 1, 7, 11, 2, 1, 6, 0, 1 -229 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 6, 0 -232 frame_dig 0 1, 7, 11, 2, 1, 6, 0, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 6, 0, 2, 0 -236 int 0 1, 7, 11, 2, 1, 6, 0, 2, 0, 0 -237 > 1, 7, 11, 2, 1, 6, 0, 2, 0 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 6, 0, 2 -256 frame_dig 2 1, 7, 11, 2, 1, 6, 0, 2, 6 -258 int 1 1, 7, 11, 2, 1, 6, 0, 2, 6, 1 -259 - 1, 7, 11, 2, 1, 6, 0, 2, 5 -260 frame_bury 2 1, 7, 11, 2, 1, 5, 0, 2 -262 frame_bury 0 1, 7, 11, 2, 1, 5, 0 -264 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 5, 0 -225 frame_dig 2 1, 7, 11, 2, 1, 5, 0, 5 -227 int 0 1, 7, 11, 2, 1, 5, 0, 5, 0 -228 > 1, 7, 11, 2, 1, 5, 0, 1 -229 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 5, 0 -232 frame_dig 0 1, 7, 11, 2, 1, 5, 0, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 5, 0, 2, 0 -236 int 0 1, 7, 11, 2, 1, 5, 0, 2, 0, 0 -237 > 1, 7, 11, 2, 1, 5, 0, 2, 0 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 5, 0, 2 -256 frame_dig 2 1, 7, 11, 2, 1, 5, 0, 2, 5 -258 int 1 1, 7, 11, 2, 1, 5, 0, 2, 5, 1 -259 - 1, 7, 11, 2, 1, 5, 0, 2, 4 -260 frame_bury 2 1, 7, 11, 2, 1, 4, 0, 2 -262 frame_bury 0 1, 7, 11, 2, 1, 4, 0 -264 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 4, 0 -225 frame_dig 2 1, 7, 11, 2, 1, 4, 0, 4 -227 int 0 1, 7, 11, 2, 1, 4, 0, 4, 0 -228 > 1, 7, 11, 2, 1, 4, 0, 1 -229 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 4, 0 -232 frame_dig 0 1, 7, 11, 2, 1, 4, 0, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 4, 0, 2, 0 -236 int 0 1, 7, 11, 2, 1, 4, 0, 2, 0, 0 -237 > 1, 7, 11, 2, 1, 4, 0, 2, 0 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 4, 0, 2 -256 frame_dig 2 1, 7, 11, 2, 1, 4, 0, 2, 4 -258 int 1 1, 7, 11, 2, 1, 4, 0, 2, 4, 1 -259 - 1, 7, 11, 2, 1, 4, 0, 2, 3 -260 frame_bury 2 1, 7, 11, 2, 1, 3, 0, 2 -262 frame_bury 0 1, 7, 11, 2, 1, 3, 0 -264 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 3, 0 -225 frame_dig 2 1, 7, 11, 2, 1, 3, 0, 3 -227 int 0 1, 7, 11, 2, 1, 3, 0, 3, 0 -228 > 1, 7, 11, 2, 1, 3, 0, 1 -229 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 3, 0 -232 frame_dig 0 1, 7, 11, 2, 1, 3, 0, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 3, 0, 2, 0 -236 int 0 1, 7, 11, 2, 1, 3, 0, 2, 0, 0 -237 > 1, 7, 11, 2, 1, 3, 0, 2, 0 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 3, 0, 2 -256 frame_dig 2 1, 7, 11, 2, 1, 3, 0, 2, 3 -258 int 1 1, 7, 11, 2, 1, 3, 0, 2, 3, 1 -259 - 1, 7, 11, 2, 1, 3, 0, 2, 2 -260 frame_bury 2 1, 7, 11, 2, 1, 2, 0, 2 -262 frame_bury 0 1, 7, 11, 2, 1, 2, 0 -264 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 2, 0 -225 frame_dig 2 1, 7, 11, 2, 1, 2, 0, 2 -227 int 0 1, 7, 11, 2, 1, 2, 0, 2, 0 -228 > 1, 7, 11, 2, 1, 2, 0, 1 -229 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 2, 0 -232 frame_dig 0 1, 7, 11, 2, 1, 2, 0, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 2, 0, 2, 0 -236 int 0 1, 7, 11, 2, 1, 2, 0, 2, 0, 0 -237 > 1, 7, 11, 2, 1, 2, 0, 2, 0 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 2, 0, 2 -256 frame_dig 2 1, 7, 11, 2, 1, 2, 0, 2, 2 -258 int 1 1, 7, 11, 2, 1, 2, 0, 2, 2, 1 -259 - 1, 7, 11, 2, 1, 2, 0, 2, 1 -260 frame_bury 2 1, 7, 11, 2, 1, 1, 0, 2 -262 frame_bury 0 1, 7, 11, 2, 1, 1, 0 -264 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 1, 0 -225 frame_dig 2 1, 7, 11, 2, 1, 1, 0, 1 -227 int 0 1, 7, 11, 2, 1, 1, 0, 1, 0 -228 > 1, 7, 11, 2, 1, 1, 0, 1 -229 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 1, 0 -232 frame_dig 0 1, 7, 11, 2, 1, 1, 0, 2 -234 frame_dig 3 1, 7, 11, 2, 1, 1, 0, 2, 0 -236 int 0 1, 7, 11, 2, 1, 1, 0, 2, 0, 0 -237 > 1, 7, 11, 2, 1, 1, 0, 2, 0 -238 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 1, 0, 2 -256 frame_dig 2 1, 7, 11, 2, 1, 1, 0, 2, 1 -258 int 1 1, 7, 11, 2, 1, 1, 0, 2, 1, 1 -259 - 1, 7, 11, 2, 1, 1, 0, 2, 0 -260 frame_bury 2 1, 7, 11, 2, 1, 0, 0, 2 -262 frame_bury 0 1, 7, 11, 2, 1, 0, 0 -264 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 0, 0 -225 frame_dig 2 1, 7, 11, 2, 1, 0, 0, 0 -227 int 0 1, 7, 11, 2, 1, 0, 0, 0, 0 -228 > 1, 7, 11, 2, 1, 0, 0, 0 -229 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 0, 0 -267 retsub 1, 2 +213 proto 2 1 1, 7, 11 +216 int 1 1, 7, 11, 1 +217 int 2 1, 7, 11, 1, 2 +218 frame_dig -2 1, 7, 11, 1, 2, 7 +220 frame_dig -1 1, 7, 11, 1, 2, 7, 11 +222 frame_dig 2 1, 7, 11, 1, 2, 7, 11, 7 +224 int 0 1, 7, 11, 1, 2, 7, 11, 7, 0 +225 > 1, 7, 11, 1, 2, 7, 11, 1 +226 bz test_swap_loop_after_while@6 1, 7, 11, 1, 2, 7, 11 +229 frame_dig 0 1, 7, 11, 1, 2, 7, 11, 1 +231 frame_dig 3 1, 7, 11, 1, 2, 7, 11, 1, 11 +233 int 0 1, 7, 11, 1, 2, 7, 11, 1, 11, 0 +234 > 1, 7, 11, 1, 2, 7, 11, 1, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 11, 1 +238 frame_dig 3 1, 7, 11, 1, 2, 7, 11, 1, 11 +240 int 1 1, 7, 11, 1, 2, 7, 11, 1, 11, 1 +241 - 1, 7, 11, 1, 2, 7, 11, 1, 10 +242 frame_bury 3 1, 7, 11, 1, 2, 7, 10, 1 +244 frame_dig 1 1, 7, 11, 1, 2, 7, 10, 1, 2 +246 frame_bury 0 1, 7, 11, 2, 2, 7, 10, 1 +248 frame_bury 1 1, 7, 11, 2, 1, 7, 10 +250 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 10 +229 frame_dig 0 1, 7, 11, 2, 1, 7, 10, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 7, 10, 2, 10 +233 int 0 1, 7, 11, 2, 1, 7, 10, 2, 10, 0 +234 > 1, 7, 11, 2, 1, 7, 10, 2, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 10, 2 +238 frame_dig 3 1, 7, 11, 2, 1, 7, 10, 2, 10 +240 int 1 1, 7, 11, 2, 1, 7, 10, 2, 10, 1 +241 - 1, 7, 11, 2, 1, 7, 10, 2, 9 +242 frame_bury 3 1, 7, 11, 2, 1, 7, 9, 2 +244 frame_dig 1 1, 7, 11, 2, 1, 7, 9, 2, 1 +246 frame_bury 0 1, 7, 11, 1, 1, 7, 9, 2 +248 frame_bury 1 1, 7, 11, 1, 2, 7, 9 +250 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 9 +229 frame_dig 0 1, 7, 11, 1, 2, 7, 9, 1 +231 frame_dig 3 1, 7, 11, 1, 2, 7, 9, 1, 9 +233 int 0 1, 7, 11, 1, 2, 7, 9, 1, 9, 0 +234 > 1, 7, 11, 1, 2, 7, 9, 1, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 9, 1 +238 frame_dig 3 1, 7, 11, 1, 2, 7, 9, 1, 9 +240 int 1 1, 7, 11, 1, 2, 7, 9, 1, 9, 1 +241 - 1, 7, 11, 1, 2, 7, 9, 1, 8 +242 frame_bury 3 1, 7, 11, 1, 2, 7, 8, 1 +244 frame_dig 1 1, 7, 11, 1, 2, 7, 8, 1, 2 +246 frame_bury 0 1, 7, 11, 2, 2, 7, 8, 1 +248 frame_bury 1 1, 7, 11, 2, 1, 7, 8 +250 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 8 +229 frame_dig 0 1, 7, 11, 2, 1, 7, 8, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 7, 8, 2, 8 +233 int 0 1, 7, 11, 2, 1, 7, 8, 2, 8, 0 +234 > 1, 7, 11, 2, 1, 7, 8, 2, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 8, 2 +238 frame_dig 3 1, 7, 11, 2, 1, 7, 8, 2, 8 +240 int 1 1, 7, 11, 2, 1, 7, 8, 2, 8, 1 +241 - 1, 7, 11, 2, 1, 7, 8, 2, 7 +242 frame_bury 3 1, 7, 11, 2, 1, 7, 7, 2 +244 frame_dig 1 1, 7, 11, 2, 1, 7, 7, 2, 1 +246 frame_bury 0 1, 7, 11, 1, 1, 7, 7, 2 +248 frame_bury 1 1, 7, 11, 1, 2, 7, 7 +250 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 7 +229 frame_dig 0 1, 7, 11, 1, 2, 7, 7, 1 +231 frame_dig 3 1, 7, 11, 1, 2, 7, 7, 1, 7 +233 int 0 1, 7, 11, 1, 2, 7, 7, 1, 7, 0 +234 > 1, 7, 11, 1, 2, 7, 7, 1, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 7, 1 +238 frame_dig 3 1, 7, 11, 1, 2, 7, 7, 1, 7 +240 int 1 1, 7, 11, 1, 2, 7, 7, 1, 7, 1 +241 - 1, 7, 11, 1, 2, 7, 7, 1, 6 +242 frame_bury 3 1, 7, 11, 1, 2, 7, 6, 1 +244 frame_dig 1 1, 7, 11, 1, 2, 7, 6, 1, 2 +246 frame_bury 0 1, 7, 11, 2, 2, 7, 6, 1 +248 frame_bury 1 1, 7, 11, 2, 1, 7, 6 +250 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 6 +229 frame_dig 0 1, 7, 11, 2, 1, 7, 6, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 7, 6, 2, 6 +233 int 0 1, 7, 11, 2, 1, 7, 6, 2, 6, 0 +234 > 1, 7, 11, 2, 1, 7, 6, 2, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 6, 2 +238 frame_dig 3 1, 7, 11, 2, 1, 7, 6, 2, 6 +240 int 1 1, 7, 11, 2, 1, 7, 6, 2, 6, 1 +241 - 1, 7, 11, 2, 1, 7, 6, 2, 5 +242 frame_bury 3 1, 7, 11, 2, 1, 7, 5, 2 +244 frame_dig 1 1, 7, 11, 2, 1, 7, 5, 2, 1 +246 frame_bury 0 1, 7, 11, 1, 1, 7, 5, 2 +248 frame_bury 1 1, 7, 11, 1, 2, 7, 5 +250 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 5 +229 frame_dig 0 1, 7, 11, 1, 2, 7, 5, 1 +231 frame_dig 3 1, 7, 11, 1, 2, 7, 5, 1, 5 +233 int 0 1, 7, 11, 1, 2, 7, 5, 1, 5, 0 +234 > 1, 7, 11, 1, 2, 7, 5, 1, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 5, 1 +238 frame_dig 3 1, 7, 11, 1, 2, 7, 5, 1, 5 +240 int 1 1, 7, 11, 1, 2, 7, 5, 1, 5, 1 +241 - 1, 7, 11, 1, 2, 7, 5, 1, 4 +242 frame_bury 3 1, 7, 11, 1, 2, 7, 4, 1 +244 frame_dig 1 1, 7, 11, 1, 2, 7, 4, 1, 2 +246 frame_bury 0 1, 7, 11, 2, 2, 7, 4, 1 +248 frame_bury 1 1, 7, 11, 2, 1, 7, 4 +250 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 4 +229 frame_dig 0 1, 7, 11, 2, 1, 7, 4, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 7, 4, 2, 4 +233 int 0 1, 7, 11, 2, 1, 7, 4, 2, 4, 0 +234 > 1, 7, 11, 2, 1, 7, 4, 2, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 4, 2 +238 frame_dig 3 1, 7, 11, 2, 1, 7, 4, 2, 4 +240 int 1 1, 7, 11, 2, 1, 7, 4, 2, 4, 1 +241 - 1, 7, 11, 2, 1, 7, 4, 2, 3 +242 frame_bury 3 1, 7, 11, 2, 1, 7, 3, 2 +244 frame_dig 1 1, 7, 11, 2, 1, 7, 3, 2, 1 +246 frame_bury 0 1, 7, 11, 1, 1, 7, 3, 2 +248 frame_bury 1 1, 7, 11, 1, 2, 7, 3 +250 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 3 +229 frame_dig 0 1, 7, 11, 1, 2, 7, 3, 1 +231 frame_dig 3 1, 7, 11, 1, 2, 7, 3, 1, 3 +233 int 0 1, 7, 11, 1, 2, 7, 3, 1, 3, 0 +234 > 1, 7, 11, 1, 2, 7, 3, 1, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 3, 1 +238 frame_dig 3 1, 7, 11, 1, 2, 7, 3, 1, 3 +240 int 1 1, 7, 11, 1, 2, 7, 3, 1, 3, 1 +241 - 1, 7, 11, 1, 2, 7, 3, 1, 2 +242 frame_bury 3 1, 7, 11, 1, 2, 7, 2, 1 +244 frame_dig 1 1, 7, 11, 1, 2, 7, 2, 1, 2 +246 frame_bury 0 1, 7, 11, 2, 2, 7, 2, 1 +248 frame_bury 1 1, 7, 11, 2, 1, 7, 2 +250 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 2 +229 frame_dig 0 1, 7, 11, 2, 1, 7, 2, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 7, 2, 2, 2 +233 int 0 1, 7, 11, 2, 1, 7, 2, 2, 2, 0 +234 > 1, 7, 11, 2, 1, 7, 2, 2, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 2, 2 +238 frame_dig 3 1, 7, 11, 2, 1, 7, 2, 2, 2 +240 int 1 1, 7, 11, 2, 1, 7, 2, 2, 2, 1 +241 - 1, 7, 11, 2, 1, 7, 2, 2, 1 +242 frame_bury 3 1, 7, 11, 2, 1, 7, 1, 2 +244 frame_dig 1 1, 7, 11, 2, 1, 7, 1, 2, 1 +246 frame_bury 0 1, 7, 11, 1, 1, 7, 1, 2 +248 frame_bury 1 1, 7, 11, 1, 2, 7, 1 +250 b test_swap_loop_while_top@3 1, 7, 11, 1, 2, 7, 1 +229 frame_dig 0 1, 7, 11, 1, 2, 7, 1, 1 +231 frame_dig 3 1, 7, 11, 1, 2, 7, 1, 1, 1 +233 int 0 1, 7, 11, 1, 2, 7, 1, 1, 1, 0 +234 > 1, 7, 11, 1, 2, 7, 1, 1, 1 +235 bz test_swap_loop_after_while@5 1, 7, 11, 1, 2, 7, 1, 1 +238 frame_dig 3 1, 7, 11, 1, 2, 7, 1, 1, 1 +240 int 1 1, 7, 11, 1, 2, 7, 1, 1, 1, 1 +241 - 1, 7, 11, 1, 2, 7, 1, 1, 0 +242 frame_bury 3 1, 7, 11, 1, 2, 7, 0, 1 +244 frame_dig 1 1, 7, 11, 1, 2, 7, 0, 1, 2 +246 frame_bury 0 1, 7, 11, 2, 2, 7, 0, 1 +248 frame_bury 1 1, 7, 11, 2, 1, 7, 0 +250 b test_swap_loop_while_top@3 1, 7, 11, 2, 1, 7, 0 +229 frame_dig 0 1, 7, 11, 2, 1, 7, 0, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 7, 0, 2, 0 +233 int 0 1, 7, 11, 2, 1, 7, 0, 2, 0, 0 +234 > 1, 7, 11, 2, 1, 7, 0, 2, 0 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 7, 0, 2 +253 frame_dig 2 1, 7, 11, 2, 1, 7, 0, 2, 7 +255 int 1 1, 7, 11, 2, 1, 7, 0, 2, 7, 1 +256 - 1, 7, 11, 2, 1, 7, 0, 2, 6 +257 frame_bury 2 1, 7, 11, 2, 1, 6, 0, 2 +259 frame_bury 0 1, 7, 11, 2, 1, 6, 0 +261 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 6, 0 +222 frame_dig 2 1, 7, 11, 2, 1, 6, 0, 6 +224 int 0 1, 7, 11, 2, 1, 6, 0, 6, 0 +225 > 1, 7, 11, 2, 1, 6, 0, 1 +226 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 6, 0 +229 frame_dig 0 1, 7, 11, 2, 1, 6, 0, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 6, 0, 2, 0 +233 int 0 1, 7, 11, 2, 1, 6, 0, 2, 0, 0 +234 > 1, 7, 11, 2, 1, 6, 0, 2, 0 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 6, 0, 2 +253 frame_dig 2 1, 7, 11, 2, 1, 6, 0, 2, 6 +255 int 1 1, 7, 11, 2, 1, 6, 0, 2, 6, 1 +256 - 1, 7, 11, 2, 1, 6, 0, 2, 5 +257 frame_bury 2 1, 7, 11, 2, 1, 5, 0, 2 +259 frame_bury 0 1, 7, 11, 2, 1, 5, 0 +261 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 5, 0 +222 frame_dig 2 1, 7, 11, 2, 1, 5, 0, 5 +224 int 0 1, 7, 11, 2, 1, 5, 0, 5, 0 +225 > 1, 7, 11, 2, 1, 5, 0, 1 +226 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 5, 0 +229 frame_dig 0 1, 7, 11, 2, 1, 5, 0, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 5, 0, 2, 0 +233 int 0 1, 7, 11, 2, 1, 5, 0, 2, 0, 0 +234 > 1, 7, 11, 2, 1, 5, 0, 2, 0 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 5, 0, 2 +253 frame_dig 2 1, 7, 11, 2, 1, 5, 0, 2, 5 +255 int 1 1, 7, 11, 2, 1, 5, 0, 2, 5, 1 +256 - 1, 7, 11, 2, 1, 5, 0, 2, 4 +257 frame_bury 2 1, 7, 11, 2, 1, 4, 0, 2 +259 frame_bury 0 1, 7, 11, 2, 1, 4, 0 +261 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 4, 0 +222 frame_dig 2 1, 7, 11, 2, 1, 4, 0, 4 +224 int 0 1, 7, 11, 2, 1, 4, 0, 4, 0 +225 > 1, 7, 11, 2, 1, 4, 0, 1 +226 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 4, 0 +229 frame_dig 0 1, 7, 11, 2, 1, 4, 0, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 4, 0, 2, 0 +233 int 0 1, 7, 11, 2, 1, 4, 0, 2, 0, 0 +234 > 1, 7, 11, 2, 1, 4, 0, 2, 0 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 4, 0, 2 +253 frame_dig 2 1, 7, 11, 2, 1, 4, 0, 2, 4 +255 int 1 1, 7, 11, 2, 1, 4, 0, 2, 4, 1 +256 - 1, 7, 11, 2, 1, 4, 0, 2, 3 +257 frame_bury 2 1, 7, 11, 2, 1, 3, 0, 2 +259 frame_bury 0 1, 7, 11, 2, 1, 3, 0 +261 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 3, 0 +222 frame_dig 2 1, 7, 11, 2, 1, 3, 0, 3 +224 int 0 1, 7, 11, 2, 1, 3, 0, 3, 0 +225 > 1, 7, 11, 2, 1, 3, 0, 1 +226 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 3, 0 +229 frame_dig 0 1, 7, 11, 2, 1, 3, 0, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 3, 0, 2, 0 +233 int 0 1, 7, 11, 2, 1, 3, 0, 2, 0, 0 +234 > 1, 7, 11, 2, 1, 3, 0, 2, 0 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 3, 0, 2 +253 frame_dig 2 1, 7, 11, 2, 1, 3, 0, 2, 3 +255 int 1 1, 7, 11, 2, 1, 3, 0, 2, 3, 1 +256 - 1, 7, 11, 2, 1, 3, 0, 2, 2 +257 frame_bury 2 1, 7, 11, 2, 1, 2, 0, 2 +259 frame_bury 0 1, 7, 11, 2, 1, 2, 0 +261 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 2, 0 +222 frame_dig 2 1, 7, 11, 2, 1, 2, 0, 2 +224 int 0 1, 7, 11, 2, 1, 2, 0, 2, 0 +225 > 1, 7, 11, 2, 1, 2, 0, 1 +226 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 2, 0 +229 frame_dig 0 1, 7, 11, 2, 1, 2, 0, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 2, 0, 2, 0 +233 int 0 1, 7, 11, 2, 1, 2, 0, 2, 0, 0 +234 > 1, 7, 11, 2, 1, 2, 0, 2, 0 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 2, 0, 2 +253 frame_dig 2 1, 7, 11, 2, 1, 2, 0, 2, 2 +255 int 1 1, 7, 11, 2, 1, 2, 0, 2, 2, 1 +256 - 1, 7, 11, 2, 1, 2, 0, 2, 1 +257 frame_bury 2 1, 7, 11, 2, 1, 1, 0, 2 +259 frame_bury 0 1, 7, 11, 2, 1, 1, 0 +261 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 1, 0 +222 frame_dig 2 1, 7, 11, 2, 1, 1, 0, 1 +224 int 0 1, 7, 11, 2, 1, 1, 0, 1, 0 +225 > 1, 7, 11, 2, 1, 1, 0, 1 +226 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 1, 0 +229 frame_dig 0 1, 7, 11, 2, 1, 1, 0, 2 +231 frame_dig 3 1, 7, 11, 2, 1, 1, 0, 2, 0 +233 int 0 1, 7, 11, 2, 1, 1, 0, 2, 0, 0 +234 > 1, 7, 11, 2, 1, 1, 0, 2, 0 +235 bz test_swap_loop_after_while@5 1, 7, 11, 2, 1, 1, 0, 2 +253 frame_dig 2 1, 7, 11, 2, 1, 1, 0, 2, 1 +255 int 1 1, 7, 11, 2, 1, 1, 0, 2, 1, 1 +256 - 1, 7, 11, 2, 1, 1, 0, 2, 0 +257 frame_bury 2 1, 7, 11, 2, 1, 0, 0, 2 +259 frame_bury 0 1, 7, 11, 2, 1, 0, 0 +261 b test_swap_loop_while_top@1 1, 7, 11, 2, 1, 0, 0 +222 frame_dig 2 1, 7, 11, 2, 1, 0, 0, 0 +224 int 0 1, 7, 11, 2, 1, 0, 0, 0, 0 +225 > 1, 7, 11, 2, 1, 0, 0, 0 +226 bz test_swap_loop_after_while@6 1, 7, 11, 2, 1, 0, 0 +264 retsub 1, 2 83 pop 1 84 int 0 1, 0 85 callsub test_param_update_with_reentrant_entry_block 1, 0 -268 proto 1 1 1, 0 -271 frame_dig -1 1, 0, 0 -273 frame_dig 0 1, 0, 0, 0 -275 int 1 1, 0, 0, 0, 1 -276 + 1, 0, 0, 1 -277 dup 1, 0, 0, 1, 1 -278 frame_bury 0 1, 0, 1, 1 -280 int 10 1, 0, 1, 1, 10 -282 >= 1, 0, 1, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 1 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 1 -273 frame_dig 0 1, 0, 1, 1 -275 int 1 1, 0, 1, 1, 1 -276 + 1, 0, 1, 2 -277 dup 1, 0, 1, 2, 2 -278 frame_bury 0 1, 0, 2, 2 -280 int 10 1, 0, 2, 2, 10 -282 >= 1, 0, 2, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 2 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 2 -273 frame_dig 0 1, 0, 2, 2 -275 int 1 1, 0, 2, 2, 1 -276 + 1, 0, 2, 3 -277 dup 1, 0, 2, 3, 3 -278 frame_bury 0 1, 0, 3, 3 -280 int 10 1, 0, 3, 3, 10 -282 >= 1, 0, 3, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 3 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 3 -273 frame_dig 0 1, 0, 3, 3 -275 int 1 1, 0, 3, 3, 1 -276 + 1, 0, 3, 4 -277 dup 1, 0, 3, 4, 4 -278 frame_bury 0 1, 0, 4, 4 -280 int 10 1, 0, 4, 4, 10 -282 >= 1, 0, 4, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 4 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 4 -273 frame_dig 0 1, 0, 4, 4 -275 int 1 1, 0, 4, 4, 1 -276 + 1, 0, 4, 5 -277 dup 1, 0, 4, 5, 5 -278 frame_bury 0 1, 0, 5, 5 -280 int 10 1, 0, 5, 5, 10 -282 >= 1, 0, 5, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 5 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 5 -273 frame_dig 0 1, 0, 5, 5 -275 int 1 1, 0, 5, 5, 1 -276 + 1, 0, 5, 6 -277 dup 1, 0, 5, 6, 6 -278 frame_bury 0 1, 0, 6, 6 -280 int 10 1, 0, 6, 6, 10 -282 >= 1, 0, 6, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 6 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 6 -273 frame_dig 0 1, 0, 6, 6 -275 int 1 1, 0, 6, 6, 1 -276 + 1, 0, 6, 7 -277 dup 1, 0, 6, 7, 7 -278 frame_bury 0 1, 0, 7, 7 -280 int 10 1, 0, 7, 7, 10 -282 >= 1, 0, 7, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 7 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 7 -273 frame_dig 0 1, 0, 7, 7 -275 int 1 1, 0, 7, 7, 1 -276 + 1, 0, 7, 8 -277 dup 1, 0, 7, 8, 8 -278 frame_bury 0 1, 0, 8, 8 -280 int 10 1, 0, 8, 8, 10 -282 >= 1, 0, 8, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 8 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 8 -273 frame_dig 0 1, 0, 8, 8 -275 int 1 1, 0, 8, 8, 1 -276 + 1, 0, 8, 9 -277 dup 1, 0, 8, 9, 9 -278 frame_bury 0 1, 0, 9, 9 -280 int 10 1, 0, 9, 9, 10 -282 >= 1, 0, 9, 0 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 9 -291 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 9 -273 frame_dig 0 1, 0, 9, 9 -275 int 1 1, 0, 9, 9, 1 -276 + 1, 0, 9, 10 -277 dup 1, 0, 9, 10, 10 -278 frame_bury 0 1, 0, 10, 10 -280 int 10 1, 0, 10, 10, 10 -282 >= 1, 0, 10, 1 -283 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 10 -286 frame_dig 0 1, 0, 10, 10 -288 uncover 1 1, 0, 10, 10 -290 retsub 1, 10 +265 proto 1 1 1, 0 +268 frame_dig -1 1, 0, 0 +270 frame_dig 0 1, 0, 0, 0 +272 int 1 1, 0, 0, 0, 1 +273 + 1, 0, 0, 1 +274 dup 1, 0, 0, 1, 1 +275 frame_bury 0 1, 0, 1, 1 +277 int 10 1, 0, 1, 1, 10 +279 >= 1, 0, 1, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 1 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 1 +270 frame_dig 0 1, 0, 1, 1 +272 int 1 1, 0, 1, 1, 1 +273 + 1, 0, 1, 2 +274 dup 1, 0, 1, 2, 2 +275 frame_bury 0 1, 0, 2, 2 +277 int 10 1, 0, 2, 2, 10 +279 >= 1, 0, 2, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 2 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 2 +270 frame_dig 0 1, 0, 2, 2 +272 int 1 1, 0, 2, 2, 1 +273 + 1, 0, 2, 3 +274 dup 1, 0, 2, 3, 3 +275 frame_bury 0 1, 0, 3, 3 +277 int 10 1, 0, 3, 3, 10 +279 >= 1, 0, 3, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 3 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 3 +270 frame_dig 0 1, 0, 3, 3 +272 int 1 1, 0, 3, 3, 1 +273 + 1, 0, 3, 4 +274 dup 1, 0, 3, 4, 4 +275 frame_bury 0 1, 0, 4, 4 +277 int 10 1, 0, 4, 4, 10 +279 >= 1, 0, 4, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 4 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 4 +270 frame_dig 0 1, 0, 4, 4 +272 int 1 1, 0, 4, 4, 1 +273 + 1, 0, 4, 5 +274 dup 1, 0, 4, 5, 5 +275 frame_bury 0 1, 0, 5, 5 +277 int 10 1, 0, 5, 5, 10 +279 >= 1, 0, 5, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 5 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 5 +270 frame_dig 0 1, 0, 5, 5 +272 int 1 1, 0, 5, 5, 1 +273 + 1, 0, 5, 6 +274 dup 1, 0, 5, 6, 6 +275 frame_bury 0 1, 0, 6, 6 +277 int 10 1, 0, 6, 6, 10 +279 >= 1, 0, 6, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 6 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 6 +270 frame_dig 0 1, 0, 6, 6 +272 int 1 1, 0, 6, 6, 1 +273 + 1, 0, 6, 7 +274 dup 1, 0, 6, 7, 7 +275 frame_bury 0 1, 0, 7, 7 +277 int 10 1, 0, 7, 7, 10 +279 >= 1, 0, 7, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 7 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 7 +270 frame_dig 0 1, 0, 7, 7 +272 int 1 1, 0, 7, 7, 1 +273 + 1, 0, 7, 8 +274 dup 1, 0, 7, 8, 8 +275 frame_bury 0 1, 0, 8, 8 +277 int 10 1, 0, 8, 8, 10 +279 >= 1, 0, 8, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 8 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 8 +270 frame_dig 0 1, 0, 8, 8 +272 int 1 1, 0, 8, 8, 1 +273 + 1, 0, 8, 9 +274 dup 1, 0, 8, 9, 9 +275 frame_bury 0 1, 0, 9, 9 +277 int 10 1, 0, 9, 9, 10 +279 >= 1, 0, 9, 0 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 9 +287 b test_param_update_with_reentrant_entry_block_while_top@1 1, 0, 9 +270 frame_dig 0 1, 0, 9, 9 +272 int 1 1, 0, 9, 9, 1 +273 + 1, 0, 9, 10 +274 dup 1, 0, 9, 10, 10 +275 frame_bury 0 1, 0, 10, 10 +277 int 10 1, 0, 10, 10, 10 +279 >= 1, 0, 10, 1 +280 bz test_param_update_with_reentrant_entry_block_after_if_else@4 1, 0, 10 +283 frame_dig 0 1, 0, 10, 10 +285 swap 1, 0, 10, 10 +286 retsub 1, 10 88 int 10 1, 10, 10 90 == 1, 1 91 assert 1 92 int 0 1, 0 93 callsub test_param_update_with_reentrant_entry_block_v2 1, 0 -294 proto 1 1 1, 0 -297 frame_dig -1 1, 0, 0 -299 int 1 1, 0, 0, 1 -300 + 1, 0, 1 -301 frame_dig 0 1, 0, 1, 1 -303 int 1 1, 0, 1, 1, 1 -304 >= 1, 0, 1, 1 -305 bz test_param_update_with_reentrant_entry_block_v2_while_top@1 1, 0, 1 -308 frame_dig 0 1, 0, 1, 1 -310 uncover 1 1, 0, 1, 1 -312 retsub 1, 1 +290 proto 1 1 1, 0 +293 frame_dig -1 1, 0, 0 +295 int 1 1, 0, 0, 1 +296 + 1, 0, 1 +297 frame_dig 0 1, 0, 1, 1 +299 int 1 1, 0, 1, 1, 1 +300 >= 1, 0, 1, 1 +301 bz test_param_update_with_reentrant_entry_block_v2_while_top@1 1, 0, 1 +304 frame_dig 0 1, 0, 1, 1 +306 swap 1, 0, 1, 1 +307 retsub 1, 1 96 pop 1 97 callsub test_param_update_with_reentrant_entry_block_v3 1 -313 proto 0 0 1 -316 callsub one 1 -323 proto 0 1 1 -326 int 1 1, 1 -327 retsub 1, 1 -319 bz test_param_update_with_reentrant_entry_block_v3_while_top@1 1 -322 retsub 1 +308 proto 0 0 1 +311 callsub one 1 +318 proto 0 1 1 +321 int 1 1, 1 +322 retsub 1, 1 +314 bz test_param_update_with_reentrant_entry_block_v3_while_top@1 1 +317 retsub 1 100 callsub test_swap_args 1 -328 proto 0 0 1 -331 callsub one 1 -323 proto 0 1 1 -326 int 1 1, 1 -327 retsub 1, 1 -334 int 123 1, 1, 123 -336 + 1, 124 -337 callsub one 1, 124 -323 proto 0 1 1, 124 -326 int 1 1, 124, 1 -327 retsub 1, 124, 1 -340 int 234 1, 124, 1, 234 -343 + 1, 124, 235 -344 callsub swap_args 1, 124, 235 -359 proto 2 2 1, 124, 235 -362 frame_dig -1 1, 124, 235, 235 -364 frame_dig -2 1, 124, 235, 235, 124 -366 retsub 1, 235, 124 -347 cover 1 1, 124, 235 -349 int 235 1, 124, 235, 235 -352 == 1, 124, 1 -353 assert 1, 124 -354 int 124 1, 124, 124 -356 == 1, 1 -357 assert 1 -358 retsub 1 +323 proto 0 0 1 +326 callsub one 1 +318 proto 0 1 1 +321 int 1 1, 1 +322 retsub 1, 1 +329 int 123 1, 1, 123 +331 + 1, 124 +332 callsub one 1, 124 +318 proto 0 1 1, 124 +321 int 1 1, 124, 1 +322 retsub 1, 124, 1 +335 int 234 1, 124, 1, 234 +338 + 1, 124, 235 +339 callsub swap_args 1, 124, 235 +353 proto 2 2 1, 124, 235 +356 frame_dig -1 1, 124, 235, 235 +358 frame_dig -2 1, 124, 235, 235, 124 +360 retsub 1, 235, 124 +342 swap 1, 124, 235 +343 int 235 1, 124, 235, 235 +346 == 1, 124, 1 +347 assert 1, 124 +348 int 124 1, 124, 124 +350 == 1, 1 +351 assert 1 +352 retsub 1 103 int 100 1, 100 104 int 200 1, 100, 200 106 int 0 1, 100, 200, 0 107 callsub test_tuple_swap 1, 100, 200, 0 -367 proto 3 2 1, 100, 200, 0 -370 int 0 1, 100, 200, 0, 0 -371 frame_dig -2 1, 100, 200, 0, 0, 200 -373 frame_dig -3 1, 100, 200, 0, 0, 200, 100 -375 frame_dig 1 1, 100, 200, 0, 0, 200, 100, 200 -377 cover 1 1, 100, 200, 0, 0, 200, 200, 100 -379 frame_bury 1 1, 100, 200, 0, 0, 100, 200 -381 frame_dig 0 1, 100, 200, 0, 0, 100, 200, 0 -383 frame_dig -1 1, 100, 200, 0, 0, 100, 200, 0, 0 -385 < 1, 100, 200, 0, 0, 100, 200, 0 -386 bz test_tuple_swap_after_for@4 1, 100, 200, 0, 0, 100, 200 -398 frame_dig 1 1, 100, 200, 0, 0, 100, 200, 100 -400 uncover 1 1, 100, 200, 0, 0, 100, 100, 200 -402 uncover 3 1, 100, 200, 0, 100, 100, 200, 0 -404 uncover 3 1, 100, 200, 0, 100, 200, 0, 100 -406 retsub 1, 100, 200 -110 cover 1 1, 200, 100 -112 int 100 1, 200, 100, 100 -113 == 1, 200, 1 -114 assert 1, 200 -115 int 200 1, 200, 200 -117 == 1, 1 -118 assert 1 -119 int 100 1, 100 -120 int 200 1, 100, 200 -122 int 1 1, 100, 200, 1 -123 callsub test_tuple_swap 1, 100, 200, 1 -367 proto 3 2 1, 100, 200, 1 -370 int 0 1, 100, 200, 1, 0 -371 frame_dig -2 1, 100, 200, 1, 0, 200 -373 frame_dig -3 1, 100, 200, 1, 0, 200, 100 -375 frame_dig 1 1, 100, 200, 1, 0, 200, 100, 200 -377 cover 1 1, 100, 200, 1, 0, 200, 200, 100 -379 frame_bury 1 1, 100, 200, 1, 0, 100, 200 -381 frame_dig 0 1, 100, 200, 1, 0, 100, 200, 0 -383 frame_dig -1 1, 100, 200, 1, 0, 100, 200, 0, 1 -385 < 1, 100, 200, 1, 0, 100, 200, 1 -386 bz test_tuple_swap_after_for@4 1, 100, 200, 1, 0, 100, 200 -389 frame_dig 0 1, 100, 200, 1, 0, 100, 200, 0 -391 int 1 1, 100, 200, 1, 0, 100, 200, 0, 1 -392 + 1, 100, 200, 1, 0, 100, 200, 1 -393 frame_bury 0 1, 100, 200, 1, 1, 100, 200 -395 b test_tuple_swap_for_header@1 1, 100, 200, 1, 1, 100, 200 -375 frame_dig 1 1, 100, 200, 1, 1, 100, 200, 100 -377 cover 1 1, 100, 200, 1, 1, 100, 100, 200 -379 frame_bury 1 1, 100, 200, 1, 1, 200, 100 -381 frame_dig 0 1, 100, 200, 1, 1, 200, 100, 1 -383 frame_dig -1 1, 100, 200, 1, 1, 200, 100, 1, 1 -385 < 1, 100, 200, 1, 1, 200, 100, 0 -386 bz test_tuple_swap_after_for@4 1, 100, 200, 1, 1, 200, 100 -398 frame_dig 1 1, 100, 200, 1, 1, 200, 100, 200 -400 uncover 1 1, 100, 200, 1, 1, 200, 200, 100 -402 uncover 3 1, 100, 200, 1, 200, 200, 100, 1 -404 uncover 3 1, 100, 200, 1, 200, 100, 1, 200 -406 retsub 1, 200, 100 -126 cover 1 1, 100, 200 -128 int 200 1, 100, 200, 200 -130 == 1, 100, 1 -131 assert 1, 100 -132 int 100 1, 100, 100 -133 == 1, 1 -134 assert 1 -135 int 1 1, 1 -136 return 1 \ No newline at end of file +361 proto 3 2 1, 100, 200, 0 +364 int 0 1, 100, 200, 0, 0 +365 frame_dig -2 1, 100, 200, 0, 0, 200 +367 frame_dig -3 1, 100, 200, 0, 0, 200, 100 +369 frame_dig 1 1, 100, 200, 0, 0, 200, 100, 200 +371 swap 1, 100, 200, 0, 0, 200, 200, 100 +372 frame_bury 1 1, 100, 200, 0, 0, 100, 200 +374 frame_dig 0 1, 100, 200, 0, 0, 100, 200, 0 +376 frame_dig -1 1, 100, 200, 0, 0, 100, 200, 0, 0 +378 < 1, 100, 200, 0, 0, 100, 200, 0 +379 bz test_tuple_swap_after_for@4 1, 100, 200, 0, 0, 100, 200 +391 frame_dig 1 1, 100, 200, 0, 0, 100, 200, 100 +393 swap 1, 100, 200, 0, 0, 100, 100, 200 +394 uncover 3 1, 100, 200, 0, 100, 100, 200, 0 +396 uncover 3 1, 100, 200, 0, 100, 200, 0, 100 +398 retsub 1, 100, 200 +110 swap 1, 200, 100 +111 int 100 1, 200, 100, 100 +112 == 1, 200, 1 +113 assert 1, 200 +114 int 200 1, 200, 200 +116 == 1, 1 +117 assert 1 +118 int 100 1, 100 +119 int 200 1, 100, 200 +121 int 1 1, 100, 200, 1 +122 callsub test_tuple_swap 1, 100, 200, 1 +361 proto 3 2 1, 100, 200, 1 +364 int 0 1, 100, 200, 1, 0 +365 frame_dig -2 1, 100, 200, 1, 0, 200 +367 frame_dig -3 1, 100, 200, 1, 0, 200, 100 +369 frame_dig 1 1, 100, 200, 1, 0, 200, 100, 200 +371 swap 1, 100, 200, 1, 0, 200, 200, 100 +372 frame_bury 1 1, 100, 200, 1, 0, 100, 200 +374 frame_dig 0 1, 100, 200, 1, 0, 100, 200, 0 +376 frame_dig -1 1, 100, 200, 1, 0, 100, 200, 0, 1 +378 < 1, 100, 200, 1, 0, 100, 200, 1 +379 bz test_tuple_swap_after_for@4 1, 100, 200, 1, 0, 100, 200 +382 frame_dig 0 1, 100, 200, 1, 0, 100, 200, 0 +384 int 1 1, 100, 200, 1, 0, 100, 200, 0, 1 +385 + 1, 100, 200, 1, 0, 100, 200, 1 +386 frame_bury 0 1, 100, 200, 1, 1, 100, 200 +388 b test_tuple_swap_for_header@1 1, 100, 200, 1, 1, 100, 200 +369 frame_dig 1 1, 100, 200, 1, 1, 100, 200, 100 +371 swap 1, 100, 200, 1, 1, 100, 100, 200 +372 frame_bury 1 1, 100, 200, 1, 1, 200, 100 +374 frame_dig 0 1, 100, 200, 1, 1, 200, 100, 1 +376 frame_dig -1 1, 100, 200, 1, 1, 200, 100, 1, 1 +378 < 1, 100, 200, 1, 1, 200, 100, 0 +379 bz test_tuple_swap_after_for@4 1, 100, 200, 1, 1, 200, 100 +391 frame_dig 1 1, 100, 200, 1, 1, 200, 100, 200 +393 swap 1, 100, 200, 1, 1, 200, 200, 100 +394 uncover 3 1, 100, 200, 1, 200, 200, 100, 1 +396 uncover 3 1, 100, 200, 1, 200, 100, 1, 200 +398 retsub 1, 200, 100 +125 swap 1, 100, 200 +126 int 200 1, 100, 200, 200 +128 == 1, 100, 1 +129 assert 1, 100 +130 int 100 1, 100, 100 +131 == 1, 1 +132 assert 1 +133 int 1 1, 1 +134 return 1 \ No newline at end of file diff --git a/examples/voting/algopy.log b/examples/voting/algopy.log new file mode 100644 index 0000000000..f310928ca5 --- /dev/null +++ b/examples/voting/algopy.log @@ -0,0 +1,1749 @@ +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug voting +debug: Building AWST for __init__.py +debug: Building AWST for voting +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for voting/voting.py +debug: Sealing block@0: // L73 +debug: Terminated block@0: // L73 +debug: Sealing block@None: // ternary_true_L90 +debug: Sealing block@None: // ternary_false_L90 +debug: Terminated block@1: // ternary_true_L90 +debug: Terminated block@2: // ternary_false_L90 +debug: Sealing block@3: // ternary_merge_L90 +debug: Created Phi assignment: let ternary_result%6#2: uint64 = undefined while trying to resolve 'ternary_result%6' in block@3: // ternary_merge_L90 +debug: Added ternary_result%6#0 to Phi node: let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1) in block@1: // ternary_true_L90 +debug: Added ternary_result%6#1 to Phi node: let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, ternary_result%6#1 <- block@2) in block@2: // ternary_false_L90 +debug: Created Phi assignment: let metadata_ipfs_cid#1: bytes = undefined while trying to resolve 'metadata_ipfs_cid' in block@3: // ternary_merge_L90 +debug: Added metadata_ipfs_cid#0 to Phi node: let metadata_ipfs_cid#1: bytes = φ(metadata_ipfs_cid#0 <- block@1) in block@1: // ternary_true_L90 +debug: Added metadata_ipfs_cid#0 to Phi node: let metadata_ipfs_cid#1: bytes = φ(metadata_ipfs_cid#0 <- block@1, metadata_ipfs_cid#0 <- block@2) in block@2: // ternary_false_L90 +debug: Replacing trivial Phi node: let metadata_ipfs_cid#1: bytes = φ(metadata_ipfs_cid#0 <- block@1, metadata_ipfs_cid#0 <- block@2) (metadata_ipfs_cid#1) with metadata_ipfs_cid#0 +debug: Deleting Phi assignment: let metadata_ipfs_cid#1: bytes = φ(metadata_ipfs_cid#0 <- block@1, metadata_ipfs_cid#0 <- block@2) +debug: Replaced trivial Phi node: let metadata_ipfs_cid#1: bytes = φ(metadata_ipfs_cid#0 <- block@1, metadata_ipfs_cid#0 <- block@2) (metadata_ipfs_cid#1) with metadata_ipfs_cid#0 in current definition for 1 blocks +debug: Created Phi assignment: let st#1: uint64 = undefined while trying to resolve 'st' in block@3: // ternary_merge_L90 +debug: Added st#0 to Phi node: let st#1: uint64 = φ(st#0 <- block@1) in block@1: // ternary_true_L90 +debug: Added st#0 to Phi node: let st#1: uint64 = φ(st#0 <- block@1, st#0 <- block@2) in block@2: // ternary_false_L90 +debug: Replacing trivial Phi node: let st#1: uint64 = φ(st#0 <- block@1, st#0 <- block@2) (st#1) with st#0 +debug: Deleting Phi assignment: let st#1: uint64 = φ(st#0 <- block@1, st#0 <- block@2) +debug: Replaced trivial Phi node: let st#1: uint64 = φ(st#0 <- block@1, st#0 <- block@2) (st#1) with st#0 in current definition for 1 blocks +debug: Created Phi assignment: let et#1: uint64 = undefined while trying to resolve 'et' in block@3: // ternary_merge_L90 +debug: Added et#0 to Phi node: let et#1: uint64 = φ(et#0 <- block@1) in block@1: // ternary_true_L90 +debug: Added et#0 to Phi node: let et#1: uint64 = φ(et#0 <- block@1, et#0 <- block@2) in block@2: // ternary_false_L90 +debug: Replacing trivial Phi node: let et#1: uint64 = φ(et#0 <- block@1, et#0 <- block@2) (et#1) with et#0 +debug: Deleting Phi assignment: let et#1: uint64 = φ(et#0 <- block@1, et#0 <- block@2) +debug: Replaced trivial Phi node: let et#1: uint64 = φ(et#0 <- block@1, et#0 <- block@2) (et#1) with et#0 in current definition for 1 blocks +debug: Created Phi assignment: let quorum#1: bytes = undefined while trying to resolve 'quorum' in block@3: // ternary_merge_L90 +debug: Added quorum#0 to Phi node: let quorum#1: bytes = φ(quorum#0 <- block@1) in block@1: // ternary_true_L90 +debug: Added quorum#0 to Phi node: let quorum#1: bytes = φ(quorum#0 <- block@1, quorum#0 <- block@2) in block@2: // ternary_false_L90 +debug: Replacing trivial Phi node: let quorum#1: bytes = φ(quorum#0 <- block@1, quorum#0 <- block@2) (quorum#1) with quorum#0 +debug: Deleting Phi assignment: let quorum#1: bytes = φ(quorum#0 <- block@1, quorum#0 <- block@2) +debug: Replaced trivial Phi node: let quorum#1: bytes = φ(quorum#0 <- block@1, quorum#0 <- block@2) (quorum#1) with quorum#0 in current definition for 1 blocks +debug: Created Phi assignment: let nft_image_url#1: bytes = undefined while trying to resolve 'nft_image_url' in block@3: // ternary_merge_L90 +debug: Added nft_image_url#0 to Phi node: let nft_image_url#1: bytes = φ(nft_image_url#0 <- block@1) in block@1: // ternary_true_L90 +debug: Added nft_image_url#0 to Phi node: let nft_image_url#1: bytes = φ(nft_image_url#0 <- block@1, nft_image_url#0 <- block@2) in block@2: // ternary_false_L90 +debug: Replacing trivial Phi node: let nft_image_url#1: bytes = φ(nft_image_url#0 <- block@1, nft_image_url#0 <- block@2) (nft_image_url#1) with nft_image_url#0 +debug: Deleting Phi assignment: let nft_image_url#1: bytes = φ(nft_image_url#0 <- block@1, nft_image_url#0 <- block@2) +debug: Replaced trivial Phi node: let nft_image_url#1: bytes = φ(nft_image_url#0 <- block@1, nft_image_url#0 <- block@2) (nft_image_url#1) with nft_image_url#0 in current definition for 1 blocks +debug: Created Phi assignment: let option_counts#1: bytes = undefined while trying to resolve 'option_counts' in block@3: // ternary_merge_L90 +debug: Added option_counts#0 to Phi node: let option_counts#1: bytes = φ(option_counts#0 <- block@1) in block@1: // ternary_true_L90 +debug: Added option_counts#0 to Phi node: let option_counts#1: bytes = φ(option_counts#0 <- block@1, option_counts#0 <- block@2) in block@2: // ternary_false_L90 +debug: Replacing trivial Phi node: let option_counts#1: bytes = φ(option_counts#0 <- block@1, option_counts#0 <- block@2) (option_counts#1) with option_counts#0 +debug: Deleting Phi assignment: let option_counts#1: bytes = φ(option_counts#0 <- block@1, option_counts#0 <- block@2) +debug: Replaced trivial Phi node: let option_counts#1: bytes = φ(option_counts#0 <- block@1, option_counts#0 <- block@2) (option_counts#1) with option_counts#0 in current definition for 1 blocks +debug: Terminated block@3: // ternary_merge_L90 +debug: Sealing block@0: // L233 +debug: Terminated block@0: // L233 +debug: Sealing block@0: // L245 +debug: Terminated block@0: // L245 +debug: Looking for 'item_index_internal%2' in an unsealed block creating an incomplete Phi: block@1: // for_header_L247 +debug: Created Phi assignment: let item_index_internal%2#1: uint64 = undefined while trying to resolve 'item_index_internal%2' in block@1: // for_header_L247 +debug: Terminated block@1: // for_header_L247 +debug: Sealing block@None: // for_body_L247 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@1: // for_header_L247 +debug: Created Phi assignment: let total#1: uint64 = undefined while trying to resolve 'total' in block@1: // for_header_L247 +debug: Terminated block@2: // for_body_L247 +debug: Sealing block@3: // for_footer_L247 +debug: Sealing block@None: // after_for_L247 +debug: Terminated block@3: // for_footer_L247 +debug: Sealing block@1: // for_header_L247 +debug: Added item_index_internal%2#0 to Phi node: let item_index_internal%2#1: uint64 = φ(item_index_internal%2#0 <- block@0) in block@0: // L245 +debug: Added item_index_internal%2#2 to Phi node: let item_index_internal%2#1: uint64 = φ(item_index_internal%2#0 <- block@0, item_index_internal%2#2 <- block@3) in block@3: // for_footer_L247 +debug: Added total#0 to Phi node: let total#1: uint64 = φ(total#0 <- block@0) in block@0: // L245 +debug: Added total#2 to Phi node: let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@3) in block@3: // for_footer_L247 +debug: Terminated block@4: // after_for_L247 +debug: Sealing block@0: // L99 +debug: Terminated block@0: // L99 +debug: Sealing block@0: // L123 +debug: Terminated block@0: // L123 +debug: Looking for 'range_item%28' in an unsealed block creating an incomplete Phi: block@1: // for_header_L144 +debug: Created Phi assignment: let range_item%28#1: uint64 = undefined while trying to resolve 'range_item%28' in block@1: // for_header_L144 +debug: Terminated block@1: // for_header_L144 +debug: Sealing block@None: // for_body_L144 +debug: Terminated block@2: // for_body_L144 +debug: Looking for 'range_item%37' in an unsealed block creating an incomplete Phi: block@3: // for_header_L146 +debug: Created Phi assignment: let range_item%37#1: uint64 = undefined while trying to resolve 'range_item%37' in block@3: // for_header_L146 +debug: Terminated block@3: // for_header_L146 +debug: Sealing block@None: // for_body_L146 +debug: Looking for 'current_index' in an unsealed block creating an incomplete Phi: block@3: // for_header_L146 +debug: Created Phi assignment: let current_index#1: uint64 = undefined while trying to resolve 'current_index' in block@3: // for_header_L146 +debug: Looking for 'note' in an unsealed block creating an incomplete Phi: block@3: // for_header_L146 +debug: Created Phi assignment: let note#1: bytes = undefined while trying to resolve 'note' in block@3: // for_header_L146 +debug: Terminated block@4: // for_body_L146 +debug: Sealing block@None: // ternary_true_L149 +debug: Sealing block@None: // ternary_false_L149 +debug: Terminated block@5: // ternary_true_L149 +debug: Looking for 'question_options' in an unsealed block creating an incomplete Phi: block@3: // for_header_L146 +debug: Created Phi assignment: let question_options#1: uint64 = undefined while trying to resolve 'question_options' in block@3: // for_header_L146 +debug: Terminated block@6: // ternary_false_L149 +debug: Sealing block@None: // ternary_true_L151 +debug: Sealing block@None: // ternary_false_L151 +debug: Terminated block@7: // ternary_true_L151 +debug: Looking for 'question_index' in an unsealed block creating an incomplete Phi: block@3: // for_header_L146 +debug: Created Phi assignment: let question_index#1: uint64 = undefined while trying to resolve 'question_index' in block@3: // for_header_L146 +debug: Terminated block@8: // ternary_false_L151 +debug: Sealing block@None: // ternary_true_L153 +debug: Sealing block@None: // ternary_false_L153 +debug: Terminated block@9: // ternary_true_L153 +debug: Terminated block@10: // ternary_false_L153 +debug: Sealing block@11: // ternary_merge_L153 +debug: Created Phi assignment: let ternary_result%51#2: bytes = undefined while trying to resolve 'ternary_result%51' in block@11: // ternary_merge_L153 +debug: Added ternary_result%51#0 to Phi node: let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@9) in block@9: // ternary_true_L153 +debug: Added ternary_result%51#1 to Phi node: let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@9, ternary_result%51#1 <- block@10) in block@10: // ternary_false_L153 +debug: Terminated block@11: // ternary_merge_L153 +debug: Sealing block@12: // ternary_merge_L151 +debug: Created Phi assignment: let ternary_result%43#2: bytes = undefined while trying to resolve 'ternary_result%43' in block@12: // ternary_merge_L151 +debug: Added ternary_result%43#0 to Phi node: let ternary_result%43#2: bytes = φ(ternary_result%43#0 <- block@7) in block@7: // ternary_true_L151 +debug: Added ternary_result%43#1 to Phi node: let ternary_result%43#2: bytes = φ(ternary_result%43#0 <- block@7, ternary_result%43#1 <- block@11) in block@11: // ternary_merge_L153 +debug: Terminated block@12: // ternary_merge_L151 +debug: Sealing block@13: // ternary_merge_L149 +debug: Created Phi assignment: let ternary_result%40#2: bytes = undefined while trying to resolve 'ternary_result%40' in block@13: // ternary_merge_L149 +debug: Added ternary_result%40#0 to Phi node: let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@5) in block@5: // ternary_true_L149 +debug: Added ternary_result%40#1 to Phi node: let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@5, ternary_result%40#1 <- block@12) in block@12: // ternary_merge_L151 +debug: Created Phi assignment: let current_index#2: uint64 = undefined while trying to resolve 'current_index' in block@13: // ternary_merge_L149 +debug: Added current_index#1 to Phi node: let current_index#2: uint64 = φ(current_index#1 <- block@5) in block@5: // ternary_true_L149 +debug: Created Phi assignment: let current_index#3: uint64 = undefined while trying to resolve 'current_index' in block@12: // ternary_merge_L151 +debug: Added current_index#1 to Phi node: let current_index#3: uint64 = φ(current_index#1 <- block@7) in block@7: // ternary_true_L151 +debug: Created Phi assignment: let current_index#4: uint64 = undefined while trying to resolve 'current_index' in block@11: // ternary_merge_L153 +debug: Added current_index#1 to Phi node: let current_index#4: uint64 = φ(current_index#1 <- block@9) in block@9: // ternary_true_L153 +debug: Added current_index#1 to Phi node: let current_index#4: uint64 = φ(current_index#1 <- block@9, current_index#1 <- block@10) in block@10: // ternary_false_L153 +debug: Replacing trivial Phi node: let current_index#4: uint64 = φ(current_index#1 <- block@9, current_index#1 <- block@10) (current_index#4) with current_index#1 +debug: Deleting Phi assignment: let current_index#4: uint64 = φ(current_index#1 <- block@9, current_index#1 <- block@10) +debug: Replaced trivial Phi node: let current_index#4: uint64 = φ(current_index#1 <- block@9, current_index#1 <- block@10) (current_index#4) with current_index#1 in current definition for 1 blocks +debug: Added current_index#1 to Phi node: let current_index#3: uint64 = φ(current_index#1 <- block@7, current_index#1 <- block@11) in block@11: // ternary_merge_L153 +debug: Replacing trivial Phi node: let current_index#3: uint64 = φ(current_index#1 <- block@7, current_index#1 <- block@11) (current_index#3) with current_index#1 +debug: Deleting Phi assignment: let current_index#3: uint64 = φ(current_index#1 <- block@7, current_index#1 <- block@11) +debug: Replaced trivial Phi node: let current_index#3: uint64 = φ(current_index#1 <- block@7, current_index#1 <- block@11) (current_index#3) with current_index#1 in current definition for 1 blocks +debug: Added current_index#1 to Phi node: let current_index#2: uint64 = φ(current_index#1 <- block@5, current_index#1 <- block@12) in block@12: // ternary_merge_L151 +debug: Replacing trivial Phi node: let current_index#2: uint64 = φ(current_index#1 <- block@5, current_index#1 <- block@12) (current_index#2) with current_index#1 +debug: Deleting Phi assignment: let current_index#2: uint64 = φ(current_index#1 <- block@5, current_index#1 <- block@12) +debug: Replaced trivial Phi node: let current_index#2: uint64 = φ(current_index#1 <- block@5, current_index#1 <- block@12) (current_index#2) with current_index#1 in current definition for 1 blocks +debug: Terminated block@13: // ternary_merge_L149 +debug: Sealing block@14: // for_footer_L146 +debug: Sealing block@None: // after_for_L146 +debug: Created Phi assignment: let range_item%37#2: uint64 = undefined while trying to resolve 'range_item%37' in block@13: // ternary_merge_L149 +debug: Added range_item%37#1 to Phi node: let range_item%37#2: uint64 = φ(range_item%37#1 <- block@5) in block@5: // ternary_true_L149 +debug: Created Phi assignment: let range_item%37#3: uint64 = undefined while trying to resolve 'range_item%37' in block@12: // ternary_merge_L151 +debug: Added range_item%37#1 to Phi node: let range_item%37#3: uint64 = φ(range_item%37#1 <- block@7) in block@7: // ternary_true_L151 +debug: Created Phi assignment: let range_item%37#4: uint64 = undefined while trying to resolve 'range_item%37' in block@11: // ternary_merge_L153 +debug: Added range_item%37#1 to Phi node: let range_item%37#4: uint64 = φ(range_item%37#1 <- block@9) in block@9: // ternary_true_L153 +debug: Added range_item%37#1 to Phi node: let range_item%37#4: uint64 = φ(range_item%37#1 <- block@9, range_item%37#1 <- block@10) in block@10: // ternary_false_L153 +debug: Replacing trivial Phi node: let range_item%37#4: uint64 = φ(range_item%37#1 <- block@9, range_item%37#1 <- block@10) (range_item%37#4) with range_item%37#1 +debug: Deleting Phi assignment: let range_item%37#4: uint64 = φ(range_item%37#1 <- block@9, range_item%37#1 <- block@10) +debug: Replaced trivial Phi node: let range_item%37#4: uint64 = φ(range_item%37#1 <- block@9, range_item%37#1 <- block@10) (range_item%37#4) with range_item%37#1 in current definition for 1 blocks +debug: Added range_item%37#1 to Phi node: let range_item%37#3: uint64 = φ(range_item%37#1 <- block@7, range_item%37#1 <- block@11) in block@11: // ternary_merge_L153 +debug: Replacing trivial Phi node: let range_item%37#3: uint64 = φ(range_item%37#1 <- block@7, range_item%37#1 <- block@11) (range_item%37#3) with range_item%37#1 +debug: Deleting Phi assignment: let range_item%37#3: uint64 = φ(range_item%37#1 <- block@7, range_item%37#1 <- block@11) +debug: Replaced trivial Phi node: let range_item%37#3: uint64 = φ(range_item%37#1 <- block@7, range_item%37#1 <- block@11) (range_item%37#3) with range_item%37#1 in current definition for 1 blocks +debug: Added range_item%37#1 to Phi node: let range_item%37#2: uint64 = φ(range_item%37#1 <- block@5, range_item%37#1 <- block@12) in block@12: // ternary_merge_L151 +debug: Replacing trivial Phi node: let range_item%37#2: uint64 = φ(range_item%37#1 <- block@5, range_item%37#1 <- block@12) (range_item%37#2) with range_item%37#1 +debug: Deleting Phi assignment: let range_item%37#2: uint64 = φ(range_item%37#1 <- block@5, range_item%37#1 <- block@12) +debug: Replaced trivial Phi node: let range_item%37#2: uint64 = φ(range_item%37#1 <- block@5, range_item%37#1 <- block@12) (range_item%37#2) with range_item%37#1 in current definition for 1 blocks +debug: Terminated block@14: // for_footer_L146 +debug: Sealing block@3: // for_header_L146 +debug: Added range_item%37#0 to Phi node: let range_item%37#1: uint64 = φ(range_item%37#0 <- block@2) in block@2: // for_body_L144 +debug: Added range_item%37#5 to Phi node: let range_item%37#1: uint64 = φ(range_item%37#0 <- block@2, range_item%37#5 <- block@14) in block@14: // for_footer_L146 +debug: Looking for 'current_index' in an unsealed block creating an incomplete Phi: block@1: // for_header_L144 +debug: Created Phi assignment: let current_index#6: uint64 = undefined while trying to resolve 'current_index' in block@1: // for_header_L144 +debug: Added current_index#6 to Phi node: let current_index#1: uint64 = φ(current_index#6 <- block@2) in block@2: // for_body_L144 +debug: Added current_index#5 to Phi node: let current_index#1: uint64 = φ(current_index#6 <- block@2, current_index#5 <- block@14) in block@14: // for_footer_L146 +debug: Looking for 'note' in an unsealed block creating an incomplete Phi: block@1: // for_header_L144 +debug: Created Phi assignment: let note#3: bytes = undefined while trying to resolve 'note' in block@1: // for_header_L144 +debug: Added note#3 to Phi node: let note#1: bytes = φ(note#3 <- block@2) in block@2: // for_body_L144 +debug: Added note#2 to Phi node: let note#1: bytes = φ(note#3 <- block@2, note#2 <- block@14) in block@14: // for_footer_L146 +debug: Added question_options#0 to Phi node: let question_options#1: uint64 = φ(question_options#0 <- block@2) in block@2: // for_body_L144 +debug: Created Phi assignment: let question_options#2: uint64 = undefined while trying to resolve 'question_options' in block@13: // ternary_merge_L149 +debug: Added question_options#1 to Phi node: let question_options#2: uint64 = φ(question_options#1 <- block@5) in block@5: // ternary_true_L149 +debug: Created Phi assignment: let question_options#3: uint64 = undefined while trying to resolve 'question_options' in block@12: // ternary_merge_L151 +debug: Added question_options#1 to Phi node: let question_options#3: uint64 = φ(question_options#1 <- block@7) in block@7: // ternary_true_L151 +debug: Created Phi assignment: let question_options#4: uint64 = undefined while trying to resolve 'question_options' in block@11: // ternary_merge_L153 +debug: Added question_options#1 to Phi node: let question_options#4: uint64 = φ(question_options#1 <- block@9) in block@9: // ternary_true_L153 +debug: Added question_options#1 to Phi node: let question_options#4: uint64 = φ(question_options#1 <- block@9, question_options#1 <- block@10) in block@10: // ternary_false_L153 +debug: Replacing trivial Phi node: let question_options#4: uint64 = φ(question_options#1 <- block@9, question_options#1 <- block@10) (question_options#4) with question_options#1 +debug: Deleting Phi assignment: let question_options#4: uint64 = φ(question_options#1 <- block@9, question_options#1 <- block@10) +debug: Replaced trivial Phi node: let question_options#4: uint64 = φ(question_options#1 <- block@9, question_options#1 <- block@10) (question_options#4) with question_options#1 in current definition for 1 blocks +debug: Added question_options#1 to Phi node: let question_options#3: uint64 = φ(question_options#1 <- block@7, question_options#1 <- block@11) in block@11: // ternary_merge_L153 +debug: Replacing trivial Phi node: let question_options#3: uint64 = φ(question_options#1 <- block@7, question_options#1 <- block@11) (question_options#3) with question_options#1 +debug: Deleting Phi assignment: let question_options#3: uint64 = φ(question_options#1 <- block@7, question_options#1 <- block@11) +debug: Replaced trivial Phi node: let question_options#3: uint64 = φ(question_options#1 <- block@7, question_options#1 <- block@11) (question_options#3) with question_options#1 in current definition for 1 blocks +debug: Added question_options#1 to Phi node: let question_options#2: uint64 = φ(question_options#1 <- block@5, question_options#1 <- block@12) in block@12: // ternary_merge_L151 +debug: Replacing trivial Phi node: let question_options#2: uint64 = φ(question_options#1 <- block@5, question_options#1 <- block@12) (question_options#2) with question_options#1 +debug: Deleting Phi assignment: let question_options#2: uint64 = φ(question_options#1 <- block@5, question_options#1 <- block@12) +debug: Replaced trivial Phi node: let question_options#2: uint64 = φ(question_options#1 <- block@5, question_options#1 <- block@12) (question_options#2) with question_options#1 in current definition for 1 blocks +debug: Added question_options#1 to Phi node: let question_options#1: uint64 = φ(question_options#0 <- block@2, question_options#1 <- block@14) in block@14: // for_footer_L146 +debug: Replacing trivial Phi node: let question_options#1: uint64 = φ(question_options#0 <- block@2, question_options#1 <- block@14) (question_options#1) with question_options#0 +debug: Deleting Phi assignment: let question_options#1: uint64 = φ(question_options#0 <- block@2, question_options#1 <- block@14) +debug: Replaced trivial Phi node: let question_options#1: uint64 = φ(question_options#0 <- block@2, question_options#1 <- block@14) (question_options#1) with question_options#0 in current definition for 12 blocks +debug: Added question_index#0 to Phi node: let question_index#1: uint64 = φ(question_index#0 <- block@2) in block@2: // for_body_L144 +debug: Created Phi assignment: let question_index#2: uint64 = undefined while trying to resolve 'question_index' in block@13: // ternary_merge_L149 +debug: Added question_index#1 to Phi node: let question_index#2: uint64 = φ(question_index#1 <- block@5) in block@5: // ternary_true_L149 +debug: Created Phi assignment: let question_index#3: uint64 = undefined while trying to resolve 'question_index' in block@12: // ternary_merge_L151 +debug: Added question_index#1 to Phi node: let question_index#3: uint64 = φ(question_index#1 <- block@7) in block@7: // ternary_true_L151 +debug: Created Phi assignment: let question_index#4: uint64 = undefined while trying to resolve 'question_index' in block@11: // ternary_merge_L153 +debug: Added question_index#1 to Phi node: let question_index#4: uint64 = φ(question_index#1 <- block@9) in block@9: // ternary_true_L153 +debug: Added question_index#1 to Phi node: let question_index#4: uint64 = φ(question_index#1 <- block@9, question_index#1 <- block@10) in block@10: // ternary_false_L153 +debug: Replacing trivial Phi node: let question_index#4: uint64 = φ(question_index#1 <- block@9, question_index#1 <- block@10) (question_index#4) with question_index#1 +debug: Deleting Phi assignment: let question_index#4: uint64 = φ(question_index#1 <- block@9, question_index#1 <- block@10) +debug: Replaced trivial Phi node: let question_index#4: uint64 = φ(question_index#1 <- block@9, question_index#1 <- block@10) (question_index#4) with question_index#1 in current definition for 1 blocks +debug: Added question_index#1 to Phi node: let question_index#3: uint64 = φ(question_index#1 <- block@7, question_index#1 <- block@11) in block@11: // ternary_merge_L153 +debug: Replacing trivial Phi node: let question_index#3: uint64 = φ(question_index#1 <- block@7, question_index#1 <- block@11) (question_index#3) with question_index#1 +debug: Deleting Phi assignment: let question_index#3: uint64 = φ(question_index#1 <- block@7, question_index#1 <- block@11) +debug: Replaced trivial Phi node: let question_index#3: uint64 = φ(question_index#1 <- block@7, question_index#1 <- block@11) (question_index#3) with question_index#1 in current definition for 1 blocks +debug: Added question_index#1 to Phi node: let question_index#2: uint64 = φ(question_index#1 <- block@5, question_index#1 <- block@12) in block@12: // ternary_merge_L151 +debug: Replacing trivial Phi node: let question_index#2: uint64 = φ(question_index#1 <- block@5, question_index#1 <- block@12) (question_index#2) with question_index#1 +debug: Deleting Phi assignment: let question_index#2: uint64 = φ(question_index#1 <- block@5, question_index#1 <- block@12) +debug: Replaced trivial Phi node: let question_index#2: uint64 = φ(question_index#1 <- block@5, question_index#1 <- block@12) (question_index#2) with question_index#1 in current definition for 1 blocks +debug: Added question_index#1 to Phi node: let question_index#1: uint64 = φ(question_index#0 <- block@2, question_index#1 <- block@14) in block@14: // for_footer_L146 +debug: Replacing trivial Phi node: let question_index#1: uint64 = φ(question_index#0 <- block@2, question_index#1 <- block@14) (question_index#1) with question_index#0 +debug: Deleting Phi assignment: let question_index#1: uint64 = φ(question_index#0 <- block@2, question_index#1 <- block@14) +debug: Replaced trivial Phi node: let question_index#1: uint64 = φ(question_index#0 <- block@2, question_index#1 <- block@14) (question_index#1) with question_index#0 in current definition for 12 blocks +debug: Terminated block@15: // after_for_L146 +debug: Sealing block@16: // for_footer_L144 +debug: Sealing block@None: // after_for_L144 +debug: Created Phi assignment: let range_item%28#2: uint64 = undefined while trying to resolve 'range_item%28' in block@3: // for_header_L146 +debug: Added range_item%28#1 to Phi node: let range_item%28#2: uint64 = φ(range_item%28#1 <- block@2) in block@2: // for_body_L144 +debug: Created Phi assignment: let range_item%28#3: uint64 = undefined while trying to resolve 'range_item%28' in block@13: // ternary_merge_L149 +debug: Added range_item%28#2 to Phi node: let range_item%28#3: uint64 = φ(range_item%28#2 <- block@5) in block@5: // ternary_true_L149 +debug: Created Phi assignment: let range_item%28#4: uint64 = undefined while trying to resolve 'range_item%28' in block@12: // ternary_merge_L151 +debug: Added range_item%28#2 to Phi node: let range_item%28#4: uint64 = φ(range_item%28#2 <- block@7) in block@7: // ternary_true_L151 +debug: Created Phi assignment: let range_item%28#5: uint64 = undefined while trying to resolve 'range_item%28' in block@11: // ternary_merge_L153 +debug: Added range_item%28#2 to Phi node: let range_item%28#5: uint64 = φ(range_item%28#2 <- block@9) in block@9: // ternary_true_L153 +debug: Added range_item%28#2 to Phi node: let range_item%28#5: uint64 = φ(range_item%28#2 <- block@9, range_item%28#2 <- block@10) in block@10: // ternary_false_L153 +debug: Replacing trivial Phi node: let range_item%28#5: uint64 = φ(range_item%28#2 <- block@9, range_item%28#2 <- block@10) (range_item%28#5) with range_item%28#2 +debug: Deleting Phi assignment: let range_item%28#5: uint64 = φ(range_item%28#2 <- block@9, range_item%28#2 <- block@10) +debug: Replaced trivial Phi node: let range_item%28#5: uint64 = φ(range_item%28#2 <- block@9, range_item%28#2 <- block@10) (range_item%28#5) with range_item%28#2 in current definition for 1 blocks +debug: Added range_item%28#2 to Phi node: let range_item%28#4: uint64 = φ(range_item%28#2 <- block@7, range_item%28#2 <- block@11) in block@11: // ternary_merge_L153 +debug: Replacing trivial Phi node: let range_item%28#4: uint64 = φ(range_item%28#2 <- block@7, range_item%28#2 <- block@11) (range_item%28#4) with range_item%28#2 +debug: Deleting Phi assignment: let range_item%28#4: uint64 = φ(range_item%28#2 <- block@7, range_item%28#2 <- block@11) +debug: Replaced trivial Phi node: let range_item%28#4: uint64 = φ(range_item%28#2 <- block@7, range_item%28#2 <- block@11) (range_item%28#4) with range_item%28#2 in current definition for 1 blocks +debug: Added range_item%28#2 to Phi node: let range_item%28#3: uint64 = φ(range_item%28#2 <- block@5, range_item%28#2 <- block@12) in block@12: // ternary_merge_L151 +debug: Replacing trivial Phi node: let range_item%28#3: uint64 = φ(range_item%28#2 <- block@5, range_item%28#2 <- block@12) (range_item%28#3) with range_item%28#2 +debug: Deleting Phi assignment: let range_item%28#3: uint64 = φ(range_item%28#2 <- block@5, range_item%28#2 <- block@12) +debug: Replaced trivial Phi node: let range_item%28#3: uint64 = φ(range_item%28#2 <- block@5, range_item%28#2 <- block@12) (range_item%28#3) with range_item%28#2 in current definition for 1 blocks +debug: Added range_item%28#2 to Phi node: let range_item%28#2: uint64 = φ(range_item%28#1 <- block@2, range_item%28#2 <- block@14) in block@14: // for_footer_L146 +debug: Replacing trivial Phi node: let range_item%28#2: uint64 = φ(range_item%28#1 <- block@2, range_item%28#2 <- block@14) (range_item%28#2) with range_item%28#1 +debug: Deleting Phi assignment: let range_item%28#2: uint64 = φ(range_item%28#1 <- block@2, range_item%28#2 <- block@14) +debug: Replaced trivial Phi node: let range_item%28#2: uint64 = φ(range_item%28#1 <- block@2, range_item%28#2 <- block@14) (range_item%28#2) with range_item%28#1 in current definition for 12 blocks +debug: Terminated block@16: // for_footer_L144 +debug: Sealing block@1: // for_header_L144 +debug: Added range_item%28#0 to Phi node: let range_item%28#1: uint64 = φ(range_item%28#0 <- block@0) in block@0: // L123 +debug: Added range_item%28#6 to Phi node: let range_item%28#1: uint64 = φ(range_item%28#0 <- block@0, range_item%28#6 <- block@16) in block@16: // for_footer_L144 +debug: Added current_index#0 to Phi node: let current_index#6: uint64 = φ(current_index#0 <- block@0) in block@0: // L123 +debug: Added current_index#1 to Phi node: let current_index#6: uint64 = φ(current_index#0 <- block@0, current_index#1 <- block@16) in block@16: // for_footer_L144 +debug: Added note#0 to Phi node: let note#3: bytes = φ(note#0 <- block@0) in block@0: // L123 +debug: Added note#1 to Phi node: let note#3: bytes = φ(note#0 <- block@0, note#1 <- block@16) in block@16: // for_footer_L144 +debug: Terminated block@17: // after_for_L144 +debug: Sealing block@0: // L14 +debug: Terminated block@0: // L14 +debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L21 +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_L21 +debug: Terminated block@1: // while_top_L21 +debug: Sealing block@None: // while_body_L21 +debug: Looking for 'fee_source' in an unsealed block creating an incomplete Phi: block@1: // while_top_L21 +debug: Created Phi assignment: let fee_source#1: uint64 = undefined while trying to resolve 'fee_source' in block@1: // while_top_L21 +debug: Terminated block@2: // while_body_L21 +debug: Sealing block@None: // switch_case_default_L27 +debug: Sealing block@None: // switch_case_0_L29 +debug: Sealing block@None: // switch_case_1_L31 +debug: Terminated block@3: // switch_case_0_L29 +debug: Terminated block@4: // switch_case_1_L31 +debug: Terminated block@5: // switch_case_default_L27 +debug: Sealing block@6: // switch_case_next_L27 +debug: Terminated block@6: // switch_case_next_L27 +debug: Sealing block@1: // while_top_L21 +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: // L14 +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_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) in block@3: // switch_case_0_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) in block@4: // switch_case_1_L31 +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_L27 +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_L27 +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: // L14 +debug: Created Phi assignment: let fee_source#2: uint64 = undefined while trying to resolve 'fee_source' in block@6: // switch_case_next_L27 +debug: Added fee_source#1 to Phi node: let fee_source#2: uint64 = φ(fee_source#1 <- block@3) in block@3: // switch_case_0_L29 +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_L31 +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_L27 +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_L27 +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_L21 +debug: Terminated block@7: // after_while_L21 +debug: Sealing block@0: // L263 +debug: Terminated block@0: // L263 +debug: Sealing block@0: // L172 +debug: Terminated block@0: // L172 +debug: Sealing block@None: // ternary_true_L175 +debug: Sealing block@None: // ternary_false_L175 +debug: Terminated block@1: // ternary_true_L175 +debug: Terminated block@2: // ternary_false_L175 +debug: Sealing block@3: // ternary_merge_L175 +debug: Created Phi assignment: let ternary_result%4#2: uint64 = undefined while trying to resolve 'ternary_result%4' in block@3: // ternary_merge_L175 +debug: Added ternary_result%4#0 to Phi node: let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1) in block@1: // ternary_true_L175 +debug: Added ternary_result%4#1 to Phi node: let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, ternary_result%4#1 <- block@2) in block@2: // ternary_false_L175 +debug: Terminated block@3: // ternary_merge_L175 +debug: Sealing block@0: // L220 +debug: Terminated block@0: // L220 +debug: Sealing block@None: // and_contd_L222 +debug: Terminated block@1: // and_contd_L222 +debug: Sealing block@None: // and_contd_L222 +debug: Terminated block@2: // and_contd_L222 +debug: Sealing block@None: // and_contd_L224 +debug: Terminated block@3: // and_contd_L224 +debug: Sealing block@None: // bool_true_L222 +debug: Sealing block@None: // bool_false_L222 +debug: Terminated block@4: // bool_true_L222 +debug: Terminated block@5: // bool_false_L222 +debug: Sealing block@6: // bool_merge_L222 +debug: Created Phi assignment: let and_result%11#2: uint64 = undefined while trying to resolve 'and_result%11' in block@6: // bool_merge_L222 +debug: Added and_result%11#0 to Phi node: let and_result%11#2: uint64 = φ(and_result%11#0 <- block@4) in block@4: // bool_true_L222 +debug: Added and_result%11#1 to Phi node: let and_result%11#2: uint64 = φ(and_result%11#0 <- block@4, and_result%11#1 <- block@5) in block@5: // bool_false_L222 +debug: Terminated block@6: // bool_merge_L222 +debug: Sealing block@0: // L253 +debug: Terminated block@0: // L253 +debug: Sealing block@0: // L228 +debug: Terminated block@0: // L228 +debug: Sealing block@0: // L181 +debug: Terminated block@0: // L181 +debug: Sealing block@None: // ternary_true_L190 +debug: Sealing block@None: // ternary_false_L190 +debug: Terminated block@1: // ternary_true_L190 +debug: Terminated block@2: // ternary_false_L190 +debug: Sealing block@3: // ternary_merge_L190 +debug: Created Phi assignment: let ternary_result%2#2: uint64 = undefined while trying to resolve 'ternary_result%2' in block@3: // ternary_merge_L190 +debug: Added ternary_result%2#0 to Phi node: let ternary_result%2#2: uint64 = φ(ternary_result%2#0 <- block@1) in block@1: // ternary_true_L190 +debug: Added ternary_result%2#1 to Phi node: let ternary_result%2#2: uint64 = φ(ternary_result%2#0 <- block@1, ternary_result%2#1 <- block@2) in block@2: // ternary_false_L190 +debug: Created Phi assignment: let answer_ids#1: bytes = undefined while trying to resolve 'answer_ids' in block@3: // ternary_merge_L190 +debug: Added answer_ids#0 to Phi node: let answer_ids#1: bytes = φ(answer_ids#0 <- block@1) in block@1: // ternary_true_L190 +debug: Added answer_ids#0 to Phi node: let answer_ids#1: bytes = φ(answer_ids#0 <- block@1, answer_ids#0 <- block@2) in block@2: // ternary_false_L190 +debug: Replacing trivial Phi node: let answer_ids#1: bytes = φ(answer_ids#0 <- block@1, answer_ids#0 <- block@2) (answer_ids#1) with answer_ids#0 +debug: Deleting Phi assignment: let answer_ids#1: bytes = φ(answer_ids#0 <- block@1, answer_ids#0 <- block@2) +debug: Replaced trivial Phi node: let answer_ids#1: bytes = φ(answer_ids#0 <- block@1, answer_ids#0 <- block@2) (answer_ids#1) with answer_ids#0 in current definition for 1 blocks +debug: Created Phi assignment: let fund_min_bal_req#1: uint64 = undefined while trying to resolve 'fund_min_bal_req' in block@3: // ternary_merge_L190 +debug: Added fund_min_bal_req#0 to Phi node: let fund_min_bal_req#1: uint64 = φ(fund_min_bal_req#0 <- block@1) in block@1: // ternary_true_L190 +debug: Added fund_min_bal_req#0 to Phi node: let fund_min_bal_req#1: uint64 = φ(fund_min_bal_req#0 <- block@1, fund_min_bal_req#0 <- block@2) in block@2: // ternary_false_L190 +debug: Replacing trivial Phi node: let fund_min_bal_req#1: uint64 = φ(fund_min_bal_req#0 <- block@1, fund_min_bal_req#0 <- block@2) (fund_min_bal_req#1) with fund_min_bal_req#0 +debug: Deleting Phi assignment: let fund_min_bal_req#1: uint64 = φ(fund_min_bal_req#0 <- block@1, fund_min_bal_req#0 <- block@2) +debug: Replaced trivial Phi node: let fund_min_bal_req#1: uint64 = φ(fund_min_bal_req#0 <- block@1, fund_min_bal_req#0 <- block@2) (fund_min_bal_req#1) with fund_min_bal_req#0 in current definition for 1 blocks +debug: Terminated block@3: // ternary_merge_L190 +debug: Looking for 'range_item%23' in an unsealed block creating an incomplete Phi: block@4: // for_header_L207 +debug: Created Phi assignment: let range_item%23#1: uint64 = undefined while trying to resolve 'range_item%23' in block@4: // for_header_L207 +debug: Terminated block@4: // for_header_L207 +debug: Sealing block@None: // for_body_L207 +debug: Looking for 'answer_ids' in an unsealed block creating an incomplete Phi: block@4: // for_header_L207 +debug: Created Phi assignment: let answer_ids#2: bytes = undefined while trying to resolve 'answer_ids' in block@4: // for_header_L207 +debug: Looking for 'cumulative_offset' in an unsealed block creating an incomplete Phi: block@4: // for_header_L207 +debug: Created Phi assignment: let cumulative_offset#1: uint64 = undefined while trying to resolve 'cumulative_offset' in block@4: // for_header_L207 +debug: Terminated block@5: // for_body_L207 +debug: Sealing block@6: // for_footer_L207 +debug: Sealing block@None: // after_for_L207 +debug: Terminated block@6: // for_footer_L207 +debug: Sealing block@4: // for_header_L207 +debug: Added range_item%23#0 to Phi node: let range_item%23#1: uint64 = φ(range_item%23#0 <- block@3) in block@3: // ternary_merge_L190 +debug: Added range_item%23#2 to Phi node: let range_item%23#1: uint64 = φ(range_item%23#0 <- block@3, range_item%23#2 <- block@6) in block@6: // for_footer_L207 +debug: Added answer_ids#0 to Phi node: let answer_ids#2: bytes = φ(answer_ids#0 <- block@3) in block@3: // ternary_merge_L190 +debug: Added answer_ids#2 to Phi node: let answer_ids#2: bytes = φ(answer_ids#0 <- block@3, answer_ids#2 <- block@6) in block@6: // for_footer_L207 +debug: Replacing trivial Phi node: let answer_ids#2: bytes = φ(answer_ids#0 <- block@3, answer_ids#2 <- block@6) (answer_ids#2) with answer_ids#0 +debug: Deleting Phi assignment: let answer_ids#2: bytes = φ(answer_ids#0 <- block@3, answer_ids#2 <- block@6) +debug: Replaced trivial Phi node: let answer_ids#2: bytes = φ(answer_ids#0 <- block@3, answer_ids#2 <- block@6) (answer_ids#2) with answer_ids#0 in current definition for 3 blocks +debug: Added cumulative_offset#0 to Phi node: let cumulative_offset#1: uint64 = φ(cumulative_offset#0 <- block@3) in block@3: // ternary_merge_L190 +debug: Added cumulative_offset#2 to Phi node: let cumulative_offset#1: uint64 = φ(cumulative_offset#0 <- block@3, cumulative_offset#2 <- block@6) in block@6: // for_footer_L207 +debug: Terminated block@7: // after_for_L207 +debug: Sealing block@0: // L270 +debug: Terminated block@0: // L270 +debug: Sealing block@0: // L52 +debug: Terminated block@0: // L52 +debug: Sealing block@0: // L51 +debug: Terminated block@0: // L51 +debug: Sealing block@None: // on_create_L52 +debug: Terminated block@1: // on_create_L52 +debug: Sealing block@2: // entrypoint_L52 +debug: Terminated block@2: // entrypoint_L52 +debug: Sealing block@None: // abi_routing_L51 +debug: Sealing block@None: // else_body_L51 +debug: Terminated block@3: // abi_routing_L51 +debug: Sealing block@None: // switch_case_default_L51 +debug: Sealing block@None: // create_route_L72 +debug: Sealing block@None: // bootstrap_route_L98 +debug: Sealing block@None: // close_route_L122 +debug: Sealing block@None: // get_preconditions_route_L171 +debug: Sealing block@None: // vote_route_L180 +debug: Terminated block@4: // create_route_L72 +debug: Terminated block@5: // bootstrap_route_L98 +debug: Terminated block@6: // close_route_L122 +debug: Terminated block@7: // get_preconditions_route_L171 +debug: Terminated block@8: // vote_route_L180 +debug: Terminated block@9: // switch_case_default_L51 +debug: Sealing block@10: // switch_case_next_L51 +debug: Terminated block@10: // switch_case_next_L51 +debug: Sealing block@11: // after_if_else_L51 +debug: Terminated block@11: // after_if_else_L51 +debug: Sealing block@0: // L69 +debug: Terminated block@0: // L69 +debug: Output IR to /examples/voting/out/voting_VotingRoundApp.ssa.ir +info: Optimizing examples.voting.voting.VotingRoundApp at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%21#0, maybe_value%18#0 +debug: Replacing {maybe_value%18#0} with awst_tmp%21#0 made 1 modifications +debug: Found equivalence set: tmp%23#0, maybe_value_did_exist%19#0 +debug: Replacing {maybe_value_did_exist%19#0} with tmp%23#0 made 1 modifications +debug: Found equivalence set: awst_tmp%21#1, maybe_value%36#0 +debug: Replacing {maybe_value%36#0} with awst_tmp%21#1 made 1 modifications +debug: Found equivalence set: tmp%40#0, maybe_value_did_exist%37#0 +debug: Replacing {maybe_value_did_exist%37#0} with tmp%40#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@10: // switch_case_next_L51 with block@9: // switch_case_default_L51 in block@11: // after_if_else_L51 +debug: Merged linear block@10: // switch_case_next_L51 into block@9: // switch_case_default_L51 +debug: Optimizer: Remove Empty Blocks +debug: Removed empty block: block@9: // switch_case_default_L51 +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.create +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%4#0, ternary_result%6#1 +debug: Replacing {ternary_result%6#1} with awst_tmp%4#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L90 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.store_option_counts +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded item_index_internal%2#1 * 1u to item_index_internal%2#1 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: item_index_internal%2#1, item_index%4#0 +debug: Replacing {item_index%4#0} with item_index_internal%2#1 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@3: // for_footer_L247 with block@2: // for_body_L247 in block@1: // for_header_L247 +debug: Merged linear block@3: // for_footer_L247 into block@2: // for_body_L247 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.bootstrap +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable bytes_per_option#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.close +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded question_index#0 * 1u to question_index#0 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: range_item%28#1, question_index#0, item_index%35#0 +debug: Replacing {range_item%28#1, item_index%35#0} with question_index#0 made 4 modifications +debug: Found equivalence set: range_item%37#1, option_index#0 +debug: Replacing {range_item%37#1} with option_index#0 made 3 modifications +debug: Found equivalence set: tmp%44#0, tmp%45#0 +debug: Replacing {tmp%45#0} with tmp%44#0 made 1 modifications +debug: Found equivalence set: ternary_result%43#2, ternary_result%40#1 +debug: Replacing {ternary_result%40#1} with ternary_result%43#2 made 1 modifications +debug: Found equivalence set: ternary_result%51#2, ternary_result%43#1 +debug: Replacing {ternary_result%43#1} with ternary_result%51#2 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@14: // for_footer_L146 with block@13: // ternary_merge_L149 in block@3: // for_header_L146 +debug: Merged linear block@14: // for_footer_L146 into block@13: // ternary_merge_L149 +debug: Replaced predecessor block@16: // for_footer_L144 with block@15: // after_for_L146 in block@1: // for_header_L144 +debug: Merged linear block@16: // for_footer_L144 into block@15: // after_for_L146 +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine algopy.ensure_budget +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Switch switch fee_source#0 {0u => block@3, 1u => block@4, * => block@5} simplified to goto [block@3, block@4, ...block@5][fee_source#0] +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Removed empty block: block@5: // switch_case_default_L27 +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.get_vote_from_box +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: tuple_assignment%0#0, box_data#0 +debug: Replacing {tuple_assignment%0#0} with box_data#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%1#0, exists#0 +debug: Replacing {tuple_assignment%1#0} with exists#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.get_preconditions +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%2#0, ternary_result%4#1 +debug: Replacing {ternary_result%4#1} with awst_tmp%2#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable current_tail_offset%13#0 +debug: Removing unused variable encoded_tuple_buffer%14#0 +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L175 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.voting_open +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.already_voted +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: tuple_assignment%1#0, votes#0 +debug: Replacing {tuple_assignment%1#0} with votes#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%2#0, exists#0 +debug: Replacing {tuple_assignment%2#0} with exists#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.vote +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Folded 1u * tmp%13#0 to tmp%13#0 +debug: Folded question_index#0 * 1u to question_index#0 +debug: Folded question_index#0 * 1u to question_index#0 +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: awst_tmp%0#0, ternary_result%2#1 +debug: Replacing {ternary_result%2#1} with awst_tmp%0#0 made 1 modifications +debug: Found equivalence set: tmp%13#0, tmp%14#0 +debug: Replacing {tmp%14#0} with tmp%13#0 made 1 modifications +debug: Found equivalence set: range_item%23#1, question_index#0, item_index%28#0, item_index%34#0 +debug: Replacing {range_item%23#1, item_index%28#0, item_index%34#0} with question_index#0 made 5 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@6: // for_footer_L207 with block@5: // for_body_L207 in block@4: // for_header_L207 +debug: Merged linear block@6: // for_footer_L207 into block@5: // for_body_L207 +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L190 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.increment_vote_in_box +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: tuple_assignment%0#0, box_data#0 +debug: Replacing {tuple_assignment%0#0} with box_data#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%1#0, exists#0 +debug: Replacing {tuple_assignment%1#0} with exists#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.__init__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.create +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L90 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.store_option_counts +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.bootstrap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.close +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine algopy.ensure_budget +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.get_vote_from_box +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.get_preconditions +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: val_as_bytes%1#0, encoded_tuple_buffer%14#1 +debug: Replacing {encoded_tuple_buffer%14#1} with val_as_bytes%1#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L175 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.voting_open +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.already_voted +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.vote +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L190 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.increment_vote_in_box +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Output IR to /examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.approval_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.create +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L90 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.store_option_counts +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.bootstrap +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.close +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine algopy.ensure_budget +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.get_vote_from_box +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.get_preconditions +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L175 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.voting_open +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.already_voted +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.vote +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +info: Not removing empty block block@2: // ternary_false_L190 because it's used by phi nodes +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.increment_vote_in_box +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.__init__ +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizing subroutine examples.voting.voting.VotingRoundApp.clear_state_program +debug: Optimizer: Arithmetic Simplification +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Simplify Conditional Branches +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: No optimizations performed in pass 3, ending loop +debug: Output IR to /examples/voting/out/voting_VotingRoundApp.cssa.ir +debug: Removing Phis from examples.voting.voting.VotingRoundApp.approval_program +debug: Removing Phis from examples.voting.voting.VotingRoundApp.create +debug: Removing Phis from examples.voting.voting.VotingRoundApp.store_option_counts +debug: Removing Phis from examples.voting.voting.VotingRoundApp.calculate_total_options_count +debug: Removing Phis from examples.voting.voting.VotingRoundApp.bootstrap +debug: Removing Phis from examples.voting.voting.VotingRoundApp.close +debug: Removing Phis from algopy.ensure_budget +debug: Removing Phis from examples.voting.voting.get_vote_from_box +debug: Removing Phis from examples.voting.voting.VotingRoundApp.get_preconditions +debug: Removing Phis from examples.voting.voting.VotingRoundApp.voting_open +debug: Removing Phis from examples.voting.voting.VotingRoundApp.allowed_to_vote +debug: Removing Phis from examples.voting.voting.VotingRoundApp.already_voted +debug: Removing Phis from examples.voting.voting.VotingRoundApp.vote +debug: Removing Phis from examples.voting.voting.increment_vote_in_box +debug: Removing Phis from examples.voting.voting.VotingRoundApp.__init__ +debug: Removing Phis from examples.voting.voting.VotingRoundApp.clear_state_program +debug: Output IR to /examples/voting/out/voting_VotingRoundApp.post_ssa.ir +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.approval_program +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.create +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.store_option_counts +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.calculate_total_options_count +debug: loc: {total#5=None, item_index_internal%2#5=None, total#0=total#0, item_index_internal%2#0=item_index_internal%2#0} +debug: pred: {total#5=total#0, item_index_internal%2#5=item_index_internal%2#0} +debug: ready: total#5, item_index_internal%2#5 +debug: to_do: total#5, item_index_internal%2#5 +debug: * avail item_index_internal%2#5 +debug: * avail item_index_internal%2#0 +debug: * avail total#5 +debug: * avail total#0 +debug: * to_do item_index_internal%2#5 +debug: * to_do total#5 +debug: loc: {total#1=None, item_index_internal%2#1=None, total#5=total#5, item_index_internal%2#5=item_index_internal%2#5} +debug: pred: {total#1=total#5, item_index_internal%2#1=item_index_internal%2#5} +debug: ready: total#1, item_index_internal%2#1 +debug: to_do: total#1, item_index_internal%2#1 +debug: * avail item_index_internal%2#1 +debug: * avail item_index_internal%2#5 +debug: * avail total#1 +debug: * avail total#5 +debug: * to_do item_index_internal%2#1 +debug: * to_do total#1 +debug: loc: {total#5=None, item_index_internal%2#5=None, total#2=total#2, item_index_internal%2#2=item_index_internal%2#2} +debug: pred: {total#5=total#2, item_index_internal%2#5=item_index_internal%2#2} +debug: ready: total#5, item_index_internal%2#5 +debug: to_do: total#5, item_index_internal%2#5 +debug: * avail item_index_internal%2#5 +debug: * avail item_index_internal%2#2 +debug: * avail total#5 +debug: * avail total#2 +debug: * to_do item_index_internal%2#5 +debug: * to_do total#5 +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.bootstrap +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.close +debug: loc: {note#7=None, current_index#9=None, question_index#1=None, note#0=note#0, current_index#0=current_index#0, range_item%28#0=range_item%28#0} +debug: pred: {note#7=note#0, current_index#9=current_index#0, question_index#1=range_item%28#0} +debug: ready: note#7, current_index#9, question_index#1 +debug: to_do: note#7, current_index#9, question_index#1 +debug: * avail question_index#1 +debug: * avail range_item%28#0 +debug: * avail current_index#9 +debug: * avail current_index#0 +debug: * avail note#7 +debug: * avail note#0 +debug: * to_do question_index#1 +debug: * to_do current_index#9 +debug: * to_do note#7 +debug: loc: {note#3=None, current_index#6=None, question_index#0=None, note#7=note#7, current_index#9=current_index#9, question_index#1=question_index#1} +debug: pred: {note#3=note#7, current_index#6=current_index#9, question_index#0=question_index#1} +debug: ready: note#3, current_index#6, question_index#0 +debug: to_do: note#3, current_index#6, question_index#0 +debug: * avail question_index#0 +debug: * avail question_index#1 +debug: * avail current_index#6 +debug: * avail current_index#9 +debug: * avail note#3 +debug: * avail note#7 +debug: * to_do question_index#0 +debug: * to_do current_index#6 +debug: * to_do note#3 +debug: loc: {note#10=None, current_index#12=None, option_index#1=None, note#3=note#3, current_index#6=current_index#6, range_item%37#0=range_item%37#0} +debug: pred: {note#10=note#3, current_index#12=current_index#6, option_index#1=range_item%37#0} +debug: ready: note#10, current_index#12, option_index#1 +debug: to_do: note#10, current_index#12, option_index#1 +debug: * avail option_index#1 +debug: * avail range_item%37#0 +debug: * avail current_index#12 +debug: * avail current_index#6 +debug: * avail note#10 +debug: * avail note#3 +debug: * to_do option_index#1 +debug: * to_do current_index#12 +debug: * to_do note#10 +debug: loc: {note#1=None, current_index#1=None, option_index#0=None, note#10=note#10, current_index#12=current_index#12, option_index#1=option_index#1} +debug: pred: {note#1=note#10, current_index#1=current_index#12, option_index#0=option_index#1} +debug: ready: note#1, current_index#1, option_index#0 +debug: to_do: note#1, current_index#1, option_index#0 +debug: * avail option_index#0 +debug: * avail option_index#1 +debug: * avail current_index#1 +debug: * avail current_index#12 +debug: * avail note#1 +debug: * avail note#10 +debug: * to_do option_index#0 +debug: * to_do current_index#1 +debug: * to_do note#1 +debug: loc: {note#10=None, current_index#12=None, option_index#1=None, note#2=note#2, current_index#5=current_index#5, range_item%37#5=range_item%37#5} +debug: pred: {note#10=note#2, current_index#12=current_index#5, option_index#1=range_item%37#5} +debug: ready: note#10, current_index#12, option_index#1 +debug: to_do: note#10, current_index#12, option_index#1 +debug: * avail option_index#1 +debug: * avail range_item%37#5 +debug: * avail current_index#12 +debug: * avail current_index#5 +debug: * avail note#10 +debug: * avail note#2 +debug: * to_do option_index#1 +debug: * to_do current_index#12 +debug: * to_do note#10 +debug: loc: {note#7=None, current_index#9=None, question_index#1=None, note#1=note#1, current_index#1=current_index#1, range_item%28#6=range_item%28#6} +debug: pred: {note#7=note#1, current_index#9=current_index#1, question_index#1=range_item%28#6} +debug: ready: note#7, current_index#9, question_index#1 +debug: to_do: note#7, current_index#9, question_index#1 +debug: * avail question_index#1 +debug: * avail range_item%28#6 +debug: * avail current_index#9 +debug: * avail current_index#1 +debug: * avail note#7 +debug: * avail note#1 +debug: * to_do question_index#1 +debug: * to_do current_index#9 +debug: * to_do note#7 +debug: Sequentializing parallel copies in algopy.ensure_budget +debug: Sequentializing parallel copies in examples.voting.voting.get_vote_from_box +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.get_preconditions +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.voting_open +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.allowed_to_vote +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.already_voted +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.vote +debug: loc: {cumulative_offset#5=None, question_index#1=None, cumulative_offset#0=cumulative_offset#0, range_item%23#0=range_item%23#0} +debug: pred: {cumulative_offset#5=cumulative_offset#0, question_index#1=range_item%23#0} +debug: ready: cumulative_offset#5, question_index#1 +debug: to_do: cumulative_offset#5, question_index#1 +debug: * avail question_index#1 +debug: * avail range_item%23#0 +debug: * avail cumulative_offset#5 +debug: * avail cumulative_offset#0 +debug: * to_do question_index#1 +debug: * to_do cumulative_offset#5 +debug: loc: {cumulative_offset#1=None, question_index#0=None, cumulative_offset#5=cumulative_offset#5, question_index#1=question_index#1} +debug: pred: {cumulative_offset#1=cumulative_offset#5, question_index#0=question_index#1} +debug: ready: cumulative_offset#1, question_index#0 +debug: to_do: cumulative_offset#1, question_index#0 +debug: * avail question_index#0 +debug: * avail question_index#1 +debug: * avail cumulative_offset#1 +debug: * avail cumulative_offset#5 +debug: * to_do question_index#0 +debug: * to_do cumulative_offset#1 +debug: loc: {cumulative_offset#5=None, question_index#1=None, cumulative_offset#2=cumulative_offset#2, range_item%23#2=range_item%23#2} +debug: pred: {cumulative_offset#5=cumulative_offset#2, question_index#1=range_item%23#2} +debug: ready: cumulative_offset#5, question_index#1 +debug: to_do: cumulative_offset#5, question_index#1 +debug: * avail question_index#1 +debug: * avail range_item%23#2 +debug: * avail cumulative_offset#5 +debug: * avail cumulative_offset#2 +debug: * to_do question_index#1 +debug: * to_do cumulative_offset#5 +debug: Sequentializing parallel copies in examples.voting.voting.increment_vote_in_box +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.__init__ +debug: Sequentializing parallel copies in examples.voting.voting.VotingRoundApp.clear_state_program +debug: Output IR to /examples/voting/out/voting_VotingRoundApp.parallel_copies.ir +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.approval_program using strategy RootOperandGrouping +debug: Coalescing awst_tmp%21#0 with [awst_tmp%21#1] +debug: Coalescing resulted in 3 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.create using strategy RootOperandGrouping +debug: Coalescing ternary_result%6#0 with [ternary_result%6#4, ternary_result%6#2] +debug: Coalescing resulted in 5 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.store_option_counts using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.calculate_total_options_count using strategy RootOperandGrouping +debug: Coalescing total#0 with [total#5, total#1, total#2] +debug: Coalescing item_index_internal%2#0 with [item_index_internal%2#5, item_index_internal%2#1, item_index_internal%2#2] +debug: Coalescing resulted in 17 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.bootstrap using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.close using strategy RootOperandGrouping +debug: Coalescing note#0 with [note#7, note#3, note#10, note#1, note#2, note#4] +debug: Coalescing current_index#0 with [current_index#9, current_index#6, current_index#12, current_index#1, current_index#5] +debug: Coalescing range_item%28#0 with [range_item%28#6] +debug: Coalescing question_index#0 with [question_index#1] +debug: Coalescing range_item%37#0 with [range_item%37#5] +debug: Coalescing option_index#0 with [option_index#1] +debug: Coalescing ternary_result%40#0 with [ternary_result%40#4, ternary_result%40#2] +debug: Coalescing ternary_result%43#0 with [ternary_result%43#4, ternary_result%43#2] +debug: Coalescing ternary_result%51#0 with [ternary_result%51#5, ternary_result%51#1, ternary_result%51#2] +debug: Coalescing resulted in 57 replacement/s +debug: Coalescing local variables in algopy.ensure_budget using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.get_vote_from_box using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.get_preconditions using strategy RootOperandGrouping +debug: Coalescing ternary_result%4#0 with [ternary_result%4#4, ternary_result%4#2] +debug: Coalescing encoded_tuple_buffer%14#2 with [encoded_tuple_buffer%14#3, encoded_tuple_buffer%14#4] +debug: Coalescing resulted in 9 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.voting_open using strategy RootOperandGrouping +debug: Coalescing and_result%11#0 with [and_result%11#5, and_result%11#1, and_result%11#2] +debug: Coalescing resulted in 7 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.allowed_to_vote using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.already_voted using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.vote using strategy RootOperandGrouping +debug: Coalescing ternary_result%2#0 with [ternary_result%2#4, ternary_result%2#2] +debug: Coalescing cumulative_offset#0 with [cumulative_offset#5, cumulative_offset#1, cumulative_offset#2] +debug: Coalescing range_item%23#0 with [range_item%23#2] +debug: Coalescing question_index#0 with [question_index#1] +debug: Coalescing resulted in 18 replacement/s +debug: Coalescing local variables in examples.voting.voting.increment_vote_in_box using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.__init__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in examples.voting.voting.VotingRoundApp.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Output IR to /examples/voting/out/voting_VotingRoundApp.final.ir +debug: Inserted main_block@0.ops[1]: 'store app_id%0#0 to l-stack (copy)' +debug: Replaced main_block@0.ops[3]: 'load app_id%0#0' with 'load app_id%0#0 from l-stack (no copy)' +debug: Inserted main_entrypoint@2.ops[1]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced main_entrypoint@2.ops[3]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted main_abi_routing@3.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced main_abi_routing@3.ops[8]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[1]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[3]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[5]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[7]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[10]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[12]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[14]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[16]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[33]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[31]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[29]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[27]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[25]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[23]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[21]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted main_create_route@4.ops[19]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced main_create_route@4.ops[42]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[1]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[3]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[5]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[7]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[10]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[12]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[15]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[17]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[20]: 'store awst_tmp%21#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[22]: 'load awst_tmp%21#0' with 'load awst_tmp%21#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[24]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[26]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[29]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[31]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted main_bootstrap_route@5.ops[23]: 'store awst_tmp%21#0 to l-stack (copy)' +debug: Replaced main_bootstrap_route@5.ops[34]: 'load awst_tmp%21#0' with 'load awst_tmp%21#0 from l-stack (no copy)' +debug: Inserted main_close_route@6.ops[1]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced main_close_route@6.ops[3]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted main_close_route@6.ops[5]: 'store tmp%25#0 to l-stack (copy)' +debug: Replaced main_close_route@6.ops[7]: 'load tmp%25#0' with 'load tmp%25#0 from l-stack (no copy)' +debug: Inserted main_close_route@6.ops[10]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced main_close_route@6.ops[12]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted main_get_preconditions_route@7.ops[1]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced main_get_preconditions_route@7.ops[3]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted main_get_preconditions_route@7.ops[5]: 'store tmp%28#0 to l-stack (copy)' +debug: Replaced main_get_preconditions_route@7.ops[7]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' +debug: Inserted main_get_preconditions_route@7.ops[10]: 'store tmp%29#0 to l-stack (copy)' +debug: Replaced main_get_preconditions_route@7.ops[12]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' +debug: Inserted main_get_preconditions_route@7.ops[15]: 'store tmp%30#0 to l-stack (copy)' +debug: Replaced main_get_preconditions_route@7.ops[17]: 'load tmp%30#0' with 'load tmp%30#0 from l-stack (no copy)' +debug: Inserted main_get_preconditions_route@7.ops[23]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced main_get_preconditions_route@7.ops[25]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted main_get_preconditions_route@7.ops[19]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced main_get_preconditions_route@7.ops[22]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[1]: 'store tmp%33#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[3]: 'load tmp%33#0' with 'load tmp%33#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[5]: 'store tmp%34#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[7]: 'load tmp%34#0' with 'load tmp%34#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[10]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[12]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[15]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[17]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[20]: 'store awst_tmp%21#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[22]: 'load awst_tmp%21#0' with 'load awst_tmp%21#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[24]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[26]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[29]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[31]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[36]: 'store tmp%42#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[40]: 'load tmp%42#0' with 'load tmp%42#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[34]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[40]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted main_vote_route@8.ops[23]: 'store awst_tmp%21#0 to l-stack (copy)' +debug: Replaced main_vote_route@8.ops[40]: 'load awst_tmp%21#0' with 'load awst_tmp%21#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.voting.voting.VotingRoundApp.approval_program +debug: Simplified uncover 7; uncover 7; uncover 7; uncover 7; uncover 7; uncover 7; uncover 7; uncover 7 to +debug: Simplified uncover 2; uncover 2; uncover 2 to +debug: Inserted create_block@0.ops[9]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[11]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[18]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[20]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[34]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[36]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[5]: 'store et#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[8]: 'load et#0' with 'load et#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[15]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[18]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[26]: 'store new_state_value%3#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[29]: 'load new_state_value%3#0' with 'load new_state_value%3#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[33]: 'store awst_tmp%4#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[36]: 'load awst_tmp%4#0' with 'load awst_tmp%4#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[2]: 'store st#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[8]: 'load st#0' with 'load st#0 from l-stack (no copy)' +debug: Inserted create_block@0.ops[10]: 'store et#0 to l-stack (copy)' +debug: Replaced create_block@0.ops[19]: 'load et#0' with 'load et#0 from l-stack (no copy)' +debug: Inserted create_ternary_merge@3.ops[7]: 'store new_state_value%8#0 to l-stack (copy)' +debug: Replaced create_ternary_merge@3.ops[10]: 'load new_state_value%8#0' with 'load new_state_value%8#0 from l-stack (no copy)' +debug: Inserted create_ternary_merge@3.ops[14]: 'store new_state_value%9#0 to l-stack (copy)' +debug: Replaced create_ternary_merge@3.ops[17]: 'load new_state_value%9#0' with 'load new_state_value%9#0 from l-stack (no copy)' +debug: Inserted create_ternary_merge@3.ops[27]: 'store new_state_value%10#0 to l-stack (copy)' +debug: Replaced create_ternary_merge@3.ops[30]: 'load new_state_value%10#0' with 'load new_state_value%10#0 from l-stack (no copy)' +debug: Inserted create_ternary_merge@3.ops[34]: 'store new_state_value%11#0 to l-stack (copy)' +debug: Replaced create_ternary_merge@3.ops[37]: 'load new_state_value%11#0' with 'load new_state_value%11#0 from l-stack (no copy)' +debug: Inserted create_ternary_merge@3.ops[2]: 'store base_length%7#0 to l-stack (copy)' +debug: Replaced create_ternary_merge@3.ops[6]: 'load base_length%7#0' with 'load base_length%7#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.voting.voting.VotingRoundApp.create +debug: Allocated 1 variable/s to x-stack: ternary_result%6#0 +debug: shared x-stack for create_ternary_true@1 -> create_ternary_merge@3: ternary_result%6#0 +debug: shared x-stack for create_ternary_false@2 -> create_ternary_merge@3: ternary_result%6#0 +debug: examples.voting.voting.VotingRoundApp.create f-stack entry: [] +debug: examples.voting.voting.VotingRoundApp.create f-stack on first store: ['st#0', 'et#0', 'awst_tmp%4#0'] +debug: Simplified uncover 2; uncover 2 to cover 2 +debug: Inserted store_option_counts_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced store_option_counts_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted store_option_counts_block@0.ops[10]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced store_option_counts_block@0.ops[12]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted store_option_counts_block@0.ops[15]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced store_option_counts_block@0.ops[17]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted store_option_counts_block@0.ops[24]: 'store total_options#0 to l-stack (copy)' +debug: Replaced store_option_counts_block@0.ops[26]: 'load total_options#0' with 'load total_options#0 from l-stack (no copy)' +debug: Inserted store_option_counts_block@0.ops[29]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced store_option_counts_block@0.ops[31]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted store_option_counts_block@0.ops[27]: 'store total_options#0 to l-stack (copy)' +debug: Replaced store_option_counts_block@0.ops[35]: 'load total_options#0' with 'load total_options#0 from l-stack (no copy)' +debug: Inserted calculate_total_options_count_for_header@1.ops[3]: 'store continue_looping%3#0 to l-stack (copy)' +debug: Replaced calculate_total_options_count_for_header@1.ops[5]: 'load continue_looping%3#0' with 'load continue_looping%3#0 from l-stack (no copy)' +debug: Inserted calculate_total_options_count_for_body@2.ops[4]: 'store item#0 to l-stack (copy)' +debug: Replaced calculate_total_options_count_for_body@2.ops[6]: 'load item#0' with 'load item#0 from l-stack (no copy)' +debug: Inserted calculate_total_options_count_for_body@2.ops[8]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced calculate_total_options_count_for_body@2.ops[11]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted calculate_total_options_count_for_body@2.ops[2]: 'store item_index_internal%2#0 to l-stack (copy)' +debug: Replaced calculate_total_options_count_for_body@2.ops[15]: 'load item_index_internal%2#0' with 'load item_index_internal%2#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.voting.voting.VotingRoundApp.calculate_total_options_count +debug: examples.voting.voting.VotingRoundApp.calculate_total_options_count f-stack entry: [] +debug: examples.voting.voting.VotingRoundApp.calculate_total_options_count f-stack on first store: ['total#0', 'array_length%0#0', 'array_value%1#0', 'item_index_internal%2#0'] +debug: Simplified frame_dig 0; frame_bury 0; retsub to retsub +debug: Inserted bootstrap_block@0.ops[9]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[11]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[26]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[28]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[48]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[50]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[54]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[56]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[60]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[62]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[65]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[67]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[83]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[85]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[20]: 'store app_global_get_ex_did_exist%4#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[23]: 'load app_global_get_ex_did_exist%4#0' with 'load app_global_get_ex_did_exist%4#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[33]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[36]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[38]: 'store box_cost#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[41]: 'load box_cost#0' with 'load box_cost#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[48]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[51]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[77]: 'store app_global_get_ex_did_exist%14#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[80]: 'load app_global_get_ex_did_exist%14#0' with 'load app_global_get_ex_did_exist%14#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[85]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[88]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[9]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[23]: 'store app_global_get_ex_value%3#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[27]: 'load app_global_get_ex_value%3#0' with 'load app_global_get_ex_value%3#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[48]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[53]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[82]: 'store app_global_get_ex_value%13#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[86]: 'load app_global_get_ex_value%13#0' with 'load app_global_get_ex_value%13#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[61]: 'store min_balance_req#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[72]: 'load min_balance_req#0' with 'load min_balance_req#0 from l-stack (no copy)' +debug: Inserted bootstrap_block@0.ops[45]: 'store min_balance_req#0 to l-stack (copy)' +debug: Replaced bootstrap_block@0.ops[61]: 'load min_balance_req#0' with 'load min_balance_req#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[12]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[14]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[31]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[33]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[47]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[49]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[63]: 'store tmp%14#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[65]: 'load tmp%14#0' with 'load tmp%14#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[82]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[84]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[101]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[103]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[121]: 'store range_item%28#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[123]: 'load range_item%28#0' with 'load range_item%28#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[6]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[9]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[18]: 'store new_state_value%3#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[21]: 'load new_state_value%3#0' with 'load new_state_value%3#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[26]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[29]: 'load app_global_get_ex_did_exist%5#0' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[43]: 'store app_global_get_ex_did_exist%9#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[46]: 'load app_global_get_ex_did_exist%9#0' with 'load app_global_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[60]: 'store app_global_get_ex_did_exist%13#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[63]: 'load app_global_get_ex_did_exist%13#0' with 'load app_global_get_ex_did_exist%13#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[77]: 'store app_global_get_ex_did_exist%17#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[80]: 'load app_global_get_ex_did_exist%17#0' with 'load app_global_get_ex_did_exist%17#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[84]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[87]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[98]: 'store app_global_get_ex_did_exist%22#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[101]: 'load app_global_get_ex_did_exist%22#0' with 'load app_global_get_ex_did_exist%22#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[105]: 'store tmp%23#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[108]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[121]: 'store app_global_get_ex_did_exist%26#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[124]: 'load app_global_get_ex_did_exist%26#0' with 'load app_global_get_ex_did_exist%26#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[8]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[12]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[80]: 'store app_global_get_ex_value%16#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[84]: 'load app_global_get_ex_value%16#0' with 'load app_global_get_ex_value%16#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[102]: 'store app_global_get_ex_value%21#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[106]: 'load app_global_get_ex_value%21#0' with 'load app_global_get_ex_value%21#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[126]: 'store app_global_get_ex_value%25#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[130]: 'load app_global_get_ex_value%25#0' with 'load app_global_get_ex_value%25#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[29]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[34]: 'load app_global_get_ex_value%4#0' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[47]: 'store app_global_get_ex_value%8#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[52]: 'load app_global_get_ex_value%8#0' with 'load app_global_get_ex_value%8#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[65]: 'store app_global_get_ex_value%12#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[70]: 'load app_global_get_ex_value%12#0' with 'load app_global_get_ex_value%12#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[41]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[52]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[60]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[71]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[79]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[94]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted close_block@0.ops[102]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced close_block@0.ops[117]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted close_for_header@1.ops[3]: 'store continue_looping%29#0 to l-stack (copy)' +debug: Replaced close_for_header@1.ops[5]: 'load continue_looping%29#0' with 'load continue_looping%29#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[14]: 'store index_is_in_bounds%33#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[16]: 'load index_is_in_bounds%33#0' with 'load index_is_in_bounds%33#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[20]: 'store array_data_sans_header%34#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[22]: 'load array_data_sans_header%34#0' with 'load array_data_sans_header%34#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[26]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[28]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[32]: 'store range_item%37#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[34]: 'load range_item%37#0' with 'load range_item%37#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[3]: 'store app_global_get_ex_did_exist%31#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[6]: 'load app_global_get_ex_did_exist%31#0' with 'load app_global_get_ex_did_exist%31#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[11]: 'store array_length%32#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[14]: 'load array_length%32#0' with 'load array_length%32#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[5]: 'store app_global_get_ex_value%30#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[9]: 'load app_global_get_ex_value%30#0' with 'load app_global_get_ex_value%30#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[10]: 'store app_global_get_ex_value%30#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[22]: 'load app_global_get_ex_value%30#0' with 'load app_global_get_ex_value%30#0 from l-stack (no copy)' +debug: Inserted close_for_body@2.ops[16]: 'store question_index#0 to l-stack (copy)' +debug: Replaced close_for_body@2.ops[28]: 'load question_index#0' with 'load question_index#0 from l-stack (no copy)' +debug: Inserted close_for_header@3.ops[3]: 'store continue_looping%38#0 to l-stack (copy)' +debug: Replaced close_for_header@3.ops[5]: 'load continue_looping%38#0' with 'load continue_looping%38#0 from l-stack (no copy)' +debug: Inserted close_for_body@4.ops[5]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced close_for_body@4.ops[7]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted close_ternary_false@6.ops[7]: 'store tmp%42#0 to l-stack (copy)' +debug: Replaced close_ternary_false@6.ops[9]: 'load tmp%42#0' with 'load tmp%42#0 from l-stack (no copy)' +debug: Inserted close_ternary_false@6.ops[3]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced close_ternary_false@6.ops[6]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted close_ternary_true@7.ops[2]: 'store tmp%44#0 to l-stack (copy)' +debug: Replaced close_ternary_true@7.ops[4]: 'load tmp%44#0' with 'load tmp%44#0 from l-stack (no copy)' +debug: Inserted close_ternary_false@8.ops[10]: 'store tmp%48#0 to l-stack (copy)' +debug: Replaced close_ternary_false@8.ops[12]: 'load tmp%48#0' with 'load tmp%48#0 from l-stack (no copy)' +debug: Inserted close_ternary_false@8.ops[19]: 'store tmp%50#0 to l-stack (copy)' +debug: Replaced close_ternary_false@8.ops[21]: 'load tmp%50#0' with 'load tmp%50#0 from l-stack (no copy)' +debug: Inserted close_ternary_false@8.ops[3]: 'store app_global_get_ex_did_exist%47#0 to l-stack (copy)' +debug: Replaced close_ternary_false@8.ops[6]: 'load app_global_get_ex_did_exist%47#0' with 'load app_global_get_ex_did_exist%47#0 from l-stack (no copy)' +debug: Inserted close_ternary_false@8.ops[16]: 'store tmp%49#0 to l-stack (copy)' +debug: Replaced close_ternary_false@8.ops[19]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' +debug: Inserted close_ternary_false@8.ops[5]: 'store app_global_get_ex_value%46#0 to l-stack (copy)' +debug: Replaced close_ternary_false@8.ops[9]: 'load app_global_get_ex_value%46#0' with 'load app_global_get_ex_value%46#0 from l-stack (no copy)' +debug: Inserted close_ternary_merge@13.ops[11]: 'store range_item%37#0 to l-stack (copy)' +debug: Replaced close_ternary_merge@13.ops[13]: 'load range_item%37#0' with 'load range_item%37#0 from l-stack (no copy)' +debug: Inserted close_after_for@15.ops[3]: 'store range_item%28#0 to l-stack (copy)' +debug: Replaced close_after_for@15.ops[5]: 'load range_item%28#0' with 'load range_item%28#0 from l-stack (no copy)' +debug: Inserted close_after_for@17.ops[23]: 'store tmp%54#0 to l-stack (copy)' +debug: Replaced close_after_for@17.ops[25]: 'load tmp%54#0' with 'load tmp%54#0 from l-stack (no copy)' +debug: Inserted close_after_for@17.ops[16]: 'store app_global_get_ex_did_exist%53#0 to l-stack (copy)' +debug: Replaced close_after_for@17.ops[19]: 'load app_global_get_ex_did_exist%53#0' with 'load app_global_get_ex_did_exist%53#0 from l-stack (no copy)' +debug: Inserted close_after_for@17.ops[33]: 'store app_global_get_ex_did_exist%56#0 to l-stack (copy)' +debug: Replaced close_after_for@17.ops[36]: 'load app_global_get_ex_did_exist%56#0' with 'load app_global_get_ex_did_exist%56#0 from l-stack (no copy)' +debug: Inserted close_after_for@17.ops[44]: 'store new_state_value%57#0 to l-stack (copy)' +debug: Replaced close_after_for@17.ops[47]: 'load new_state_value%57#0' with 'load new_state_value%57#0 from l-stack (no copy)' +debug: Inserted close_after_for@17.ops[35]: 'store app_global_get_ex_value%55#0 to l-stack (copy)' +debug: Replaced close_after_for@17.ops[39]: 'load app_global_get_ex_value%55#0' with 'load app_global_get_ex_value%55#0 from l-stack (no copy)' +debug: Inserted close_after_for@17.ops[18]: 'store app_global_get_ex_value%52#0 to l-stack (copy)' +debug: Replaced close_after_for@17.ops[23]: 'load app_global_get_ex_value%52#0' with 'load app_global_get_ex_value%52#0 from l-stack (no copy)' +debug: Inserted close_after_for@17.ops[3]: 'store note#0 to l-stack (copy)' +debug: Replaced close_after_for@17.ops[43]: 'load note#0' with 'load note#0 from l-stack (no copy)' +debug: Found 10 edge set/s for examples.voting.voting.VotingRoundApp.close +debug: Allocated 3 variable/s to x-stack: ternary_result%40#0, ternary_result%43#0, ternary_result%51#0 +debug: shared x-stack for close_ternary_true@5 -> close_ternary_merge@13: ternary_result%40#0 +debug: shared x-stack for close_ternary_merge@12 -> close_ternary_merge@13: ternary_result%40#0 +debug: shared x-stack for close_ternary_true@7 -> close_ternary_merge@12: ternary_result%43#0 +debug: shared x-stack for close_ternary_merge@11 -> close_ternary_merge@12: ternary_result%43#0 +debug: shared x-stack for close_ternary_true@9 -> close_ternary_merge@11: ternary_result%51#0 +debug: shared x-stack for close_ternary_false@10 -> close_ternary_merge@11: ternary_result%51#0 +debug: examples.voting.voting.VotingRoundApp.close f-stack entry: ['option_index#0', 'question_options#0', 'votes_for_option#0'] +debug: examples.voting.voting.VotingRoundApp.close f-stack on first store: ['note#0', 'current_index#0', 'tmp%27#0', 'question_index#0'] +debug: Inserted ensure_budget_while_top@1.ops[5]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced ensure_budget_while_top@1.ops[7]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted ensure_budget_while_top@1.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced ensure_budget_while_top@1.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted ensure_budget_switch_case_1@4.ops[1]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced ensure_budget_switch_case_1@4.ops[3]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Found 3 edge set/s for algopy.ensure_budget +debug: algopy.ensure_budget f-stack entry: [] +debug: algopy.ensure_budget f-stack on first store: ['required_budget_with_buffer#0'] +debug: Inserted get_vote_from_box_block@0.ops[10]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced get_vote_from_box_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted get_vote_from_box_block@0.ops[14]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced get_vote_from_box_block@0.ops[16]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted get_vote_from_box_block@0.ops[2]: 'store exists#0 to l-stack (copy)' +debug: Replaced get_vote_from_box_block@0.ops[5]: 'load exists#0' with 'load exists#0 from l-stack (no copy)' +debug: Inserted get_vote_from_box_block@0.ops[4]: 'store box_data#0 to l-stack (copy)' +debug: Replaced get_vote_from_box_block@0.ops[8]: 'load box_data#0' with 'load box_data#0 from l-stack (no copy)' +debug: Inserted get_preconditions_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced get_preconditions_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted get_preconditions_block@0.ops[12]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced get_preconditions_block@0.ops[14]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted get_preconditions_block@0.ops[8]: 'store awst_tmp%2#0 to l-stack (copy)' +debug: Replaced get_preconditions_block@0.ops[11]: 'load awst_tmp%2#0' with 'load awst_tmp%2#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[7]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[9]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[11]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[13]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[17]: 'store tmp%9#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[19]: 'load tmp%9#0' with 'load tmp%9#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[23]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[25]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[31]: 'store encoded_tuple_buffer%14#2 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[33]: 'load encoded_tuple_buffer%14#2' with 'load encoded_tuple_buffer%14#2 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[36]: 'store encoded_tuple_buffer%14#2 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[38]: 'load encoded_tuple_buffer%14#2' with 'load encoded_tuple_buffer%14#2 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[41]: 'store encoded_tuple_buffer%14#2 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[43]: 'load encoded_tuple_buffer%14#2' with 'load encoded_tuple_buffer%14#2 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[2]: 'store base_length%5#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[6]: 'load base_length%5#0' with 'load base_length%5#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[28]: 'store val_as_bytes%12#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[41]: 'load val_as_bytes%12#0' with 'load val_as_bytes%12#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[22]: 'store val_as_bytes%10#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[37]: 'load val_as_bytes%10#0' with 'load val_as_bytes%10#0 from l-stack (no copy)' +debug: Inserted get_preconditions_ternary_merge@3.ops[16]: 'store val_as_bytes%8#0 to l-stack (copy)' +debug: Replaced get_preconditions_ternary_merge@3.ops[33]: 'load val_as_bytes%8#0' with 'load val_as_bytes%8#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.voting.voting.VotingRoundApp.get_preconditions +debug: Allocated 1 variable/s to x-stack: ternary_result%4#0 +debug: shared x-stack for get_preconditions_ternary_true@1 -> get_preconditions_ternary_merge@3: ternary_result%4#0 +debug: shared x-stack for get_preconditions_ternary_false@2 -> get_preconditions_ternary_merge@3: ternary_result%4#0 +debug: examples.voting.voting.VotingRoundApp.get_preconditions f-stack entry: [] +debug: examples.voting.voting.VotingRoundApp.get_preconditions f-stack on first store: ['val_as_bytes%1#0', 'awst_tmp%2#0'] +debug: Simplified uncover 2; uncover 2 to cover 2 +debug: Inserted voting_open_block@0.ops[3]: 'store app_global_get_ex_did_exist%1#0 to l-stack (copy)' +debug: Replaced voting_open_block@0.ops[6]: 'load app_global_get_ex_did_exist%1#0' with 'load app_global_get_ex_did_exist%1#0 from l-stack (no copy)' +debug: Inserted voting_open_block@0.ops[5]: 'store app_global_get_ex_value%0#0 to l-stack (copy)' +debug: Replaced voting_open_block@0.ops[9]: 'load app_global_get_ex_value%0#0' with 'load app_global_get_ex_value%0#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@1.ops[3]: 'store app_global_get_ex_did_exist%3#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@1.ops[6]: 'load app_global_get_ex_did_exist%3#0' with 'load app_global_get_ex_did_exist%3#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@1.ops[5]: 'store app_global_get_ex_value%2#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@1.ops[9]: 'load app_global_get_ex_value%2#0' with 'load app_global_get_ex_value%2#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@2.ops[12]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@2.ops[14]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@2.ops[3]: 'store app_global_get_ex_did_exist%5#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@2.ops[6]: 'load app_global_get_ex_did_exist%5#0' with 'load app_global_get_ex_did_exist%5#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@2.ops[9]: 'store awst_tmp%6#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@2.ops[12]: 'load awst_tmp%6#0' with 'load awst_tmp%6#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@2.ops[5]: 'store app_global_get_ex_value%4#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@2.ops[12]: 'load app_global_get_ex_value%4#0' with 'load app_global_get_ex_value%4#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@3.ops[10]: 'store tmp%10#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@3.ops[12]: 'load tmp%10#0' with 'load tmp%10#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@3.ops[3]: 'store app_global_get_ex_did_exist%9#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@3.ops[6]: 'load app_global_get_ex_did_exist%9#0' with 'load app_global_get_ex_did_exist%9#0 from l-stack (no copy)' +debug: Inserted voting_open_and_contd@3.ops[5]: 'store app_global_get_ex_value%8#0 to l-stack (copy)' +debug: Replaced voting_open_and_contd@3.ops[10]: 'load app_global_get_ex_value%8#0' with 'load app_global_get_ex_value%8#0 from l-stack (no copy)' +debug: Found 2 edge set/s for examples.voting.voting.VotingRoundApp.voting_open +debug: Allocated 1 variable/s to x-stack: and_result%11#0 +debug: shared x-stack for voting_open_bool_true@4 -> voting_open_bool_merge@6: and_result%11#0 +debug: shared x-stack for voting_open_bool_false@5 -> voting_open_bool_merge@6: and_result%11#0 +debug: examples.voting.voting.VotingRoundApp.voting_open f-stack entry: ['awst_tmp%6#0'] +debug: examples.voting.voting.VotingRoundApp.voting_open f-stack on first store: [] +debug: Inserted allowed_to_vote_block@0.ops[16]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced allowed_to_vote_block@0.ops[18]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted allowed_to_vote_block@0.ops[8]: 'store app_global_get_ex_did_exist%2#0 to l-stack (copy)' +debug: Replaced allowed_to_vote_block@0.ops[11]: 'load app_global_get_ex_did_exist%2#0' with 'load app_global_get_ex_did_exist%2#0 from l-stack (no copy)' +debug: Inserted allowed_to_vote_block@0.ops[10]: 'store app_global_get_ex_value%1#0 to l-stack (copy)' +debug: Replaced allowed_to_vote_block@0.ops[16]: 'load app_global_get_ex_value%1#0' with 'load app_global_get_ex_value%1#0 from l-stack (no copy)' +debug: Inserted allowed_to_vote_block@0.ops[4]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced allowed_to_vote_block@0.ops[15]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted already_voted_block@0.ops[1]: 'store tmp%0#0 to l-stack (copy)' +debug: Replaced already_voted_block@0.ops[3]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' +debug: Inserted already_voted_block@0.ops[5]: 'store exists#0 to l-stack (copy)' +debug: Replaced already_voted_block@0.ops[8]: 'load exists#0' with 'load exists#0 from l-stack (no copy)' +debug: Inserted vote_block@0.ops[9]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced vote_block@0.ops[11]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted vote_block@0.ops[5]: 'store awst_tmp%0#0 to l-stack (copy)' +debug: Replaced vote_block@0.ops[8]: 'load awst_tmp%0#0' with 'load awst_tmp%0#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[7]: 'store tmp%4#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[9]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[11]: 'store tmp%5#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[13]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[16]: 'store tmp%6#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[18]: 'load tmp%6#0' with 'load tmp%6#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[21]: 'store tmp%7#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[23]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[25]: 'store tmp%8#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[27]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[43]: 'store tmp%11#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[45]: 'load tmp%11#0' with 'load tmp%11#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[48]: 'store tmp%12#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[50]: 'load tmp%12#0' with 'load tmp%12#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[59]: 'store tmp%15#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[61]: 'load tmp%15#0' with 'load tmp%15#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[77]: 'store tmp%19#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[79]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[83]: 'store tmp%20#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[85]: 'load tmp%20#0' with 'load tmp%20#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[89]: 'store tmp%21#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[91]: 'load tmp%21#0' with 'load tmp%21#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[94]: 'store tmp%22#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[96]: 'load tmp%22#0' with 'load tmp%22#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[101]: 'store range_item%23#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[103]: 'load range_item%23#0' with 'load range_item%23#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[32]: 'store app_global_get_ex_did_exist%10#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[35]: 'load app_global_get_ex_did_exist%10#0' with 'load app_global_get_ex_did_exist%10#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[56]: 'store tmp%13#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[59]: 'load tmp%13#0' with 'load tmp%13#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[66]: 'store tmp%16#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[69]: 'load tmp%16#0' with 'load tmp%16#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[76]: 'store tmp%18#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[79]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[2]: 'store base_length%3#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[6]: 'load base_length%3#0' with 'load base_length%3#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[35]: 'store app_global_get_ex_value%9#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[39]: 'load app_global_get_ex_value%9#0' with 'load app_global_get_ex_value%9#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[76]: 'store tmp%17#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[81]: 'load tmp%17#0' with 'load tmp%17#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[42]: 'store questions_count#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[50]: 'load questions_count#0' with 'load questions_count#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[90]: 'store min_bal_req#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[101]: 'load min_bal_req#0' with 'load min_bal_req#0 from l-stack (no copy)' +debug: Inserted vote_ternary_merge@3.ops[74]: 'store min_bal_req#0 to l-stack (copy)' +debug: Replaced vote_ternary_merge@3.ops[90]: 'load min_bal_req#0' with 'load min_bal_req#0 from l-stack (no copy)' +debug: Inserted vote_for_header@4.ops[3]: 'store continue_looping%24#0 to l-stack (copy)' +debug: Replaced vote_for_header@4.ops[5]: 'load continue_looping%24#0' with 'load continue_looping%24#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[7]: 'store index_is_in_bounds%26#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[9]: 'load index_is_in_bounds%26#0' with 'load index_is_in_bounds%26#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[13]: 'store array_data_sans_header%27#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[15]: 'load array_data_sans_header%27#0' with 'load array_data_sans_header%27#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[34]: 'store index_is_in_bounds%32#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[36]: 'load index_is_in_bounds%32#0' with 'load index_is_in_bounds%32#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[40]: 'store array_data_sans_header%33#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[42]: 'load array_data_sans_header%33#0' with 'load array_data_sans_header%33#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[56]: 'store tmp%37#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[58]: 'load tmp%37#0' with 'load tmp%37#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[66]: 'store tmp%39#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[68]: 'load tmp%39#0' with 'load tmp%39#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[78]: 'store tmp%41#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[80]: 'load tmp%41#0' with 'load tmp%41#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[100]: 'store range_item%23#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[102]: 'load range_item%23#0' with 'load range_item%23#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[3]: 'store array_length%25#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[6]: 'load array_length%25#0' with 'load array_length%25#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[24]: 'store app_global_get_ex_did_exist%30#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[27]: 'load app_global_get_ex_did_exist%30#0' with 'load app_global_get_ex_did_exist%30#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[32]: 'store array_length%31#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[35]: 'load array_length%31#0' with 'load array_length%31#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[55]: 'store tmp%36#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[58]: 'load tmp%36#0' with 'load tmp%36#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[66]: 'store tmp%38#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[69]: 'load tmp%38#0' with 'load tmp%38#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[77]: 'store tmp%40#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[80]: 'load tmp%40#0' with 'load tmp%40#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[92]: 'store app_global_get_ex_did_exist%43#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[95]: 'load app_global_get_ex_did_exist%43#0' with 'load app_global_get_ex_did_exist%43#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[100]: 'store new_state_value%44#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[103]: 'load new_state_value%44#0' with 'load new_state_value%44#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[26]: 'store app_global_get_ex_value%29#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[30]: 'load app_global_get_ex_value%29#0' with 'load app_global_get_ex_value%29#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[95]: 'store app_global_get_ex_value%42#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[99]: 'load app_global_get_ex_value%42#0' with 'load app_global_get_ex_value%42#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[50]: 'store options_count#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[55]: 'load options_count#0' with 'load options_count#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[54]: 'store tmp%35#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[60]: 'load tmp%35#0' with 'load tmp%35#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[72]: 'store cumulative_offset#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[83]: 'load cumulative_offset#0' with 'load cumulative_offset#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[6]: 'store question_index#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[18]: 'load question_index#0' with 'load question_index#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[32]: 'store app_global_get_ex_value%29#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[44]: 'load app_global_get_ex_value%29#0' with 'load app_global_get_ex_value%29#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[38]: 'store question_index#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[50]: 'load question_index#0' with 'load question_index#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[56]: 'store answer_option_index#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[71]: 'load answer_option_index#0' with 'load answer_option_index#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[19]: 'store question_index#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[38]: 'load question_index#0' with 'load question_index#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[62]: 'store options_count#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[85]: 'load options_count#0' with 'load options_count#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[22]: 'store answer_option_index#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[57]: 'load answer_option_index#0' with 'load answer_option_index#0 from l-stack (no copy)' +debug: Inserted vote_for_body@5.ops[53]: 'store question_index#0 to l-stack (copy)' +debug: Replaced vote_for_body@5.ops[118]: 'load question_index#0' with 'load question_index#0 from l-stack (no copy)' +debug: Found 4 edge set/s for examples.voting.voting.VotingRoundApp.vote +debug: Allocated 1 variable/s to x-stack: ternary_result%2#0 +debug: shared x-stack for vote_ternary_true@1 -> vote_ternary_merge@3: ternary_result%2#0 +debug: shared x-stack for vote_ternary_false@2 -> vote_ternary_merge@3: ternary_result%2#0 +debug: examples.voting.voting.VotingRoundApp.vote f-stack entry: ['cumulative_offset#0', 'question_index#0', 'questions_count#0'] +debug: examples.voting.voting.VotingRoundApp.vote f-stack on first store: ['awst_tmp%0#0'] +debug: Simplified uncover 2; uncover 2 to cover 2 +debug: Inserted increment_vote_in_box_block@0.ops[10]: 'store tmp%2#0 to l-stack (copy)' +debug: Replaced increment_vote_in_box_block@0.ops[12]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' +debug: Inserted increment_vote_in_box_block@0.ops[14]: 'store current_vote#0 to l-stack (copy)' +debug: Replaced increment_vote_in_box_block@0.ops[16]: 'load current_vote#0' with 'load current_vote#0 from l-stack (no copy)' +debug: Inserted increment_vote_in_box_block@0.ops[19]: 'store tmp%3#0 to l-stack (copy)' +debug: Replaced increment_vote_in_box_block@0.ops[21]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' +debug: Inserted increment_vote_in_box_block@0.ops[2]: 'store exists#0 to l-stack (copy)' +debug: Replaced increment_vote_in_box_block@0.ops[5]: 'load exists#0' with 'load exists#0 from l-stack (no copy)' +debug: Inserted increment_vote_in_box_block@0.ops[4]: 'store box_data#0 to l-stack (copy)' +debug: Replaced increment_vote_in_box_block@0.ops[8]: 'load box_data#0' with 'load box_data#0 from l-stack (no copy)' +debug: Inserted increment_vote_in_box_block@0.ops[25]: 'store tmp%4#0 to l-stack (copy)' +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/voting.approval.teal +info: Writing voting/out/voting.approval.debug.teal +info: Writing voting/out/voting.clear.teal +info: Writing voting/out/voting.clear.debug.teal +info: Writing voting/out/application.json +>> exit code = 0 \ No newline at end of file diff --git a/examples/voting/out/application.json b/examples/voting/out/application.json new file mode 100644 index 0000000000..8ccf6f953e --- /dev/null +++ b/examples/voting/out/application.json @@ -0,0 +1,228 @@ +{ + "hints": { + "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void": { + "call_config": { + "no_op": "CREATE" + } + }, + "bootstrap(pay)void": { + "call_config": { + "no_op": "CALL" + } + }, + "close()void": { + "call_config": { + "no_op": "CALL" + } + }, + "get_preconditions(byte[])(uint64,uint64,uint64,uint64)": { + "read_only": true, + "call_config": { + "no_op": "CALL" + }, + "structs": { + "output": { + "name": "arc4.struct", + "elements": [ + [ + "is_voting_open", + "uint64" + ], + [ + "is_allowed_to_vote", + "uint64" + ], + [ + "has_already_voted", + "uint64" + ], + [ + "current_time", + "uint64" + ] + ] + } + } + }, + "vote(pay,byte[],uint8[])void": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLnZvdGluZy52b3RpbmcuVm90aW5nUm91bmRBcHAuYXBwcm92YWxfcHJvZ3JhbSgpIC0+IHVpbnQ2NDoKbWFpbl9ibG9ja0AwOgogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYm56IG1haW5fZW50cnlwb2ludEAyCgptYWluX29uX2NyZWF0ZUAxOgogICAgICAgIGNhbGxzdWIgX19pbml0X18KCm1haW5fZW50cnlwb2ludEAyOgogICAgICAgIHR4biBOdW1BcHBBcmdzCiAgICAgICAgYnogbWFpbl9hZnRlcl9pZl9lbHNlQDExCgptYWluX2FiaV9yb3V0aW5nQDM6CiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgICAgIG1ldGhvZCAiY3JlYXRlKHN0cmluZyxieXRlW10sc3RyaW5nLHVpbnQ2NCx1aW50NjQsdWludDhbXSx1aW50NjQsc3RyaW5nKXZvaWQiCiAgICAgICAgbWV0aG9kICJib290c3RyYXAocGF5KXZvaWQiCiAgICAgICAgbWV0aG9kICJjbG9zZSgpdm9pZCIKICAgICAgICBtZXRob2QgImdldF9wcmVjb25kaXRpb25zKGJ5dGVbXSkodWludDY0LHVpbnQ2NCx1aW50NjQsdWludDY0KSIKICAgICAgICBtZXRob2QgInZvdGUocGF5LGJ5dGVbXSx1aW50OFtdKXZvaWQiCiAgICAgICAgdW5jb3ZlciA1CiAgICAgICAgbWF0Y2ggbWFpbl9jcmVhdGVfcm91dGVANCBtYWluX2Jvb3RzdHJhcF9yb3V0ZUA1IG1haW5fY2xvc2Vfcm91dGVANiBtYWluX2dldF9wcmVjb25kaXRpb25zX3JvdXRlQDcgbWFpbl92b3RlX3JvdXRlQDgKICAgICAgICBiIG1haW5fYWZ0ZXJfaWZfZWxzZUAxMQoKbWFpbl9jcmVhdGVfcm91dGVANDoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBpcyBjcmVhdGluZwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAyCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDQKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA1CiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgNgogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDcKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyA4CiAgICAgICAgY2FsbHN1YiBjcmVhdGUKICAgICAgICBpbnQgMQogICAgICAgIHJldHVybgoKbWFpbl9ib290c3RyYXBfcm91dGVANToKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4biBHcm91cEluZGV4CiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZHVwCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBpbnQgcGF5CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBwYXkKICAgICAgICBjYWxsc3ViIGJvb3RzdHJhcAogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2Nsb3NlX3JvdXRlQDY6CiAgICAgICAgdHhuIE9uQ29tcGxldGlvbgogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gT25Db21wbGV0aW9uIGlzIE5vT3AKICAgICAgICB0eG4gQXBwbGljYXRpb25JRAogICAgICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgICAgICBjYWxsc3ViIGNsb3NlCiAgICAgICAgaW50IDEKICAgICAgICByZXR1cm4KCm1haW5fZ2V0X3ByZWNvbmRpdGlvbnNfcm91dGVANzoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgICAgICBjYWxsc3ViIGdldF9wcmVjb25kaXRpb25zCiAgICAgICAgYnl0ZSAweDE1MWY3Yzc1CiAgICAgICAgc3dhcAogICAgICAgIGNvbmNhdAogICAgICAgIGxvZwogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX3ZvdGVfcm91dGVAODoKICAgICAgICB0eG4gT25Db21wbGV0aW9uCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAgICAgYXNzZXJ0IC8vIGlzIG5vdCBjcmVhdGluZwogICAgICAgIHR4biBHcm91cEluZGV4CiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZHVwCiAgICAgICAgZ3R4bnMgVHlwZUVudW0KICAgICAgICBpbnQgcGF5CiAgICAgICAgPT0KICAgICAgICBhc3NlcnQgLy8gdHJhbnNhY3Rpb24gdHlwZSBpcyBwYXkKICAgICAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAxCiAgICAgICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMgogICAgICAgIGNhbGxzdWIgdm90ZQogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgptYWluX2FmdGVyX2lmX2Vsc2VAMTE6CiAgICAgICAgZXJyIC8vIHJlamVjdCB0cmFuc2FjdGlvbgoKCi8vIGV4YW1wbGVzLnZvdGluZy52b3RpbmcuVm90aW5nUm91bmRBcHAuY3JlYXRlKHZvdGVfaWQjMDogYnl0ZXMsIHNuYXBzaG90X3B1YmxpY19rZXkjMDogYnl0ZXMsIG1ldGFkYXRhX2lwZnNfY2lkIzA6IGJ5dGVzLCBzdGFydF90aW1lIzA6IGJ5dGVzLCBlbmRfdGltZSMwOiBieXRlcywgb3B0aW9uX2NvdW50cyMwOiBieXRlcywgcXVvcnVtIzA6IGJ5dGVzLCBuZnRfaW1hZ2VfdXJsIzA6IGJ5dGVzKSAtPiB2b2lkOgpjcmVhdGU6CiAgICAgICAgcHJvdG8gOCAwCgpjcmVhdGVfYmxvY2tAMDoKICAgICAgICBmcmFtZV9kaWcgLTUKICAgICAgICBidG9pCiAgICAgICAgZHVwCiAgICAgICAgc3dhcAogICAgICAgIGZyYW1lX2RpZyAtNAogICAgICAgIGJ0b2kKICAgICAgICBkdXAKICAgICAgICBjb3ZlciAyCiAgICAgICAgZHVwCiAgICAgICAgY292ZXIgMgogICAgICAgIDwKICAgICAgICBhc3NlcnQgLy8gRW5kIHRpbWUgc2hvdWxkIGJlIGFmdGVyIHN0YXJ0IHRpbWUKICAgICAgICBnbG9iYWwgTGF0ZXN0VGltZXN0YW1wCiAgICAgICAgPj0KICAgICAgICBhc3NlcnQgLy8gRW5kIHRpbWUgc2hvdWxkIGJlIGluIHRoZSBmdXR1cmUKICAgICAgICBmcmFtZV9kaWcgLTgKICAgICAgICBleHRyYWN0IDIgMAogICAgICAgIGJ5dGUgInZvdGVfaWQiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgZnJhbWVfZGlnIC03CiAgICAgICAgbGVuCiAgICAgICAgZHVwCiAgICAgICAgc3dhcAogICAgICAgIGludCAyCiAgICAgICAgPgogICAgICAgIGJ6IGNyZWF0ZV90ZXJuYXJ5X2ZhbHNlQDIKCmNyZWF0ZV90ZXJuYXJ5X3RydWVAMToKICAgICAgICBpbnQgMgogICAgICAgIGIgY3JlYXRlX3Rlcm5hcnlfbWVyZ2VAMwoKY3JlYXRlX3Rlcm5hcnlfZmFsc2VAMjoKICAgICAgICBmcmFtZV9kaWcgMgoKY3JlYXRlX3Rlcm5hcnlfbWVyZ2VAMzoKICAgICAgICBmcmFtZV9kaWcgLTcKICAgICAgICBsZW4KICAgICAgICBmcmFtZV9kaWcgLTcKICAgICAgICBjb3ZlciAyCiAgICAgICAgc3Vic3RyaW5nMwogICAgICAgIGJ5dGUgInNuYXBzaG90X3B1YmxpY19rZXkiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgZnJhbWVfZGlnIC02CiAgICAgICAgZXh0cmFjdCAyIDAKICAgICAgICBieXRlICJtZXRhZGF0YV9pcGZzX2NpZCIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJzdGFydF90aW1lIgogICAgICAgIGZyYW1lX2RpZyAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJlbmRfdGltZSIKICAgICAgICBmcmFtZV9kaWcgMQogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgYnRvaQogICAgICAgIGJ5dGUgInF1b3J1bSIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBleHRyYWN0IDIgMAogICAgICAgIGJ5dGUgIm5mdF9pbWFnZV91cmwiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgZnJhbWVfZGlnIC0zCiAgICAgICAgY2FsbHN1YiBzdG9yZV9vcHRpb25fY291bnRzCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudm90aW5nLnZvdGluZy5Wb3RpbmdSb3VuZEFwcC5zdG9yZV9vcHRpb25fY291bnRzKG9wdGlvbl9jb3VudHMjMDogYnl0ZXMpIC0+IHZvaWQ6CnN0b3JlX29wdGlvbl9jb3VudHM6CiAgICAgICAgcHJvdG8gMSAwCgpzdG9yZV9vcHRpb25fY291bnRzX2Jsb2NrQDA6CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgaW50IDAKICAgICAgICBleHRyYWN0X3VpbnQxNgogICAgICAgIGFzc2VydCAvLyBvcHRpb25fY291bnRzIHNob3VsZCBiZSBub24tZW1wdHkKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBpbnQgMAogICAgICAgIGV4dHJhY3RfdWludDE2CiAgICAgICAgaW50IDExMgogICAgICAgIDw9CiAgICAgICAgYXNzZXJ0IC8vIENhbid0IGhhdmUgbW9yZSB0aGFuIDExMiBxdWVzdGlvbnMKICAgICAgICBieXRlICJvcHRpb25fY291bnRzIgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgY2FsbHN1YiBjYWxjdWxhdGVfdG90YWxfb3B0aW9uc19jb3VudAogICAgICAgIGR1cAogICAgICAgIGludCAxMjgKICAgICAgICA8PQogICAgICAgIGFzc2VydCAvLyBDYW4ndCBoYXZlIG1vcmUgdGhhbiAxMjggdm90ZSBvcHRpb25zCiAgICAgICAgYnl0ZSAidG90YWxfb3B0aW9ucyIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy52b3Rpbmcudm90aW5nLlZvdGluZ1JvdW5kQXBwLmNhbGN1bGF0ZV90b3RhbF9vcHRpb25zX2NvdW50KG9wdGlvbl9jb3VudHMjMDogYnl0ZXMpIC0+IHVpbnQ2NDoKY2FsY3VsYXRlX3RvdGFsX29wdGlvbnNfY291bnQ6CiAgICAgICAgcHJvdG8gMSAxCgpjYWxjdWxhdGVfdG90YWxfb3B0aW9uc19jb3VudF9ibG9ja0AwOgogICAgICAgIGludCAwCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgaW50IDAKICAgICAgICBleHRyYWN0X3VpbnQxNgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGV4dHJhY3QgMiAwCiAgICAgICAgaW50IDAKCmNhbGN1bGF0ZV90b3RhbF9vcHRpb25zX2NvdW50X2Zvcl9oZWFkZXJAMToKICAgICAgICBmcmFtZV9kaWcgMwogICAgICAgIGZyYW1lX2RpZyAxCiAgICAgICAgPAogICAgICAgIGJ6IGNhbGN1bGF0ZV90b3RhbF9vcHRpb25zX2NvdW50X2FmdGVyX2ZvckA0CgpjYWxjdWxhdGVfdG90YWxfb3B0aW9uc19jb3VudF9mb3JfYm9keUAyOgogICAgICAgIGZyYW1lX2RpZyAyCiAgICAgICAgZnJhbWVfZGlnIDMKICAgICAgICBkdXAKICAgICAgICBjb3ZlciAyCiAgICAgICAgaW50IDEKICAgICAgICBleHRyYWN0MwogICAgICAgIGJ0b2kKICAgICAgICBmcmFtZV9kaWcgMAogICAgICAgICsKICAgICAgICBmcmFtZV9idXJ5IDAKICAgICAgICBpbnQgMQogICAgICAgICsKICAgICAgICBmcmFtZV9idXJ5IDMKICAgICAgICBiIGNhbGN1bGF0ZV90b3RhbF9vcHRpb25zX2NvdW50X2Zvcl9oZWFkZXJAMQoKY2FsY3VsYXRlX3RvdGFsX29wdGlvbnNfY291bnRfYWZ0ZXJfZm9yQDQ6CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudm90aW5nLnZvdGluZy5Wb3RpbmdSb3VuZEFwcC5ib290c3RyYXAoZnVuZF9taW5fYmFsX3JlcSMwOiB1aW50NjQpIC0+IHZvaWQ6CmJvb3RzdHJhcDoKICAgICAgICBwcm90byAxIDAKCmJvb3RzdHJhcF9ibG9ja0AwOgogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAiaXNfYm9vdHN0cmFwcGVkIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgICEKICAgICAgICBhc3NlcnQgLy8gTXVzdCBub3QgYmUgYWxyZWFkeSBib290c3RyYXBwZWQKICAgICAgICBieXRlICJpc19ib290c3RyYXBwZWQiCiAgICAgICAgaW50IDEKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAidG90YWxfb3B0aW9ucyIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBpbnQgNDAwCiAgICAgICAgKgogICAgICAgIGludCA4CiAgICAgICAgKgogICAgICAgIGludCAyOTAwCiAgICAgICAgKwogICAgICAgIGludCAyMDEwMDAKICAgICAgICArCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgZ3R4bnMgUmVjZWl2ZXIKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIFBheW1lbnQgbXVzdCBiZSB0byBhcHAgYWRkcmVzcwogICAgICAgIGR1cAogICAgICAgIGl0b2IKICAgICAgICBsb2cKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBndHhucyBBbW91bnQKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBQYXltZW50IG11c3QgYmUgZm9yIHRoZSBleGFjdCBtaW4gYmFsYW5jZSByZXF1aXJlbWVudAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAidG90YWxfb3B0aW9ucyIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBpbnQgOAogICAgICAgICoKICAgICAgICBieXRlICJWIgogICAgICAgIHN3YXAKICAgICAgICBib3hfY3JlYXRlCiAgICAgICAgYXNzZXJ0CiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudm90aW5nLnZvdGluZy5Wb3RpbmdSb3VuZEFwcC5jbG9zZSgpIC0+IHZvaWQ6CmNsb3NlOgogICAgICAgIHByb3RvIDAgMAogICAgICAgIGJ5dGUgIiIKICAgICAgICBkdXBuIDIKCmNsb3NlX2Jsb2NrQDA6CiAgICAgICAgaW50IDIwMDAwCiAgICAgICAgaW50IDAKICAgICAgICBjYWxsc3ViIGVuc3VyZV9idWRnZXQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImNsb3NlX3RpbWUiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgIQogICAgICAgIGFzc2VydCAvLyBBbHJlYWR5IGNsb3NlZAogICAgICAgIGdsb2JhbCBMYXRlc3RUaW1lc3RhbXAKICAgICAgICBieXRlICJjbG9zZV90aW1lIgogICAgICAgIHN3YXAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAidm90ZV9pZCIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBieXRlICJ7XCJzdGFuZGFyZFwiOlwiYXJjNjlcIixcImRlc2NyaXB0aW9uXCI6XCJUaGlzIGlzIGEgdm90aW5nIHJlc3VsdCBORlQgZm9yIHZvdGluZyByb3VuZCB3aXRoIElEICIKICAgICAgICBzd2FwCiAgICAgICAgY29uY2F0CiAgICAgICAgYnl0ZSAiLlwiLFwicHJvcGVydGllc1wiOntcIm1ldGFkYXRhXCI6XCJpcGZzOi8vIgogICAgICAgIGNvbmNhdAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAibWV0YWRhdGFfaXBmc19jaWQiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgY29uY2F0CiAgICAgICAgYnl0ZSAiXCIsXCJpZFwiOlwiIgogICAgICAgIGNvbmNhdAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAidm90ZV9pZCIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBjb25jYXQKICAgICAgICBieXRlICJcIixcInF1b3J1bVwiOiIKICAgICAgICBjb25jYXQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgInF1b3J1bSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBpdG9iCiAgICAgICAgY29uY2F0CiAgICAgICAgYnl0ZSAiLFwidm90ZXJDb3VudFwiOiIKICAgICAgICBjb25jYXQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgInZvdGVyX2NvdW50IgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGl0b2IKICAgICAgICBjb25jYXQKICAgICAgICBieXRlICIsXCJ0YWxsaWVzXCI6WyIKICAgICAgICBjb25jYXQKICAgICAgICBpbnQgMAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAib3B0aW9uX2NvdW50cyIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBpbnQgMAogICAgICAgIGV4dHJhY3RfdWludDE2CiAgICAgICAgaW50IDAKCmNsb3NlX2Zvcl9oZWFkZXJAMToKICAgICAgICBmcmFtZV9kaWcgNgogICAgICAgIGZyYW1lX2RpZyA1CiAgICAgICAgPAogICAgICAgIGJ6IGNsb3NlX2FmdGVyX2ZvckAxNwoKY2xvc2VfZm9yX2JvZHlAMjoKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgIm9wdGlvbl9jb3VudHMiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgZHVwCiAgICAgICAgaW50IDAKICAgICAgICBleHRyYWN0X3VpbnQxNgogICAgICAgIGZyYW1lX2RpZyA2CiAgICAgICAgZHVwCiAgICAgICAgY292ZXIgMwogICAgICAgID4KICAgICAgICBhc3NlcnQgLy8gSW5kZXggYWNjZXNzIGlzIG91dCBvZiBib3VuZHMKICAgICAgICBleHRyYWN0IDIgMAogICAgICAgIHN3YXAKICAgICAgICBpbnQgMQogICAgICAgIGV4dHJhY3QzCiAgICAgICAgYnRvaQogICAgICAgIGZyYW1lX2J1cnkgMQogICAgICAgIGludCAwCiAgICAgICAgZnJhbWVfYnVyeSAwCgpjbG9zZV9mb3JfaGVhZGVyQDM6CiAgICAgICAgZnJhbWVfZGlnIDAKICAgICAgICBmcmFtZV9kaWcgMQogICAgICAgIDwKICAgICAgICBieiBjbG9zZV9hZnRlcl9mb3JAMTUKCmNsb3NlX2Zvcl9ib2R5QDQ6CiAgICAgICAgZnJhbWVfZGlnIDQKICAgICAgICBjYWxsc3ViIGdldF92b3RlX2Zyb21fYm94CiAgICAgICAgZnJhbWVfYnVyeSAyCiAgICAgICAgZnJhbWVfZGlnIDAKICAgICAgICAhCiAgICAgICAgYnogY2xvc2VfdGVybmFyeV9mYWxzZUA2CgpjbG9zZV90ZXJuYXJ5X3RydWVANToKICAgICAgICBieXRlICJbIgogICAgICAgIGIgY2xvc2VfdGVybmFyeV9tZXJnZUAxMwoKY2xvc2VfdGVybmFyeV9mYWxzZUA2OgogICAgICAgIGZyYW1lX2RpZyAxCiAgICAgICAgaW50IDEKICAgICAgICAtCiAgICAgICAgZnJhbWVfZGlnIDAKICAgICAgICA9PQogICAgICAgIGJ6IGNsb3NlX3Rlcm5hcnlfZmFsc2VAOAoKY2xvc2VfdGVybmFyeV90cnVlQDc6CiAgICAgICAgZnJhbWVfZGlnIDIKICAgICAgICBpdG9iCiAgICAgICAgYnl0ZSAiXSIKICAgICAgICBjb25jYXQKICAgICAgICBiIGNsb3NlX3Rlcm5hcnlfbWVyZ2VAMTIKCmNsb3NlX3Rlcm5hcnlfZmFsc2VAODoKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgIm9wdGlvbl9jb3VudHMiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgaW50IDAKICAgICAgICBleHRyYWN0X3VpbnQxNgogICAgICAgIGludCAxCiAgICAgICAgLQogICAgICAgIGZyYW1lX2RpZyA2CiAgICAgICAgPT0KICAgICAgICBieiBjbG9zZV90ZXJuYXJ5X2ZhbHNlQDEwCgpjbG9zZV90ZXJuYXJ5X3RydWVAOToKICAgICAgICBieXRlICIsIgogICAgICAgIGIgY2xvc2VfdGVybmFyeV9tZXJnZUAxMQoKY2xvc2VfdGVybmFyeV9mYWxzZUAxMDoKICAgICAgICBieXRlICIiCgpjbG9zZV90ZXJuYXJ5X21lcmdlQDExOgoKY2xvc2VfdGVybmFyeV9tZXJnZUAxMjoKCmNsb3NlX3Rlcm5hcnlfbWVyZ2VAMTM6CiAgICAgICAgZnJhbWVfZGlnIDMKICAgICAgICBzd2FwCiAgICAgICAgY29uY2F0CiAgICAgICAgZnJhbWVfYnVyeSAzCiAgICAgICAgZnJhbWVfZGlnIDQKICAgICAgICBpbnQgMQogICAgICAgICsKICAgICAgICBmcmFtZV9idXJ5IDQKICAgICAgICBmcmFtZV9kaWcgMAogICAgICAgIGludCAxCiAgICAgICAgKwogICAgICAgIGZyYW1lX2J1cnkgMAogICAgICAgIGIgY2xvc2VfZm9yX2hlYWRlckAzCgpjbG9zZV9hZnRlcl9mb3JAMTU6CiAgICAgICAgZnJhbWVfZGlnIDYKICAgICAgICBpbnQgMQogICAgICAgICsKICAgICAgICBmcmFtZV9idXJ5IDYKICAgICAgICBiIGNsb3NlX2Zvcl9oZWFkZXJAMQoKY2xvc2VfYWZ0ZXJfZm9yQDE3OgogICAgICAgIGZyYW1lX2RpZyAzCiAgICAgICAgYnl0ZSAiXX19IgogICAgICAgIGNvbmNhdAogICAgICAgIGl0eG5fYmVnaW4KICAgICAgICBpbnQgYWNmZwogICAgICAgIGl0eG5fZmllbGQgVHlwZUVudW0KICAgICAgICBpbnQgMQogICAgICAgIGl0eG5fZmllbGQgQ29uZmlnQXNzZXRUb3RhbAogICAgICAgIGludCAwCiAgICAgICAgaXR4bl9maWVsZCBDb25maWdBc3NldERlY2ltYWxzCiAgICAgICAgaW50IDAKICAgICAgICBpdHhuX2ZpZWxkIENvbmZpZ0Fzc2V0RGVmYXVsdEZyb3plbgogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAidm90ZV9pZCIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBieXRlICJbVk9URSBSRVNVTFRdICIKICAgICAgICBzd2FwCiAgICAgICAgY29uY2F0CiAgICAgICAgaXR4bl9maWVsZCBDb25maWdBc3NldE5hbWUKICAgICAgICBieXRlICJWT1RFUlNMVCIKICAgICAgICBpdHhuX2ZpZWxkIENvbmZpZ0Fzc2V0VW5pdE5hbWUKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgIm5mdF9pbWFnZV91cmwiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgaXR4bl9maWVsZCBDb25maWdBc3NldFVSTAogICAgICAgIGl0eG5fZmllbGQgTm90ZQogICAgICAgIGl0eG5fc3VibWl0CiAgICAgICAgaXR4biBDcmVhdGVkQXNzZXRJRAogICAgICAgIGJ5dGUgIm5mdF9hc3NldF9pZCIKICAgICAgICBzd2FwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICByZXRzdWIKCgovLyBhbGdvcHkuZW5zdXJlX2J1ZGdldChyZXF1aXJlZF9idWRnZXQjMDogdWludDY0LCBmZWVfc291cmNlIzA6IHVpbnQ2NCkgLT4gdm9pZDoKZW5zdXJlX2J1ZGdldDoKICAgICAgICBwcm90byAyIDAKCmVuc3VyZV9idWRnZXRfYmxvY2tAMDoKICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICBpbnQgMTAKICAgICAgICArCgplbnN1cmVfYnVkZ2V0X3doaWxlX3RvcEAxOgogICAgICAgIGdsb2JhbCBPcGNvZGVCdWRnZXQKICAgICAgICBmcmFtZV9kaWcgMAogICAgICAgIDwKICAgICAgICBieiBlbnN1cmVfYnVkZ2V0X2FmdGVyX3doaWxlQDcKCmVuc3VyZV9idWRnZXRfd2hpbGVfYm9keUAyOgogICAgICAgIGl0eG5fYmVnaW4KICAgICAgICBpbnQgYXBwbAogICAgICAgIGl0eG5fZmllbGQgVHlwZUVudW0KICAgICAgICBpbnQgRGVsZXRlQXBwbGljYXRpb24KICAgICAgICBpdHhuX2ZpZWxkIE9uQ29tcGxldGlvbgogICAgICAgIGJ5dGUgMHgwNjgxMDEKICAgICAgICBpdHhuX2ZpZWxkIEFwcHJvdmFsUHJvZ3JhbQogICAgICAgIGJ5dGUgMHgwNjgxMDEKICAgICAgICBpdHhuX2ZpZWxkIENsZWFyU3RhdGVQcm9ncmFtCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgc3dpdGNoIGVuc3VyZV9idWRnZXRfc3dpdGNoX2Nhc2VfMEAzIGVuc3VyZV9idWRnZXRfc3dpdGNoX2Nhc2VfMUA0CiAgICAgICAgYiBlbnN1cmVfYnVkZ2V0X3N3aXRjaF9jYXNlX25leHRANgoKZW5zdXJlX2J1ZGdldF9zd2l0Y2hfY2FzZV8wQDM6CiAgICAgICAgaW50IDAKICAgICAgICBpdHhuX2ZpZWxkIEZlZQogICAgICAgIGIgZW5zdXJlX2J1ZGdldF9zd2l0Y2hfY2FzZV9uZXh0QDYKCmVuc3VyZV9idWRnZXRfc3dpdGNoX2Nhc2VfMUA0OgogICAgICAgIGdsb2JhbCBNaW5UeG5GZWUKICAgICAgICBpdHhuX2ZpZWxkIEZlZQoKZW5zdXJlX2J1ZGdldF9zd2l0Y2hfY2FzZV9uZXh0QDY6CiAgICAgICAgaXR4bl9zdWJtaXQKICAgICAgICBiIGVuc3VyZV9idWRnZXRfd2hpbGVfdG9wQDEKCmVuc3VyZV9idWRnZXRfYWZ0ZXJfd2hpbGVANzoKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy52b3Rpbmcudm90aW5nLmdldF92b3RlX2Zyb21fYm94KGluZGV4IzA6IHVpbnQ2NCkgLT4gdWludDY0OgpnZXRfdm90ZV9mcm9tX2JveDoKICAgICAgICBwcm90byAxIDEKCmdldF92b3RlX2Zyb21fYm94X2Jsb2NrQDA6CiAgICAgICAgYnl0ZSAiViIKICAgICAgICBib3hfZ2V0CiAgICAgICAgYXNzZXJ0IC8vIEJveCBub3QgY3JlYXRlZAogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGludCA4CiAgICAgICAgZXh0cmFjdDMKICAgICAgICBidG9pCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudm90aW5nLnZvdGluZy5Wb3RpbmdSb3VuZEFwcC5nZXRfcHJlY29uZGl0aW9ucyhzaWduYXR1cmUjMDogYnl0ZXMpIC0+IGJ5dGVzOgpnZXRfcHJlY29uZGl0aW9uczoKICAgICAgICBwcm90byAxIDEKCmdldF9wcmVjb25kaXRpb25zX2Jsb2NrQDA6CiAgICAgICAgY2FsbHN1YiB2b3Rpbmdfb3BlbgogICAgICAgIGl0b2IKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBsZW4KICAgICAgICBkdXAKICAgICAgICBzd2FwCiAgICAgICAgaW50IDIKICAgICAgICA+CiAgICAgICAgYnogZ2V0X3ByZWNvbmRpdGlvbnNfdGVybmFyeV9mYWxzZUAyCgpnZXRfcHJlY29uZGl0aW9uc190ZXJuYXJ5X3RydWVAMToKICAgICAgICBpbnQgMgogICAgICAgIGIgZ2V0X3ByZWNvbmRpdGlvbnNfdGVybmFyeV9tZXJnZUAzCgpnZXRfcHJlY29uZGl0aW9uc190ZXJuYXJ5X2ZhbHNlQDI6CiAgICAgICAgZnJhbWVfZGlnIDEKCmdldF9wcmVjb25kaXRpb25zX3Rlcm5hcnlfbWVyZ2VAMzoKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBsZW4KICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBjb3ZlciAyCiAgICAgICAgc3Vic3RyaW5nMwogICAgICAgIGNhbGxzdWIgYWxsb3dlZF90b192b3RlCiAgICAgICAgaXRvYgogICAgICAgIGNhbGxzdWIgYWxyZWFkeV92b3RlZAogICAgICAgIGl0b2IKICAgICAgICBnbG9iYWwgTGF0ZXN0VGltZXN0YW1wCiAgICAgICAgaXRvYgogICAgICAgIGZyYW1lX2RpZyAwCiAgICAgICAgdW5jb3ZlciAzCiAgICAgICAgY29uY2F0CiAgICAgICAgdW5jb3ZlciAyCiAgICAgICAgY29uY2F0CiAgICAgICAgc3dhcAogICAgICAgIGNvbmNhdAogICAgICAgIGZyYW1lX2J1cnkgMAogICAgICAgIHJldHN1YgoKCi8vIGV4YW1wbGVzLnZvdGluZy52b3RpbmcuVm90aW5nUm91bmRBcHAudm90aW5nX29wZW4oKSAtPiB1aW50NjQ6CnZvdGluZ19vcGVuOgogICAgICAgIHByb3RvIDAgMQogICAgICAgIGJ5dGUgIiIKCnZvdGluZ19vcGVuX2Jsb2NrQDA6CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJpc19ib290c3RyYXBwZWQiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgYnogdm90aW5nX29wZW5fYm9vbF9mYWxzZUA1Cgp2b3Rpbmdfb3Blbl9hbmRfY29udGRAMToKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgImNsb3NlX3RpbWUiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgYm56IHZvdGluZ19vcGVuX2Jvb2xfZmFsc2VANQoKdm90aW5nX29wZW5fYW5kX2NvbnRkQDI6CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJzdGFydF90aW1lIgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIGdsb2JhbCBMYXRlc3RUaW1lc3RhbXAKICAgICAgICBkdXAKICAgICAgICBmcmFtZV9idXJ5IDAKICAgICAgICA8PQogICAgICAgIGJ6IHZvdGluZ19vcGVuX2Jvb2xfZmFsc2VANQoKdm90aW5nX29wZW5fYW5kX2NvbnRkQDM6CiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJlbmRfdGltZSIKICAgICAgICBhcHBfZ2xvYmFsX2dldF9leAogICAgICAgIGFzc2VydCAvLyBjaGVjayB2YWx1ZSBleGlzdHMKICAgICAgICBmcmFtZV9kaWcgMAogICAgICAgID49CiAgICAgICAgYnogdm90aW5nX29wZW5fYm9vbF9mYWxzZUA1Cgp2b3Rpbmdfb3Blbl9ib29sX3RydWVANDoKICAgICAgICBpbnQgMQogICAgICAgIGIgdm90aW5nX29wZW5fYm9vbF9tZXJnZUA2Cgp2b3Rpbmdfb3Blbl9ib29sX2ZhbHNlQDU6CiAgICAgICAgaW50IDAKCnZvdGluZ19vcGVuX2Jvb2xfbWVyZ2VANjoKICAgICAgICBzd2FwCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudm90aW5nLnZvdGluZy5Wb3RpbmdSb3VuZEFwcC5hbGxvd2VkX3RvX3ZvdGUoc2lnbmF0dXJlIzA6IGJ5dGVzKSAtPiB1aW50NjQ6CmFsbG93ZWRfdG9fdm90ZToKICAgICAgICBwcm90byAxIDEKCmFsbG93ZWRfdG9fdm90ZV9ibG9ja0AwOgogICAgICAgIGludCAyMDAwCiAgICAgICAgaW50IDIKICAgICAgICBjYWxsc3ViIGVuc3VyZV9idWRnZXQKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgaW50IDAKICAgICAgICBieXRlICJzbmFwc2hvdF9wdWJsaWNfa2V5IgogICAgICAgIGFwcF9nbG9iYWxfZ2V0X2V4CiAgICAgICAgYXNzZXJ0IC8vIGNoZWNrIHZhbHVlIGV4aXN0cwogICAgICAgIHN3YXAKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICB1bmNvdmVyIDIKICAgICAgICBlZDI1NTE5dmVyaWZ5X2JhcmUKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy52b3Rpbmcudm90aW5nLlZvdGluZ1JvdW5kQXBwLmFscmVhZHlfdm90ZWQoKSAtPiB1aW50NjQ6CmFscmVhZHlfdm90ZWQ6CiAgICAgICAgcHJvdG8gMCAxCgphbHJlYWR5X3ZvdGVkX2Jsb2NrQDA6CiAgICAgICAgdHhuIFNlbmRlcgogICAgICAgIGJveF9nZXQKICAgICAgICBzd2FwCiAgICAgICAgcG9wCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudm90aW5nLnZvdGluZy5Wb3RpbmdSb3VuZEFwcC52b3RlKGZ1bmRfbWluX2JhbF9yZXEjMDogdWludDY0LCBzaWduYXR1cmUjMDogYnl0ZXMsIGFuc3dlcl9pZHMjMDogYnl0ZXMpIC0+IHZvaWQ6CnZvdGU6CiAgICAgICAgcHJvdG8gMyAwCiAgICAgICAgYnl0ZSAiIgogICAgICAgIGR1cG4gMgoKdm90ZV9ibG9ja0AwOgogICAgICAgIGludCA3NzAwCiAgICAgICAgaW50IDAKICAgICAgICBjYWxsc3ViIGVuc3VyZV9idWRnZXQKICAgICAgICBmcmFtZV9kaWcgLTIKICAgICAgICBsZW4KICAgICAgICBkdXAKICAgICAgICBzd2FwCiAgICAgICAgaW50IDIKICAgICAgICA+CiAgICAgICAgYnogdm90ZV90ZXJuYXJ5X2ZhbHNlQDIKCnZvdGVfdGVybmFyeV90cnVlQDE6CiAgICAgICAgaW50IDIKICAgICAgICBiIHZvdGVfdGVybmFyeV9tZXJnZUAzCgp2b3RlX3Rlcm5hcnlfZmFsc2VAMjoKICAgICAgICBmcmFtZV9kaWcgMwoKdm90ZV90ZXJuYXJ5X21lcmdlQDM6CiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgbGVuCiAgICAgICAgZnJhbWVfZGlnIC0yCiAgICAgICAgY292ZXIgMgogICAgICAgIHN1YnN0cmluZzMKICAgICAgICBjYWxsc3ViIGFsbG93ZWRfdG9fdm90ZQogICAgICAgIGFzc2VydCAvLyBOb3QgYWxsb3dlZCB0byB2b3RlCiAgICAgICAgY2FsbHN1YiB2b3Rpbmdfb3BlbgogICAgICAgIGFzc2VydCAvLyBWb3Rpbmcgbm90IG9wZW4KICAgICAgICBjYWxsc3ViIGFscmVhZHlfdm90ZWQKICAgICAgICAhCiAgICAgICAgYXNzZXJ0IC8vIEFscmVhZHkgdm90ZWQKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgIm9wdGlvbl9jb3VudHMiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgaW50IDAKICAgICAgICBleHRyYWN0X3VpbnQxNgogICAgICAgIGR1cAogICAgICAgIGZyYW1lX2J1cnkgMgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIGludCAwCiAgICAgICAgZXh0cmFjdF91aW50MTYKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBOdW1iZXIgb2YgYW5zd2VycyBpbmNvcnJlY3QKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBpbnQgMAogICAgICAgIGV4dHJhY3RfdWludDE2CiAgICAgICAgaW50IDM0CiAgICAgICAgKwogICAgICAgIGludCA0MDAKICAgICAgICAqCiAgICAgICAgaW50IDI1MDAKICAgICAgICArCiAgICAgICAgZnJhbWVfZGlnIC0zCiAgICAgICAgZ3R4bnMgUmVjZWl2ZXIKICAgICAgICBnbG9iYWwgQ3VycmVudEFwcGxpY2F0aW9uQWRkcmVzcwogICAgICAgID09CiAgICAgICAgYXNzZXJ0IC8vIFBheW1lbnQgbXVzdCBiZSB0byBhcHAgYWRkcmVzcwogICAgICAgIGR1cAogICAgICAgIGl0b2IKICAgICAgICBsb2cKICAgICAgICBmcmFtZV9kaWcgLTMKICAgICAgICBndHhucyBBbW91bnQKICAgICAgICA9PQogICAgICAgIGFzc2VydCAvLyBQYXltZW50IG11c3QgYmUgdGhlIGV4YWN0IG1pbiBiYWxhbmNlCiAgICAgICAgaW50IDAKICAgICAgICBmcmFtZV9idXJ5IDAKICAgICAgICBpbnQgMAogICAgICAgIGZyYW1lX2J1cnkgMQoKdm90ZV9mb3JfaGVhZGVyQDQ6CiAgICAgICAgZnJhbWVfZGlnIDEKICAgICAgICBmcmFtZV9kaWcgMgogICAgICAgIDwKICAgICAgICBieiB2b3RlX2FmdGVyX2ZvckA3Cgp2b3RlX2Zvcl9ib2R5QDU6CiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgaW50IDAKICAgICAgICBleHRyYWN0X3VpbnQxNgogICAgICAgIGZyYW1lX2RpZyAxCiAgICAgICAgZHVwCiAgICAgICAgY292ZXIgMgogICAgICAgID4KICAgICAgICBhc3NlcnQgLy8gSW5kZXggYWNjZXNzIGlzIG91dCBvZiBib3VuZHMKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBleHRyYWN0IDIgMAogICAgICAgIGRpZyAxCiAgICAgICAgaW50IDEKICAgICAgICBleHRyYWN0MwogICAgICAgIHN3YXAKICAgICAgICBpbnQgMAogICAgICAgIGJ5dGUgIm9wdGlvbl9jb3VudHMiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgZHVwCiAgICAgICAgaW50IDAKICAgICAgICBleHRyYWN0X3VpbnQxNgogICAgICAgIGRpZyAyCiAgICAgICAgPgogICAgICAgIGFzc2VydCAvLyBJbmRleCBhY2Nlc3MgaXMgb3V0IG9mIGJvdW5kcwogICAgICAgIGV4dHJhY3QgMiAwCiAgICAgICAgZGlnIDEKICAgICAgICBpbnQgMQogICAgICAgIGV4dHJhY3QzCiAgICAgICAgZGlnIDIKICAgICAgICBidG9pCiAgICAgICAgc3dhcAogICAgICAgIGR1cAogICAgICAgIGJ0b2kKICAgICAgICB1bmNvdmVyIDIKICAgICAgICA+CiAgICAgICAgYXNzZXJ0IC8vIEFuc3dlciBvcHRpb24gaW5kZXggaW52YWxpZAogICAgICAgIHVuY292ZXIgMgogICAgICAgIGJ0b2kKICAgICAgICBmcmFtZV9kaWcgMAogICAgICAgIGR1cAogICAgICAgIGNvdmVyIDIKICAgICAgICArCiAgICAgICAgY2FsbHN1YiBpbmNyZW1lbnRfdm90ZV9pbl9ib3gKICAgICAgICBzd2FwCiAgICAgICAgYnRvaQogICAgICAgICsKICAgICAgICBmcmFtZV9idXJ5IDAKICAgICAgICB0eG4gU2VuZGVyCiAgICAgICAgZnJhbWVfZGlnIC0xCiAgICAgICAgYm94X3B1dAogICAgICAgIGludCAwCiAgICAgICAgYnl0ZSAidm90ZXJfY291bnQiCiAgICAgICAgYXBwX2dsb2JhbF9nZXRfZXgKICAgICAgICBhc3NlcnQgLy8gY2hlY2sgdmFsdWUgZXhpc3RzCiAgICAgICAgaW50IDEKICAgICAgICArCiAgICAgICAgYnl0ZSAidm90ZXJfY291bnQiCiAgICAgICAgc3dhcAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgaW50IDEKICAgICAgICArCiAgICAgICAgZnJhbWVfYnVyeSAxCiAgICAgICAgYiB2b3RlX2Zvcl9oZWFkZXJANAoKdm90ZV9hZnRlcl9mb3JANzoKICAgICAgICByZXRzdWIKCgovLyBleGFtcGxlcy52b3Rpbmcudm90aW5nLmluY3JlbWVudF92b3RlX2luX2JveChpbmRleCMwOiB1aW50NjQpIC0+IHZvaWQ6CmluY3JlbWVudF92b3RlX2luX2JveDoKICAgICAgICBwcm90byAxIDAKCmluY3JlbWVudF92b3RlX2luX2JveF9ibG9ja0AwOgogICAgICAgIGJ5dGUgIlYiCiAgICAgICAgYm94X2dldAogICAgICAgIGFzc2VydCAvLyBCb3ggbm90IGNyZWF0ZWQKICAgICAgICBmcmFtZV9kaWcgLTEKICAgICAgICBpbnQgOAogICAgICAgIGV4dHJhY3QzCiAgICAgICAgYnRvaQogICAgICAgIGludCAxCiAgICAgICAgKwogICAgICAgIGl0b2IKICAgICAgICBieXRlICJWIgogICAgICAgIGZyYW1lX2RpZyAtMQogICAgICAgIHVuY292ZXIgMgogICAgICAgIGJveF9yZXBsYWNlCiAgICAgICAgcmV0c3ViCgoKLy8gZXhhbXBsZXMudm90aW5nLnZvdGluZy5Wb3RpbmdSb3VuZEFwcC5fX2luaXRfXygpIC0+IHZvaWQ6Cl9faW5pdF9fOgogICAgICAgIHByb3RvIDAgMAoKX19pbml0X19fYmxvY2tAMDoKICAgICAgICBieXRlICJpc19ib290c3RyYXBwZWQiCiAgICAgICAgaW50IDAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGJ5dGUgInZvdGVyX2NvdW50IgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJjbG9zZV90aW1lIgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJuZnRfYXNzZXRfaWQiCiAgICAgICAgaW50IDAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGJ5dGUgInNuYXBzaG90X3B1YmxpY19rZXkiCiAgICAgICAgYnl0ZSAiIgogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgYnl0ZSAidm90ZV9pZCIKICAgICAgICBieXRlICIiCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJtZXRhZGF0YV9pcGZzX2NpZCIKICAgICAgICBieXRlICIiCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJzdGFydF90aW1lIgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJlbmRfdGltZSIKICAgICAgICBpbnQgMAogICAgICAgIGFwcF9nbG9iYWxfcHV0CiAgICAgICAgYnl0ZSAicXVvcnVtIgogICAgICAgIGludCAwCiAgICAgICAgYXBwX2dsb2JhbF9wdXQKICAgICAgICBieXRlICJuZnRfaW1hZ2VfdXJsIgogICAgICAgIGJ5dGUgIiIKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGJ5dGUgIm9wdGlvbl9jb3VudHMiCiAgICAgICAgYnl0ZSAweDAwMDAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIGJ5dGUgInRvdGFsX29wdGlvbnMiCiAgICAgICAgaW50IDAKICAgICAgICBhcHBfZ2xvYmFsX3B1dAogICAgICAgIHJldHN1YgoK", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDgKCi8vIGV4YW1wbGVzLnZvdGluZy52b3RpbmcuVm90aW5nUm91bmRBcHAuY2xlYXJfc3RhdGVfcHJvZ3JhbSgpIC0+IHVpbnQ2NDoKbWFpbl9ibG9ja0AwOgogICAgICAgIGludCAxCiAgICAgICAgcmV0dXJuCgo=" + }, + "state": { + "global": { + "num_byte_slices": 5, + "num_uints": 8 + }, + "local": { + "num_byte_slices": 0, + "num_uints": 0 + } + }, + "schema": { + "global": { + "declared": { + "close_time": { + "type": "uint64", + "key": "close_time" + }, + "end_time": { + "type": "uint64", + "key": "end_time" + }, + "is_bootstrapped": { + "type": "uint64", + "key": "is_bootstrapped" + }, + "metadata_ipfs_cid": { + "type": "bytes", + "key": "metadata_ipfs_cid" + }, + "nft_asset_id": { + "type": "uint64", + "key": "nft_asset_id" + }, + "nft_image_url": { + "type": "bytes", + "key": "nft_image_url" + }, + "option_counts": { + "type": "bytes", + "key": "option_counts" + }, + "quorum": { + "type": "uint64", + "key": "quorum" + }, + "snapshot_public_key": { + "type": "bytes", + "key": "snapshot_public_key" + }, + "start_time": { + "type": "uint64", + "key": "start_time" + }, + "total_options": { + "type": "uint64", + "key": "total_options" + }, + "vote_id": { + "type": "bytes", + "key": "vote_id" + }, + "voter_count": { + "type": "uint64", + "key": "voter_count" + } + }, + "reserved": {} + }, + "local": { + "declared": {}, + "reserved": {} + } + }, + "contract": { + "name": "VotingRoundApp", + "methods": [ + { + "name": "create", + "args": [ + { + "type": "string", + "name": "vote_id" + }, + { + "type": "byte[]", + "name": "snapshot_public_key" + }, + { + "type": "string", + "name": "metadata_ipfs_cid" + }, + { + "type": "uint64", + "name": "start_time" + }, + { + "type": "uint64", + "name": "end_time" + }, + { + "type": "uint8[]", + "name": "option_counts" + }, + { + "type": "uint64", + "name": "quorum" + }, + { + "type": "string", + "name": "nft_image_url" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "bootstrap", + "args": [ + { + "type": "pay", + "name": "fund_min_bal_req" + } + ], + "returns": { + "type": "void" + } + }, + { + "name": "close", + "args": [], + "returns": { + "type": "void" + } + }, + { + "name": "get_preconditions", + "args": [ + { + "type": "byte[]", + "name": "signature" + } + ], + "returns": { + "type": "(uint64,uint64,uint64,uint64)" + } + }, + { + "name": "vote", + "args": [ + { + "type": "pay", + "name": "fund_min_bal_req" + }, + { + "type": "byte[]", + "name": "signature" + }, + { + "type": "uint8[]", + "name": "answer_ids" + } + ], + "returns": { + "type": "void" + } + } + ], + "networks": {} + }, + "bare_call_config": {} +} \ No newline at end of file diff --git a/examples/voting/out/voting.approval.debug.teal b/examples/voting/out/voting.approval.debug.teal new file mode 100644 index 0000000000..8adef9023c --- /dev/null +++ b/examples/voting/out/voting.approval.debug.teal @@ -0,0 +1,960 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + bz main_after_if_else@11 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + // Implicit fall through to main_abi_routing@3 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void"> arc4.abimethod(create=True) File "voting/voting.py", line 72 + method "bootstrap(pay)void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void"> arc4.abimethod() File "voting/voting.py", line 98 + method "close()void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void"> arc4.abimethod() File "voting/voting.py", line 122 + method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void">,method<"get_preconditions(byte[])(uint64,uint64,uint64,uint64)"> arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + method "vote(pay,byte[],uint8[])void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void">,method<"get_preconditions(byte[])(uint64,uint64,uint64,uint64)">,method<"vote(pay,byte[],uint8[])void"> arc4.abimethod() File "voting/voting.py", line 180 + uncover 5 // load tmp%2#0 from l-stack (no copy) method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void">,method<"get_preconditions(byte[])(uint64,uint64,uint64,uint64)">,method<"vote(pay,byte[],uint8[])void">,tmp%2#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + match main_create_route@4 main_bootstrap_route@5 main_close_route@6 main_get_preconditions_route@7 main_vote_route@8 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + b main_after_if_else@11 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + +main_create_route@4: + txn OnCompletion // {txn} arc4.abimethod(create=True) File "voting/voting.py", line 72 + ! // {!} arc4.abimethod(create=True) File "voting/voting.py", line 72 + assert // OnCompletion is NoOp // arc4.abimethod(create=True) File "voting/voting.py", line 72 + txn ApplicationID // {txn} arc4.abimethod(create=True) File "voting/voting.py", line 72 + ! // {!} arc4.abimethod(create=True) File "voting/voting.py", line 72 + assert // is creating // arc4.abimethod(create=True) File "voting/voting.py", line 72 + txna ApplicationArgs 1 // {txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 2 // tmp%7#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 3 // tmp%7#0,tmp%8#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 4 // tmp%7#0,tmp%8#0,tmp%9#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 5 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 6 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,tmp%11#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 7 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,tmp%11#0,tmp%12#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 8 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,tmp%11#0,tmp%12#0,tmp%13#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub create // arc4.abimethod(create=True) File "voting/voting.py", line 72 + int 1 // 1 arc4.abimethod(create=True) File "voting/voting.py", line 72 + return // arc4.abimethod(create=True) File "voting/voting.py", line 72 + +main_bootstrap_route@5: + txn OnCompletion // {txn} arc4.abimethod() File "voting/voting.py", line 98 + ! // {!} arc4.abimethod() File "voting/voting.py", line 98 + assert // OnCompletion is NoOp // arc4.abimethod() File "voting/voting.py", line 98 + txn ApplicationID // {txn} arc4.abimethod() File "voting/voting.py", line 98 + assert // is not creating // arc4.abimethod() File "voting/voting.py", line 98 + txn GroupIndex // {txn} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int 1 // tmp%20#0,1 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + - // {-} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + dup // load awst_tmp%21#0 from l-stack (copy) awst_tmp%21#0,awst_tmp%21#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + gtxns TypeEnum // awst_tmp%21#0,{gtxns} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int pay // awst_tmp%21#0,tmp%22#0,pay class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + == // awst_tmp%21#0,{==} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + assert // transaction type is pay // awst_tmp%21#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub bootstrap // arc4.abimethod() File "voting/voting.py", line 98 + int 1 // 1 arc4.abimethod() File "voting/voting.py", line 98 + return // arc4.abimethod() File "voting/voting.py", line 98 + +main_close_route@6: + txn OnCompletion // {txn} arc4.abimethod() File "voting/voting.py", line 122 + ! // {!} arc4.abimethod() File "voting/voting.py", line 122 + assert // OnCompletion is NoOp // arc4.abimethod() File "voting/voting.py", line 122 + txn ApplicationID // {txn} arc4.abimethod() File "voting/voting.py", line 122 + assert // is not creating // arc4.abimethod() File "voting/voting.py", line 122 + callsub close // arc4.abimethod() File "voting/voting.py", line 122 + int 1 // 1 arc4.abimethod() File "voting/voting.py", line 122 + return // arc4.abimethod() File "voting/voting.py", line 122 + +main_get_preconditions_route@7: + txn OnCompletion // {txn} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + ! // {!} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + txn ApplicationID // {txn} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + assert // is not creating // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + txna ApplicationArgs 1 // {txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub get_preconditions // {get_preconditions} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + byte 0x151f7c75 // tmp%31#0,0x151f7c75 arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + swap // load tmp%31#0 from l-stack (no copy) 0x151f7c75,tmp%31#0 arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + concat // {concat} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + log // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + int 1 // 1 arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + return // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + +main_vote_route@8: + txn OnCompletion // {txn} arc4.abimethod() File "voting/voting.py", line 180 + ! // {!} arc4.abimethod() File "voting/voting.py", line 180 + assert // OnCompletion is NoOp // arc4.abimethod() File "voting/voting.py", line 180 + txn ApplicationID // {txn} arc4.abimethod() File "voting/voting.py", line 180 + assert // is not creating // arc4.abimethod() File "voting/voting.py", line 180 + txn GroupIndex // {txn} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int 1 // tmp%38#0,1 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + - // {-} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + dup // load awst_tmp%21#0 from l-stack (copy) awst_tmp%21#0,awst_tmp%21#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + gtxns TypeEnum // awst_tmp%21#0,{gtxns} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int pay // awst_tmp%21#0,tmp%39#0,pay class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + == // awst_tmp%21#0,{==} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + assert // transaction type is pay // awst_tmp%21#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 1 // awst_tmp%21#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 2 // awst_tmp%21#0,tmp%41#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub vote // arc4.abimethod() File "voting/voting.py", line 180 + int 1 // 1 arc4.abimethod() File "voting/voting.py", line 180 + return // arc4.abimethod() File "voting/voting.py", line 180 + +main_after_if_else@11: + err // reject transaction // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + + +// examples.voting.voting.VotingRoundApp.create(vote_id#0: bytes, snapshot_public_key#0: bytes, metadata_ipfs_cid#0: bytes, start_time#0: bytes, end_time#0: bytes, option_counts#0: bytes, quorum#0: bytes, nft_image_url#0: bytes) -> void: +create: + proto 8 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | def create( File "voting/voting.py", line 73 + +create_block@0: + frame_dig -5 // load start_time#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | start_time#0 start_time: arc4.UInt64 File "voting/voting.py", line 78 + btoi // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | {btoi} start_time.decode() File "voting/voting.py", line 84 + dup // store st#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | st#0,st#0 st File "voting/voting.py", line 84 + swap // store st#0 to f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0 st File "voting/voting.py", line 84 + frame_dig -4 // load end_time#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0,end_time#0 end_time: arc4.UInt64 File "voting/voting.py", line 79 + btoi // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0,{btoi} end_time.decode() File "voting/voting.py", line 85 + dup // store et#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0,et#0,et#0 et File "voting/voting.py", line 85 + cover 2 // store et#0 to f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | st#0,et#0 et File "voting/voting.py", line 85 + dup + cover 2 // store et#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0,st#0,et#0 et File "voting/voting.py", line 85 + < // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0,{<} st < et, "End time should be after start time" File "voting/voting.py", line 86 + assert // End time should be after start time // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0 assert st < et, "End time should be after start time" File "voting/voting.py", line 86 + global LatestTimestamp // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0,{global} Global.latest_timestamp() File "voting/voting.py", line 87 + >= // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | {>=} et >= Global.latest_timestamp(), "End time should be in the future" File "voting/voting.py", line 87 + assert // End time should be in the future // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | assert et >= Global.latest_timestamp(), "End time should be in the future" File "voting/voting.py", line 87 + frame_dig -8 // load vote_id#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | vote_id#0 vote_id: arc4.String File "voting/voting.py", line 75 + extract 2 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | {extract} vote_id.decode() File "voting/voting.py", line 89 + byte "vote_id" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | new_state_value%3#0,"vote_id" self.vote_id File "voting/voting.py", line 89 + swap // load new_state_value%3#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | "vote_id",new_state_value%3#0 vote_id.decode() File "voting/voting.py", line 89 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | self.vote_id = vote_id.decode() File "voting/voting.py", line 89 + frame_dig -7 // load snapshot_public_key#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | snapshot_public_key#0 snapshot_public_key: arc4.DynamicBytes File "voting/voting.py", line 76 + len // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | {len} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + dup // store awst_tmp%4#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | awst_tmp%4#0,awst_tmp%4#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + swap // store awst_tmp%4#0 to f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | awst_tmp%4#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + int 2 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | awst_tmp%4#0,2 2 File "voting/voting.py", line 90 + > // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {>} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + bz create_ternary_false@2 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + // Implicit fall through to create_ternary_true@1 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + +create_ternary_true@1: + int 2 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | 2 2 File "voting/voting.py", line 90 + b create_ternary_merge@3 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +create_ternary_false@2: + frame_dig 2 // load awst_tmp%4#0 from f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | awst_tmp%4#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + // Implicit fall through to create_ternary_merge@3 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +create_ternary_merge@3: + frame_dig -7 // load snapshot_public_key#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | snapshot_public_key#0 ternary_result%6#0 snapshot_public_key: arc4.DynamicBytes File "voting/voting.py", line 76 + len // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | {len} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + frame_dig -7 // load snapshot_public_key#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | base_length%7#0,snapshot_public_key#0 snapshot_public_key: arc4.DynamicBytes File "voting/voting.py", line 76 + cover 2 // virtual: 2 ops (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | snapshot_public_key#0,ternary_result%6#0,base_length%7#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + substring3 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {substring3} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + byte "snapshot_public_key" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%8#0,"snapshot_public_key" self.snapshot_public_key File "voting/voting.py", line 90 + swap // load new_state_value%8#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "snapshot_public_key",new_state_value%8#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.snapshot_public_key = snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + frame_dig -6 // load metadata_ipfs_cid#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | metadata_ipfs_cid#0 metadata_ipfs_cid: arc4.String File "voting/voting.py", line 77 + extract 2 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {extract} metadata_ipfs_cid.decode() File "voting/voting.py", line 91 + byte "metadata_ipfs_cid" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%9#0,"metadata_ipfs_cid" self.metadata_ipfs_cid File "voting/voting.py", line 91 + swap // load new_state_value%9#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "metadata_ipfs_cid",new_state_value%9#0 metadata_ipfs_cid.decode() File "voting/voting.py", line 91 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.metadata_ipfs_cid = metadata_ipfs_cid.decode() File "voting/voting.py", line 91 + byte "start_time" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "start_time" self.start_time File "voting/voting.py", line 92 + frame_dig 0 // load st#0 from f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "start_time",st#0 st File "voting/voting.py", line 84 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.start_time = st File "voting/voting.py", line 92 + byte "end_time" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "end_time" self.end_time File "voting/voting.py", line 93 + frame_dig 1 // load et#0 from f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "end_time",et#0 et File "voting/voting.py", line 85 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.end_time = et File "voting/voting.py", line 93 + frame_dig -2 // load quorum#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | quorum#0 quorum: arc4.UInt64 File "voting/voting.py", line 81 + btoi // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {btoi} quorum.decode() File "voting/voting.py", line 94 + byte "quorum" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%10#0,"quorum" self.quorum File "voting/voting.py", line 94 + swap // load new_state_value%10#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "quorum",new_state_value%10#0 quorum.decode() File "voting/voting.py", line 94 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.quorum = quorum.decode() File "voting/voting.py", line 94 + frame_dig -1 // load nft_image_url#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | nft_image_url#0 nft_image_url: arc4.String File "voting/voting.py", line 82 + extract 2 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {extract} nft_image_url.decode() File "voting/voting.py", line 95 + byte "nft_image_url" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%11#0,"nft_image_url" self.nft_image_url File "voting/voting.py", line 95 + swap // load new_state_value%11#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "nft_image_url",new_state_value%11#0 nft_image_url.decode() File "voting/voting.py", line 95 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.nft_image_url = nft_image_url.decode() File "voting/voting.py", line 95 + frame_dig -3 // load option_counts#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 80 + callsub store_option_counts // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.store_option_counts(option_counts) File "voting/voting.py", line 96 + retsub // + + +// examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0: bytes) -> void: +store_option_counts: + proto 1 0 // (𝕡) option_counts#0 | def store_option_counts(self, option_counts: VoteIndexArray) -> None: File "voting/voting.py", line 233 + +store_option_counts_block@0: + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + int 0 // (𝕡) option_counts#0 | option_counts#0,0 option_counts.length File "voting/voting.py", line 234 + extract_uint16 // (𝕡) option_counts#0 | {extract_uint16} option_counts.length File "voting/voting.py", line 234 + assert // option_counts should be non-empty // (𝕡) option_counts#0 | assert option_counts.length, "option_counts should be non-empty" File "voting/voting.py", line 234 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + int 0 // (𝕡) option_counts#0 | option_counts#0,0 option_counts.length File "voting/voting.py", line 236 + extract_uint16 // (𝕡) option_counts#0 | {extract_uint16} option_counts.length File "voting/voting.py", line 236 + int 112 // (𝕡) option_counts#0 | tmp%1#0,112 112 File "voting/voting.py", line 236 + <= // (𝕡) option_counts#0 | {<=} option_counts.length <= 112, "Can't have more than 112 questions" File "voting/voting.py", line 236 + assert // Can't have more than 112 questions // (𝕡) option_counts#0 | assert option_counts.length <= 112, "Can't have more than 112 questions" File "voting/voting.py", line 236 + byte "option_counts" // (𝕡) option_counts#0 | "option_counts" self.option_counts File "voting/voting.py", line 238 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | "option_counts",option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + app_global_put // (𝕡) option_counts#0 | self.option_counts = option_counts File "voting/voting.py", line 238 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + callsub calculate_total_options_count // (𝕡) option_counts#0 | {calculate_total_options_count} self.calculate_total_options_count(option_counts) File "voting/voting.py", line 240 + dup // load total_options#0 from l-stack (copy) (𝕡) option_counts#0 | total_options#0,total_options#0 total_options File "voting/voting.py", line 240 + int 128 // (𝕡) option_counts#0 | total_options#0,total_options#0,128 128 File "voting/voting.py", line 241 + <= // (𝕡) option_counts#0 | total_options#0,{<=} total_options <= 128, "Can't have more than 128 vote options" File "voting/voting.py", line 241 + assert // Can't have more than 128 vote options // (𝕡) option_counts#0 | total_options#0 assert total_options <= 128, "Can't have more than 128 vote options" File "voting/voting.py", line 241 + byte "total_options" // (𝕡) option_counts#0 | total_options#0,"total_options" self.total_options File "voting/voting.py", line 242 + swap // load total_options#0 from l-stack (no copy) (𝕡) option_counts#0 | "total_options",total_options#0 total_options File "voting/voting.py", line 240 + app_global_put // (𝕡) option_counts#0 | self.total_options = total_options File "voting/voting.py", line 242 + retsub // + + +// examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0: bytes) -> uint64: +calculate_total_options_count: + proto 1 1 // (𝕡) option_counts#0 | def calculate_total_options_count(self, option_counts: VoteIndexArray) -> UInt64: File "voting/voting.py", line 245 + +calculate_total_options_count_block@0: + int 0 // (𝕡) option_counts#0 | 0 0 File "voting/voting.py", line 246 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | (𝕗) total#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 245 + int 0 // (𝕡) option_counts#0 | (𝕗) total#0 | option_counts#0,0 for item in option_counts: File "voting/voting.py", line 247 + extract_uint16 // (𝕡) option_counts#0 | (𝕗) total#0 | {extract_uint16} for item in option_counts: File "voting/voting.py", line 247 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 245 + extract 2 0 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0 | {extract} for item in option_counts: File "voting/voting.py", line 247 + int 0 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0 | 0 + // Implicit fall through to calculate_total_options_count_for_header@1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | + +calculate_total_options_count_for_header@1: + frame_dig 3 // load item_index_internal%2#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0 + frame_dig 1 // load array_length%0#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,array_length%0#0 for item in option_counts: File "voting/voting.py", line 247 + < // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {<} for item in option_counts: File "voting/voting.py", line 247 + bz calculate_total_options_count_after_for@4 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | for item in option_counts: File "voting/voting.py", line 247 + // Implicit fall through to calculate_total_options_count_for_body@2 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | for item in option_counts: File "voting/voting.py", line 247 + +calculate_total_options_count_for_body@2: + frame_dig 2 // load array_value%1#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | array_value%1#0 for item in option_counts: File "voting/voting.py", line 247 + frame_dig 3 // load item_index_internal%2#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | array_value%1#0,item_index_internal%2#0 + dup + cover 2 // store item_index_internal%2#0 to l-stack (copy) (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,array_value%1#0,item_index_internal%2#0 + int 1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,array_value%1#0,item_index_internal%2#0,1 for item in option_counts: File "voting/voting.py", line 247 + extract3 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,{extract3} for item in option_counts: File "voting/voting.py", line 247 + btoi // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,{btoi} item.decode() File "voting/voting.py", line 248 + frame_dig 0 // load total#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,tmp%5#0,total#0 total File "voting/voting.py", line 246 + + // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,{+} total += item.decode() File "voting/voting.py", line 248 + frame_bury 0 // store total#0 to f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0 total File "voting/voting.py", line 246 + int 1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,1 + + // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {+} + frame_bury 3 // store item_index_internal%2#0 to f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | + b calculate_total_options_count_for_header@1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | + +calculate_total_options_count_after_for@4: + retsub // virtual: 2 ops total#0 total = UInt64(0) File "voting/voting.py", line 246 + + +// examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req#0: uint64) -> void: +bootstrap: + proto 1 0 // (𝕡) fund_min_bal_req#0 | def bootstrap(self, fund_min_bal_req: PaymentTransaction) -> None: File "voting/voting.py", line 99 + +bootstrap_block@0: + int 0 // (𝕡) fund_min_bal_req#0 | 0 self.is_bootstrapped File "voting/voting.py", line 100 + byte "is_bootstrapped" // (𝕡) fund_min_bal_req#0 | 0,"is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 100 + app_global_get_ex // (𝕡) fund_min_bal_req#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.is_bootstrapped File "voting/voting.py", line 100 + assert // check value exists // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%0#0 self.is_bootstrapped File "voting/voting.py", line 100 + ! // (𝕡) fund_min_bal_req#0 | {!} not self.is_bootstrapped File "voting/voting.py", line 100 + assert // Must not be already bootstrapped // (𝕡) fund_min_bal_req#0 | assert not self.is_bootstrapped, "Must not be already bootstrapped" File "voting/voting.py", line 100 + byte "is_bootstrapped" // (𝕡) fund_min_bal_req#0 | "is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 101 + int 1 // (𝕡) fund_min_bal_req#0 | "is_bootstrapped",1 True File "voting/voting.py", line 101 + app_global_put // (𝕡) fund_min_bal_req#0 | self.is_bootstrapped = True File "voting/voting.py", line 101 + int 0 // (𝕡) fund_min_bal_req#0 | 0 self.total_options File "voting/voting.py", line 107 + byte "total_options" // (𝕡) fund_min_bal_req#0 | 0,"total_options" self.total_options File "voting/voting.py", line 107 + app_global_get_ex // (𝕡) fund_min_bal_req#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.total_options File "voting/voting.py", line 107 + assert // check value exists // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%3#0 self.total_options File "voting/voting.py", line 107 + int 400 // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%3#0,400 BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 107 + * // (𝕡) fund_min_bal_req#0 | {*} self.total_options * BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 107 + int 8 // (𝕡) fund_min_bal_req#0 | tmp%5#0,8 8 File "voting/voting.py", line 103 + * // (𝕡) fund_min_bal_req#0 | {*} self.total_options * BOX_BYTE_MIN_BALANCE * bytes_per_option File "voting/voting.py", line 107 + int 2900 // (𝕡) fund_min_bal_req#0 | tmp%6#0,2900 BOX_FLAT_MIN_BALANCE File "voting/voting.py", line 105 + + // (𝕡) fund_min_bal_req#0 | {+} BOX_FLAT_MIN_BALANCE File "voting/voting.py", line 105 + int 201000 // (𝕡) fund_min_bal_req#0 | box_cost#0,201000 ASSET_MIN_BALANCE * 2 + 1000 File "voting/voting.py", line 110 + + // (𝕡) fund_min_bal_req#0 | {+} ASSET_MIN_BALANCE * 2 + 1000 + box_cost File "voting/voting.py", line 110 + frame_dig -1 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0 | min_balance_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 99 + gtxns Receiver // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{gtxns} fund_min_bal_req.receiver File "voting/voting.py", line 112 + global CurrentApplicationAddress // (𝕡) fund_min_bal_req#0 | min_balance_req#0,tmp%7#0,{global} Global.current_application_address() File "voting/voting.py", line 112 + == // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{==} fund_min_bal_req.receiver == Global.current_application_address() File "voting/voting.py", line 112 + assert // Payment must be to app address // (𝕡) fund_min_bal_req#0 | min_balance_req#0 assert ( File "voting/voting.py", line 111 + dup // load min_balance_req#0 from l-stack (copy) (𝕡) fund_min_bal_req#0 | min_balance_req#0,min_balance_req#0 min_balance_req File "voting/voting.py", line 110 + itob // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{itob} itob(min_balance_req) File "voting/voting.py", line 114 + log // (𝕡) fund_min_bal_req#0 | min_balance_req#0 log(itob(min_balance_req)) File "voting/voting.py", line 114 + frame_dig -1 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0 | min_balance_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 99 + gtxns Amount // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{gtxns} fund_min_bal_req.amount File "voting/voting.py", line 117 + == // (𝕡) fund_min_bal_req#0 | {==} fund_min_bal_req.amount == min_balance_req File "voting/voting.py", line 117 + assert // Payment must be for the exact min balance requirement // (𝕡) fund_min_bal_req#0 | assert ( File "voting/voting.py", line 116 + int 0 // (𝕡) fund_min_bal_req#0 | 0 self.total_options File "voting/voting.py", line 120 + byte "total_options" // (𝕡) fund_min_bal_req#0 | 0,"total_options" self.total_options File "voting/voting.py", line 120 + app_global_get_ex // (𝕡) fund_min_bal_req#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.total_options File "voting/voting.py", line 120 + assert // check value exists // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%13#0 self.total_options File "voting/voting.py", line 120 + int 8 // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%13#0,8 VOTE_COUNT_BYTES File "voting/voting.py", line 120 + * // (𝕡) fund_min_bal_req#0 | {*} self.total_options * VOTE_COUNT_BYTES File "voting/voting.py", line 120 + byte "V" // (𝕡) fund_min_bal_req#0 | tmp%15#0,"V" TALLY_BOX_KEY File "voting/voting.py", line 120 + swap // load tmp%15#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0 | "V",tmp%15#0 self.total_options * VOTE_COUNT_BYTES File "voting/voting.py", line 120 + box_create // (𝕡) fund_min_bal_req#0 | {box_create} Box.create(TALLY_BOX_KEY, self.total_options * VOTE_COUNT_BYTES) File "voting/voting.py", line 120 + assert // (𝕡) fund_min_bal_req#0 | assert Box.create(TALLY_BOX_KEY, self.total_options * VOTE_COUNT_BYTES) File "voting/voting.py", line 120 + retsub // + + +// examples.voting.voting.VotingRoundApp.close() -> void: +close: + proto 0 0 // def close(self) -> None: File "voting/voting.py", line 123 + byte "" + dupn 2 // allocate 3 to stack (𝕗) option_index#0,question_options#0,votes_for_option#0 | + +close_block@0: + int 20000 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | 20000 20000 File "voting/voting.py", line 124 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | 20000,0 OpUpFeeSource.GroupCredit File "voting/voting.py", line 124 + callsub ensure_budget // (𝕗) option_index#0,question_options#0,votes_for_option#0 | ensure_budget(20000, fee_source=OpUpFeeSource.GroupCredit) File "voting/voting.py", line 124 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | 0 self.close_time File "voting/voting.py", line 125 + byte "close_time" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | 0,"close_time" self.close_time File "voting/voting.py", line 125 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.close_time File "voting/voting.py", line 125 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0 | app_global_get_ex_value%0#0 self.close_time File "voting/voting.py", line 125 + ! // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {!} self.close_time == 0, "Already closed" File "voting/voting.py", line 125 + assert // Already closed // (𝕗) option_index#0,question_options#0,votes_for_option#0 | assert self.close_time == 0, "Already closed" File "voting/voting.py", line 125 + global LatestTimestamp // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {global} Global.latest_timestamp() File "voting/voting.py", line 126 + byte "close_time" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | new_state_value%3#0,"close_time" self.close_time File "voting/voting.py", line 126 + swap // load new_state_value%3#0 from l-stack (no copy) (𝕗) option_index#0,question_options#0,votes_for_option#0 | "close_time",new_state_value%3#0 Global.latest_timestamp() File "voting/voting.py", line 126 + app_global_put // (𝕗) option_index#0,question_options#0,votes_for_option#0 | self.close_time = Global.latest_timestamp() File "voting/voting.py", line 126 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | 0 self.vote_id File "voting/voting.py", line 131 + byte "vote_id" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | 0,"vote_id" self.vote_id File "voting/voting.py", line 131 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.vote_id File "voting/voting.py", line 131 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0 | app_global_get_ex_value%4#0 self.vote_id File "voting/voting.py", line 131 + byte "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " // (𝕗) option_index#0,question_options#0,votes_for_option#0 | app_global_get_ex_value%4#0,"{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " b'{"standard":"arc69",' File "voting/voting.py", line 129 + swap // load app_global_get_ex_value%4#0 from l-stack (no copy) (𝕗) option_index#0,question_options#0,votes_for_option#0 | "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID ",app_global_get_ex_value%4#0 self.vote_id File "voting/voting.py", line 131 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte ".\",\"properties\":{\"metadata\":\"ipfs://" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%6#0,".\",\"properties\":{\"metadata\":\"ipfs://" b'.","properties":{"metadata":"ipfs://' File "voting/voting.py", line 132 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%7#0,0 self.metadata_ipfs_cid File "voting/voting.py", line 133 + byte "metadata_ipfs_cid" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%7#0,0,"metadata_ipfs_cid" self.metadata_ipfs_cid File "voting/voting.py", line 133 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%7#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.metadata_ipfs_cid File "voting/voting.py", line 133 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%7#0,app_global_get_ex_value%8#0 self.metadata_ipfs_cid File "voting/voting.py", line 133 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte "\",\"id\":\"" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%10#0,"\",\"id\":\"" b'","id":"' File "voting/voting.py", line 134 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%11#0,0 self.vote_id File "voting/voting.py", line 135 + byte "vote_id" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%11#0,0,"vote_id" self.vote_id File "voting/voting.py", line 135 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%11#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.vote_id File "voting/voting.py", line 135 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%11#0,app_global_get_ex_value%12#0 self.vote_id File "voting/voting.py", line 135 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte "\",\"quorum\":" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%14#0,"\",\"quorum\":" b'","quorum":' File "voting/voting.py", line 136 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%15#0,0 self.quorum File "voting/voting.py", line 137 + byte "quorum" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%15#0,0,"quorum" self.quorum File "voting/voting.py", line 137 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%15#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.quorum File "voting/voting.py", line 137 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%15#0,app_global_get_ex_value%16#0 self.quorum File "voting/voting.py", line 137 + itob // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%15#0,{itob} itob(self.quorum) File "voting/voting.py", line 137 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte ",\"voterCount\":" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%19#0,",\"voterCount\":" b',"voterCount":' File "voting/voting.py", line 138 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%20#0,0 self.voter_count File "voting/voting.py", line 139 + byte "voter_count" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%20#0,0,"voter_count" self.voter_count File "voting/voting.py", line 139 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%20#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.voter_count File "voting/voting.py", line 139 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%20#0,app_global_get_ex_value%21#0 self.voter_count File "voting/voting.py", line 139 + itob // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%20#0,{itob} itob(self.voter_count) File "voting/voting.py", line 139 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte ",\"tallies\":[" // (𝕗) option_index#0,question_options#0,votes_for_option#0 | tmp%24#0,",\"tallies\":[" b',"tallies":[' File "voting/voting.py", line 140 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0 | 0 0 File "voting/voting.py", line 143 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0 | 0 self.option_counts File "voting/voting.py", line 144 + byte "option_counts" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0 | 0,"option_counts" self.option_counts File "voting/voting.py", line 144 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 144 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0 | app_global_get_ex_value%25#0 self.option_counts File "voting/voting.py", line 144 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0 | app_global_get_ex_value%25#0,0 self.option_counts.length File "voting/voting.py", line 144 + extract_uint16 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0 | {extract_uint16} self.option_counts.length File "voting/voting.py", line 144 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0 | 0 urange(self.option_counts.length) File "voting/voting.py", line 144 + // Implicit fall through to close_for_header@1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | + +close_for_header@1: + frame_dig 6 // load question_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0 question_index File "voting/voting.py", line 144 + frame_dig 5 // load tmp%27#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0,tmp%27#0 self.option_counts.length File "voting/voting.py", line 144 + < // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {<} urange(self.option_counts.length) File "voting/voting.py", line 144 + bz close_after_for@17 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | for question_index in urange(self.option_counts.length): File "voting/voting.py", line 144 + // Implicit fall through to close_for_body@2 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | for question_index in urange(self.option_counts.length): File "voting/voting.py", line 144 + +close_for_body@2: + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | 0 self.option_counts File "voting/voting.py", line 145 + byte "option_counts" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | 0,"option_counts" self.option_counts File "voting/voting.py", line 145 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 145 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | app_global_get_ex_value%30#0 self.option_counts File "voting/voting.py", line 145 + dup // load app_global_get_ex_value%30#0 from l-stack (copy) (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | app_global_get_ex_value%30#0,app_global_get_ex_value%30#0 self.option_counts File "voting/voting.py", line 145 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | app_global_get_ex_value%30#0,app_global_get_ex_value%30#0,0 self.option_counts[question_index] File "voting/voting.py", line 145 + extract_uint16 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | app_global_get_ex_value%30#0,{extract_uint16} self.option_counts[question_index] File "voting/voting.py", line 145 + frame_dig 6 // load question_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | app_global_get_ex_value%30#0,array_length%32#0,question_index#0 question_index File "voting/voting.py", line 144 + dup + cover 3 // store question_index#0 to l-stack (copy) (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0,app_global_get_ex_value%30#0,array_length%32#0,question_index#0 question_index File "voting/voting.py", line 144 + > // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0,app_global_get_ex_value%30#0,{>} self.option_counts[question_index] File "voting/voting.py", line 145 + assert // Index access is out of bounds // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0,app_global_get_ex_value%30#0 self.option_counts[question_index] File "voting/voting.py", line 145 + extract 2 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0,{extract} self.option_counts[question_index] File "voting/voting.py", line 145 + swap // load question_index#0 from l-stack (no copy) (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | array_data_sans_header%34#0,question_index#0 question_index File "voting/voting.py", line 144 + int 1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | array_data_sans_header%34#0,question_index#0,1 self.option_counts[question_index] File "voting/voting.py", line 145 + extract3 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {extract3} self.option_counts[question_index] File "voting/voting.py", line 145 + btoi // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {btoi} self.option_counts[question_index].decode() File "voting/voting.py", line 145 + frame_bury 1 // store question_options#0 to f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_options File "voting/voting.py", line 145 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | 0 urange(question_options) File "voting/voting.py", line 146 + frame_bury 0 // store option_index#0 to f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | option_index File "voting/voting.py", line 146 + // Implicit fall through to close_for_header@3 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | + +close_for_header@3: + frame_dig 0 // load option_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | option_index#0 option_index File "voting/voting.py", line 146 + frame_dig 1 // load question_options#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | option_index#0,question_options#0 question_options File "voting/voting.py", line 145 + < // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {<} urange(question_options) File "voting/voting.py", line 146 + bz close_after_for@15 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | for option_index in urange(question_options): File "voting/voting.py", line 146 + // Implicit fall through to close_for_body@4 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | for option_index in urange(question_options): File "voting/voting.py", line 146 + +close_for_body@4: + frame_dig 4 // load current_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | current_index#0 current_index File "voting/voting.py", line 143 + callsub get_vote_from_box // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {get_vote_from_box} get_vote_from_box(current_index) File "voting/voting.py", line 147 + frame_bury 2 // store votes_for_option#0 to f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | votes_for_option File "voting/voting.py", line 147 + frame_dig 0 // load option_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | option_index#0 option_index File "voting/voting.py", line 146 + ! // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {!} option_index == 0 File "voting/voting.py", line 150 + bz close_ternary_false@6 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | Bytes(b"[") File "voting/voting.py", line 149 + // Implicit fall through to close_ternary_true@5 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | Bytes(b"[") File "voting/voting.py", line 149 + +close_ternary_true@5: + byte "[" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | "[" b"[" File "voting/voting.py", line 149 + b close_ternary_merge@13 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | (𝕏) ternary_result%40#0 | ternary_result%40#0 + +close_ternary_false@6: + frame_dig 1 // load question_options#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_options#0 question_options File "voting/voting.py", line 145 + int 1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_options#0,1 1 File "voting/voting.py", line 152 + - // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {-} question_options - 1 File "voting/voting.py", line 152 + frame_dig 0 // load option_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | tmp%41#0,option_index#0 option_index File "voting/voting.py", line 146 + == // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {==} option_index == (question_options - 1) File "voting/voting.py", line 152 + bz close_ternary_false@8 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | Bytes(b"") + itob(votes_for_option) + Bytes(b"]") File "voting/voting.py", line 151 + // Implicit fall through to close_ternary_true@7 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | Bytes(b"") + itob(votes_for_option) + Bytes(b"]") File "voting/voting.py", line 151 + +close_ternary_true@7: + frame_dig 2 // load votes_for_option#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | votes_for_option#0 votes_for_option File "voting/voting.py", line 147 + itob // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {itob} itob(votes_for_option) File "voting/voting.py", line 151 + byte "]" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | tmp%44#0,"]" b"]" File "voting/voting.py", line 151 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {concat} Bytes(b"") + itob(votes_for_option) + Bytes(b"]") File "voting/voting.py", line 151 + b close_ternary_merge@12 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | (𝕏) ternary_result%43#0 | ternary_result%43#0 + +close_ternary_false@8: + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | 0 self.option_counts File "voting/voting.py", line 154 + byte "option_counts" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | 0,"option_counts" self.option_counts File "voting/voting.py", line 154 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 154 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | app_global_get_ex_value%46#0 self.option_counts File "voting/voting.py", line 154 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | app_global_get_ex_value%46#0,0 self.option_counts.length File "voting/voting.py", line 154 + extract_uint16 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {extract_uint16} self.option_counts.length File "voting/voting.py", line 154 + int 1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | tmp%48#0,1 1 File "voting/voting.py", line 154 + - // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {-} self.option_counts.length - 1 File "voting/voting.py", line 154 + frame_dig 6 // load question_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | tmp%49#0,question_index#0 question_index File "voting/voting.py", line 144 + == // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {==} question_index == (self.option_counts.length - 1) File "voting/voting.py", line 154 + bz close_ternary_false@10 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | Bytes(b",") File "voting/voting.py", line 153 + // Implicit fall through to close_ternary_true@9 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | Bytes(b",") File "voting/voting.py", line 153 + +close_ternary_true@9: + byte "," // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | "," b"," File "voting/voting.py", line 153 + b close_ternary_merge@11 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | (𝕏) ternary_result%51#0 | ternary_result%51#0 + +close_ternary_false@10: + byte "" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | "" b"" File "voting/voting.py", line 155 + // Implicit fall through to close_ternary_merge@11 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | (𝕏) ternary_result%51#0 | ternary_result%51#0 + +close_ternary_merge@11: + // Implicit fall through to close_ternary_merge@12 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | (𝕏) ternary_result%43#0 | ternary_result%51#0 + +close_ternary_merge@12: + // Implicit fall through to close_ternary_merge@13 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | (𝕏) ternary_result%40#0 | ternary_result%43#0 + +close_ternary_merge@13: + frame_dig 3 // load note#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | (𝕏) ternary_result%40#0 | note#0 ternary_result%40#0 note File "voting/voting.py", line 128 + swap // load ternary_result%40#0 from x-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,ternary_result%40#0 b"[" File "voting/voting.py", line 149 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {concat} note += ( File "voting/voting.py", line 148 + frame_bury 3 // store note#0 to f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note File "voting/voting.py", line 128 + frame_dig 4 // load current_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | current_index#0 current_index File "voting/voting.py", line 143 + int 1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | current_index#0,1 1 File "voting/voting.py", line 157 + + // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {+} current_index += 1 File "voting/voting.py", line 157 + frame_bury 4 // store current_index#0 to f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | current_index File "voting/voting.py", line 143 + frame_dig 0 // load option_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | option_index#0 option_index File "voting/voting.py", line 146 + int 1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | option_index#0,1 urange(question_options) File "voting/voting.py", line 146 + + // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {+} urange(question_options) File "voting/voting.py", line 146 + frame_bury 0 // store option_index#0 to f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | option_index File "voting/voting.py", line 146 + b close_for_header@3 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | + +close_after_for@15: + frame_dig 6 // load question_index#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0 question_index File "voting/voting.py", line 144 + int 1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index#0,1 urange(self.option_counts.length) File "voting/voting.py", line 144 + + // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {+} urange(self.option_counts.length) File "voting/voting.py", line 144 + frame_bury 6 // store question_index#0 to f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | question_index File "voting/voting.py", line 144 + b close_for_header@1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | + +close_after_for@17: + frame_dig 3 // load note#0 from f-stack (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 note File "voting/voting.py", line 128 + byte "]}}" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,"]}}" b"]}}" File "voting/voting.py", line 158 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {concat} note += b"]}}" File "voting/voting.py", line 158 + itxn_begin // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.begin() File "voting/voting.py", line 159 + int acfg // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,acfg TransactionType.AssetConfig File "voting/voting.py", line 160 + itxn_field TypeEnum // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.set_type_enum(TransactionType.AssetConfig) File "voting/voting.py", line 160 + int 1 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,1 1 File "voting/voting.py", line 161 + itxn_field ConfigAssetTotal // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.set_config_asset_total(1) File "voting/voting.py", line 161 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,0 0 File "voting/voting.py", line 162 + itxn_field ConfigAssetDecimals // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.set_config_asset_decimals(0) File "voting/voting.py", line 162 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,0 False File "voting/voting.py", line 163 + itxn_field ConfigAssetDefaultFrozen // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.set_config_asset_default_frozen(False) File "voting/voting.py", line 163 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,0 self.vote_id File "voting/voting.py", line 164 + byte "vote_id" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,0,"vote_id" self.vote_id File "voting/voting.py", line 164 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.vote_id File "voting/voting.py", line 164 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,app_global_get_ex_value%52#0 self.vote_id File "voting/voting.py", line 164 + byte "[VOTE RESULT] " // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,app_global_get_ex_value%52#0,"[VOTE RESULT] " b"[VOTE RESULT] " File "voting/voting.py", line 164 + swap // load app_global_get_ex_value%52#0 from l-stack (no copy) (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,"[VOTE RESULT] ",app_global_get_ex_value%52#0 self.vote_id File "voting/voting.py", line 164 + concat // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,{concat} b"[VOTE RESULT] " + self.vote_id File "voting/voting.py", line 164 + itxn_field ConfigAssetName // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.set_config_asset_name(b"[VOTE RESULT] " + self.vote_id) File "voting/voting.py", line 164 + byte "VOTERSLT" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,"VOTERSLT" b"VOTERSLT" File "voting/voting.py", line 165 + itxn_field ConfigAssetUnitName // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.set_config_asset_unit_name(b"VOTERSLT") File "voting/voting.py", line 165 + int 0 // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,0 self.nft_image_url File "voting/voting.py", line 166 + byte "nft_image_url" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,0,"nft_image_url" self.nft_image_url File "voting/voting.py", line 166 + app_global_get_ex // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.nft_image_url File "voting/voting.py", line 166 + assert // check value exists // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0,app_global_get_ex_value%55#0 self.nft_image_url File "voting/voting.py", line 166 + itxn_field ConfigAssetURL // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | note#0 CreateInnerTransaction.set_config_asset_url(self.nft_image_url) File "voting/voting.py", line 166 + itxn_field Note // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | CreateInnerTransaction.set_note(note) File "voting/voting.py", line 167 + itxn_submit // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | CreateInnerTransaction.submit() File "voting/voting.py", line 168 + itxn CreatedAssetID // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | {itxn} InnerTransaction.created_asset_id() File "voting/voting.py", line 169 + byte "nft_asset_id" // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | new_state_value%57#0,"nft_asset_id" self.nft_asset_id File "voting/voting.py", line 169 + swap // load new_state_value%57#0 from l-stack (no copy) (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | "nft_asset_id",new_state_value%57#0 InnerTransaction.created_asset_id() File "voting/voting.py", line 169 + app_global_put // (𝕗) option_index#0,question_options#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,question_index#0 | self.nft_asset_id = InnerTransaction.created_asset_id() File "voting/voting.py", line 169 + retsub // + + +// algopy.ensure_budget(required_budget#0: uint64, fee_source#0: uint64) -> void: +ensure_budget: + proto 2 0 // (𝕡) required_budget#0,fee_source#0 | File "/algopy.py", line 14 + +ensure_budget_block@0: + frame_dig -2 // load required_budget#0 from parameters (𝕡) required_budget#0,fee_source#0 | required_budget#0 File "/algopy.py", line 14 + int 10 // (𝕡) required_budget#0,fee_source#0 | required_budget#0,10 File "/algopy.py", line 20 + + // (𝕡) required_budget#0,fee_source#0 | {+} File "/algopy.py", line 20 + // Implicit fall through to ensure_budget_while_top@1 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_while_top@1: + global OpcodeBudget // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | {global} File "/algopy.py", line 21 + frame_dig 0 // load required_budget_with_buffer#0 from f-stack (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | tmp%0#0,required_budget_with_buffer#0 File "/algopy.py", line 20 + < // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | {<} File "/algopy.py", line 21 + bz ensure_budget_after_while@7 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 21 + // Implicit fall through to ensure_budget_while_body@2 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 21 + +ensure_budget_while_body@2: + itxn_begin // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 22 + int appl // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | appl File "/algopy.py", line 23 + itxn_field TypeEnum // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 23 + int DeleteApplication // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | DeleteApplication File "/algopy.py", line 24 + itxn_field OnCompletion // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 24 + byte 0x068101 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0x068101 File "/algopy.py", line 25 + itxn_field ApprovalProgram // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 25 + byte 0x068101 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0x068101 File "/algopy.py", line 26 + itxn_field ClearStateProgram // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 26 + frame_dig -1 // load fee_source#0 from parameters (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | fee_source#0 File "/algopy.py", line 14 + switch ensure_budget_switch_case_0@3 ensure_budget_switch_case_1@4 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 27 + b ensure_budget_switch_case_next@6 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 27 + +ensure_budget_switch_case_0@3: + int 0 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0 File "/algopy.py", line 29 + itxn_field Fee // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 29 + b ensure_budget_switch_case_next@6 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_switch_case_1@4: + global MinTxnFee // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | {global} File "/algopy.py", line 31 + itxn_field Fee // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 31 + // Implicit fall through to ensure_budget_switch_case_next@6 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_switch_case_next@6: + itxn_submit // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 32 + b ensure_budget_while_top@1 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_after_while@7: + retsub // + + +// examples.voting.voting.get_vote_from_box(index#0: uint64) -> uint64: +get_vote_from_box: + proto 1 1 // (𝕡) index#0 | def get_vote_from_box(index: UInt64) -> UInt64: File "voting/voting.py", line 263 + +get_vote_from_box_block@0: + byte "V" // (𝕡) index#0 | "V" TALLY_BOX_KEY File "voting/voting.py", line 264 + box_get // (𝕡) index#0 | {box_get}.0,{box_get}.1 Box.get(TALLY_BOX_KEY) File "voting/voting.py", line 264 + assert // Box not created // (𝕡) index#0 | box_data#0 assert exists, "Box not created" File "voting/voting.py", line 265 + frame_dig -1 // load index#0 from parameters (𝕡) index#0 | box_data#0,index#0 index: UInt64 File "voting/voting.py", line 263 + int 8 // (𝕡) index#0 | box_data#0,index#0,8 VOTE_COUNT_BYTES File "voting/voting.py", line 266 + extract3 // (𝕡) index#0 | {extract3} extract(box_data, index, VOTE_COUNT_BYTES) File "voting/voting.py", line 266 + btoi // (𝕡) index#0 | {btoi} btoi(extract(box_data, index, VOTE_COUNT_BYTES)) File "voting/voting.py", line 266 + retsub // tmp%3#0 return btoi(extract(box_data, index, VOTE_COUNT_BYTES)) File "voting/voting.py", line 266 + + +// examples.voting.voting.VotingRoundApp.get_preconditions(signature#0: bytes) -> bytes: +get_preconditions: + proto 1 1 // (𝕡) signature#0 | def get_preconditions(self, signature: arc4.DynamicBytes) -> VotingPreconditions: File "voting/voting.py", line 172 + +get_preconditions_block@0: + callsub voting_open // (𝕡) signature#0 | {voting_open} self.voting_open() File "voting/voting.py", line 174 + itob // (𝕡) signature#0 | {itob} arc4.UInt64(self.voting_open()) File "voting/voting.py", line 174 + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | (𝕗) val_as_bytes%1#0 | signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 172 + len // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0 | {len} signature.bytes[2:] File "voting/voting.py", line 175 + dup // store awst_tmp%2#0 to l-stack (copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0 | awst_tmp%2#0,awst_tmp%2#0 signature.bytes[2:] File "voting/voting.py", line 175 + swap // store awst_tmp%2#0 to f-stack (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | awst_tmp%2#0 signature.bytes[2:] File "voting/voting.py", line 175 + int 2 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | awst_tmp%2#0,2 2 File "voting/voting.py", line 175 + > // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {>} signature.bytes[2:] File "voting/voting.py", line 175 + bz get_preconditions_ternary_false@2 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | signature.bytes[2:] File "voting/voting.py", line 175 + // Implicit fall through to get_preconditions_ternary_true@1 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | signature.bytes[2:] File "voting/voting.py", line 175 + +get_preconditions_ternary_true@1: + int 2 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | 2 2 File "voting/voting.py", line 175 + b get_preconditions_ternary_merge@3 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | ternary_result%4#0 + +get_preconditions_ternary_false@2: + frame_dig 1 // load awst_tmp%2#0 from f-stack (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | awst_tmp%2#0 signature.bytes[2:] File "voting/voting.py", line 175 + // Implicit fall through to get_preconditions_ternary_merge@3 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | ternary_result%4#0 + +get_preconditions_ternary_merge@3: + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | signature#0 ternary_result%4#0 signature: arc4.DynamicBytes File "voting/voting.py", line 172 + len // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | {len} signature.bytes[2:] File "voting/voting.py", line 175 + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | base_length%5#0,signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 172 + cover 2 // virtual: 2 ops (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | signature#0,ternary_result%4#0,base_length%5#0 signature.bytes[2:])), File "voting/voting.py", line 175 + substring3 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {substring3} signature.bytes[2:] File "voting/voting.py", line 175 + callsub allowed_to_vote // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {allowed_to_vote} self.allowed_to_vote(signature.bytes[2:]) File "voting/voting.py", line 175 + itob // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {itob} arc4.UInt64(self.allowed_to_vote(signature.bytes[2:])) File "voting/voting.py", line 175 + callsub already_voted // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,{already_voted} self.already_voted() File "voting/voting.py", line 176 + itob // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,{itob} arc4.UInt64(self.already_voted()) File "voting/voting.py", line 176 + global LatestTimestamp // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,{global} Global.latest_timestamp() File "voting/voting.py", line 177 + itob // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,{itob} arc4.UInt64(Global.latest_timestamp()) File "voting/voting.py", line 177 + frame_dig 0 // load val_as_bytes%1#0 from f-stack (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,val_as_bytes%12#0,val_as_bytes%1#0 arc4.UInt64(self.voting_open()) File "voting/voting.py", line 174 + uncover 3 // load val_as_bytes%8#0 from l-stack (no copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%10#0,val_as_bytes%12#0,val_as_bytes%1#0,val_as_bytes%8#0 arc4.UInt64(self.allowed_to_vote(signature.bytes[2:])) File "voting/voting.py", line 175 + concat // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%10#0,val_as_bytes%12#0,{concat} VotingPreconditions( File "voting/voting.py", line 173 + uncover 2 // load val_as_bytes%10#0 from l-stack (no copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%12#0,encoded_tuple_buffer%14#2,val_as_bytes%10#0 arc4.UInt64(self.already_voted()) File "voting/voting.py", line 176 + concat // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%12#0,{concat} VotingPreconditions( File "voting/voting.py", line 173 + swap // load val_as_bytes%12#0 from l-stack (no copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | encoded_tuple_buffer%14#2,val_as_bytes%12#0 arc4.UInt64(Global.latest_timestamp()) File "voting/voting.py", line 177 + concat // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {concat} VotingPreconditions( File "voting/voting.py", line 173 + frame_bury 0 + retsub // encoded_tuple_buffer%14#2 return VotingPreconditions( File "voting/voting.py", line 173 + + +// examples.voting.voting.VotingRoundApp.voting_open() -> uint64: +voting_open: + proto 0 1 // def voting_open(self) -> bool: File "voting/voting.py", line 220 + byte "" // allocate 1 to stack (𝕗) awst_tmp%6#0 | + +voting_open_block@0: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.is_bootstrapped File "voting/voting.py", line 222 + byte "is_bootstrapped" // (𝕗) awst_tmp%6#0 | 0,"is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 222 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.is_bootstrapped File "voting/voting.py", line 222 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%0#0 self.is_bootstrapped File "voting/voting.py", line 222 + bz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | self.is_bootstrapped File "voting/voting.py", line 222 + // Implicit fall through to voting_open_and_contd@1 // (𝕗) awst_tmp%6#0 | self.is_bootstrapped File "voting/voting.py", line 222 + +voting_open_and_contd@1: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.close_time File "voting/voting.py", line 223 + byte "close_time" // (𝕗) awst_tmp%6#0 | 0,"close_time" self.close_time File "voting/voting.py", line 223 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.close_time File "voting/voting.py", line 223 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%2#0 self.close_time File "voting/voting.py", line 223 + bnz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | not self.close_time File "voting/voting.py", line 223 + // Implicit fall through to voting_open_and_contd@2 // (𝕗) awst_tmp%6#0 | not self.close_time File "voting/voting.py", line 223 + +voting_open_and_contd@2: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.start_time File "voting/voting.py", line 224 + byte "start_time" // (𝕗) awst_tmp%6#0 | 0,"start_time" self.start_time File "voting/voting.py", line 224 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.start_time File "voting/voting.py", line 224 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0 self.start_time File "voting/voting.py", line 224 + global LatestTimestamp // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0,{global} Global.latest_timestamp() File "voting/voting.py", line 224 + dup // store awst_tmp%6#0 to l-stack (copy) (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0,awst_tmp%6#0,awst_tmp%6#0 Global.latest_timestamp() File "voting/voting.py", line 224 + frame_bury 0 // store awst_tmp%6#0 to f-stack (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0,awst_tmp%6#0 Global.latest_timestamp() File "voting/voting.py", line 224 + <= // (𝕗) awst_tmp%6#0 | {<=} self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + bz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + // Implicit fall through to voting_open_and_contd@3 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + +voting_open_and_contd@3: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.end_time File "voting/voting.py", line 224 + byte "end_time" // (𝕗) awst_tmp%6#0 | 0,"end_time" self.end_time File "voting/voting.py", line 224 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.end_time File "voting/voting.py", line 224 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%8#0 self.end_time File "voting/voting.py", line 224 + frame_dig 0 // load awst_tmp%6#0 from f-stack (𝕗) awst_tmp%6#0 | app_global_get_ex_value%8#0,awst_tmp%6#0 Global.latest_timestamp() File "voting/voting.py", line 224 + >= // (𝕗) awst_tmp%6#0 | {>=} Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + bz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + // Implicit fall through to voting_open_bool_true@4 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + +voting_open_bool_true@4: + int 1 // (𝕗) awst_tmp%6#0 | 1 + b voting_open_bool_merge@6 // (𝕗) awst_tmp%6#0 | (𝕏) and_result%11#0 | and_result%11#0 + +voting_open_bool_false@5: + int 0 // (𝕗) awst_tmp%6#0 | 0 + // Implicit fall through to voting_open_bool_merge@6 // (𝕗) awst_tmp%6#0 | (𝕏) and_result%11#0 | and_result%11#0 + +voting_open_bool_merge@6: + swap + retsub // and_result%11#0 and_result%11#0 return ( File "voting/voting.py", line 221 + + +// examples.voting.voting.VotingRoundApp.allowed_to_vote(signature#0: bytes) -> uint64: +allowed_to_vote: + proto 1 1 // (𝕡) signature#0 | def allowed_to_vote(self, signature: Bytes) -> bool: File "voting/voting.py", line 253 + +allowed_to_vote_block@0: + int 2000 // (𝕡) signature#0 | 2000 2000 File "voting/voting.py", line 254 + int 2 // (𝕡) signature#0 | 2000,2 ensure_budget(2000) File "voting/voting.py", line 254 + callsub ensure_budget // (𝕡) signature#0 | ensure_budget(2000) File "voting/voting.py", line 254 + txn Sender // (𝕡) signature#0 | {txn} Transaction.sender() File "voting/voting.py", line 256 + int 0 // (𝕡) signature#0 | tmp%0#0,0 self.snapshot_public_key File "voting/voting.py", line 258 + byte "snapshot_public_key" // (𝕡) signature#0 | tmp%0#0,0,"snapshot_public_key" self.snapshot_public_key File "voting/voting.py", line 258 + app_global_get_ex // (𝕡) signature#0 | tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.snapshot_public_key File "voting/voting.py", line 258 + assert // check value exists // (𝕡) signature#0 | tmp%0#0,app_global_get_ex_value%1#0 self.snapshot_public_key File "voting/voting.py", line 258 + swap // load tmp%0#0 from l-stack (no copy) (𝕡) signature#0 | app_global_get_ex_value%1#0,tmp%0#0 Transaction.sender() File "voting/voting.py", line 256 + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | app_global_get_ex_value%1#0,tmp%0#0,signature#0 signature: Bytes File "voting/voting.py", line 253 + uncover 2 // load app_global_get_ex_value%1#0 from l-stack (no copy) (𝕡) signature#0 | tmp%0#0,signature#0,app_global_get_ex_value%1#0 self.snapshot_public_key File "voting/voting.py", line 258 + ed25519verify_bare // (𝕡) signature#0 | {ed25519verify_bare} ed25519verify_bare( File "voting/voting.py", line 255 + retsub // tmp%3#0 return ed25519verify_bare( File "voting/voting.py", line 255 + + +// examples.voting.voting.VotingRoundApp.already_voted() -> uint64: +already_voted: + proto 0 1 // def already_voted(self) -> bool: File "voting/voting.py", line 228 + +already_voted_block@0: + txn Sender // {txn} Transaction.sender() File "voting/voting.py", line 229 + box_get // {box_get}.0,{box_get}.1 Box.get(Transaction.sender().bytes) File "voting/voting.py", line 229 + swap // store exists#0 to l-stack (no copy) exists#0,{box_get}.0 exists File "voting/voting.py", line 229 + pop // exists#0 votes File "voting/voting.py", line 229 + retsub // exists#0 return exists File "voting/voting.py", line 230 + + +// examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req#0: uint64, signature#0: bytes, answer_ids#0: bytes) -> void: +vote: + proto 3 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | def vote( File "voting/voting.py", line 181 + byte "" + dupn 2 // allocate 3 to stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0 | + +vote_block@0: + int 7700 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0 | 7700 7700 File "voting/voting.py", line 188 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0 | 7700,0 OpUpFeeSource.GroupCredit File "voting/voting.py", line 188 + callsub ensure_budget // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0 | ensure_budget(7700, fee_source=OpUpFeeSource.GroupCredit) File "voting/voting.py", line 188 + frame_dig -2 // load signature#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0 | signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 184 + len // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0 | {len} signature.bytes[2:] File "voting/voting.py", line 190 + dup // store awst_tmp%0#0 to l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0 | awst_tmp%0#0,awst_tmp%0#0 signature.bytes[2:] File "voting/voting.py", line 190 + swap // store awst_tmp%0#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | awst_tmp%0#0 signature.bytes[2:] File "voting/voting.py", line 190 + int 2 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | awst_tmp%0#0,2 2 File "voting/voting.py", line 190 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {>} signature.bytes[2:] File "voting/voting.py", line 190 + bz vote_ternary_false@2 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | signature.bytes[2:] File "voting/voting.py", line 190 + // Implicit fall through to vote_ternary_true@1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | signature.bytes[2:] File "voting/voting.py", line 190 + +vote_ternary_true@1: + int 2 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | 2 2 File "voting/voting.py", line 190 + b vote_ternary_merge@3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | ternary_result%2#0 + +vote_ternary_false@2: + frame_dig 3 // load awst_tmp%0#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | awst_tmp%0#0 signature.bytes[2:] File "voting/voting.py", line 190 + // Implicit fall through to vote_ternary_merge@3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | ternary_result%2#0 + +vote_ternary_merge@3: + frame_dig -2 // load signature#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | signature#0 ternary_result%2#0 signature: arc4.DynamicBytes File "voting/voting.py", line 184 + len // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | {len} signature.bytes[2:] File "voting/voting.py", line 190 + frame_dig -2 // load signature#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | base_length%3#0,signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 184 + cover 2 // virtual: 2 ops (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | signature#0,ternary_result%2#0,base_length%3#0 signature.bytes[2:]), "Not allowed to vote" File "voting/voting.py", line 190 + substring3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {substring3} signature.bytes[2:] File "voting/voting.py", line 190 + callsub allowed_to_vote // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {allowed_to_vote} self.allowed_to_vote(signature.bytes[2:]) File "voting/voting.py", line 190 + assert // Not allowed to vote // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | assert self.allowed_to_vote(signature.bytes[2:]), "Not allowed to vote" File "voting/voting.py", line 190 + callsub voting_open // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {voting_open} self.voting_open() File "voting/voting.py", line 191 + assert // Voting not open // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | assert self.voting_open(), "Voting not open" File "voting/voting.py", line 191 + callsub already_voted // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {already_voted} self.already_voted() File "voting/voting.py", line 192 + ! // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {!} not self.already_voted() File "voting/voting.py", line 192 + assert // Already voted // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | assert not self.already_voted(), "Already voted" File "voting/voting.py", line 192 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | 0 self.option_counts File "voting/voting.py", line 193 + byte "option_counts" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | 0,"option_counts" self.option_counts File "voting/voting.py", line 193 + app_global_get_ex // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 193 + assert // check value exists // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | app_global_get_ex_value%9#0 self.option_counts File "voting/voting.py", line 193 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | app_global_get_ex_value%9#0,0 self.option_counts.length File "voting/voting.py", line 193 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {extract_uint16} self.option_counts.length File "voting/voting.py", line 193 + dup // store questions_count#0 to l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | questions_count#0,questions_count#0 questions_count File "voting/voting.py", line 193 + frame_bury 2 // store questions_count#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | questions_count#0 questions_count File "voting/voting.py", line 193 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | questions_count#0,answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | questions_count#0,answer_ids#0,0 answer_ids.length File "voting/voting.py", line 194 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | questions_count#0,{extract_uint16} answer_ids.length File "voting/voting.py", line 194 + == // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {==} answer_ids.length == questions_count, "Number of answers incorrect" File "voting/voting.py", line 194 + assert // Number of answers incorrect // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | assert answer_ids.length == questions_count, "Number of answers incorrect" File "voting/voting.py", line 194 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_ids#0,0 answer_ids.length File "voting/voting.py", line 197 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {extract_uint16} answer_ids.length File "voting/voting.py", line 197 + int 34 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | tmp%13#0,34 32 + 2 File "voting/voting.py", line 197 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {+} 32 + 2 + VOTE_INDEX_BYTES * answer_ids.length File "voting/voting.py", line 197 + int 400 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | tmp%15#0,400 BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 197 + * // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {*} (32 + 2 + VOTE_INDEX_BYTES * answer_ids.length) * BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 197 + int 2500 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | tmp%16#0,2500 BOX_FLAT_MIN_BALANCE File "voting/voting.py", line 196 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {+} BOX_FLAT_MIN_BALANCE + ( File "voting/voting.py", line 196 + frame_dig -3 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 183 + gtxns Receiver // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,{gtxns} fund_min_bal_req.receiver File "voting/voting.py", line 200 + global CurrentApplicationAddress // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,tmp%17#0,{global} Global.current_application_address() File "voting/voting.py", line 200 + == // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,{==} fund_min_bal_req.receiver == Global.current_application_address() File "voting/voting.py", line 200 + assert // Payment must be to app address // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0 assert ( File "voting/voting.py", line 199 + dup // load min_bal_req#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,min_bal_req#0 min_bal_req File "voting/voting.py", line 196 + itob // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,{itob} itob(min_bal_req) File "voting/voting.py", line 203 + log // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0 log(itob(min_bal_req)) File "voting/voting.py", line 203 + frame_dig -3 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 183 + gtxns Amount // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | min_bal_req#0,{gtxns} fund_min_bal_req.amount File "voting/voting.py", line 204 + == // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {==} fund_min_bal_req.amount == min_bal_req, "Payment must be the exact min balance" File "voting/voting.py", line 204 + assert // Payment must be the exact min balance // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | assert fund_min_bal_req.amount == min_bal_req, "Payment must be the exact min balance" File "voting/voting.py", line 204 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | 0 0 File "voting/voting.py", line 206 + frame_bury 0 // store cumulative_offset#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | cumulative_offset File "voting/voting.py", line 206 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | 0 urange(questions_count) File "voting/voting.py", line 207 + frame_bury 1 // store question_index#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index File "voting/voting.py", line 207 + // Implicit fall through to vote_for_header@4 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | + +vote_for_header@4: + frame_dig 1 // load question_index#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0 question_index File "voting/voting.py", line 207 + frame_dig 2 // load questions_count#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,questions_count#0 questions_count File "voting/voting.py", line 193 + < // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {<} urange(questions_count) File "voting/voting.py", line 207 + bz vote_after_for@7 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | for question_index in urange(questions_count): File "voting/voting.py", line 207 + // Implicit fall through to vote_for_body@5 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | for question_index in urange(questions_count): File "voting/voting.py", line 207 + +vote_for_body@5: + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_ids#0,0 answer_ids[question_index] File "voting/voting.py", line 209 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {extract_uint16} answer_ids[question_index] File "voting/voting.py", line 209 + frame_dig 1 // load question_index#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | array_length%25#0,question_index#0 question_index File "voting/voting.py", line 207 + dup + cover 2 // store question_index#0 to l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,array_length%25#0,question_index#0 question_index File "voting/voting.py", line 207 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,{>} answer_ids[question_index] File "voting/voting.py", line 209 + assert // Index access is out of bounds // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0 answer_ids[question_index] File "voting/voting.py", line 209 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + extract 2 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,{extract} answer_ids[question_index] File "voting/voting.py", line 209 + dig 1 // load question_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,array_data_sans_header%27#0,question_index#0 question_index File "voting/voting.py", line 207 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,array_data_sans_header%27#0,question_index#0,1 answer_ids[question_index] File "voting/voting.py", line 209 + extract3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,{extract3} answer_ids[question_index] File "voting/voting.py", line 209 + swap // store answer_option_index#0 to l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0 answer_option_index File "voting/voting.py", line 209 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,0 self.option_counts File "voting/voting.py", line 210 + byte "option_counts" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,0,"option_counts" self.option_counts File "voting/voting.py", line 210 + app_global_get_ex // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 210 + assert // check value exists // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0 self.option_counts File "voting/voting.py", line 210 + dup // load app_global_get_ex_value%29#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,app_global_get_ex_value%29#0 self.option_counts File "voting/voting.py", line 210 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,app_global_get_ex_value%29#0,0 self.option_counts[question_index] File "voting/voting.py", line 210 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,{extract_uint16} self.option_counts[question_index] File "voting/voting.py", line 210 + dig 2 // load question_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,array_length%31#0,question_index#0 question_index File "voting/voting.py", line 207 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,{>} self.option_counts[question_index] File "voting/voting.py", line 210 + assert // Index access is out of bounds // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0 self.option_counts[question_index] File "voting/voting.py", line 210 + extract 2 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,{extract} self.option_counts[question_index] File "voting/voting.py", line 210 + dig 1 // load question_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,array_data_sans_header%33#0,question_index#0 question_index File "voting/voting.py", line 207 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,array_data_sans_header%33#0,question_index#0,1 self.option_counts[question_index] File "voting/voting.py", line 210 + extract3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,{extract3} self.option_counts[question_index] File "voting/voting.py", line 210 + dig 2 // load answer_option_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,options_count#0,answer_option_index#0 answer_option_index File "voting/voting.py", line 209 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,options_count#0,{btoi} answer_option_index.decode() File "voting/voting.py", line 212 + swap // store tmp%35#0 to l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,tmp%35#0,options_count#0 answer_option_index.decode() File "voting/voting.py", line 212 + dup // load options_count#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,tmp%35#0,options_count#0,options_count#0 options_count File "voting/voting.py", line 210 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,tmp%35#0,options_count#0,{btoi} options_count.decode() File "voting/voting.py", line 212 + uncover 2 // load tmp%35#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,options_count#0,tmp%36#0,tmp%35#0 answer_option_index.decode() File "voting/voting.py", line 212 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,options_count#0,{>} answer_option_index.decode() < options_count.decode() File "voting/voting.py", line 212 + assert // Answer option index invalid // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,options_count#0 assert ( File "voting/voting.py", line 211 + uncover 2 // load answer_option_index#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,options_count#0,answer_option_index#0 answer_option_index File "voting/voting.py", line 209 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,options_count#0,{btoi} answer_option_index.decode() File "voting/voting.py", line 214 + frame_dig 0 // load cumulative_offset#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,options_count#0,tmp%38#0,cumulative_offset#0 cumulative_offset File "voting/voting.py", line 206 + dup + cover 2 // store cumulative_offset#0 to l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,options_count#0,cumulative_offset#0,tmp%38#0,cumulative_offset#0 cumulative_offset File "voting/voting.py", line 206 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,options_count#0,cumulative_offset#0,{+} cumulative_offset + answer_option_index.decode() File "voting/voting.py", line 214 + callsub increment_vote_in_box // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,options_count#0,cumulative_offset#0 increment_vote_in_box(cumulative_offset + answer_option_index.decode()) File "voting/voting.py", line 214 + swap // load options_count#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,cumulative_offset#0,options_count#0 options_count File "voting/voting.py", line 210 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,cumulative_offset#0,{btoi} options_count.decode() File "voting/voting.py", line 215 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,{+} cumulative_offset += options_count.decode() File "voting/voting.py", line 215 + frame_bury 0 // store cumulative_offset#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0 cumulative_offset File "voting/voting.py", line 206 + txn Sender // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,{txn} Transaction.sender() File "voting/voting.py", line 216 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,tmp%41#0,answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + box_put // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0 Box.put(Transaction.sender().bytes, answer_ids.bytes) File "voting/voting.py", line 216 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,0 self.voter_count File "voting/voting.py", line 217 + byte "voter_count" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,0,"voter_count" self.voter_count File "voting/voting.py", line 217 + app_global_get_ex // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.voter_count File "voting/voting.py", line 217 + assert // check value exists // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,app_global_get_ex_value%42#0 self.voter_count File "voting/voting.py", line 217 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,app_global_get_ex_value%42#0,1 1 File "voting/voting.py", line 217 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,{+} self.voter_count += 1 File "voting/voting.py", line 217 + byte "voter_count" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,new_state_value%44#0,"voter_count" self.voter_count File "voting/voting.py", line 217 + swap // load new_state_value%44#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,"voter_count",new_state_value%44#0 self.voter_count += 1 File "voting/voting.py", line 217 + app_global_put // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0 self.voter_count += 1 File "voting/voting.py", line 217 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index#0,1 urange(questions_count) File "voting/voting.py", line 207 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | {+} urange(questions_count) File "voting/voting.py", line 207 + frame_bury 1 // store question_index#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | question_index File "voting/voting.py", line 207 + b vote_for_header@4 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,question_index#0,questions_count#0,awst_tmp%0#0 | + +vote_after_for@7: + retsub // + + +// examples.voting.voting.increment_vote_in_box(index#0: uint64) -> void: +increment_vote_in_box: + proto 1 0 // (𝕡) index#0 | def increment_vote_in_box(index: UInt64) -> None: File "voting/voting.py", line 270 + +increment_vote_in_box_block@0: + byte "V" // (𝕡) index#0 | "V" TALLY_BOX_KEY File "voting/voting.py", line 271 + box_get // (𝕡) index#0 | {box_get}.0,{box_get}.1 Box.get(TALLY_BOX_KEY) File "voting/voting.py", line 271 + assert // Box not created // (𝕡) index#0 | box_data#0 assert exists, "Box not created" File "voting/voting.py", line 272 + frame_dig -1 // load index#0 from parameters (𝕡) index#0 | box_data#0,index#0 index: UInt64 File "voting/voting.py", line 270 + int 8 // (𝕡) index#0 | box_data#0,index#0,8 VOTE_COUNT_BYTES File "voting/voting.py", line 273 + extract3 // (𝕡) index#0 | {extract3} extract(box_data, index, VOTE_COUNT_BYTES) File "voting/voting.py", line 273 + btoi // (𝕡) index#0 | {btoi} btoi(extract(box_data, index, VOTE_COUNT_BYTES)) File "voting/voting.py", line 273 + int 1 // (𝕡) index#0 | current_vote#0,1 1 File "voting/voting.py", line 274 + + // (𝕡) index#0 | {+} current_vote + 1 File "voting/voting.py", line 274 + itob // (𝕡) index#0 | {itob} itob(current_vote + 1) File "voting/voting.py", line 274 + byte "V" // (𝕡) index#0 | tmp%4#0,"V" TALLY_BOX_KEY File "voting/voting.py", line 274 + frame_dig -1 // load index#0 from parameters (𝕡) index#0 | tmp%4#0,"V",index#0 index: UInt64 File "voting/voting.py", line 270 + uncover 2 // load tmp%4#0 from l-stack (no copy) (𝕡) index#0 | "V",index#0,tmp%4#0 itob(current_vote + 1) File "voting/voting.py", line 274 + box_replace // (𝕡) index#0 | Box.replace(TALLY_BOX_KEY, index, itob(current_vote + 1)) File "voting/voting.py", line 274 + retsub // + + +// examples.voting.voting.VotingRoundApp.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "voting/voting.py", line 52 + +__init___block@0: + byte "is_bootstrapped" // "is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 53 + int 0 // "is_bootstrapped",0 False File "voting/voting.py", line 53 + app_global_put // self.is_bootstrapped = False File "voting/voting.py", line 53 + byte "voter_count" // "voter_count" self.voter_count File "voting/voting.py", line 55 + int 0 // "voter_count",0 0 File "voting/voting.py", line 55 + app_global_put // self.voter_count = UInt64(0) File "voting/voting.py", line 55 + byte "close_time" // "close_time" self.close_time File "voting/voting.py", line 56 + int 0 // "close_time",0 0 File "voting/voting.py", line 56 + app_global_put // self.close_time = UInt64(0) File "voting/voting.py", line 56 + byte "nft_asset_id" // "nft_asset_id" self.nft_asset_id File "voting/voting.py", line 57 + int 0 // "nft_asset_id",0 0 File "voting/voting.py", line 57 + app_global_put // self.nft_asset_id = UInt64(0) File "voting/voting.py", line 57 + byte "snapshot_public_key" // "snapshot_public_key" self.snapshot_public_key File "voting/voting.py", line 59 + byte "" // "snapshot_public_key","" Bytes() File "voting/voting.py", line 59 + app_global_put // self.snapshot_public_key = Bytes() File "voting/voting.py", line 59 + byte "vote_id" // "vote_id" self.vote_id File "voting/voting.py", line 60 + byte "" // "vote_id","" Bytes() File "voting/voting.py", line 60 + app_global_put // self.vote_id = Bytes() File "voting/voting.py", line 60 + byte "metadata_ipfs_cid" // "metadata_ipfs_cid" self.metadata_ipfs_cid File "voting/voting.py", line 61 + byte "" // "metadata_ipfs_cid","" Bytes() File "voting/voting.py", line 61 + app_global_put // self.metadata_ipfs_cid = Bytes() File "voting/voting.py", line 61 + byte "start_time" // "start_time" self.start_time File "voting/voting.py", line 62 + int 0 // "start_time",0 0 File "voting/voting.py", line 62 + app_global_put // self.start_time = UInt64(0) File "voting/voting.py", line 62 + byte "end_time" // "end_time" self.end_time File "voting/voting.py", line 63 + int 0 // "end_time",0 0 File "voting/voting.py", line 63 + app_global_put // self.end_time = UInt64(0) File "voting/voting.py", line 63 + byte "quorum" // "quorum" self.quorum File "voting/voting.py", line 64 + int 0 // "quorum",0 0 File "voting/voting.py", line 64 + app_global_put // self.quorum = UInt64(0) File "voting/voting.py", line 64 + byte "nft_image_url" // "nft_image_url" self.nft_image_url File "voting/voting.py", line 65 + byte "" // "nft_image_url","" Bytes() File "voting/voting.py", line 65 + app_global_put // self.nft_image_url = Bytes() File "voting/voting.py", line 65 + byte "option_counts" // "option_counts" self.option_counts File "voting/voting.py", line 66 + byte 0x0000 // "option_counts",0x0000 VoteIndexArray() File "voting/voting.py", line 66 + app_global_put // self.option_counts = VoteIndexArray() File "voting/voting.py", line 66 + byte "total_options" // "total_options" self.total_options File "voting/voting.py", line 67 + int 0 // "total_options",0 0 File "voting/voting.py", line 67 + app_global_put // self.total_options = UInt64(0) File "voting/voting.py", line 67 + retsub // + diff --git a/examples/voting/out/voting.approval.teal b/examples/voting/out/voting.approval.teal new file mode 100644 index 0000000000..ccab80778f --- /dev/null +++ b/examples/voting/out/voting.approval.teal @@ -0,0 +1,927 @@ +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_after_if_else@11 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" + method "bootstrap(pay)void" + method "close()void" + method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" + method "vote(pay,byte[],uint8[])void" + uncover 5 + match main_create_route@4 main_bootstrap_route@5 main_close_route@6 main_get_preconditions_route@7 main_vote_route@8 + b main_after_if_else@11 + +main_create_route@4: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + ! + assert // is 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 + callsub create + int 1 + return + +main_bootstrap_route@5: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + callsub bootstrap + int 1 + return + +main_close_route@6: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub close + int 1 + return + +main_get_preconditions_route@7: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub get_preconditions + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_vote_route@8: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + txna ApplicationArgs 1 + txna ApplicationArgs 2 + callsub vote + int 1 + return + +main_after_if_else@11: + err // reject transaction + + +// examples.voting.voting.VotingRoundApp.create(vote_id#0: bytes, snapshot_public_key#0: bytes, metadata_ipfs_cid#0: bytes, start_time#0: bytes, end_time#0: bytes, option_counts#0: bytes, quorum#0: bytes, nft_image_url#0: bytes) -> void: +create: + proto 8 0 + +create_block@0: + frame_dig -5 + btoi + dup + swap + frame_dig -4 + btoi + dup + cover 2 + dup + cover 2 + < + assert // End time should be after start time + global LatestTimestamp + >= + assert // End time should be in the future + frame_dig -8 + extract 2 0 + byte "vote_id" + swap + app_global_put + frame_dig -7 + len + dup + swap + int 2 + > + bz create_ternary_false@2 + +create_ternary_true@1: + int 2 + b create_ternary_merge@3 + +create_ternary_false@2: + frame_dig 2 + +create_ternary_merge@3: + frame_dig -7 + len + frame_dig -7 + cover 2 + substring3 + byte "snapshot_public_key" + swap + app_global_put + frame_dig -6 + extract 2 0 + byte "metadata_ipfs_cid" + swap + app_global_put + byte "start_time" + frame_dig 0 + app_global_put + byte "end_time" + frame_dig 1 + app_global_put + frame_dig -2 + btoi + byte "quorum" + swap + app_global_put + frame_dig -1 + extract 2 0 + byte "nft_image_url" + swap + app_global_put + frame_dig -3 + callsub store_option_counts + retsub + + +// examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0: bytes) -> void: +store_option_counts: + proto 1 0 + +store_option_counts_block@0: + frame_dig -1 + int 0 + extract_uint16 + assert // option_counts should be non-empty + frame_dig -1 + int 0 + extract_uint16 + int 112 + <= + assert // Can't have more than 112 questions + byte "option_counts" + frame_dig -1 + app_global_put + frame_dig -1 + callsub calculate_total_options_count + dup + int 128 + <= + assert // Can't have more than 128 vote options + byte "total_options" + swap + app_global_put + retsub + + +// examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0: bytes) -> uint64: +calculate_total_options_count: + proto 1 1 + +calculate_total_options_count_block@0: + int 0 + frame_dig -1 + int 0 + extract_uint16 + frame_dig -1 + extract 2 0 + int 0 + +calculate_total_options_count_for_header@1: + frame_dig 3 + frame_dig 1 + < + bz calculate_total_options_count_after_for@4 + +calculate_total_options_count_for_body@2: + frame_dig 2 + frame_dig 3 + dup + cover 2 + int 1 + extract3 + btoi + frame_dig 0 + + + frame_bury 0 + int 1 + + + frame_bury 3 + b calculate_total_options_count_for_header@1 + +calculate_total_options_count_after_for@4: + retsub + + +// examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req#0: uint64) -> void: +bootstrap: + proto 1 0 + +bootstrap_block@0: + int 0 + byte "is_bootstrapped" + app_global_get_ex + assert // check value exists + ! + assert // Must not be already bootstrapped + byte "is_bootstrapped" + int 1 + app_global_put + int 0 + byte "total_options" + app_global_get_ex + assert // check value exists + int 400 + * + int 8 + * + int 2900 + + + int 201000 + + + frame_dig -1 + gtxns Receiver + global CurrentApplicationAddress + == + assert // Payment must be to app address + dup + itob + log + frame_dig -1 + gtxns Amount + == + assert // Payment must be for the exact min balance requirement + int 0 + byte "total_options" + app_global_get_ex + assert // check value exists + int 8 + * + byte "V" + swap + box_create + assert + retsub + + +// examples.voting.voting.VotingRoundApp.close() -> void: +close: + proto 0 0 + byte "" + dupn 2 + +close_block@0: + int 20000 + int 0 + callsub ensure_budget + int 0 + byte "close_time" + app_global_get_ex + assert // check value exists + ! + assert // Already closed + global LatestTimestamp + byte "close_time" + swap + app_global_put + int 0 + byte "vote_id" + app_global_get_ex + assert // check value exists + byte "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " + swap + concat + byte ".\",\"properties\":{\"metadata\":\"ipfs://" + concat + int 0 + byte "metadata_ipfs_cid" + app_global_get_ex + assert // check value exists + concat + byte "\",\"id\":\"" + concat + int 0 + byte "vote_id" + app_global_get_ex + assert // check value exists + concat + byte "\",\"quorum\":" + concat + int 0 + byte "quorum" + app_global_get_ex + assert // check value exists + itob + concat + byte ",\"voterCount\":" + concat + int 0 + byte "voter_count" + app_global_get_ex + assert // check value exists + itob + concat + byte ",\"tallies\":[" + concat + int 0 + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + int 0 + extract_uint16 + int 0 + +close_for_header@1: + frame_dig 6 + frame_dig 5 + < + bz close_after_for@17 + +close_for_body@2: + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + dup + int 0 + extract_uint16 + frame_dig 6 + dup + cover 3 + > + assert // Index access is out of bounds + extract 2 0 + swap + int 1 + extract3 + btoi + frame_bury 1 + int 0 + frame_bury 0 + +close_for_header@3: + frame_dig 0 + frame_dig 1 + < + bz close_after_for@15 + +close_for_body@4: + frame_dig 4 + callsub get_vote_from_box + frame_bury 2 + frame_dig 0 + ! + bz close_ternary_false@6 + +close_ternary_true@5: + byte "[" + b close_ternary_merge@13 + +close_ternary_false@6: + frame_dig 1 + int 1 + - + frame_dig 0 + == + bz close_ternary_false@8 + +close_ternary_true@7: + frame_dig 2 + itob + byte "]" + concat + b close_ternary_merge@12 + +close_ternary_false@8: + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + int 0 + extract_uint16 + int 1 + - + frame_dig 6 + == + bz close_ternary_false@10 + +close_ternary_true@9: + byte "," + b close_ternary_merge@11 + +close_ternary_false@10: + byte "" + +close_ternary_merge@11: + +close_ternary_merge@12: + +close_ternary_merge@13: + frame_dig 3 + swap + concat + frame_bury 3 + frame_dig 4 + int 1 + + + frame_bury 4 + frame_dig 0 + int 1 + + + frame_bury 0 + b close_for_header@3 + +close_after_for@15: + frame_dig 6 + int 1 + + + frame_bury 6 + b close_for_header@1 + +close_after_for@17: + frame_dig 3 + byte "]}}" + concat + itxn_begin + int acfg + itxn_field TypeEnum + int 1 + itxn_field ConfigAssetTotal + int 0 + itxn_field ConfigAssetDecimals + int 0 + itxn_field ConfigAssetDefaultFrozen + int 0 + byte "vote_id" + app_global_get_ex + assert // check value exists + byte "[VOTE RESULT] " + swap + concat + itxn_field ConfigAssetName + byte "VOTERSLT" + itxn_field ConfigAssetUnitName + int 0 + byte "nft_image_url" + app_global_get_ex + assert // check value exists + itxn_field ConfigAssetURL + itxn_field Note + itxn_submit + itxn CreatedAssetID + byte "nft_asset_id" + swap + app_global_put + retsub + + +// algopy.ensure_budget(required_budget#0: uint64, fee_source#0: uint64) -> void: +ensure_budget: + proto 2 0 + +ensure_budget_block@0: + frame_dig -2 + int 10 + + + +ensure_budget_while_top@1: + global OpcodeBudget + frame_dig 0 + < + bz ensure_budget_after_while@7 + +ensure_budget_while_body@2: + itxn_begin + int appl + itxn_field TypeEnum + int DeleteApplication + itxn_field OnCompletion + byte 0x068101 + itxn_field ApprovalProgram + byte 0x068101 + itxn_field ClearStateProgram + frame_dig -1 + switch ensure_budget_switch_case_0@3 ensure_budget_switch_case_1@4 + b ensure_budget_switch_case_next@6 + +ensure_budget_switch_case_0@3: + int 0 + itxn_field Fee + b ensure_budget_switch_case_next@6 + +ensure_budget_switch_case_1@4: + global MinTxnFee + itxn_field Fee + +ensure_budget_switch_case_next@6: + itxn_submit + b ensure_budget_while_top@1 + +ensure_budget_after_while@7: + retsub + + +// examples.voting.voting.get_vote_from_box(index#0: uint64) -> uint64: +get_vote_from_box: + proto 1 1 + +get_vote_from_box_block@0: + byte "V" + box_get + assert // Box not created + frame_dig -1 + int 8 + extract3 + btoi + retsub + + +// examples.voting.voting.VotingRoundApp.get_preconditions(signature#0: bytes) -> bytes: +get_preconditions: + proto 1 1 + +get_preconditions_block@0: + callsub voting_open + itob + frame_dig -1 + len + dup + swap + int 2 + > + bz get_preconditions_ternary_false@2 + +get_preconditions_ternary_true@1: + int 2 + b get_preconditions_ternary_merge@3 + +get_preconditions_ternary_false@2: + frame_dig 1 + +get_preconditions_ternary_merge@3: + frame_dig -1 + len + frame_dig -1 + cover 2 + substring3 + callsub allowed_to_vote + itob + callsub already_voted + itob + global LatestTimestamp + itob + frame_dig 0 + uncover 3 + concat + uncover 2 + concat + swap + concat + frame_bury 0 + retsub + + +// examples.voting.voting.VotingRoundApp.voting_open() -> uint64: +voting_open: + proto 0 1 + byte "" + +voting_open_block@0: + int 0 + byte "is_bootstrapped" + app_global_get_ex + assert // check value exists + bz voting_open_bool_false@5 + +voting_open_and_contd@1: + int 0 + byte "close_time" + app_global_get_ex + assert // check value exists + bnz voting_open_bool_false@5 + +voting_open_and_contd@2: + int 0 + byte "start_time" + app_global_get_ex + assert // check value exists + global LatestTimestamp + dup + frame_bury 0 + <= + bz voting_open_bool_false@5 + +voting_open_and_contd@3: + int 0 + byte "end_time" + app_global_get_ex + assert // check value exists + frame_dig 0 + >= + bz voting_open_bool_false@5 + +voting_open_bool_true@4: + int 1 + b voting_open_bool_merge@6 + +voting_open_bool_false@5: + int 0 + +voting_open_bool_merge@6: + swap + retsub + + +// examples.voting.voting.VotingRoundApp.allowed_to_vote(signature#0: bytes) -> uint64: +allowed_to_vote: + proto 1 1 + +allowed_to_vote_block@0: + int 2000 + int 2 + callsub ensure_budget + txn Sender + int 0 + byte "snapshot_public_key" + app_global_get_ex + assert // check value exists + swap + frame_dig -1 + uncover 2 + ed25519verify_bare + retsub + + +// examples.voting.voting.VotingRoundApp.already_voted() -> uint64: +already_voted: + proto 0 1 + +already_voted_block@0: + txn Sender + box_get + swap + pop + retsub + + +// examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req#0: uint64, signature#0: bytes, answer_ids#0: bytes) -> void: +vote: + proto 3 0 + byte "" + dupn 2 + +vote_block@0: + int 7700 + int 0 + callsub ensure_budget + frame_dig -2 + len + dup + swap + int 2 + > + bz vote_ternary_false@2 + +vote_ternary_true@1: + int 2 + b vote_ternary_merge@3 + +vote_ternary_false@2: + frame_dig 3 + +vote_ternary_merge@3: + frame_dig -2 + len + frame_dig -2 + cover 2 + substring3 + callsub allowed_to_vote + assert // Not allowed to vote + callsub voting_open + assert // Voting not open + callsub already_voted + ! + assert // Already voted + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + int 0 + extract_uint16 + dup + frame_bury 2 + frame_dig -1 + int 0 + extract_uint16 + == + assert // Number of answers incorrect + frame_dig -1 + int 0 + extract_uint16 + int 34 + + + int 400 + * + int 2500 + + + frame_dig -3 + gtxns Receiver + global CurrentApplicationAddress + == + assert // Payment must be to app address + dup + itob + log + frame_dig -3 + gtxns Amount + == + assert // Payment must be the exact min balance + int 0 + frame_bury 0 + int 0 + frame_bury 1 + +vote_for_header@4: + frame_dig 1 + frame_dig 2 + < + bz vote_after_for@7 + +vote_for_body@5: + frame_dig -1 + int 0 + extract_uint16 + frame_dig 1 + dup + cover 2 + > + assert // Index access is out of bounds + frame_dig -1 + extract 2 0 + dig 1 + int 1 + extract3 + swap + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + dup + int 0 + extract_uint16 + dig 2 + > + assert // Index access is out of bounds + extract 2 0 + dig 1 + int 1 + extract3 + dig 2 + btoi + swap + dup + btoi + uncover 2 + > + assert // Answer option index invalid + uncover 2 + btoi + frame_dig 0 + dup + cover 2 + + + callsub increment_vote_in_box + swap + btoi + + + frame_bury 0 + txn Sender + frame_dig -1 + box_put + int 0 + byte "voter_count" + app_global_get_ex + assert // check value exists + int 1 + + + byte "voter_count" + swap + app_global_put + int 1 + + + frame_bury 1 + b vote_for_header@4 + +vote_after_for@7: + retsub + + +// examples.voting.voting.increment_vote_in_box(index#0: uint64) -> void: +increment_vote_in_box: + proto 1 0 + +increment_vote_in_box_block@0: + byte "V" + box_get + assert // Box not created + frame_dig -1 + int 8 + extract3 + btoi + int 1 + + + itob + byte "V" + frame_dig -1 + uncover 2 + box_replace + retsub + + +// examples.voting.voting.VotingRoundApp.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "is_bootstrapped" + int 0 + app_global_put + byte "voter_count" + int 0 + app_global_put + byte "close_time" + int 0 + app_global_put + byte "nft_asset_id" + int 0 + app_global_put + byte "snapshot_public_key" + byte "" + app_global_put + byte "vote_id" + byte "" + app_global_put + byte "metadata_ipfs_cid" + byte "" + app_global_put + byte "start_time" + int 0 + app_global_put + byte "end_time" + int 0 + app_global_put + byte "quorum" + int 0 + app_global_put + byte "nft_image_url" + byte "" + app_global_put + byte "option_counts" + byte 0x0000 + app_global_put + byte "total_options" + int 0 + app_global_put + retsub + diff --git a/examples/voting/out/voting.approval_unoptimized.debug.teal b/examples/voting/out/voting.approval_unoptimized.debug.teal new file mode 100644 index 0000000000..6fcf13f7cb --- /dev/null +++ b/examples/voting/out/voting.approval_unoptimized.debug.teal @@ -0,0 +1,1010 @@ +// Op // Op Description Stack (out) X stack Source code Source line + +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.approval_program() -> uint64: +main_block@0: + txn ApplicationID // {txn} + bnz main_entrypoint@2 // + // Implicit fall through to main_on_create@1 // + +main_on_create@1: + callsub __init__ // + // Implicit fall through to main_entrypoint@2 // + +main_entrypoint@2: + txn NumAppArgs // {txn} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + bz main_after_if_else@11 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + // Implicit fall through to main_abi_routing@3 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + +main_abi_routing@3: + txna ApplicationArgs 0 // {txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void"> arc4.abimethod(create=True) File "voting/voting.py", line 72 + method "bootstrap(pay)void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void"> arc4.abimethod() File "voting/voting.py", line 98 + method "close()void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void"> arc4.abimethod() File "voting/voting.py", line 122 + method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void">,method<"get_preconditions(byte[])(uint64,uint64,uint64,uint64)"> arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + method "vote(pay,byte[],uint8[])void" // tmp%2#0,method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void">,method<"get_preconditions(byte[])(uint64,uint64,uint64,uint64)">,method<"vote(pay,byte[],uint8[])void"> arc4.abimethod() File "voting/voting.py", line 180 + uncover 5 // load tmp%2#0 from l-stack (no copy) method<"create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void">,method<"bootstrap(pay)void">,method<"close()void">,method<"get_preconditions(byte[])(uint64,uint64,uint64,uint64)">,method<"vote(pay,byte[],uint8[])void">,tmp%2#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + match main_create_route@4 main_bootstrap_route@5 main_close_route@6 main_get_preconditions_route@7 main_vote_route@8 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + b main_switch_case_default@9 // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + +main_create_route@4: + txn OnCompletion // {txn} arc4.abimethod(create=True) File "voting/voting.py", line 72 + int NoOp // tmp%3#0,NoOp arc4.abimethod(create=True) File "voting/voting.py", line 72 + == // {==} arc4.abimethod(create=True) File "voting/voting.py", line 72 + assert // OnCompletion is NoOp // arc4.abimethod(create=True) File "voting/voting.py", line 72 + txn ApplicationID // {txn} arc4.abimethod(create=True) File "voting/voting.py", line 72 + ! // {!} arc4.abimethod(create=True) File "voting/voting.py", line 72 + assert // is creating // arc4.abimethod(create=True) File "voting/voting.py", line 72 + txna ApplicationArgs 1 // {txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 2 // tmp%7#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 3 // tmp%7#0,tmp%8#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 4 // tmp%7#0,tmp%8#0,tmp%9#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 5 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 6 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,tmp%11#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 7 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,tmp%11#0,tmp%12#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 8 // tmp%7#0,tmp%8#0,tmp%9#0,tmp%10#0,tmp%11#0,tmp%12#0,tmp%13#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub create // arc4.abimethod(create=True) File "voting/voting.py", line 72 + int 1 // 1 arc4.abimethod(create=True) File "voting/voting.py", line 72 + return // arc4.abimethod(create=True) File "voting/voting.py", line 72 + +main_bootstrap_route@5: + txn OnCompletion // {txn} arc4.abimethod() File "voting/voting.py", line 98 + int NoOp // tmp%15#0,NoOp arc4.abimethod() File "voting/voting.py", line 98 + == // {==} arc4.abimethod() File "voting/voting.py", line 98 + assert // OnCompletion is NoOp // arc4.abimethod() File "voting/voting.py", line 98 + txn ApplicationID // {txn} arc4.abimethod() File "voting/voting.py", line 98 + assert // is not creating // arc4.abimethod() File "voting/voting.py", line 98 + txn GroupIndex // {txn} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int 1 // tmp%20#0,1 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + - // {-} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + dup // load awst_tmp%21#0 from l-stack (copy) awst_tmp%21#0,awst_tmp%21#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + gtxns TypeEnum // awst_tmp%21#0,{gtxns} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int pay // awst_tmp%21#0,tmp%22#0,pay class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + == // awst_tmp%21#0,{==} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + assert // transaction type is pay // maybe_value%18#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub bootstrap // arc4.abimethod() File "voting/voting.py", line 98 + int 1 // 1 arc4.abimethod() File "voting/voting.py", line 98 + return // arc4.abimethod() File "voting/voting.py", line 98 + +main_close_route@6: + txn OnCompletion // {txn} arc4.abimethod() File "voting/voting.py", line 122 + int NoOp // tmp%24#0,NoOp arc4.abimethod() File "voting/voting.py", line 122 + == // {==} arc4.abimethod() File "voting/voting.py", line 122 + assert // OnCompletion is NoOp // arc4.abimethod() File "voting/voting.py", line 122 + txn ApplicationID // {txn} arc4.abimethod() File "voting/voting.py", line 122 + assert // is not creating // arc4.abimethod() File "voting/voting.py", line 122 + callsub close // arc4.abimethod() File "voting/voting.py", line 122 + int 1 // 1 arc4.abimethod() File "voting/voting.py", line 122 + return // arc4.abimethod() File "voting/voting.py", line 122 + +main_get_preconditions_route@7: + txn OnCompletion // {txn} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + int NoOp // tmp%27#0,NoOp arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + == // {==} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + assert // OnCompletion is NoOp // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + txn ApplicationID // {txn} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + assert // is not creating // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + txna ApplicationArgs 1 // {txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub get_preconditions // {get_preconditions} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + byte 0x151f7c75 // tmp%31#0,0x151f7c75 arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + swap // load tmp%31#0 from l-stack (no copy) 0x151f7c75,tmp%31#0 arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + concat // {concat} arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + log // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + int 1 // 1 arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + return // arc4.abimethod(readonly=True) File "voting/voting.py", line 171 + +main_vote_route@8: + txn OnCompletion // {txn} arc4.abimethod() File "voting/voting.py", line 180 + int NoOp // tmp%33#0,NoOp arc4.abimethod() File "voting/voting.py", line 180 + == // {==} arc4.abimethod() File "voting/voting.py", line 180 + assert // OnCompletion is NoOp // arc4.abimethod() File "voting/voting.py", line 180 + txn ApplicationID // {txn} arc4.abimethod() File "voting/voting.py", line 180 + assert // is not creating // arc4.abimethod() File "voting/voting.py", line 180 + txn GroupIndex // {txn} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int 1 // tmp%38#0,1 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + - // {-} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + dup // load awst_tmp%21#0 from l-stack (copy) awst_tmp%21#0,awst_tmp%21#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + gtxns TypeEnum // awst_tmp%21#0,{gtxns} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + int pay // awst_tmp%21#0,tmp%39#0,pay class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + == // awst_tmp%21#0,{==} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + assert // transaction type is pay // maybe_value%36#0 class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 1 // maybe_value%36#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + txna ApplicationArgs 2 // maybe_value%36#0,tmp%41#0,{txna} class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + callsub vote // arc4.abimethod() File "voting/voting.py", line 180 + int 1 // 1 arc4.abimethod() File "voting/voting.py", line 180 + return // arc4.abimethod() File "voting/voting.py", line 180 + +main_switch_case_default@9: + // Implicit fall through to main_switch_case_next@10 // + +main_switch_case_next@10: + // Implicit fall through to main_after_if_else@11 // + +main_after_if_else@11: + err // reject transaction // class VotingRoundApp(ARC4Contract): File "voting/voting.py", line 51 + + +// examples.voting.voting.VotingRoundApp.create(vote_id#0: bytes, snapshot_public_key#0: bytes, metadata_ipfs_cid#0: bytes, start_time#0: bytes, end_time#0: bytes, option_counts#0: bytes, quorum#0: bytes, nft_image_url#0: bytes) -> void: +create: + proto 8 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | def create( File "voting/voting.py", line 73 + +create_block@0: + frame_dig -5 // load start_time#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | start_time#0 start_time: arc4.UInt64 File "voting/voting.py", line 78 + btoi // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | {btoi} start_time.decode() File "voting/voting.py", line 84 + dup // store st#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | st#0,st#0 st File "voting/voting.py", line 84 + swap // store st#0 to f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0 st File "voting/voting.py", line 84 + frame_dig -4 // load end_time#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0,end_time#0 end_time: arc4.UInt64 File "voting/voting.py", line 79 + btoi // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0,{btoi} end_time.decode() File "voting/voting.py", line 85 + dup // store et#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0 | st#0,et#0,et#0 et File "voting/voting.py", line 85 + cover 2 // store et#0 to f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | st#0,et#0 et File "voting/voting.py", line 85 + dup + cover 2 // store et#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0,st#0,et#0 et File "voting/voting.py", line 85 + < // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0,{<} st < et, "End time should be after start time" File "voting/voting.py", line 86 + assert // End time should be after start time // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0 assert st < et, "End time should be after start time" File "voting/voting.py", line 86 + global LatestTimestamp // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | et#0,{global} Global.latest_timestamp() File "voting/voting.py", line 87 + >= // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | {>=} et >= Global.latest_timestamp(), "End time should be in the future" File "voting/voting.py", line 87 + assert // End time should be in the future // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | assert et >= Global.latest_timestamp(), "End time should be in the future" File "voting/voting.py", line 87 + frame_dig -8 // load vote_id#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | vote_id#0 vote_id: arc4.String File "voting/voting.py", line 75 + extract 2 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | {extract} vote_id.decode() File "voting/voting.py", line 89 + byte "vote_id" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | new_state_value%3#0,"vote_id" self.vote_id File "voting/voting.py", line 89 + swap // load new_state_value%3#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | "vote_id",new_state_value%3#0 vote_id.decode() File "voting/voting.py", line 89 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | self.vote_id = vote_id.decode() File "voting/voting.py", line 89 + frame_dig -7 // load snapshot_public_key#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | snapshot_public_key#0 snapshot_public_key: arc4.DynamicBytes File "voting/voting.py", line 76 + len // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | {len} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + dup // store awst_tmp%4#0 to l-stack (copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0 | awst_tmp%4#0,awst_tmp%4#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + swap // store awst_tmp%4#0 to f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | awst_tmp%4#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + int 2 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | awst_tmp%4#0,2 2 File "voting/voting.py", line 90 + > // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {>} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + bz create_ternary_false@2 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + // Implicit fall through to create_ternary_true@1 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + +create_ternary_true@1: + int 2 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | 2 2 File "voting/voting.py", line 90 + b create_ternary_merge@3 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +create_ternary_false@2: + frame_dig 2 // load awst_tmp%4#0 from f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | awst_tmp%4#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + // Implicit fall through to create_ternary_merge@3 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | ternary_result%6#0 + +create_ternary_merge@3: + frame_dig -7 // load snapshot_public_key#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | snapshot_public_key#0 ternary_result%6#0 snapshot_public_key: arc4.DynamicBytes File "voting/voting.py", line 76 + len // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | {len} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + frame_dig -7 // load snapshot_public_key#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | (𝕏) ternary_result%6#0 | base_length%7#0,snapshot_public_key#0 snapshot_public_key: arc4.DynamicBytes File "voting/voting.py", line 76 + cover 2 // virtual: 2 ops (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | snapshot_public_key#0,ternary_result%6#0,base_length%7#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + substring3 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {substring3} snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + byte "snapshot_public_key" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%8#0,"snapshot_public_key" self.snapshot_public_key File "voting/voting.py", line 90 + swap // load new_state_value%8#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "snapshot_public_key",new_state_value%8#0 snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.snapshot_public_key = snapshot_public_key.bytes[2:] File "voting/voting.py", line 90 + frame_dig -6 // load metadata_ipfs_cid#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | metadata_ipfs_cid#0 metadata_ipfs_cid: arc4.String File "voting/voting.py", line 77 + extract 2 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {extract} metadata_ipfs_cid.decode() File "voting/voting.py", line 91 + byte "metadata_ipfs_cid" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%9#0,"metadata_ipfs_cid" self.metadata_ipfs_cid File "voting/voting.py", line 91 + swap // load new_state_value%9#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "metadata_ipfs_cid",new_state_value%9#0 metadata_ipfs_cid.decode() File "voting/voting.py", line 91 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.metadata_ipfs_cid = metadata_ipfs_cid.decode() File "voting/voting.py", line 91 + byte "start_time" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "start_time" self.start_time File "voting/voting.py", line 92 + frame_dig 0 // load st#0 from f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "start_time",st#0 st File "voting/voting.py", line 84 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.start_time = st File "voting/voting.py", line 92 + byte "end_time" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "end_time" self.end_time File "voting/voting.py", line 93 + frame_dig 1 // load et#0 from f-stack (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "end_time",et#0 et File "voting/voting.py", line 85 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.end_time = et File "voting/voting.py", line 93 + frame_dig -2 // load quorum#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | quorum#0 quorum: arc4.UInt64 File "voting/voting.py", line 81 + btoi // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {btoi} quorum.decode() File "voting/voting.py", line 94 + byte "quorum" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%10#0,"quorum" self.quorum File "voting/voting.py", line 94 + swap // load new_state_value%10#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "quorum",new_state_value%10#0 quorum.decode() File "voting/voting.py", line 94 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.quorum = quorum.decode() File "voting/voting.py", line 94 + frame_dig -1 // load nft_image_url#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | nft_image_url#0 nft_image_url: arc4.String File "voting/voting.py", line 82 + extract 2 0 // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | {extract} nft_image_url.decode() File "voting/voting.py", line 95 + byte "nft_image_url" // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | new_state_value%11#0,"nft_image_url" self.nft_image_url File "voting/voting.py", line 95 + swap // load new_state_value%11#0 from l-stack (no copy) (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | "nft_image_url",new_state_value%11#0 nft_image_url.decode() File "voting/voting.py", line 95 + app_global_put // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.nft_image_url = nft_image_url.decode() File "voting/voting.py", line 95 + frame_dig -3 // load option_counts#0 from parameters (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 80 + callsub store_option_counts // (𝕡) vote_id#0,snapshot_public_key#0,metadata_ipfs_cid#0,start_time#0,end_time#0,option_counts#0,quorum#0,nft_image_url#0 | (𝕗) st#0,et#0,awst_tmp%4#0 | self.store_option_counts(option_counts) File "voting/voting.py", line 96 + retsub // + + +// examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0: bytes) -> void: +store_option_counts: + proto 1 0 // (𝕡) option_counts#0 | def store_option_counts(self, option_counts: VoteIndexArray) -> None: File "voting/voting.py", line 233 + +store_option_counts_block@0: + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + int 0 // (𝕡) option_counts#0 | option_counts#0,0 option_counts.length File "voting/voting.py", line 234 + extract_uint16 // (𝕡) option_counts#0 | {extract_uint16} option_counts.length File "voting/voting.py", line 234 + assert // option_counts should be non-empty // (𝕡) option_counts#0 | assert option_counts.length, "option_counts should be non-empty" File "voting/voting.py", line 234 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + int 0 // (𝕡) option_counts#0 | option_counts#0,0 option_counts.length File "voting/voting.py", line 236 + extract_uint16 // (𝕡) option_counts#0 | {extract_uint16} option_counts.length File "voting/voting.py", line 236 + int 112 // (𝕡) option_counts#0 | tmp%1#0,112 112 File "voting/voting.py", line 236 + <= // (𝕡) option_counts#0 | {<=} option_counts.length <= 112, "Can't have more than 112 questions" File "voting/voting.py", line 236 + assert // Can't have more than 112 questions // (𝕡) option_counts#0 | assert option_counts.length <= 112, "Can't have more than 112 questions" File "voting/voting.py", line 236 + byte "option_counts" // (𝕡) option_counts#0 | "option_counts" self.option_counts File "voting/voting.py", line 238 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | "option_counts",option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + app_global_put // (𝕡) option_counts#0 | self.option_counts = option_counts File "voting/voting.py", line 238 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 233 + callsub calculate_total_options_count // (𝕡) option_counts#0 | {calculate_total_options_count} self.calculate_total_options_count(option_counts) File "voting/voting.py", line 240 + dup // load total_options#0 from l-stack (copy) (𝕡) option_counts#0 | total_options#0,total_options#0 total_options File "voting/voting.py", line 240 + int 128 // (𝕡) option_counts#0 | total_options#0,total_options#0,128 128 File "voting/voting.py", line 241 + <= // (𝕡) option_counts#0 | total_options#0,{<=} total_options <= 128, "Can't have more than 128 vote options" File "voting/voting.py", line 241 + assert // Can't have more than 128 vote options // (𝕡) option_counts#0 | total_options#0 assert total_options <= 128, "Can't have more than 128 vote options" File "voting/voting.py", line 241 + byte "total_options" // (𝕡) option_counts#0 | total_options#0,"total_options" self.total_options File "voting/voting.py", line 242 + swap // load total_options#0 from l-stack (no copy) (𝕡) option_counts#0 | "total_options",total_options#0 total_options File "voting/voting.py", line 240 + app_global_put // (𝕡) option_counts#0 | self.total_options = total_options File "voting/voting.py", line 242 + retsub // + + +// examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0: bytes) -> uint64: +calculate_total_options_count: + proto 1 1 // (𝕡) option_counts#0 | def calculate_total_options_count(self, option_counts: VoteIndexArray) -> UInt64: File "voting/voting.py", line 245 + +calculate_total_options_count_block@0: + int 0 // (𝕡) option_counts#0 | 0 0 File "voting/voting.py", line 246 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | (𝕗) total#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 245 + int 0 // (𝕡) option_counts#0 | (𝕗) total#0 | option_counts#0,0 for item in option_counts: File "voting/voting.py", line 247 + extract_uint16 // (𝕡) option_counts#0 | (𝕗) total#0 | {extract_uint16} for item in option_counts: File "voting/voting.py", line 247 + frame_dig -1 // load option_counts#0 from parameters (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0 | option_counts#0 option_counts: VoteIndexArray File "voting/voting.py", line 245 + extract 2 0 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0 | {extract} for item in option_counts: File "voting/voting.py", line 247 + int 0 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0 | 0 + // Implicit fall through to calculate_total_options_count_for_header@1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | + +calculate_total_options_count_for_header@1: + frame_dig 3 // load item_index_internal%2#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0 + frame_dig 1 // load array_length%0#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,array_length%0#0 for item in option_counts: File "voting/voting.py", line 247 + < // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {<} for item in option_counts: File "voting/voting.py", line 247 + bz calculate_total_options_count_after_for@4 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | for item in option_counts: File "voting/voting.py", line 247 + // Implicit fall through to calculate_total_options_count_for_body@2 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | for item in option_counts: File "voting/voting.py", line 247 + +calculate_total_options_count_for_body@2: + frame_dig 3 // load item_index_internal%2#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0 + int 1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,1 for item in option_counts: File "voting/voting.py", line 247 + * // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {*} for item in option_counts: File "voting/voting.py", line 247 + frame_dig 2 // load array_value%1#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index%4#0,array_value%1#0 for item in option_counts: File "voting/voting.py", line 247 + swap // load item_index%4#0 from l-stack (no copy) (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | array_value%1#0,item_index%4#0 for item in option_counts: File "voting/voting.py", line 247 + int 1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | array_value%1#0,item_index%4#0,1 for item in option_counts: File "voting/voting.py", line 247 + extract3 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {extract3} for item in option_counts: File "voting/voting.py", line 247 + btoi // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {btoi} item.decode() File "voting/voting.py", line 248 + frame_dig 0 // load total#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | tmp%5#0,total#0 total File "voting/voting.py", line 246 + + // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {+} total += item.decode() File "voting/voting.py", line 248 + frame_bury 0 // store total#0 to f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | total File "voting/voting.py", line 246 + // Implicit fall through to calculate_total_options_count_for_footer@3 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | + +calculate_total_options_count_for_footer@3: + frame_dig 3 // load item_index_internal%2#0 from f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0 + int 1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | item_index_internal%2#0,1 + + // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | {+} + frame_bury 3 // store item_index_internal%2#0 to f-stack (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | + b calculate_total_options_count_for_header@1 // (𝕡) option_counts#0 | (𝕗) total#0,array_length%0#0,array_value%1#0,item_index_internal%2#0 | + +calculate_total_options_count_after_for@4: + retsub // virtual: 2 ops total#0 total = UInt64(0) File "voting/voting.py", line 246 + + +// examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req#0: uint64) -> void: +bootstrap: + proto 1 0 // (𝕡) fund_min_bal_req#0 | def bootstrap(self, fund_min_bal_req: PaymentTransaction) -> None: File "voting/voting.py", line 99 + +bootstrap_block@0: + int 0 // (𝕡) fund_min_bal_req#0 | 0 self.is_bootstrapped File "voting/voting.py", line 100 + byte "is_bootstrapped" // (𝕡) fund_min_bal_req#0 | 0,"is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 100 + app_global_get_ex // (𝕡) fund_min_bal_req#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.is_bootstrapped File "voting/voting.py", line 100 + assert // check value exists // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%0#0 self.is_bootstrapped File "voting/voting.py", line 100 + ! // (𝕡) fund_min_bal_req#0 | {!} not self.is_bootstrapped File "voting/voting.py", line 100 + assert // Must not be already bootstrapped // (𝕡) fund_min_bal_req#0 | assert not self.is_bootstrapped, "Must not be already bootstrapped" File "voting/voting.py", line 100 + byte "is_bootstrapped" // (𝕡) fund_min_bal_req#0 | "is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 101 + int 1 // (𝕡) fund_min_bal_req#0 | "is_bootstrapped",1 True File "voting/voting.py", line 101 + app_global_put // (𝕡) fund_min_bal_req#0 | self.is_bootstrapped = True File "voting/voting.py", line 101 + int 8 // (𝕡) fund_min_bal_req#0 | 8 8 File "voting/voting.py", line 103 + int 0 // (𝕡) fund_min_bal_req#0 | bytes_per_option#0,0 self.total_options File "voting/voting.py", line 107 + byte "total_options" // (𝕡) fund_min_bal_req#0 | bytes_per_option#0,0,"total_options" self.total_options File "voting/voting.py", line 107 + app_global_get_ex // (𝕡) fund_min_bal_req#0 | bytes_per_option#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.total_options File "voting/voting.py", line 107 + assert // check value exists // (𝕡) fund_min_bal_req#0 | bytes_per_option#0,app_global_get_ex_value%3#0 self.total_options File "voting/voting.py", line 107 + int 400 // (𝕡) fund_min_bal_req#0 | bytes_per_option#0,app_global_get_ex_value%3#0,400 BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 107 + * // (𝕡) fund_min_bal_req#0 | bytes_per_option#0,{*} self.total_options * BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 107 + * // (𝕡) fund_min_bal_req#0 | {*} self.total_options * BOX_BYTE_MIN_BALANCE * bytes_per_option File "voting/voting.py", line 107 + int 2900 // (𝕡) fund_min_bal_req#0 | tmp%6#0,2900 BOX_FLAT_MIN_BALANCE File "voting/voting.py", line 105 + + // (𝕡) fund_min_bal_req#0 | {+} BOX_FLAT_MIN_BALANCE File "voting/voting.py", line 105 + int 201000 // (𝕡) fund_min_bal_req#0 | box_cost#0,201000 ASSET_MIN_BALANCE * 2 + 1000 File "voting/voting.py", line 110 + + // (𝕡) fund_min_bal_req#0 | {+} ASSET_MIN_BALANCE * 2 + 1000 + box_cost File "voting/voting.py", line 110 + frame_dig -1 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0 | min_balance_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 99 + gtxns Receiver // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{gtxns} fund_min_bal_req.receiver File "voting/voting.py", line 112 + global CurrentApplicationAddress // (𝕡) fund_min_bal_req#0 | min_balance_req#0,tmp%7#0,{global} Global.current_application_address() File "voting/voting.py", line 112 + == // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{==} fund_min_bal_req.receiver == Global.current_application_address() File "voting/voting.py", line 112 + assert // Payment must be to app address // (𝕡) fund_min_bal_req#0 | min_balance_req#0 assert ( File "voting/voting.py", line 111 + dup // load min_balance_req#0 from l-stack (copy) (𝕡) fund_min_bal_req#0 | min_balance_req#0,min_balance_req#0 min_balance_req File "voting/voting.py", line 110 + itob // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{itob} itob(min_balance_req) File "voting/voting.py", line 114 + log // (𝕡) fund_min_bal_req#0 | min_balance_req#0 log(itob(min_balance_req)) File "voting/voting.py", line 114 + frame_dig -1 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0 | min_balance_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 99 + gtxns Amount // (𝕡) fund_min_bal_req#0 | min_balance_req#0,{gtxns} fund_min_bal_req.amount File "voting/voting.py", line 117 + == // (𝕡) fund_min_bal_req#0 | {==} fund_min_bal_req.amount == min_balance_req File "voting/voting.py", line 117 + assert // Payment must be for the exact min balance requirement // (𝕡) fund_min_bal_req#0 | assert ( File "voting/voting.py", line 116 + int 0 // (𝕡) fund_min_bal_req#0 | 0 self.total_options File "voting/voting.py", line 120 + byte "total_options" // (𝕡) fund_min_bal_req#0 | 0,"total_options" self.total_options File "voting/voting.py", line 120 + app_global_get_ex // (𝕡) fund_min_bal_req#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.total_options File "voting/voting.py", line 120 + assert // check value exists // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%13#0 self.total_options File "voting/voting.py", line 120 + int 8 // (𝕡) fund_min_bal_req#0 | app_global_get_ex_value%13#0,8 VOTE_COUNT_BYTES File "voting/voting.py", line 120 + * // (𝕡) fund_min_bal_req#0 | {*} self.total_options * VOTE_COUNT_BYTES File "voting/voting.py", line 120 + byte "V" // (𝕡) fund_min_bal_req#0 | tmp%15#0,"V" TALLY_BOX_KEY File "voting/voting.py", line 120 + swap // load tmp%15#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0 | "V",tmp%15#0 self.total_options * VOTE_COUNT_BYTES File "voting/voting.py", line 120 + box_create // (𝕡) fund_min_bal_req#0 | {box_create} Box.create(TALLY_BOX_KEY, self.total_options * VOTE_COUNT_BYTES) File "voting/voting.py", line 120 + assert // (𝕡) fund_min_bal_req#0 | assert Box.create(TALLY_BOX_KEY, self.total_options * VOTE_COUNT_BYTES) File "voting/voting.py", line 120 + retsub // + + +// examples.voting.voting.VotingRoundApp.close() -> void: +close: + proto 0 0 // def close(self) -> None: File "voting/voting.py", line 123 + byte "" + dupn 4 // allocate 5 to stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | + +close_block@0: + int 20000 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | 20000 20000 File "voting/voting.py", line 124 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | 20000,0 OpUpFeeSource.GroupCredit File "voting/voting.py", line 124 + callsub ensure_budget // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | ensure_budget(20000, fee_source=OpUpFeeSource.GroupCredit) File "voting/voting.py", line 124 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | 0 self.close_time File "voting/voting.py", line 125 + byte "close_time" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | 0,"close_time" self.close_time File "voting/voting.py", line 125 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.close_time File "voting/voting.py", line 125 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | app_global_get_ex_value%0#0 self.close_time File "voting/voting.py", line 125 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | app_global_get_ex_value%0#0,0 0 File "voting/voting.py", line 125 + == // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {==} self.close_time == 0, "Already closed" File "voting/voting.py", line 125 + assert // Already closed // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | assert self.close_time == 0, "Already closed" File "voting/voting.py", line 125 + global LatestTimestamp // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {global} Global.latest_timestamp() File "voting/voting.py", line 126 + byte "close_time" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | new_state_value%3#0,"close_time" self.close_time File "voting/voting.py", line 126 + swap // load new_state_value%3#0 from l-stack (no copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | "close_time",new_state_value%3#0 Global.latest_timestamp() File "voting/voting.py", line 126 + app_global_put // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | self.close_time = Global.latest_timestamp() File "voting/voting.py", line 126 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | 0 self.vote_id File "voting/voting.py", line 131 + byte "vote_id" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | 0,"vote_id" self.vote_id File "voting/voting.py", line 131 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.vote_id File "voting/voting.py", line 131 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | app_global_get_ex_value%4#0 self.vote_id File "voting/voting.py", line 131 + byte "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | app_global_get_ex_value%4#0,"{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " b'{"standard":"arc69",' File "voting/voting.py", line 129 + swap // load app_global_get_ex_value%4#0 from l-stack (no copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID ",app_global_get_ex_value%4#0 self.vote_id File "voting/voting.py", line 131 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte ".\",\"properties\":{\"metadata\":\"ipfs://" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%6#0,".\",\"properties\":{\"metadata\":\"ipfs://" b'.","properties":{"metadata":"ipfs://' File "voting/voting.py", line 132 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%7#0,0 self.metadata_ipfs_cid File "voting/voting.py", line 133 + byte "metadata_ipfs_cid" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%7#0,0,"metadata_ipfs_cid" self.metadata_ipfs_cid File "voting/voting.py", line 133 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%7#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.metadata_ipfs_cid File "voting/voting.py", line 133 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%7#0,app_global_get_ex_value%8#0 self.metadata_ipfs_cid File "voting/voting.py", line 133 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte "\",\"id\":\"" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%10#0,"\",\"id\":\"" b'","id":"' File "voting/voting.py", line 134 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%11#0,0 self.vote_id File "voting/voting.py", line 135 + byte "vote_id" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%11#0,0,"vote_id" self.vote_id File "voting/voting.py", line 135 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%11#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.vote_id File "voting/voting.py", line 135 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%11#0,app_global_get_ex_value%12#0 self.vote_id File "voting/voting.py", line 135 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte "\",\"quorum\":" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%14#0,"\",\"quorum\":" b'","quorum":' File "voting/voting.py", line 136 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%15#0,0 self.quorum File "voting/voting.py", line 137 + byte "quorum" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%15#0,0,"quorum" self.quorum File "voting/voting.py", line 137 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%15#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.quorum File "voting/voting.py", line 137 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%15#0,app_global_get_ex_value%16#0 self.quorum File "voting/voting.py", line 137 + itob // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%15#0,{itob} itob(self.quorum) File "voting/voting.py", line 137 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte ",\"voterCount\":" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%19#0,",\"voterCount\":" b',"voterCount":' File "voting/voting.py", line 138 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%20#0,0 self.voter_count File "voting/voting.py", line 139 + byte "voter_count" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%20#0,0,"voter_count" self.voter_count File "voting/voting.py", line 139 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%20#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.voter_count File "voting/voting.py", line 139 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%20#0,app_global_get_ex_value%21#0 self.voter_count File "voting/voting.py", line 139 + itob // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%20#0,{itob} itob(self.voter_count) File "voting/voting.py", line 139 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + byte ",\"tallies\":[" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | tmp%24#0,",\"tallies\":[" b',"tallies":[' File "voting/voting.py", line 140 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0 | {concat} b'{"standard":"arc69",' File "voting/voting.py", line 129 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0 | 0 0 File "voting/voting.py", line 143 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0 | 0 self.option_counts File "voting/voting.py", line 144 + byte "option_counts" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0 | 0,"option_counts" self.option_counts File "voting/voting.py", line 144 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 144 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0 | app_global_get_ex_value%25#0 self.option_counts File "voting/voting.py", line 144 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0 | app_global_get_ex_value%25#0,0 self.option_counts.length File "voting/voting.py", line 144 + extract_uint16 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0 | {extract_uint16} self.option_counts.length File "voting/voting.py", line 144 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0 | 0 urange(self.option_counts.length) File "voting/voting.py", line 144 + // Implicit fall through to close_for_header@1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | + +close_for_header@1: + frame_dig 8 // load range_item%28#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%28#0 question_index File "voting/voting.py", line 144 + frame_dig 7 // load tmp%27#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%28#0,tmp%27#0 self.option_counts.length File "voting/voting.py", line 144 + < // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {<} urange(self.option_counts.length) File "voting/voting.py", line 144 + bz close_after_for@17 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | for question_index in urange(self.option_counts.length): File "voting/voting.py", line 144 + // Implicit fall through to close_for_body@2 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | for question_index in urange(self.option_counts.length): File "voting/voting.py", line 144 + +close_for_body@2: + frame_dig 8 // load range_item%28#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%28#0 question_index File "voting/voting.py", line 144 + dup // store question_index#0 to l-stack (copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,question_index#0 question_index File "voting/voting.py", line 144 + frame_bury 1 // store question_index#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0 question_index File "voting/voting.py", line 144 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,0 self.option_counts File "voting/voting.py", line 145 + byte "option_counts" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,0,"option_counts" self.option_counts File "voting/voting.py", line 145 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 145 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,app_global_get_ex_value%30#0 self.option_counts File "voting/voting.py", line 145 + dup // load app_global_get_ex_value%30#0 from l-stack (copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,app_global_get_ex_value%30#0,app_global_get_ex_value%30#0 self.option_counts File "voting/voting.py", line 145 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,app_global_get_ex_value%30#0,app_global_get_ex_value%30#0,0 self.option_counts[question_index] File "voting/voting.py", line 145 + extract_uint16 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,app_global_get_ex_value%30#0,{extract_uint16} self.option_counts[question_index] File "voting/voting.py", line 145 + dig 2 // load question_index#0 from l-stack (copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,app_global_get_ex_value%30#0,array_length%32#0,question_index#0 question_index File "voting/voting.py", line 144 + > // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,app_global_get_ex_value%30#0,{>} self.option_counts[question_index] File "voting/voting.py", line 145 + assert // Index access is out of bounds // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,app_global_get_ex_value%30#0 self.option_counts[question_index] File "voting/voting.py", line 145 + extract 2 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index#0,{extract} self.option_counts[question_index] File "voting/voting.py", line 145 + swap // load question_index#0 from l-stack (no copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | array_data_sans_header%34#0,question_index#0 question_index File "voting/voting.py", line 144 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | array_data_sans_header%34#0,question_index#0,1 self.option_counts[question_index] File "voting/voting.py", line 145 + * // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | array_data_sans_header%34#0,{*} self.option_counts[question_index] File "voting/voting.py", line 145 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | array_data_sans_header%34#0,item_index%35#0,1 self.option_counts[question_index] File "voting/voting.py", line 145 + extract3 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {extract3} self.option_counts[question_index] File "voting/voting.py", line 145 + btoi // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {btoi} self.option_counts[question_index].decode() File "voting/voting.py", line 145 + frame_bury 2 // store question_options#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_options File "voting/voting.py", line 145 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | 0 urange(question_options) File "voting/voting.py", line 146 + frame_bury 3 // store range_item%37#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index File "voting/voting.py", line 146 + // Implicit fall through to close_for_header@3 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | + +close_for_header@3: + frame_dig 3 // load range_item%37#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%37#0 option_index File "voting/voting.py", line 146 + frame_dig 2 // load question_options#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%37#0,question_options#0 question_options File "voting/voting.py", line 145 + < // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {<} urange(question_options) File "voting/voting.py", line 146 + bz close_after_for@15 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | for option_index in urange(question_options): File "voting/voting.py", line 146 + // Implicit fall through to close_for_body@4 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | for option_index in urange(question_options): File "voting/voting.py", line 146 + +close_for_body@4: + frame_dig 3 // load range_item%37#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%37#0 option_index File "voting/voting.py", line 146 + dup // store option_index#0 to l-stack (copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index#0,option_index#0 option_index File "voting/voting.py", line 146 + frame_bury 0 // store option_index#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index#0 option_index File "voting/voting.py", line 146 + frame_dig 6 // load current_index#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index#0,current_index#0 current_index File "voting/voting.py", line 143 + callsub get_vote_from_box // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index#0,{get_vote_from_box} get_vote_from_box(current_index) File "voting/voting.py", line 147 + frame_bury 4 // store votes_for_option#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index#0 votes_for_option File "voting/voting.py", line 147 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index#0,0 0 File "voting/voting.py", line 150 + == // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {==} option_index == 0 File "voting/voting.py", line 150 + bz close_ternary_false@6 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | Bytes(b"[") File "voting/voting.py", line 149 + // Implicit fall through to close_ternary_true@5 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | Bytes(b"[") File "voting/voting.py", line 149 + +close_ternary_true@5: + byte "[" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | "[" b"[" File "voting/voting.py", line 149 + b close_ternary_merge@13 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | (𝕏) ternary_result%40#0 | ternary_result%40#0 + +close_ternary_false@6: + frame_dig 2 // load question_options#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_options#0 question_options File "voting/voting.py", line 145 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_options#0,1 1 File "voting/voting.py", line 152 + - // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {-} question_options - 1 File "voting/voting.py", line 152 + frame_dig 0 // load option_index#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | tmp%41#0,option_index#0 option_index File "voting/voting.py", line 146 + == // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {==} option_index == (question_options - 1) File "voting/voting.py", line 152 + bz close_ternary_false@8 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | Bytes(b"") + itob(votes_for_option) + Bytes(b"]") File "voting/voting.py", line 151 + // Implicit fall through to close_ternary_true@7 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | Bytes(b"") + itob(votes_for_option) + Bytes(b"]") File "voting/voting.py", line 151 + +close_ternary_true@7: + frame_dig 4 // load votes_for_option#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | votes_for_option#0 votes_for_option File "voting/voting.py", line 147 + itob // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {itob} itob(votes_for_option) File "voting/voting.py", line 151 + byte "" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | tmp%44#0,"" b"" File "voting/voting.py", line 151 + swap // load tmp%44#0 from l-stack (no copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | "",tmp%44#0 itob(votes_for_option) File "voting/voting.py", line 151 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {concat} Bytes(b"") + itob(votes_for_option) File "voting/voting.py", line 151 + byte "]" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | tmp%45#0,"]" b"]" File "voting/voting.py", line 151 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {concat} Bytes(b"") + itob(votes_for_option) + Bytes(b"]") File "voting/voting.py", line 151 + b close_ternary_merge@12 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | (𝕏) ternary_result%43#0 | ternary_result%43#0 + +close_ternary_false@8: + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | 0 self.option_counts File "voting/voting.py", line 154 + byte "option_counts" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | 0,"option_counts" self.option_counts File "voting/voting.py", line 154 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 154 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | app_global_get_ex_value%46#0 self.option_counts File "voting/voting.py", line 154 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | app_global_get_ex_value%46#0,0 self.option_counts.length File "voting/voting.py", line 154 + extract_uint16 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {extract_uint16} self.option_counts.length File "voting/voting.py", line 154 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | tmp%48#0,1 1 File "voting/voting.py", line 154 + - // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {-} self.option_counts.length - 1 File "voting/voting.py", line 154 + frame_dig 1 // load question_index#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | tmp%49#0,question_index#0 question_index File "voting/voting.py", line 144 + == // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {==} question_index == (self.option_counts.length - 1) File "voting/voting.py", line 154 + bz close_ternary_false@10 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | Bytes(b",") File "voting/voting.py", line 153 + // Implicit fall through to close_ternary_true@9 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | Bytes(b",") File "voting/voting.py", line 153 + +close_ternary_true@9: + byte "," // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | "," b"," File "voting/voting.py", line 153 + b close_ternary_merge@11 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | (𝕏) ternary_result%51#0 | ternary_result%51#0 + +close_ternary_false@10: + byte "" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | "" b"" File "voting/voting.py", line 155 + // Implicit fall through to close_ternary_merge@11 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | (𝕏) ternary_result%51#0 | ternary_result%51#0 + +close_ternary_merge@11: + // Implicit fall through to close_ternary_merge@12 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | (𝕏) ternary_result%43#0 | ternary_result%51#0 + +close_ternary_merge@12: + // Implicit fall through to close_ternary_merge@13 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | (𝕏) ternary_result%40#0 | ternary_result%43#0 + +close_ternary_merge@13: + frame_dig 5 // load note#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | (𝕏) ternary_result%40#0 | note#0 ternary_result%40#0 note File "voting/voting.py", line 128 + swap // load ternary_result%40#0 from x-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,ternary_result%40#0 b"[" File "voting/voting.py", line 149 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {concat} note += ( File "voting/voting.py", line 148 + frame_bury 5 // store note#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note File "voting/voting.py", line 128 + frame_dig 6 // load current_index#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | current_index#0 current_index File "voting/voting.py", line 143 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | current_index#0,1 1 File "voting/voting.py", line 157 + + // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {+} current_index += 1 File "voting/voting.py", line 157 + frame_bury 6 // store current_index#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | current_index File "voting/voting.py", line 143 + // Implicit fall through to close_for_footer@14 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | + +close_for_footer@14: + frame_dig 3 // load range_item%37#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%37#0 option_index File "voting/voting.py", line 146 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%37#0,1 urange(question_options) File "voting/voting.py", line 146 + + // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {+} urange(question_options) File "voting/voting.py", line 146 + frame_bury 3 // store range_item%37#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | option_index File "voting/voting.py", line 146 + b close_for_header@3 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | + +close_after_for@15: + // Implicit fall through to close_for_footer@16 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | + +close_for_footer@16: + frame_dig 8 // load range_item%28#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%28#0 question_index File "voting/voting.py", line 144 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | range_item%28#0,1 urange(self.option_counts.length) File "voting/voting.py", line 144 + + // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {+} urange(self.option_counts.length) File "voting/voting.py", line 144 + frame_bury 8 // store range_item%28#0 to f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | question_index File "voting/voting.py", line 144 + b close_for_header@1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | + +close_after_for@17: + frame_dig 5 // load note#0 from f-stack (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 note File "voting/voting.py", line 128 + byte "]}}" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,"]}}" b"]}}" File "voting/voting.py", line 158 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {concat} note += b"]}}" File "voting/voting.py", line 158 + itxn_begin // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.begin() File "voting/voting.py", line 159 + int acfg // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,acfg TransactionType.AssetConfig File "voting/voting.py", line 160 + itxn_field TypeEnum // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.set_type_enum(TransactionType.AssetConfig) File "voting/voting.py", line 160 + int 1 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,1 1 File "voting/voting.py", line 161 + itxn_field ConfigAssetTotal // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.set_config_asset_total(1) File "voting/voting.py", line 161 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,0 0 File "voting/voting.py", line 162 + itxn_field ConfigAssetDecimals // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.set_config_asset_decimals(0) File "voting/voting.py", line 162 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,0 False File "voting/voting.py", line 163 + itxn_field ConfigAssetDefaultFrozen // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.set_config_asset_default_frozen(False) File "voting/voting.py", line 163 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,0 self.vote_id File "voting/voting.py", line 164 + byte "vote_id" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,0,"vote_id" self.vote_id File "voting/voting.py", line 164 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.vote_id File "voting/voting.py", line 164 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,app_global_get_ex_value%52#0 self.vote_id File "voting/voting.py", line 164 + byte "[VOTE RESULT] " // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,app_global_get_ex_value%52#0,"[VOTE RESULT] " b"[VOTE RESULT] " File "voting/voting.py", line 164 + swap // load app_global_get_ex_value%52#0 from l-stack (no copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,"[VOTE RESULT] ",app_global_get_ex_value%52#0 self.vote_id File "voting/voting.py", line 164 + concat // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,{concat} b"[VOTE RESULT] " + self.vote_id File "voting/voting.py", line 164 + itxn_field ConfigAssetName // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.set_config_asset_name(b"[VOTE RESULT] " + self.vote_id) File "voting/voting.py", line 164 + byte "VOTERSLT" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,"VOTERSLT" b"VOTERSLT" File "voting/voting.py", line 165 + itxn_field ConfigAssetUnitName // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.set_config_asset_unit_name(b"VOTERSLT") File "voting/voting.py", line 165 + int 0 // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,0 self.nft_image_url File "voting/voting.py", line 166 + byte "nft_image_url" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,0,"nft_image_url" self.nft_image_url File "voting/voting.py", line 166 + app_global_get_ex // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.nft_image_url File "voting/voting.py", line 166 + assert // check value exists // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0,app_global_get_ex_value%55#0 self.nft_image_url File "voting/voting.py", line 166 + itxn_field ConfigAssetURL // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | note#0 CreateInnerTransaction.set_config_asset_url(self.nft_image_url) File "voting/voting.py", line 166 + itxn_field Note // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | CreateInnerTransaction.set_note(note) File "voting/voting.py", line 167 + itxn_submit // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | CreateInnerTransaction.submit() File "voting/voting.py", line 168 + itxn CreatedAssetID // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | {itxn} InnerTransaction.created_asset_id() File "voting/voting.py", line 169 + byte "nft_asset_id" // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | new_state_value%57#0,"nft_asset_id" self.nft_asset_id File "voting/voting.py", line 169 + swap // load new_state_value%57#0 from l-stack (no copy) (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | "nft_asset_id",new_state_value%57#0 InnerTransaction.created_asset_id() File "voting/voting.py", line 169 + app_global_put // (𝕗) option_index#0,question_index#0,question_options#0,range_item%37#0,votes_for_option#0,note#0,current_index#0,tmp%27#0,range_item%28#0 | self.nft_asset_id = InnerTransaction.created_asset_id() File "voting/voting.py", line 169 + retsub // + + +// algopy.ensure_budget(required_budget#0: uint64, fee_source#0: uint64) -> void: +ensure_budget: + proto 2 0 // (𝕡) required_budget#0,fee_source#0 | File "/algopy.py", line 14 + +ensure_budget_block@0: + frame_dig -2 // load required_budget#0 from parameters (𝕡) required_budget#0,fee_source#0 | required_budget#0 File "/algopy.py", line 14 + int 10 // (𝕡) required_budget#0,fee_source#0 | required_budget#0,10 File "/algopy.py", line 20 + + // (𝕡) required_budget#0,fee_source#0 | {+} File "/algopy.py", line 20 + // Implicit fall through to ensure_budget_while_top@1 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_while_top@1: + global OpcodeBudget // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | {global} File "/algopy.py", line 21 + frame_dig 0 // load required_budget_with_buffer#0 from f-stack (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | tmp%0#0,required_budget_with_buffer#0 File "/algopy.py", line 20 + < // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | {<} File "/algopy.py", line 21 + bz ensure_budget_after_while@7 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 21 + // Implicit fall through to ensure_budget_while_body@2 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 21 + +ensure_budget_while_body@2: + itxn_begin // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 22 + int appl // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | appl File "/algopy.py", line 23 + itxn_field TypeEnum // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 23 + int DeleteApplication // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | DeleteApplication File "/algopy.py", line 24 + itxn_field OnCompletion // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 24 + byte 0x068101 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0x068101 File "/algopy.py", line 25 + itxn_field ApprovalProgram // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 25 + byte 0x068101 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0x068101 File "/algopy.py", line 26 + itxn_field ClearStateProgram // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 26 + int 0 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0 File "/algopy.py", line 28 + int 1 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0,1 File "/algopy.py", line 30 + frame_dig -1 // load fee_source#0 from parameters (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0,1,fee_source#0 File "/algopy.py", line 14 + match ensure_budget_switch_case_0@3 ensure_budget_switch_case_1@4 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 27 + b ensure_budget_switch_case_default@5 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 27 + +ensure_budget_switch_case_0@3: + int 0 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | 0 File "/algopy.py", line 29 + itxn_field Fee // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 29 + b ensure_budget_switch_case_next@6 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_switch_case_1@4: + global MinTxnFee // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | {global} File "/algopy.py", line 31 + itxn_field Fee // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 31 + b ensure_budget_switch_case_next@6 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_switch_case_default@5: + // Implicit fall through to ensure_budget_switch_case_next@6 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_switch_case_next@6: + itxn_submit // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | File "/algopy.py", line 32 + b ensure_budget_while_top@1 // (𝕡) required_budget#0,fee_source#0 | (𝕗) required_budget_with_buffer#0 | + +ensure_budget_after_while@7: + retsub // + + +// examples.voting.voting.get_vote_from_box(index#0: uint64) -> uint64: +get_vote_from_box: + proto 1 1 // (𝕡) index#0 | def get_vote_from_box(index: UInt64) -> UInt64: File "voting/voting.py", line 263 + +get_vote_from_box_block@0: + byte "V" // (𝕡) index#0 | "V" TALLY_BOX_KEY File "voting/voting.py", line 264 + box_get // (𝕡) index#0 | {box_get}.0,{box_get}.1 Box.get(TALLY_BOX_KEY) File "voting/voting.py", line 264 + assert // Box not created // (𝕡) index#0 | box_data#0 assert exists, "Box not created" File "voting/voting.py", line 265 + frame_dig -1 // load index#0 from parameters (𝕡) index#0 | box_data#0,index#0 index: UInt64 File "voting/voting.py", line 263 + int 8 // (𝕡) index#0 | box_data#0,index#0,8 VOTE_COUNT_BYTES File "voting/voting.py", line 266 + extract3 // (𝕡) index#0 | {extract3} extract(box_data, index, VOTE_COUNT_BYTES) File "voting/voting.py", line 266 + btoi // (𝕡) index#0 | {btoi} btoi(extract(box_data, index, VOTE_COUNT_BYTES)) File "voting/voting.py", line 266 + retsub // tmp%3#0 return btoi(extract(box_data, index, VOTE_COUNT_BYTES)) File "voting/voting.py", line 266 + + +// examples.voting.voting.VotingRoundApp.get_preconditions(signature#0: bytes) -> bytes: +get_preconditions: + proto 1 1 // (𝕡) signature#0 | def get_preconditions(self, signature: arc4.DynamicBytes) -> VotingPreconditions: File "voting/voting.py", line 172 + +get_preconditions_block@0: + callsub voting_open // (𝕡) signature#0 | {voting_open} self.voting_open() File "voting/voting.py", line 174 + itob // (𝕡) signature#0 | {itob} arc4.UInt64(self.voting_open()) File "voting/voting.py", line 174 + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | (𝕗) val_as_bytes%1#0 | signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 172 + len // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0 | {len} signature.bytes[2:] File "voting/voting.py", line 175 + dup // store awst_tmp%2#0 to l-stack (copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0 | awst_tmp%2#0,awst_tmp%2#0 signature.bytes[2:] File "voting/voting.py", line 175 + swap // store awst_tmp%2#0 to f-stack (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | awst_tmp%2#0 signature.bytes[2:] File "voting/voting.py", line 175 + int 2 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | awst_tmp%2#0,2 2 File "voting/voting.py", line 175 + > // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {>} signature.bytes[2:] File "voting/voting.py", line 175 + bz get_preconditions_ternary_false@2 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | signature.bytes[2:] File "voting/voting.py", line 175 + // Implicit fall through to get_preconditions_ternary_true@1 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | signature.bytes[2:] File "voting/voting.py", line 175 + +get_preconditions_ternary_true@1: + int 2 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | 2 2 File "voting/voting.py", line 175 + b get_preconditions_ternary_merge@3 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | ternary_result%4#0 + +get_preconditions_ternary_false@2: + frame_dig 1 // load awst_tmp%2#0 from f-stack (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | awst_tmp%2#0 signature.bytes[2:] File "voting/voting.py", line 175 + // Implicit fall through to get_preconditions_ternary_merge@3 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | ternary_result%4#0 + +get_preconditions_ternary_merge@3: + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | signature#0 ternary_result%4#0 signature: arc4.DynamicBytes File "voting/voting.py", line 172 + len // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | {len} signature.bytes[2:] File "voting/voting.py", line 175 + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | (𝕏) ternary_result%4#0 | base_length%5#0,signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 172 + cover 2 // virtual: 2 ops (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | signature#0,ternary_result%4#0,base_length%5#0 signature.bytes[2:])), File "voting/voting.py", line 175 + substring3 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {substring3} signature.bytes[2:] File "voting/voting.py", line 175 + callsub allowed_to_vote // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {allowed_to_vote} self.allowed_to_vote(signature.bytes[2:]) File "voting/voting.py", line 175 + itob // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {itob} arc4.UInt64(self.allowed_to_vote(signature.bytes[2:])) File "voting/voting.py", line 175 + callsub already_voted // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,{already_voted} self.already_voted() File "voting/voting.py", line 176 + itob // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,{itob} arc4.UInt64(self.already_voted()) File "voting/voting.py", line 176 + global LatestTimestamp // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,{global} Global.latest_timestamp() File "voting/voting.py", line 177 + itob // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,{itob} arc4.UInt64(Global.latest_timestamp()) File "voting/voting.py", line 177 + int 32 // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,val_as_bytes%12#0,32 VotingPreconditions( File "voting/voting.py", line 173 + pop // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,val_as_bytes%12#0 VotingPreconditions( File "voting/voting.py", line 173 + byte 0x // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,val_as_bytes%12#0,0x VotingPreconditions( File "voting/voting.py", line 173 + frame_dig 0 // load val_as_bytes%1#0 from f-stack (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,val_as_bytes%12#0,encoded_tuple_buffer%14#0,val_as_bytes%1#0 arc4.UInt64(self.voting_open()) File "voting/voting.py", line 174 + concat // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%8#0,val_as_bytes%10#0,val_as_bytes%12#0,{concat} VotingPreconditions( File "voting/voting.py", line 173 + uncover 3 // load val_as_bytes%8#0 from l-stack (no copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%10#0,val_as_bytes%12#0,encoded_tuple_buffer%14#0,val_as_bytes%8#0 arc4.UInt64(self.allowed_to_vote(signature.bytes[2:])) File "voting/voting.py", line 175 + concat // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%10#0,val_as_bytes%12#0,{concat} VotingPreconditions( File "voting/voting.py", line 173 + uncover 2 // load val_as_bytes%10#0 from l-stack (no copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%12#0,encoded_tuple_buffer%14#0,val_as_bytes%10#0 arc4.UInt64(self.already_voted()) File "voting/voting.py", line 176 + concat // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | val_as_bytes%12#0,{concat} VotingPreconditions( File "voting/voting.py", line 173 + swap // load val_as_bytes%12#0 from l-stack (no copy) (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | encoded_tuple_buffer%14#0,val_as_bytes%12#0 arc4.UInt64(Global.latest_timestamp()) File "voting/voting.py", line 177 + concat // (𝕡) signature#0 | (𝕗) val_as_bytes%1#0,awst_tmp%2#0 | {concat} VotingPreconditions( File "voting/voting.py", line 173 + frame_bury 0 + retsub // encoded_tuple_buffer%14#0 return VotingPreconditions( File "voting/voting.py", line 173 + + +// examples.voting.voting.VotingRoundApp.voting_open() -> uint64: +voting_open: + proto 0 1 // def voting_open(self) -> bool: File "voting/voting.py", line 220 + byte "" // allocate 1 to stack (𝕗) awst_tmp%6#0 | + +voting_open_block@0: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.is_bootstrapped File "voting/voting.py", line 222 + byte "is_bootstrapped" // (𝕗) awst_tmp%6#0 | 0,"is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 222 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.is_bootstrapped File "voting/voting.py", line 222 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%0#0 self.is_bootstrapped File "voting/voting.py", line 222 + bz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | self.is_bootstrapped File "voting/voting.py", line 222 + // Implicit fall through to voting_open_and_contd@1 // (𝕗) awst_tmp%6#0 | self.is_bootstrapped File "voting/voting.py", line 222 + +voting_open_and_contd@1: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.close_time File "voting/voting.py", line 223 + byte "close_time" // (𝕗) awst_tmp%6#0 | 0,"close_time" self.close_time File "voting/voting.py", line 223 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.close_time File "voting/voting.py", line 223 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%2#0 self.close_time File "voting/voting.py", line 223 + bnz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | not self.close_time File "voting/voting.py", line 223 + // Implicit fall through to voting_open_and_contd@2 // (𝕗) awst_tmp%6#0 | not self.close_time File "voting/voting.py", line 223 + +voting_open_and_contd@2: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.start_time File "voting/voting.py", line 224 + byte "start_time" // (𝕗) awst_tmp%6#0 | 0,"start_time" self.start_time File "voting/voting.py", line 224 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.start_time File "voting/voting.py", line 224 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0 self.start_time File "voting/voting.py", line 224 + global LatestTimestamp // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0,{global} Global.latest_timestamp() File "voting/voting.py", line 224 + dup // store awst_tmp%6#0 to l-stack (copy) (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0,awst_tmp%6#0,awst_tmp%6#0 Global.latest_timestamp() File "voting/voting.py", line 224 + frame_bury 0 // store awst_tmp%6#0 to f-stack (𝕗) awst_tmp%6#0 | app_global_get_ex_value%4#0,awst_tmp%6#0 Global.latest_timestamp() File "voting/voting.py", line 224 + <= // (𝕗) awst_tmp%6#0 | {<=} self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + bz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + // Implicit fall through to voting_open_and_contd@3 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + +voting_open_and_contd@3: + int 0 // (𝕗) awst_tmp%6#0 | 0 self.end_time File "voting/voting.py", line 224 + byte "end_time" // (𝕗) awst_tmp%6#0 | 0,"end_time" self.end_time File "voting/voting.py", line 224 + app_global_get_ex // (𝕗) awst_tmp%6#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.end_time File "voting/voting.py", line 224 + assert // check value exists // (𝕗) awst_tmp%6#0 | app_global_get_ex_value%8#0 self.end_time File "voting/voting.py", line 224 + frame_dig 0 // load awst_tmp%6#0 from f-stack (𝕗) awst_tmp%6#0 | app_global_get_ex_value%8#0,awst_tmp%6#0 Global.latest_timestamp() File "voting/voting.py", line 224 + >= // (𝕗) awst_tmp%6#0 | {>=} Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + bz voting_open_bool_false@5 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + // Implicit fall through to voting_open_bool_true@4 // (𝕗) awst_tmp%6#0 | self.start_time <= Global.latest_timestamp() <= self.end_time File "voting/voting.py", line 224 + +voting_open_bool_true@4: + int 1 // (𝕗) awst_tmp%6#0 | 1 + b voting_open_bool_merge@6 // (𝕗) awst_tmp%6#0 | (𝕏) and_result%11#0 | and_result%11#0 + +voting_open_bool_false@5: + int 0 // (𝕗) awst_tmp%6#0 | 0 + // Implicit fall through to voting_open_bool_merge@6 // (𝕗) awst_tmp%6#0 | (𝕏) and_result%11#0 | and_result%11#0 + +voting_open_bool_merge@6: + swap + retsub // and_result%11#0 and_result%11#0 return ( File "voting/voting.py", line 221 + + +// examples.voting.voting.VotingRoundApp.allowed_to_vote(signature#0: bytes) -> uint64: +allowed_to_vote: + proto 1 1 // (𝕡) signature#0 | def allowed_to_vote(self, signature: Bytes) -> bool: File "voting/voting.py", line 253 + +allowed_to_vote_block@0: + int 2000 // (𝕡) signature#0 | 2000 2000 File "voting/voting.py", line 254 + int 2 // (𝕡) signature#0 | 2000,2 ensure_budget(2000) File "voting/voting.py", line 254 + callsub ensure_budget // (𝕡) signature#0 | ensure_budget(2000) File "voting/voting.py", line 254 + txn Sender // (𝕡) signature#0 | {txn} Transaction.sender() File "voting/voting.py", line 256 + int 0 // (𝕡) signature#0 | tmp%0#0,0 self.snapshot_public_key File "voting/voting.py", line 258 + byte "snapshot_public_key" // (𝕡) signature#0 | tmp%0#0,0,"snapshot_public_key" self.snapshot_public_key File "voting/voting.py", line 258 + app_global_get_ex // (𝕡) signature#0 | tmp%0#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.snapshot_public_key File "voting/voting.py", line 258 + assert // check value exists // (𝕡) signature#0 | tmp%0#0,app_global_get_ex_value%1#0 self.snapshot_public_key File "voting/voting.py", line 258 + swap // load tmp%0#0 from l-stack (no copy) (𝕡) signature#0 | app_global_get_ex_value%1#0,tmp%0#0 Transaction.sender() File "voting/voting.py", line 256 + frame_dig -1 // load signature#0 from parameters (𝕡) signature#0 | app_global_get_ex_value%1#0,tmp%0#0,signature#0 signature: Bytes File "voting/voting.py", line 253 + uncover 2 // load app_global_get_ex_value%1#0 from l-stack (no copy) (𝕡) signature#0 | tmp%0#0,signature#0,app_global_get_ex_value%1#0 self.snapshot_public_key File "voting/voting.py", line 258 + ed25519verify_bare // (𝕡) signature#0 | {ed25519verify_bare} ed25519verify_bare( File "voting/voting.py", line 255 + retsub // tmp%3#0 return ed25519verify_bare( File "voting/voting.py", line 255 + + +// examples.voting.voting.VotingRoundApp.already_voted() -> uint64: +already_voted: + proto 0 1 // def already_voted(self) -> bool: File "voting/voting.py", line 228 + +already_voted_block@0: + txn Sender // {txn} Transaction.sender() File "voting/voting.py", line 229 + box_get // {box_get}.0,{box_get}.1 Box.get(Transaction.sender().bytes) File "voting/voting.py", line 229 + swap // store tuple_assignment%2#0 to l-stack (no copy) tuple_assignment%2#0,{box_get}.0 Box.get(Transaction.sender().bytes) File "voting/voting.py", line 229 + pop // tuple_assignment%2#0 Box.get(Transaction.sender().bytes) File "voting/voting.py", line 229 + retsub // exists#0 return exists File "voting/voting.py", line 230 + + +// examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req#0: uint64, signature#0: bytes, answer_ids#0: bytes) -> void: +vote: + proto 3 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | def vote( File "voting/voting.py", line 181 + byte "" + dupn 2 // allocate 3 to stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0 | + +vote_block@0: + int 7700 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0 | 7700 7700 File "voting/voting.py", line 188 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0 | 7700,0 OpUpFeeSource.GroupCredit File "voting/voting.py", line 188 + callsub ensure_budget // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0 | ensure_budget(7700, fee_source=OpUpFeeSource.GroupCredit) File "voting/voting.py", line 188 + frame_dig -2 // load signature#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0 | signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 184 + len // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0 | {len} signature.bytes[2:] File "voting/voting.py", line 190 + dup // store awst_tmp%0#0 to l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0 | awst_tmp%0#0,awst_tmp%0#0 signature.bytes[2:] File "voting/voting.py", line 190 + swap // store awst_tmp%0#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | awst_tmp%0#0 signature.bytes[2:] File "voting/voting.py", line 190 + int 2 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | awst_tmp%0#0,2 2 File "voting/voting.py", line 190 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {>} signature.bytes[2:] File "voting/voting.py", line 190 + bz vote_ternary_false@2 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | signature.bytes[2:] File "voting/voting.py", line 190 + // Implicit fall through to vote_ternary_true@1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | signature.bytes[2:] File "voting/voting.py", line 190 + +vote_ternary_true@1: + int 2 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | 2 2 File "voting/voting.py", line 190 + b vote_ternary_merge@3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | ternary_result%2#0 + +vote_ternary_false@2: + frame_dig 3 // load awst_tmp%0#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | awst_tmp%0#0 signature.bytes[2:] File "voting/voting.py", line 190 + // Implicit fall through to vote_ternary_merge@3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | ternary_result%2#0 + +vote_ternary_merge@3: + frame_dig -2 // load signature#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | signature#0 ternary_result%2#0 signature: arc4.DynamicBytes File "voting/voting.py", line 184 + len // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | {len} signature.bytes[2:] File "voting/voting.py", line 190 + frame_dig -2 // load signature#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | (𝕏) ternary_result%2#0 | base_length%3#0,signature#0 signature: arc4.DynamicBytes File "voting/voting.py", line 184 + cover 2 // virtual: 2 ops (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | signature#0,ternary_result%2#0,base_length%3#0 signature.bytes[2:]), "Not allowed to vote" File "voting/voting.py", line 190 + substring3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {substring3} signature.bytes[2:] File "voting/voting.py", line 190 + callsub allowed_to_vote // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {allowed_to_vote} self.allowed_to_vote(signature.bytes[2:]) File "voting/voting.py", line 190 + assert // Not allowed to vote // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | assert self.allowed_to_vote(signature.bytes[2:]), "Not allowed to vote" File "voting/voting.py", line 190 + callsub voting_open // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {voting_open} self.voting_open() File "voting/voting.py", line 191 + assert // Voting not open // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | assert self.voting_open(), "Voting not open" File "voting/voting.py", line 191 + callsub already_voted // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {already_voted} self.already_voted() File "voting/voting.py", line 192 + ! // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {!} not self.already_voted() File "voting/voting.py", line 192 + assert // Already voted // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | assert not self.already_voted(), "Already voted" File "voting/voting.py", line 192 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | 0 self.option_counts File "voting/voting.py", line 193 + byte "option_counts" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | 0,"option_counts" self.option_counts File "voting/voting.py", line 193 + app_global_get_ex // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 193 + assert // check value exists // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | app_global_get_ex_value%9#0 self.option_counts File "voting/voting.py", line 193 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | app_global_get_ex_value%9#0,0 self.option_counts.length File "voting/voting.py", line 193 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {extract_uint16} self.option_counts.length File "voting/voting.py", line 193 + dup // store questions_count#0 to l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | questions_count#0,questions_count#0 questions_count File "voting/voting.py", line 193 + frame_bury 1 // store questions_count#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | questions_count#0 questions_count File "voting/voting.py", line 193 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | questions_count#0,answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | questions_count#0,answer_ids#0,0 answer_ids.length File "voting/voting.py", line 194 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | questions_count#0,{extract_uint16} answer_ids.length File "voting/voting.py", line 194 + == // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {==} answer_ids.length == questions_count, "Number of answers incorrect" File "voting/voting.py", line 194 + assert // Number of answers incorrect // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | assert answer_ids.length == questions_count, "Number of answers incorrect" File "voting/voting.py", line 194 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_ids#0,0 answer_ids.length File "voting/voting.py", line 197 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {extract_uint16} answer_ids.length File "voting/voting.py", line 197 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | tmp%13#0,1 VOTE_INDEX_BYTES File "voting/voting.py", line 197 + * // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {*} VOTE_INDEX_BYTES * answer_ids.length File "voting/voting.py", line 197 + int 34 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | tmp%14#0,34 32 + 2 File "voting/voting.py", line 197 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {+} 32 + 2 + VOTE_INDEX_BYTES * answer_ids.length File "voting/voting.py", line 197 + int 400 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | tmp%15#0,400 BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 197 + * // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {*} (32 + 2 + VOTE_INDEX_BYTES * answer_ids.length) * BOX_BYTE_MIN_BALANCE File "voting/voting.py", line 197 + int 2500 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | tmp%16#0,2500 BOX_FLAT_MIN_BALANCE File "voting/voting.py", line 196 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {+} BOX_FLAT_MIN_BALANCE + ( File "voting/voting.py", line 196 + frame_dig -3 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 183 + gtxns Receiver // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,{gtxns} fund_min_bal_req.receiver File "voting/voting.py", line 200 + global CurrentApplicationAddress // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,tmp%17#0,{global} Global.current_application_address() File "voting/voting.py", line 200 + == // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,{==} fund_min_bal_req.receiver == Global.current_application_address() File "voting/voting.py", line 200 + assert // Payment must be to app address // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0 assert ( File "voting/voting.py", line 199 + dup // load min_bal_req#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,min_bal_req#0 min_bal_req File "voting/voting.py", line 196 + itob // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,{itob} itob(min_bal_req) File "voting/voting.py", line 203 + log // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0 log(itob(min_bal_req)) File "voting/voting.py", line 203 + frame_dig -3 // load fund_min_bal_req#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,fund_min_bal_req#0 fund_min_bal_req: PaymentTransaction File "voting/voting.py", line 183 + gtxns Amount // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | min_bal_req#0,{gtxns} fund_min_bal_req.amount File "voting/voting.py", line 204 + == // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {==} fund_min_bal_req.amount == min_bal_req, "Payment must be the exact min balance" File "voting/voting.py", line 204 + assert // Payment must be the exact min balance // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | assert fund_min_bal_req.amount == min_bal_req, "Payment must be the exact min balance" File "voting/voting.py", line 204 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | 0 0 File "voting/voting.py", line 206 + frame_bury 0 // store cumulative_offset#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | cumulative_offset File "voting/voting.py", line 206 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | 0 urange(questions_count) File "voting/voting.py", line 207 + frame_bury 2 // store range_item%23#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index File "voting/voting.py", line 207 + // Implicit fall through to vote_for_header@4 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | + +vote_for_header@4: + frame_dig 2 // load range_item%23#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | range_item%23#0 question_index File "voting/voting.py", line 207 + frame_dig 1 // load questions_count#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | range_item%23#0,questions_count#0 questions_count File "voting/voting.py", line 193 + < // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {<} urange(questions_count) File "voting/voting.py", line 207 + bz vote_after_for@7 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | for question_index in urange(questions_count): File "voting/voting.py", line 207 + // Implicit fall through to vote_for_body@5 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | for question_index in urange(questions_count): File "voting/voting.py", line 207 + +vote_for_body@5: + frame_dig 2 // load range_item%23#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | range_item%23#0 question_index File "voting/voting.py", line 207 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,answer_ids#0,0 answer_ids[question_index] File "voting/voting.py", line 209 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,{extract_uint16} answer_ids[question_index] File "voting/voting.py", line 209 + dig 1 // load question_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,array_length%25#0,question_index#0 question_index File "voting/voting.py", line 207 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,{>} answer_ids[question_index] File "voting/voting.py", line 209 + assert // Index access is out of bounds // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0 answer_ids[question_index] File "voting/voting.py", line 209 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + extract 2 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,{extract} answer_ids[question_index] File "voting/voting.py", line 209 + dig 1 // load question_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,array_data_sans_header%27#0,question_index#0 question_index File "voting/voting.py", line 207 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,array_data_sans_header%27#0,question_index#0,1 answer_ids[question_index] File "voting/voting.py", line 209 + * // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,array_data_sans_header%27#0,{*} answer_ids[question_index] File "voting/voting.py", line 209 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,array_data_sans_header%27#0,item_index%28#0,1 answer_ids[question_index] File "voting/voting.py", line 209 + extract3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index#0,{extract3} answer_ids[question_index] File "voting/voting.py", line 209 + swap // store answer_option_index#0 to l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0 answer_option_index File "voting/voting.py", line 209 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,0 self.option_counts File "voting/voting.py", line 210 + byte "option_counts" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,0,"option_counts" self.option_counts File "voting/voting.py", line 210 + app_global_get_ex // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,{app_global_get_ex}.0,{app_global_get_ex}.1 self.option_counts File "voting/voting.py", line 210 + assert // check value exists // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0 self.option_counts File "voting/voting.py", line 210 + dup // load app_global_get_ex_value%29#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,app_global_get_ex_value%29#0 self.option_counts File "voting/voting.py", line 210 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,app_global_get_ex_value%29#0,0 self.option_counts[question_index] File "voting/voting.py", line 210 + extract_uint16 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,{extract_uint16} self.option_counts[question_index] File "voting/voting.py", line 210 + dig 2 // load question_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,array_length%31#0,question_index#0 question_index File "voting/voting.py", line 207 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0,{>} self.option_counts[question_index] File "voting/voting.py", line 210 + assert // Index access is out of bounds // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,app_global_get_ex_value%29#0 self.option_counts[question_index] File "voting/voting.py", line 210 + extract 2 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,question_index#0,{extract} self.option_counts[question_index] File "voting/voting.py", line 210 + swap // load question_index#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,array_data_sans_header%33#0,question_index#0 question_index File "voting/voting.py", line 207 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,array_data_sans_header%33#0,question_index#0,1 self.option_counts[question_index] File "voting/voting.py", line 210 + * // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,array_data_sans_header%33#0,{*} self.option_counts[question_index] File "voting/voting.py", line 210 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,array_data_sans_header%33#0,item_index%34#0,1 self.option_counts[question_index] File "voting/voting.py", line 210 + extract3 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,{extract3} self.option_counts[question_index] File "voting/voting.py", line 210 + dig 1 // load answer_option_index#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,options_count#0,answer_option_index#0 answer_option_index File "voting/voting.py", line 209 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,options_count#0,{btoi} answer_option_index.decode() File "voting/voting.py", line 212 + swap // store tmp%35#0 to l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,tmp%35#0,options_count#0 answer_option_index.decode() File "voting/voting.py", line 212 + dup // load options_count#0 from l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,tmp%35#0,options_count#0,options_count#0 options_count File "voting/voting.py", line 210 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,tmp%35#0,options_count#0,{btoi} options_count.decode() File "voting/voting.py", line 212 + uncover 2 // load tmp%35#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,options_count#0,tmp%36#0,tmp%35#0 answer_option_index.decode() File "voting/voting.py", line 212 + > // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,options_count#0,{>} answer_option_index.decode() < options_count.decode() File "voting/voting.py", line 212 + assert // Answer option index invalid // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | answer_option_index#0,options_count#0 assert ( File "voting/voting.py", line 211 + swap // load answer_option_index#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | options_count#0,answer_option_index#0 answer_option_index File "voting/voting.py", line 209 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | options_count#0,{btoi} answer_option_index.decode() File "voting/voting.py", line 214 + frame_dig 0 // load cumulative_offset#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | options_count#0,tmp%38#0,cumulative_offset#0 cumulative_offset File "voting/voting.py", line 206 + dup + cover 2 // store cumulative_offset#0 to l-stack (copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | options_count#0,cumulative_offset#0,tmp%38#0,cumulative_offset#0 cumulative_offset File "voting/voting.py", line 206 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | options_count#0,cumulative_offset#0,{+} cumulative_offset + answer_option_index.decode() File "voting/voting.py", line 214 + callsub increment_vote_in_box // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | options_count#0,cumulative_offset#0 increment_vote_in_box(cumulative_offset + answer_option_index.decode()) File "voting/voting.py", line 214 + swap // load options_count#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | cumulative_offset#0,options_count#0 options_count File "voting/voting.py", line 210 + btoi // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | cumulative_offset#0,{btoi} options_count.decode() File "voting/voting.py", line 215 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {+} cumulative_offset += options_count.decode() File "voting/voting.py", line 215 + frame_bury 0 // store cumulative_offset#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | cumulative_offset File "voting/voting.py", line 206 + txn Sender // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {txn} Transaction.sender() File "voting/voting.py", line 216 + frame_dig -1 // load answer_ids#0 from parameters (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | tmp%41#0,answer_ids#0 answer_ids: VoteIndexArray File "voting/voting.py", line 185 + box_put // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | Box.put(Transaction.sender().bytes, answer_ids.bytes) File "voting/voting.py", line 216 + int 0 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | 0 self.voter_count File "voting/voting.py", line 217 + byte "voter_count" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | 0,"voter_count" self.voter_count File "voting/voting.py", line 217 + app_global_get_ex // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {app_global_get_ex}.0,{app_global_get_ex}.1 self.voter_count File "voting/voting.py", line 217 + assert // check value exists // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | app_global_get_ex_value%42#0 self.voter_count File "voting/voting.py", line 217 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | app_global_get_ex_value%42#0,1 1 File "voting/voting.py", line 217 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {+} self.voter_count += 1 File "voting/voting.py", line 217 + byte "voter_count" // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | new_state_value%44#0,"voter_count" self.voter_count File "voting/voting.py", line 217 + swap // load new_state_value%44#0 from l-stack (no copy) (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | "voter_count",new_state_value%44#0 self.voter_count += 1 File "voting/voting.py", line 217 + app_global_put // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | self.voter_count += 1 File "voting/voting.py", line 217 + // Implicit fall through to vote_for_footer@6 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | + +vote_for_footer@6: + frame_dig 2 // load range_item%23#0 from f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | range_item%23#0 question_index File "voting/voting.py", line 207 + int 1 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | range_item%23#0,1 urange(questions_count) File "voting/voting.py", line 207 + + // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | {+} urange(questions_count) File "voting/voting.py", line 207 + frame_bury 2 // store range_item%23#0 to f-stack (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | question_index File "voting/voting.py", line 207 + b vote_for_header@4 // (𝕡) fund_min_bal_req#0,signature#0,answer_ids#0 | (𝕗) cumulative_offset#0,questions_count#0,range_item%23#0,awst_tmp%0#0 | + +vote_after_for@7: + retsub // + + +// examples.voting.voting.increment_vote_in_box(index#0: uint64) -> void: +increment_vote_in_box: + proto 1 0 // (𝕡) index#0 | def increment_vote_in_box(index: UInt64) -> None: File "voting/voting.py", line 270 + +increment_vote_in_box_block@0: + byte "V" // (𝕡) index#0 | "V" TALLY_BOX_KEY File "voting/voting.py", line 271 + box_get // (𝕡) index#0 | {box_get}.0,{box_get}.1 Box.get(TALLY_BOX_KEY) File "voting/voting.py", line 271 + assert // Box not created // (𝕡) index#0 | box_data#0 assert exists, "Box not created" File "voting/voting.py", line 272 + frame_dig -1 // load index#0 from parameters (𝕡) index#0 | box_data#0,index#0 index: UInt64 File "voting/voting.py", line 270 + int 8 // (𝕡) index#0 | box_data#0,index#0,8 VOTE_COUNT_BYTES File "voting/voting.py", line 273 + extract3 // (𝕡) index#0 | {extract3} extract(box_data, index, VOTE_COUNT_BYTES) File "voting/voting.py", line 273 + btoi // (𝕡) index#0 | {btoi} btoi(extract(box_data, index, VOTE_COUNT_BYTES)) File "voting/voting.py", line 273 + int 1 // (𝕡) index#0 | current_vote#0,1 1 File "voting/voting.py", line 274 + + // (𝕡) index#0 | {+} current_vote + 1 File "voting/voting.py", line 274 + itob // (𝕡) index#0 | {itob} itob(current_vote + 1) File "voting/voting.py", line 274 + byte "V" // (𝕡) index#0 | tmp%4#0,"V" TALLY_BOX_KEY File "voting/voting.py", line 274 + frame_dig -1 // load index#0 from parameters (𝕡) index#0 | tmp%4#0,"V",index#0 index: UInt64 File "voting/voting.py", line 270 + uncover 2 // load tmp%4#0 from l-stack (no copy) (𝕡) index#0 | "V",index#0,tmp%4#0 itob(current_vote + 1) File "voting/voting.py", line 274 + box_replace // (𝕡) index#0 | Box.replace(TALLY_BOX_KEY, index, itob(current_vote + 1)) File "voting/voting.py", line 274 + retsub // + + +// examples.voting.voting.VotingRoundApp.__init__() -> void: +__init__: + proto 0 0 // def __init__(self) -> None: File "voting/voting.py", line 52 + +__init___block@0: + byte "is_bootstrapped" // "is_bootstrapped" self.is_bootstrapped File "voting/voting.py", line 53 + int 0 // "is_bootstrapped",0 False File "voting/voting.py", line 53 + app_global_put // self.is_bootstrapped = False File "voting/voting.py", line 53 + byte "voter_count" // "voter_count" self.voter_count File "voting/voting.py", line 55 + int 0 // "voter_count",0 0 File "voting/voting.py", line 55 + app_global_put // self.voter_count = UInt64(0) File "voting/voting.py", line 55 + byte "close_time" // "close_time" self.close_time File "voting/voting.py", line 56 + int 0 // "close_time",0 0 File "voting/voting.py", line 56 + app_global_put // self.close_time = UInt64(0) File "voting/voting.py", line 56 + byte "nft_asset_id" // "nft_asset_id" self.nft_asset_id File "voting/voting.py", line 57 + int 0 // "nft_asset_id",0 0 File "voting/voting.py", line 57 + app_global_put // self.nft_asset_id = UInt64(0) File "voting/voting.py", line 57 + byte "snapshot_public_key" // "snapshot_public_key" self.snapshot_public_key File "voting/voting.py", line 59 + byte "" // "snapshot_public_key","" Bytes() File "voting/voting.py", line 59 + app_global_put // self.snapshot_public_key = Bytes() File "voting/voting.py", line 59 + byte "vote_id" // "vote_id" self.vote_id File "voting/voting.py", line 60 + byte "" // "vote_id","" Bytes() File "voting/voting.py", line 60 + app_global_put // self.vote_id = Bytes() File "voting/voting.py", line 60 + byte "metadata_ipfs_cid" // "metadata_ipfs_cid" self.metadata_ipfs_cid File "voting/voting.py", line 61 + byte "" // "metadata_ipfs_cid","" Bytes() File "voting/voting.py", line 61 + app_global_put // self.metadata_ipfs_cid = Bytes() File "voting/voting.py", line 61 + byte "start_time" // "start_time" self.start_time File "voting/voting.py", line 62 + int 0 // "start_time",0 0 File "voting/voting.py", line 62 + app_global_put // self.start_time = UInt64(0) File "voting/voting.py", line 62 + byte "end_time" // "end_time" self.end_time File "voting/voting.py", line 63 + int 0 // "end_time",0 0 File "voting/voting.py", line 63 + app_global_put // self.end_time = UInt64(0) File "voting/voting.py", line 63 + byte "quorum" // "quorum" self.quorum File "voting/voting.py", line 64 + int 0 // "quorum",0 0 File "voting/voting.py", line 64 + app_global_put // self.quorum = UInt64(0) File "voting/voting.py", line 64 + byte "nft_image_url" // "nft_image_url" self.nft_image_url File "voting/voting.py", line 65 + byte "" // "nft_image_url","" Bytes() File "voting/voting.py", line 65 + app_global_put // self.nft_image_url = Bytes() File "voting/voting.py", line 65 + byte "option_counts" // "option_counts" self.option_counts File "voting/voting.py", line 66 + byte 0x0000 // "option_counts",0x0000 VoteIndexArray() File "voting/voting.py", line 66 + app_global_put // self.option_counts = VoteIndexArray() File "voting/voting.py", line 66 + byte "total_options" // "total_options" self.total_options File "voting/voting.py", line 67 + int 0 // "total_options",0 0 File "voting/voting.py", line 67 + app_global_put // self.total_options = UInt64(0) File "voting/voting.py", line 67 + retsub // + diff --git a/examples/voting/out/voting.approval_unoptimized.teal b/examples/voting/out/voting.approval_unoptimized.teal new file mode 100644 index 0000000000..0f0c195514 --- /dev/null +++ b/examples/voting/out/voting.approval_unoptimized.teal @@ -0,0 +1,971 @@ +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.approval_program() -> uint64: +main_block@0: + txn ApplicationID + bnz main_entrypoint@2 + +main_on_create@1: + callsub __init__ + +main_entrypoint@2: + txn NumAppArgs + bz main_after_if_else@11 + +main_abi_routing@3: + txna ApplicationArgs 0 + method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" + method "bootstrap(pay)void" + method "close()void" + method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" + method "vote(pay,byte[],uint8[])void" + uncover 5 + match main_create_route@4 main_bootstrap_route@5 main_close_route@6 main_get_preconditions_route@7 main_vote_route@8 + b main_switch_case_default@9 + +main_create_route@4: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + ! + assert // is 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 + callsub create + int 1 + return + +main_bootstrap_route@5: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + callsub bootstrap + int 1 + return + +main_close_route@6: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub close + int 1 + return + +main_get_preconditions_route@7: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txna ApplicationArgs 1 + callsub get_preconditions + byte 0x151f7c75 + swap + concat + log + int 1 + return + +main_vote_route@8: + txn OnCompletion + int NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + txn GroupIndex + int 1 + - + dup + gtxns TypeEnum + int pay + == + assert // transaction type is pay + txna ApplicationArgs 1 + txna ApplicationArgs 2 + callsub vote + int 1 + return + +main_switch_case_default@9: + +main_switch_case_next@10: + +main_after_if_else@11: + err // reject transaction + + +// examples.voting.voting.VotingRoundApp.create(vote_id#0: bytes, snapshot_public_key#0: bytes, metadata_ipfs_cid#0: bytes, start_time#0: bytes, end_time#0: bytes, option_counts#0: bytes, quorum#0: bytes, nft_image_url#0: bytes) -> void: +create: + proto 8 0 + +create_block@0: + frame_dig -5 + btoi + dup + swap + frame_dig -4 + btoi + dup + cover 2 + dup + cover 2 + < + assert // End time should be after start time + global LatestTimestamp + >= + assert // End time should be in the future + frame_dig -8 + extract 2 0 + byte "vote_id" + swap + app_global_put + frame_dig -7 + len + dup + swap + int 2 + > + bz create_ternary_false@2 + +create_ternary_true@1: + int 2 + b create_ternary_merge@3 + +create_ternary_false@2: + frame_dig 2 + +create_ternary_merge@3: + frame_dig -7 + len + frame_dig -7 + cover 2 + substring3 + byte "snapshot_public_key" + swap + app_global_put + frame_dig -6 + extract 2 0 + byte "metadata_ipfs_cid" + swap + app_global_put + byte "start_time" + frame_dig 0 + app_global_put + byte "end_time" + frame_dig 1 + app_global_put + frame_dig -2 + btoi + byte "quorum" + swap + app_global_put + frame_dig -1 + extract 2 0 + byte "nft_image_url" + swap + app_global_put + frame_dig -3 + callsub store_option_counts + retsub + + +// examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0: bytes) -> void: +store_option_counts: + proto 1 0 + +store_option_counts_block@0: + frame_dig -1 + int 0 + extract_uint16 + assert // option_counts should be non-empty + frame_dig -1 + int 0 + extract_uint16 + int 112 + <= + assert // Can't have more than 112 questions + byte "option_counts" + frame_dig -1 + app_global_put + frame_dig -1 + callsub calculate_total_options_count + dup + int 128 + <= + assert // Can't have more than 128 vote options + byte "total_options" + swap + app_global_put + retsub + + +// examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0: bytes) -> uint64: +calculate_total_options_count: + proto 1 1 + +calculate_total_options_count_block@0: + int 0 + frame_dig -1 + int 0 + extract_uint16 + frame_dig -1 + extract 2 0 + int 0 + +calculate_total_options_count_for_header@1: + frame_dig 3 + frame_dig 1 + < + bz calculate_total_options_count_after_for@4 + +calculate_total_options_count_for_body@2: + frame_dig 3 + int 1 + * + frame_dig 2 + swap + int 1 + extract3 + btoi + frame_dig 0 + + + frame_bury 0 + +calculate_total_options_count_for_footer@3: + frame_dig 3 + int 1 + + + frame_bury 3 + b calculate_total_options_count_for_header@1 + +calculate_total_options_count_after_for@4: + retsub + + +// examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req#0: uint64) -> void: +bootstrap: + proto 1 0 + +bootstrap_block@0: + int 0 + byte "is_bootstrapped" + app_global_get_ex + assert // check value exists + ! + assert // Must not be already bootstrapped + byte "is_bootstrapped" + int 1 + app_global_put + int 8 + int 0 + byte "total_options" + app_global_get_ex + assert // check value exists + int 400 + * + * + int 2900 + + + int 201000 + + + frame_dig -1 + gtxns Receiver + global CurrentApplicationAddress + == + assert // Payment must be to app address + dup + itob + log + frame_dig -1 + gtxns Amount + == + assert // Payment must be for the exact min balance requirement + int 0 + byte "total_options" + app_global_get_ex + assert // check value exists + int 8 + * + byte "V" + swap + box_create + assert + retsub + + +// examples.voting.voting.VotingRoundApp.close() -> void: +close: + proto 0 0 + byte "" + dupn 4 + +close_block@0: + int 20000 + int 0 + callsub ensure_budget + int 0 + byte "close_time" + app_global_get_ex + assert // check value exists + int 0 + == + assert // Already closed + global LatestTimestamp + byte "close_time" + swap + app_global_put + int 0 + byte "vote_id" + app_global_get_ex + assert // check value exists + byte "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " + swap + concat + byte ".\",\"properties\":{\"metadata\":\"ipfs://" + concat + int 0 + byte "metadata_ipfs_cid" + app_global_get_ex + assert // check value exists + concat + byte "\",\"id\":\"" + concat + int 0 + byte "vote_id" + app_global_get_ex + assert // check value exists + concat + byte "\",\"quorum\":" + concat + int 0 + byte "quorum" + app_global_get_ex + assert // check value exists + itob + concat + byte ",\"voterCount\":" + concat + int 0 + byte "voter_count" + app_global_get_ex + assert // check value exists + itob + concat + byte ",\"tallies\":[" + concat + int 0 + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + int 0 + extract_uint16 + int 0 + +close_for_header@1: + frame_dig 8 + frame_dig 7 + < + bz close_after_for@17 + +close_for_body@2: + frame_dig 8 + dup + frame_bury 1 + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + dup + int 0 + extract_uint16 + dig 2 + > + assert // Index access is out of bounds + extract 2 0 + swap + int 1 + * + int 1 + extract3 + btoi + frame_bury 2 + int 0 + frame_bury 3 + +close_for_header@3: + frame_dig 3 + frame_dig 2 + < + bz close_after_for@15 + +close_for_body@4: + frame_dig 3 + dup + frame_bury 0 + frame_dig 6 + callsub get_vote_from_box + frame_bury 4 + int 0 + == + bz close_ternary_false@6 + +close_ternary_true@5: + byte "[" + b close_ternary_merge@13 + +close_ternary_false@6: + frame_dig 2 + int 1 + - + frame_dig 0 + == + bz close_ternary_false@8 + +close_ternary_true@7: + frame_dig 4 + itob + byte "" + swap + concat + byte "]" + concat + b close_ternary_merge@12 + +close_ternary_false@8: + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + int 0 + extract_uint16 + int 1 + - + frame_dig 1 + == + bz close_ternary_false@10 + +close_ternary_true@9: + byte "," + b close_ternary_merge@11 + +close_ternary_false@10: + byte "" + +close_ternary_merge@11: + +close_ternary_merge@12: + +close_ternary_merge@13: + frame_dig 5 + swap + concat + frame_bury 5 + frame_dig 6 + int 1 + + + frame_bury 6 + +close_for_footer@14: + frame_dig 3 + int 1 + + + frame_bury 3 + b close_for_header@3 + +close_after_for@15: + +close_for_footer@16: + frame_dig 8 + int 1 + + + frame_bury 8 + b close_for_header@1 + +close_after_for@17: + frame_dig 5 + byte "]}}" + concat + itxn_begin + int acfg + itxn_field TypeEnum + int 1 + itxn_field ConfigAssetTotal + int 0 + itxn_field ConfigAssetDecimals + int 0 + itxn_field ConfigAssetDefaultFrozen + int 0 + byte "vote_id" + app_global_get_ex + assert // check value exists + byte "[VOTE RESULT] " + swap + concat + itxn_field ConfigAssetName + byte "VOTERSLT" + itxn_field ConfigAssetUnitName + int 0 + byte "nft_image_url" + app_global_get_ex + assert // check value exists + itxn_field ConfigAssetURL + itxn_field Note + itxn_submit + itxn CreatedAssetID + byte "nft_asset_id" + swap + app_global_put + retsub + + +// algopy.ensure_budget(required_budget#0: uint64, fee_source#0: uint64) -> void: +ensure_budget: + proto 2 0 + +ensure_budget_block@0: + frame_dig -2 + int 10 + + + +ensure_budget_while_top@1: + global OpcodeBudget + frame_dig 0 + < + bz ensure_budget_after_while@7 + +ensure_budget_while_body@2: + itxn_begin + int appl + itxn_field TypeEnum + int DeleteApplication + itxn_field OnCompletion + byte 0x068101 + itxn_field ApprovalProgram + byte 0x068101 + itxn_field ClearStateProgram + int 0 + int 1 + frame_dig -1 + match ensure_budget_switch_case_0@3 ensure_budget_switch_case_1@4 + b ensure_budget_switch_case_default@5 + +ensure_budget_switch_case_0@3: + int 0 + itxn_field Fee + b ensure_budget_switch_case_next@6 + +ensure_budget_switch_case_1@4: + global MinTxnFee + itxn_field Fee + b ensure_budget_switch_case_next@6 + +ensure_budget_switch_case_default@5: + +ensure_budget_switch_case_next@6: + itxn_submit + b ensure_budget_while_top@1 + +ensure_budget_after_while@7: + retsub + + +// examples.voting.voting.get_vote_from_box(index#0: uint64) -> uint64: +get_vote_from_box: + proto 1 1 + +get_vote_from_box_block@0: + byte "V" + box_get + assert // Box not created + frame_dig -1 + int 8 + extract3 + btoi + retsub + + +// examples.voting.voting.VotingRoundApp.get_preconditions(signature#0: bytes) -> bytes: +get_preconditions: + proto 1 1 + +get_preconditions_block@0: + callsub voting_open + itob + frame_dig -1 + len + dup + swap + int 2 + > + bz get_preconditions_ternary_false@2 + +get_preconditions_ternary_true@1: + int 2 + b get_preconditions_ternary_merge@3 + +get_preconditions_ternary_false@2: + frame_dig 1 + +get_preconditions_ternary_merge@3: + frame_dig -1 + len + frame_dig -1 + cover 2 + substring3 + callsub allowed_to_vote + itob + callsub already_voted + itob + global LatestTimestamp + itob + int 32 + pop + byte 0x + frame_dig 0 + concat + uncover 3 + concat + uncover 2 + concat + swap + concat + frame_bury 0 + retsub + + +// examples.voting.voting.VotingRoundApp.voting_open() -> uint64: +voting_open: + proto 0 1 + byte "" + +voting_open_block@0: + int 0 + byte "is_bootstrapped" + app_global_get_ex + assert // check value exists + bz voting_open_bool_false@5 + +voting_open_and_contd@1: + int 0 + byte "close_time" + app_global_get_ex + assert // check value exists + bnz voting_open_bool_false@5 + +voting_open_and_contd@2: + int 0 + byte "start_time" + app_global_get_ex + assert // check value exists + global LatestTimestamp + dup + frame_bury 0 + <= + bz voting_open_bool_false@5 + +voting_open_and_contd@3: + int 0 + byte "end_time" + app_global_get_ex + assert // check value exists + frame_dig 0 + >= + bz voting_open_bool_false@5 + +voting_open_bool_true@4: + int 1 + b voting_open_bool_merge@6 + +voting_open_bool_false@5: + int 0 + +voting_open_bool_merge@6: + swap + retsub + + +// examples.voting.voting.VotingRoundApp.allowed_to_vote(signature#0: bytes) -> uint64: +allowed_to_vote: + proto 1 1 + +allowed_to_vote_block@0: + int 2000 + int 2 + callsub ensure_budget + txn Sender + int 0 + byte "snapshot_public_key" + app_global_get_ex + assert // check value exists + swap + frame_dig -1 + uncover 2 + ed25519verify_bare + retsub + + +// examples.voting.voting.VotingRoundApp.already_voted() -> uint64: +already_voted: + proto 0 1 + +already_voted_block@0: + txn Sender + box_get + swap + pop + retsub + + +// examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req#0: uint64, signature#0: bytes, answer_ids#0: bytes) -> void: +vote: + proto 3 0 + byte "" + dupn 2 + +vote_block@0: + int 7700 + int 0 + callsub ensure_budget + frame_dig -2 + len + dup + swap + int 2 + > + bz vote_ternary_false@2 + +vote_ternary_true@1: + int 2 + b vote_ternary_merge@3 + +vote_ternary_false@2: + frame_dig 3 + +vote_ternary_merge@3: + frame_dig -2 + len + frame_dig -2 + cover 2 + substring3 + callsub allowed_to_vote + assert // Not allowed to vote + callsub voting_open + assert // Voting not open + callsub already_voted + ! + assert // Already voted + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + int 0 + extract_uint16 + dup + frame_bury 1 + frame_dig -1 + int 0 + extract_uint16 + == + assert // Number of answers incorrect + frame_dig -1 + int 0 + extract_uint16 + int 1 + * + int 34 + + + int 400 + * + int 2500 + + + frame_dig -3 + gtxns Receiver + global CurrentApplicationAddress + == + assert // Payment must be to app address + dup + itob + log + frame_dig -3 + gtxns Amount + == + assert // Payment must be the exact min balance + int 0 + frame_bury 0 + int 0 + frame_bury 2 + +vote_for_header@4: + frame_dig 2 + frame_dig 1 + < + bz vote_after_for@7 + +vote_for_body@5: + frame_dig 2 + frame_dig -1 + int 0 + extract_uint16 + dig 1 + > + assert // Index access is out of bounds + frame_dig -1 + extract 2 0 + dig 1 + int 1 + * + int 1 + extract3 + swap + int 0 + byte "option_counts" + app_global_get_ex + assert // check value exists + dup + int 0 + extract_uint16 + dig 2 + > + assert // Index access is out of bounds + extract 2 0 + swap + int 1 + * + int 1 + extract3 + dig 1 + btoi + swap + dup + btoi + uncover 2 + > + assert // Answer option index invalid + swap + btoi + frame_dig 0 + dup + cover 2 + + + callsub increment_vote_in_box + swap + btoi + + + frame_bury 0 + txn Sender + frame_dig -1 + box_put + int 0 + byte "voter_count" + app_global_get_ex + assert // check value exists + int 1 + + + byte "voter_count" + swap + app_global_put + +vote_for_footer@6: + frame_dig 2 + int 1 + + + frame_bury 2 + b vote_for_header@4 + +vote_after_for@7: + retsub + + +// examples.voting.voting.increment_vote_in_box(index#0: uint64) -> void: +increment_vote_in_box: + proto 1 0 + +increment_vote_in_box_block@0: + byte "V" + box_get + assert // Box not created + frame_dig -1 + int 8 + extract3 + btoi + int 1 + + + itob + byte "V" + frame_dig -1 + uncover 2 + box_replace + retsub + + +// examples.voting.voting.VotingRoundApp.__init__() -> void: +__init__: + proto 0 0 + +__init___block@0: + byte "is_bootstrapped" + int 0 + app_global_put + byte "voter_count" + int 0 + app_global_put + byte "close_time" + int 0 + app_global_put + byte "nft_asset_id" + int 0 + app_global_put + byte "snapshot_public_key" + byte "" + app_global_put + byte "vote_id" + byte "" + app_global_put + byte "metadata_ipfs_cid" + byte "" + app_global_put + byte "start_time" + int 0 + app_global_put + byte "end_time" + int 0 + app_global_put + byte "quorum" + int 0 + app_global_put + byte "nft_image_url" + byte "" + app_global_put + byte "option_counts" + byte 0x0000 + app_global_put + byte "total_options" + int 0 + app_global_put + retsub + diff --git a/examples/voting/out/voting.awst b/examples/voting/out/voting.awst new file mode 100644 index 0000000000..2dcda1a075 --- /dev/null +++ b/examples/voting/out/voting.awst @@ -0,0 +1,192 @@ +VOTE_INDEX_BYTES = 1 +VOTE_COUNT_BYTES = 8 +BOX_FLAT_MIN_BALANCE = 2500 +BOX_BYTE_MIN_BALANCE = 400 +ASSET_MIN_BALANCE = 100000 +TALLY_BOX_KEY = b'V' + +struct VotingPreconditions { + is_voting_open: algopy.arc4.UIntN[typing.Literal[64]] + is_allowed_to_vote: algopy.arc4.UIntN[typing.Literal[64]] + has_already_voted: algopy.arc4.UIntN[typing.Literal[64]] + current_time: algopy.arc4.UIntN[typing.Literal[64]] +} + +contract VotingRoundApp +{ + globals { + ['is_bootstrapped']: bool + ['voter_count']: algopy.UInt64 + ['close_time']: algopy.UInt64 + ['nft_asset_id']: algopy.UInt64 + ['snapshot_public_key']: algopy.Bytes + ['vote_id']: algopy.Bytes + ['metadata_ipfs_cid']: algopy.Bytes + ['start_time']: algopy.UInt64 + ['end_time']: algopy.UInt64 + ['quorum']: algopy.UInt64 + ['nft_image_url']: algopy.Bytes + ['option_counts']: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]] + ['total_options']: algopy.UInt64 + } + + constructor() + { + this.globals['is_bootstrapped']: bool = false + this.globals['voter_count']: algopy.UInt64 = 0u + this.globals['close_time']: algopy.UInt64 = 0u + this.globals['nft_asset_id']: algopy.UInt64 = 0u + this.globals['snapshot_public_key']: algopy.Bytes = '' + this.globals['vote_id']: algopy.Bytes = '' + this.globals['metadata_ipfs_cid']: algopy.Bytes = '' + this.globals['start_time']: algopy.UInt64 = 0u + this.globals['end_time']: algopy.UInt64 = 0u + this.globals['quorum']: algopy.UInt64 = 0u + this.globals['nft_image_url']: algopy.Bytes = '' + this.globals['option_counts']: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]] = arc4_array_encode([], algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]) + this.globals['total_options']: algopy.UInt64 = 0u + } + + clear_state_program(): bool + { + return true + } + + abimethod create(vote_id: algopy.arc4.String, snapshot_public_key: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]], metadata_ipfs_cid: algopy.arc4.String, start_time: algopy.arc4.UIntN[typing.Literal[64]], end_time: algopy.arc4.UIntN[typing.Literal[64]], option_counts: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]], quorum: algopy.arc4.UIntN[typing.Literal[64]], nft_image_url: algopy.arc4.String): None + { + st: algopy.UInt64 = arc4_decode(start_time, algopy.UInt64) + et: algopy.UInt64 = arc4_decode(end_time, algopy.UInt64) + assert(st < et, comment="End time should be after start time") + assert(et >= global(), comment="End time should be in the future") + this.globals['vote_id']: algopy.Bytes = arc4_decode(vote_id, algopy.Bytes) + this.globals['snapshot_public_key']: algopy.Bytes = reinterpret_cast(snapshot_public_key)[(2u < tmp$0: algopy.UInt64 := len(reinterpret_cast(snapshot_public_key))) ? (2u) : (tmp$0):] + this.globals['metadata_ipfs_cid']: algopy.Bytes = arc4_decode(metadata_ipfs_cid, algopy.Bytes) + this.globals['start_time']: algopy.UInt64 = st + this.globals['end_time']: algopy.UInt64 = et + this.globals['quorum']: algopy.UInt64 = arc4_decode(quorum, algopy.UInt64) + this.globals['nft_image_url']: algopy.Bytes = arc4_decode(nft_image_url, algopy.Bytes) + this::store_option_counts(option_counts) + } + + abimethod bootstrap(fund_min_bal_req: algopy.PaymentTransaction): None + { + assert(!(this.globals['is_bootstrapped']), comment="Must not be already bootstrapped") + this.globals['is_bootstrapped']: bool = true + bytes_per_option: algopy.UInt64 = 8u + box_cost: algopy.UInt64 = 2900u + this.globals['total_options'] * 400u * bytes_per_option + min_balance_req: algopy.UInt64 = 201000u + box_cost + assert(gtxns(fund_min_bal_req) == global(), comment="Payment must be to app address") + log(itob(min_balance_req)) + assert(gtxns(fund_min_bal_req) == min_balance_req, comment="Payment must be for the exact min balance requirement") + assert(box_create('V', this.globals['total_options'] * 8u)) + } + + abimethod close(): None + { + algopy::ensure_budget(required_budget=20000u, fee_source=0u) + assert(this.globals['close_time'] == 0u, comment="Already closed") + this.globals['close_time']: algopy.UInt64 = global() + note: algopy.Bytes = '{"standard":"arc69","description":"This is a voting result NFT for voting round with ID ' + this.globals['vote_id'] + '.","properties":{"metadata":"ipfs://' + this.globals['metadata_ipfs_cid'] + '","id":"' + this.globals['vote_id'] + '","quorum":' + itob(this.globals['quorum']) + ',"voterCount":' + itob(this.globals['voter_count']) + ',"tallies":[' + current_index: algopy.UInt64 = 0u + for question_index in range(0u, extract_uint16(this.globals['option_counts'], 0u), 1u) { + question_options: algopy.UInt64 = arc4_decode(this.globals['option_counts'][question_index], algopy.UInt64) + for option_index in range(0u, question_options, 1u) { + votes_for_option: algopy.UInt64 = examples.voting.voting::get_vote_from_box(current_index) + note += (option_index == 0u) ? ('[') : ((option_index == question_options - 1u) ? ('' + itob(votes_for_option) + ']') : ((question_index == extract_uint16(this.globals['option_counts'], 0u) - 1u) ? (',') : (''))) + current_index += 1u + } + } + note += ']}}' + itxn_begin() + itxn_field(acfg) + itxn_field(1u) + itxn_field(0u) + itxn_field(false) + itxn_field('[VOTE RESULT] ' + this.globals['vote_id']) + itxn_field('VOTERSLT') + itxn_field(this.globals['nft_image_url']) + itxn_field(note) + itxn_submit() + this.globals['nft_asset_id']: algopy.UInt64 = itxn() + } + + abimethod get_preconditions(signature: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]): examples.voting.voting.VotingPreconditions + { + return arc4_encode((arc4_encode(this::voting_open(), algopy.arc4.UIntN[typing.Literal[64]]), arc4_encode(this::allowed_to_vote(reinterpret_cast(signature)[(2u < tmp$1: algopy.UInt64 := len(reinterpret_cast(signature))) ? (2u) : (tmp$1):]), algopy.arc4.UIntN[typing.Literal[64]]), arc4_encode(this::already_voted(), algopy.arc4.UIntN[typing.Literal[64]]), arc4_encode(global(), algopy.arc4.UIntN[typing.Literal[64]])), examples.voting.voting.VotingPreconditions) + } + + abimethod vote(fund_min_bal_req: algopy.PaymentTransaction, signature: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]], answer_ids: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]): None + { + algopy::ensure_budget(required_budget=7700u, fee_source=0u) + assert(this::allowed_to_vote(reinterpret_cast(signature)[(2u < tmp$2: algopy.UInt64 := len(reinterpret_cast(signature))) ? (2u) : (tmp$2):]), comment="Not allowed to vote") + assert(this::voting_open(), comment="Voting not open") + assert(!(this::already_voted()), comment="Already voted") + questions_count: algopy.UInt64 = extract_uint16(this.globals['option_counts'], 0u) + assert(extract_uint16(answer_ids, 0u) == questions_count, comment="Number of answers incorrect") + min_bal_req: algopy.UInt64 = 2500u + 34u + 1u * extract_uint16(answer_ids, 0u) * 400u + assert(gtxns(fund_min_bal_req) == global(), comment="Payment must be to app address") + log(itob(min_bal_req)) + assert(gtxns(fund_min_bal_req) == min_bal_req, comment="Payment must be the exact min balance") + cumulative_offset: algopy.UInt64 = 0u + for question_index in range(0u, questions_count, 1u) { + answer_option_index: algopy.arc4.UIntN[typing.Literal[8]] = answer_ids[question_index] + options_count: algopy.arc4.UIntN[typing.Literal[8]] = this.globals['option_counts'][question_index] + assert(arc4_decode(answer_option_index, algopy.UInt64) < arc4_decode(options_count, algopy.UInt64), comment="Answer option index invalid") + examples.voting.voting::increment_vote_in_box(cumulative_offset + arc4_decode(answer_option_index, algopy.UInt64)) + cumulative_offset += arc4_decode(options_count, algopy.UInt64) + box_put(reinterpret_cast(txn()), reinterpret_cast(answer_ids)) + this.globals['voter_count'] += 1u + } + } + + subroutine voting_open(): bool + { + return this.globals['is_bootstrapped'] and !(reinterpret_cast(this.globals['close_time'])) and this.globals['start_time'] <= tmp$3: algopy.UInt64 := global() and tmp$3 <= this.globals['end_time'] + } + + subroutine already_voted(): bool + { + (votes, exists): tuple[algopy.Bytes, bool] = box_get(reinterpret_cast(txn())) + return exists + } + + subroutine store_option_counts(option_counts: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]): 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") + this.globals['option_counts']: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]] = option_counts + total_options: algopy.UInt64 = this::calculate_total_options_count(option_counts) + assert(total_options <= 128u, comment="Can't have more than 128 vote options") + this.globals['total_options']: algopy.UInt64 = total_options + } + + subroutine calculate_total_options_count(option_counts: algopy.arc4.DynamicArray[algopy.arc4.UIntN[typing.Literal[8]]]): algopy.UInt64 + { + total: algopy.UInt64 = 0u + for item in option_counts { + total += arc4_decode(item, algopy.UInt64) + } + return total + } + + subroutine allowed_to_vote(signature: algopy.Bytes): bool + { + algopy::ensure_budget(required_budget=2000u, fee_source=2u) + return ed25519verify_bare(reinterpret_cast(txn()), signature, this.globals['snapshot_public_key']) + } +} + +subroutine get_vote_from_box(index: algopy.UInt64): algopy.UInt64 +{ + (box_data, exists): tuple[algopy.Bytes, bool] = box_get('V') + assert(exists, comment="Box not created") + return btoi(extract3(box_data, index, 8u)) +} + +subroutine increment_vote_in_box(index: algopy.UInt64): None +{ + (box_data, exists): tuple[algopy.Bytes, bool] = box_get('V') + assert(exists, comment="Box not created") + current_vote: algopy.UInt64 = btoi(extract3(box_data, index, 8u)) + box_replace('V', index, itob(current_vote + 1u)) +} \ No newline at end of file diff --git a/examples/voting/out/voting.clear.debug.teal b/examples/voting/out/voting.clear.debug.teal new file mode 100644 index 0000000000..ea65225462 --- /dev/null +++ b/examples/voting/out/voting.clear.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "voting/voting.py", line 70 + return // return True File "voting/voting.py", line 70 + diff --git a/examples/voting/out/voting.clear.teal b/examples/voting/out/voting.clear.teal new file mode 100644 index 0000000000..a396274e86 --- /dev/null +++ b/examples/voting/out/voting.clear.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/voting/out/voting.clear_unoptimized.debug.teal b/examples/voting/out/voting.clear_unoptimized.debug.teal new file mode 100644 index 0000000000..ea65225462 --- /dev/null +++ b/examples/voting/out/voting.clear_unoptimized.debug.teal @@ -0,0 +1,9 @@ +// Op // Stack (out) Source code Source line + +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: +main_block@0: + int 1 // 1 True File "voting/voting.py", line 70 + return // return True File "voting/voting.py", line 70 + diff --git a/examples/voting/out/voting.clear_unoptimized.teal b/examples/voting/out/voting.clear_unoptimized.teal new file mode 100644 index 0000000000..a396274e86 --- /dev/null +++ b/examples/voting/out/voting.clear_unoptimized.teal @@ -0,0 +1,7 @@ +#pragma version 8 + +// examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: +main_block@0: + int 1 + return + diff --git a/examples/voting/out/voting_VotingRoundApp.cssa.ir b/examples/voting/out/voting_VotingRoundApp.cssa.ir new file mode 100644 index 0000000000..46955015e9 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.cssa.ir @@ -0,0 +1,560 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@11} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + (assert tmp%23#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(awst_tmp%21#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (! tmp%27#0) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (! tmp%33#0) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#1: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#1) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + (assert tmp%40#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(awst_tmp%21#1, tmp%41#0, tmp%42#0) + return 1u + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + let ternary_result%6#3: uint64 = ternary_result%6#0 + goto block@3 + block@2: // ternary_false_L90 + let awst_tmp%4#1: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L90 + let ternary_result%6#4: uint64 = φ(ternary_result%6#3 <- block@1, awst_tmp%4#1 <- block@2) + let ternary_result%6#2: uint64 = ternary_result%6#4 + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#2 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + let (total#3: uint64, item_index_internal%2#3: uint64) = (total#0, item_index_internal%2#0) + goto block@1 + block@1: // for_header_L247 + let item_index_internal%2#5: uint64 = φ(item_index_internal%2#3 <- block@0, item_index_internal%2#4 <- block@2) + let total#5: uint64 = φ(total#3 <- block@0, total#4 <- block@2) + let (total#1: uint64, item_index_internal%2#1: uint64) = (total#5, item_index_internal%2#5) + let continue_looping%3#0: uint64 = (< item_index_internal%2#1 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item#0: bytes = (extract3 array_value%1#0 item_index_internal%2#1 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#2: uint64 = (+ total#1 tmp%5#0) + let item_index_internal%2#2: uint64 = (+ item_index_internal%2#1 1u) + let (total#4: uint64, item_index_internal%2#4: uint64) = (total#2, item_index_internal%2#2) + goto block@1 + block@4: // after_for_L247 + return total#1 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 8u) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + let (note#5: bytes, current_index#7: uint64, range_item%28#7: uint64) = (note#0, current_index#0, range_item%28#0) + goto block@1 + block@1: // for_header_L144 + let question_index#1: uint64 = φ(range_item%28#7 <- block@0, range_item%28#8 <- block@15) + let current_index#9: uint64 = φ(current_index#7 <- block@0, current_index#8 <- block@15) + let note#7: bytes = φ(note#5 <- block@0, note#6 <- block@15) + let (note#3: bytes, current_index#6: uint64, question_index#0: uint64) = (note#7, current_index#9, question_index#1) + let continue_looping%29#0: uint64 = (< question_index#0 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 question_index#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + let (note#8: bytes, current_index#10: uint64, range_item%37#6: uint64) = (note#3, current_index#6, range_item%37#0) + goto block@3 + block@3: // for_header_L146 + let option_index#1: uint64 = φ(range_item%37#6 <- block@2, range_item%37#7 <- block@13) + let current_index#12: uint64 = φ(current_index#10 <- block@2, current_index#11 <- block@13) + let note#10: bytes = φ(note#8 <- block@2, note#9 <- block@13) + let (note#1: bytes, current_index#1: uint64, option_index#0: uint64) = (note#10, current_index#12, option_index#1) + let continue_looping%38#0: uint64 = (< option_index#0 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#1) + let tmp%39#0: uint64 = (! option_index#0) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + let ternary_result%40#3: bytes = ternary_result%40#0 + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let ternary_result%43#0: bytes = (concat tmp%44#0 "]") + let ternary_result%43#3: bytes = ternary_result%43#0 + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + let ternary_result%51#3: bytes = ternary_result%51#0 + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#1: bytes = "" + let ternary_result%51#4: bytes = ternary_result%51#1 + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%51#5: bytes = φ(ternary_result%51#3 <- block@9, ternary_result%51#4 <- block@10) + let ternary_result%51#2: bytes = ternary_result%51#5 + let ternary_result%51#6: bytes = ternary_result%51#2 + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%43#4: bytes = φ(ternary_result%43#3 <- block@7, ternary_result%51#6 <- block@11) + let ternary_result%43#2: bytes = ternary_result%43#4 + let ternary_result%43#5: bytes = ternary_result%43#2 + goto block@13 + block@13: // ternary_merge_L149 + let ternary_result%40#4: bytes = φ(ternary_result%40#3 <- block@5, ternary_result%43#5 <- block@12) + let ternary_result%40#2: bytes = ternary_result%40#4 + let note#2: bytes = (concat note#1 ternary_result%40#2) + let current_index#5: uint64 = (+ current_index#1 1u) + let range_item%37#5: uint64 = (+ option_index#0 1u) + let (note#9: bytes, current_index#11: uint64, range_item%37#7: uint64) = (note#2, current_index#5, range_item%37#5) + goto block@3 + block@15: // after_for_L146 + let range_item%28#6: uint64 = (+ question_index#0 1u) + let (note#6: bytes, current_index#8: uint64, range_item%28#8: uint64) = (note#1, current_index#1, range_item%28#6) + goto block@1 + block@17: // after_for_L144 + let note#4: bytes = (concat note#3 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#4) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + goto [block@3, block@4, ...block@6][fee_source#0] + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + let ternary_result%4#3: uint64 = ternary_result%4#0 + goto block@3 + block@2: // ternary_false_L175 + let awst_tmp%2#1: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L175 + let ternary_result%4#4: uint64 = φ(ternary_result%4#3 <- block@1, awst_tmp%2#1 <- block@2) + let ternary_result%4#2: uint64 = ternary_result%4#4 + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#2 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let encoded_tuple_buffer%14#2: bytes = (concat val_as_bytes%1#0 val_as_bytes%8#0) + let encoded_tuple_buffer%14#3: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%10#0) + let encoded_tuple_buffer%14#4: bytes = (concat encoded_tuple_buffer%14#3 val_as_bytes%12#0) + return encoded_tuple_buffer%14#4 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + let and_result%11#3: uint64 = and_result%11#0 + goto block@6 + block@5: // bool_false_L222 + let and_result%11#1: uint64 = 0u + let and_result%11#4: uint64 = and_result%11#1 + goto block@6 + block@6: // bool_merge_L222 + let and_result%11#5: uint64 = φ(and_result%11#3 <- block@4, and_result%11#4 <- block@5) + let and_result%11#2: uint64 = and_result%11#5 + return and_result%11#2 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (votes#0: bytes, exists#0: uint64) = (box_get tmp%0#0) + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + let ternary_result%2#3: uint64 = ternary_result%2#0 + goto block@3 + block@2: // ternary_false_L190 + let awst_tmp%0#1: uint64 = awst_tmp%0#0 + goto block@3 + block@3: // ternary_merge_L190 + let ternary_result%2#4: uint64 = φ(ternary_result%2#3 <- block@1, awst_tmp%0#1 <- block@2) + let ternary_result%2#2: uint64 = ternary_result%2#4 + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#2 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%15#0: uint64 = (+ 34u tmp%13#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + let (cumulative_offset#3: uint64, range_item%23#3: uint64) = (cumulative_offset#0, range_item%23#0) + goto block@4 + block@4: // for_header_L207 + let question_index#1: uint64 = φ(range_item%23#3 <- block@3, range_item%23#4 <- block@5) + let cumulative_offset#5: uint64 = φ(cumulative_offset#3 <- block@3, cumulative_offset#4 <- block@5) + let (cumulative_offset#1: uint64, question_index#0: uint64) = (cumulative_offset#5, question_index#1) + let continue_looping%24#0: uint64 = (< question_index#0 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 question_index#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 question_index#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#1 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#2: uint64 = (+ cumulative_offset#1 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + let range_item%23#2: uint64 = (+ question_index#0 1u) + let (cumulative_offset#4: uint64, range_item%23#4: uint64) = (cumulative_offset#2, range_item%23#2) + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/examples/voting/out/voting_VotingRoundApp.final.ir b/examples/voting/out/voting_VotingRoundApp.final.ir new file mode 100644 index 0000000000..99cc666540 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.final.ir @@ -0,0 +1,521 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@11} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + (assert tmp%23#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(awst_tmp%21#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (! tmp%27#0) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (! tmp%33#0) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + (assert tmp%40#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(awst_tmp%21#0, tmp%41#0, tmp%42#0) + return 1u + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L90 + let ternary_result%6#0: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L90 + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#0 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + goto block@1 + block@1: // for_header_L247 + let continue_looping%3#0: uint64 = (< item_index_internal%2#0 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item#0: bytes = (extract3 array_value%1#0 item_index_internal%2#0 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#0: uint64 = (+ total#0 tmp%5#0) + let item_index_internal%2#0: uint64 = (+ item_index_internal%2#0 1u) + goto block@1 + block@4: // after_for_L247 + return total#0 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 8u) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + let question_index#0: uint64 = range_item%28#0 + goto block@1 + block@1: // for_header_L144 + let continue_looping%29#0: uint64 = (< question_index#0 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 question_index#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + let option_index#0: uint64 = range_item%37#0 + goto block@3 + block@3: // for_header_L146 + let continue_looping%38#0: uint64 = (< option_index#0 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#0) + let tmp%39#0: uint64 = (! option_index#0) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let ternary_result%43#0: bytes = (concat tmp%44#0 "]") + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#0: bytes = "" + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%43#0: bytes = ternary_result%51#0 + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%40#0: bytes = ternary_result%43#0 + goto block@13 + block@13: // ternary_merge_L149 + let note#0: bytes = (concat note#0 ternary_result%40#0) + let current_index#0: uint64 = (+ current_index#0 1u) + let range_item%37#0: uint64 = (+ option_index#0 1u) + let option_index#0: uint64 = range_item%37#0 + goto block@3 + block@15: // after_for_L146 + let range_item%28#0: uint64 = (+ question_index#0 1u) + let question_index#0: uint64 = range_item%28#0 + goto block@1 + block@17: // after_for_L144 + let note#0: bytes = (concat note#0 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#0) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + goto [block@3, block@4, ...block@6][fee_source#0] + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L175 + let ternary_result%4#0: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L175 + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#0 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let encoded_tuple_buffer%14#2: bytes = (concat val_as_bytes%1#0 val_as_bytes%8#0) + let encoded_tuple_buffer%14#2: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%10#0) + let encoded_tuple_buffer%14#2: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%12#0) + return encoded_tuple_buffer%14#2 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L222 + let and_result%11#0: uint64 = 0u + goto block@6 + block@6: // bool_merge_L222 + return and_result%11#0 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (votes#0: bytes, exists#0: uint64) = (box_get tmp%0#0) + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L190 + let ternary_result%2#0: uint64 = awst_tmp%0#0 + goto block@3 + block@3: // ternary_merge_L190 + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#0 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%15#0: uint64 = (+ 34u tmp%13#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + let question_index#0: uint64 = range_item%23#0 + goto block@4 + block@4: // for_header_L207 + let continue_looping%24#0: uint64 = (< question_index#0 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 question_index#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 question_index#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#0 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#0: uint64 = (+ cumulative_offset#0 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + let range_item%23#0: uint64 = (+ question_index#0 1u) + let question_index#0: uint64 = range_item%23#0 + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/examples/voting/out/voting_VotingRoundApp.final_unoptimized.ir b/examples/voting/out/voting_VotingRoundApp.final_unoptimized.ir new file mode 100644 index 0000000000..0384d6f878 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.final_unoptimized.ir @@ -0,0 +1,552 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@9} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (== tmp%15#0 NoOp) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + let maybe_value_did_exist%19#0: uint64 = tmp%23#0 + let maybe_value%18#0: uint64 = awst_tmp%21#0 + (assert maybe_value_did_exist%19#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(maybe_value%18#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (== tmp%27#0 NoOp) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (== tmp%33#0 NoOp) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + let maybe_value_did_exist%37#0: uint64 = tmp%40#0 + let maybe_value%36#0: uint64 = awst_tmp%21#0 + (assert maybe_value_did_exist%37#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(maybe_value%36#0, tmp%41#0, tmp%42#0) + return 1u + block@9: // switch_case_default_L51 + goto block@10 + block@10: // switch_case_next_L51 + goto block@11 + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L90 + let ternary_result%6#0: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L90 + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#0 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + goto block@1 + block@1: // for_header_L247 + let continue_looping%3#0: uint64 = (< item_index_internal%2#0 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item_index%4#0: uint64 = (* item_index_internal%2#0 1u) + let item#0: bytes = (extract3 array_value%1#0 item_index%4#0 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#0: uint64 = (+ total#0 tmp%5#0) + goto block@3 + block@3: // for_footer_L247 + let item_index_internal%2#0: uint64 = (+ item_index_internal%2#0 1u) + goto block@1 + block@4: // after_for_L247 + return total#0 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let bytes_per_option#0: uint64 = 8u + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 bytes_per_option#0) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 0u) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + goto block@1 + block@1: // for_header_L144 + let continue_looping%29#0: uint64 = (< range_item%28#0 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let question_index#0: uint64 = range_item%28#0 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let item_index%35#0: uint64 = (* question_index#0 1u) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 item_index%35#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + goto block@3 + block@3: // for_header_L146 + let continue_looping%38#0: uint64 = (< range_item%37#0 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let option_index#0: uint64 = range_item%37#0 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#0) + let tmp%39#0: uint64 = (== option_index#0 0u) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let tmp%45#0: bytes = (concat "" tmp%44#0) + let ternary_result%43#0: bytes = (concat tmp%45#0 "]") + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#0: bytes = "" + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%43#0: bytes = ternary_result%51#0 + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%40#0: bytes = ternary_result%43#0 + goto block@13 + block@13: // ternary_merge_L149 + let note#0: bytes = (concat note#0 ternary_result%40#0) + let current_index#0: uint64 = (+ current_index#0 1u) + goto block@14 + block@14: // for_footer_L146 + let range_item%37#0: uint64 = (+ range_item%37#0 1u) + goto block@3 + block@15: // after_for_L146 + goto block@16 + block@16: // for_footer_L144 + let range_item%28#0: uint64 = (+ range_item%28#0 1u) + goto block@1 + block@17: // after_for_L144 + let note#0: bytes = (concat note#0 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#0) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + switch fee_source#0 {0u => block@3, 1u => block@4, * => block@5} + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@5: // switch_case_default_L27 + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (tuple_assignment%0#0: bytes, tuple_assignment%1#0: uint64) = (box_get "V") + let box_data#0: bytes = tuple_assignment%0#0 + let exists#0: uint64 = tuple_assignment%1#0 + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L175 + let ternary_result%4#0: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L175 + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#0 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let current_tail_offset%13#0: uint64 = 32u + let encoded_tuple_buffer%14#0: bytes = 0x + let encoded_tuple_buffer%14#0: bytes = (concat encoded_tuple_buffer%14#0 val_as_bytes%1#0) + let encoded_tuple_buffer%14#0: bytes = (concat encoded_tuple_buffer%14#0 val_as_bytes%8#0) + let encoded_tuple_buffer%14#0: bytes = (concat encoded_tuple_buffer%14#0 val_as_bytes%10#0) + let encoded_tuple_buffer%14#0: bytes = (concat encoded_tuple_buffer%14#0 val_as_bytes%12#0) + return encoded_tuple_buffer%14#0 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L222 + let and_result%11#0: uint64 = 0u + goto block@6 + block@6: // bool_merge_L222 + return and_result%11#0 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (tuple_assignment%1#0: bytes, tuple_assignment%2#0: uint64) = (box_get tmp%0#0) + let votes#0: bytes = tuple_assignment%1#0 + let exists#0: uint64 = tuple_assignment%2#0 + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L190 + let ternary_result%2#0: uint64 = awst_tmp%0#0 + goto block@3 + block@3: // ternary_merge_L190 + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#0 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%14#0: uint64 = (* 1u tmp%13#0) + let tmp%15#0: uint64 = (+ 34u tmp%14#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + goto block@4 + block@4: // for_header_L207 + let continue_looping%24#0: uint64 = (< range_item%23#0 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let question_index#0: uint64 = range_item%23#0 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let item_index%28#0: uint64 = (* question_index#0 1u) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 item_index%28#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let item_index%34#0: uint64 = (* question_index#0 1u) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 item_index%34#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#0 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#0: uint64 = (+ cumulative_offset#0 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + goto block@6 + block@6: // for_footer_L207 + let range_item%23#0: uint64 = (+ range_item%23#0 1u) + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (tuple_assignment%0#0: bytes, tuple_assignment%1#0: uint64) = (box_get "V") + let box_data#0: bytes = tuple_assignment%0#0 + let exists#0: uint64 = tuple_assignment%1#0 + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/examples/voting/out/voting_VotingRoundApp.parallel_copies.ir b/examples/voting/out/voting_VotingRoundApp.parallel_copies.ir new file mode 100644 index 0000000000..5cabd526b5 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.parallel_copies.ir @@ -0,0 +1,561 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@11} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + (assert tmp%23#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(awst_tmp%21#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (! tmp%27#0) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (! tmp%33#0) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#1: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#1) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + (assert tmp%40#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(awst_tmp%21#1, tmp%41#0, tmp%42#0) + return 1u + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + let ternary_result%6#4: uint64 = ternary_result%6#0 + goto block@3 + block@2: // ternary_false_L90 + let ternary_result%6#4: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L90 + let ternary_result%6#2: uint64 = ternary_result%6#4 + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#2 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + let item_index_internal%2#5: uint64 = item_index_internal%2#0 + let total#5: uint64 = total#0 + goto block@1 + block@1: // for_header_L247 + let item_index_internal%2#1: uint64 = item_index_internal%2#5 + let total#1: uint64 = total#5 + let continue_looping%3#0: uint64 = (< item_index_internal%2#1 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item#0: bytes = (extract3 array_value%1#0 item_index_internal%2#1 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#2: uint64 = (+ total#1 tmp%5#0) + let item_index_internal%2#2: uint64 = (+ item_index_internal%2#1 1u) + let item_index_internal%2#5: uint64 = item_index_internal%2#2 + let total#5: uint64 = total#2 + goto block@1 + block@4: // after_for_L247 + return total#1 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 8u) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + let question_index#1: uint64 = range_item%28#0 + let current_index#9: uint64 = current_index#0 + let note#7: bytes = note#0 + goto block@1 + block@1: // for_header_L144 + let question_index#0: uint64 = question_index#1 + let current_index#6: uint64 = current_index#9 + let note#3: bytes = note#7 + let continue_looping%29#0: uint64 = (< question_index#0 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 question_index#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + let option_index#1: uint64 = range_item%37#0 + let current_index#12: uint64 = current_index#6 + let note#10: bytes = note#3 + goto block@3 + block@3: // for_header_L146 + let option_index#0: uint64 = option_index#1 + let current_index#1: uint64 = current_index#12 + let note#1: bytes = note#10 + let continue_looping%38#0: uint64 = (< option_index#0 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#1) + let tmp%39#0: uint64 = (! option_index#0) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + let ternary_result%40#4: bytes = ternary_result%40#0 + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let ternary_result%43#0: bytes = (concat tmp%44#0 "]") + let ternary_result%43#4: bytes = ternary_result%43#0 + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + let ternary_result%51#5: bytes = ternary_result%51#0 + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#1: bytes = "" + let ternary_result%51#5: bytes = ternary_result%51#1 + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%51#2: bytes = ternary_result%51#5 + let ternary_result%43#4: bytes = ternary_result%51#2 + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%43#2: bytes = ternary_result%43#4 + let ternary_result%40#4: bytes = ternary_result%43#2 + goto block@13 + block@13: // ternary_merge_L149 + let ternary_result%40#2: bytes = ternary_result%40#4 + let note#2: bytes = (concat note#1 ternary_result%40#2) + let current_index#5: uint64 = (+ current_index#1 1u) + let range_item%37#5: uint64 = (+ option_index#0 1u) + let option_index#1: uint64 = range_item%37#5 + let current_index#12: uint64 = current_index#5 + let note#10: bytes = note#2 + goto block@3 + block@15: // after_for_L146 + let range_item%28#6: uint64 = (+ question_index#0 1u) + let question_index#1: uint64 = range_item%28#6 + let current_index#9: uint64 = current_index#1 + let note#7: bytes = note#1 + goto block@1 + block@17: // after_for_L144 + let note#4: bytes = (concat note#3 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#4) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + goto [block@3, block@4, ...block@6][fee_source#0] + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + let ternary_result%4#4: uint64 = ternary_result%4#0 + goto block@3 + block@2: // ternary_false_L175 + let ternary_result%4#4: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L175 + let ternary_result%4#2: uint64 = ternary_result%4#4 + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#2 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let encoded_tuple_buffer%14#2: bytes = (concat val_as_bytes%1#0 val_as_bytes%8#0) + let encoded_tuple_buffer%14#3: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%10#0) + let encoded_tuple_buffer%14#4: bytes = (concat encoded_tuple_buffer%14#3 val_as_bytes%12#0) + return encoded_tuple_buffer%14#4 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + let and_result%11#5: uint64 = and_result%11#0 + goto block@6 + block@5: // bool_false_L222 + let and_result%11#1: uint64 = 0u + let and_result%11#5: uint64 = and_result%11#1 + goto block@6 + block@6: // bool_merge_L222 + let and_result%11#2: uint64 = and_result%11#5 + return and_result%11#2 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (votes#0: bytes, exists#0: uint64) = (box_get tmp%0#0) + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + let ternary_result%2#4: uint64 = ternary_result%2#0 + goto block@3 + block@2: // ternary_false_L190 + let ternary_result%2#4: uint64 = awst_tmp%0#0 + goto block@3 + block@3: // ternary_merge_L190 + let ternary_result%2#2: uint64 = ternary_result%2#4 + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#2 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%15#0: uint64 = (+ 34u tmp%13#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + let question_index#1: uint64 = range_item%23#0 + let cumulative_offset#5: uint64 = cumulative_offset#0 + goto block@4 + block@4: // for_header_L207 + let question_index#0: uint64 = question_index#1 + let cumulative_offset#1: uint64 = cumulative_offset#5 + let continue_looping%24#0: uint64 = (< question_index#0 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 question_index#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 question_index#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#1 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#2: uint64 = (+ cumulative_offset#1 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + let range_item%23#2: uint64 = (+ question_index#0 1u) + let question_index#1: uint64 = range_item%23#2 + let cumulative_offset#5: uint64 = cumulative_offset#2 + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/examples/voting/out/voting_VotingRoundApp.post_ssa.ir b/examples/voting/out/voting_VotingRoundApp.post_ssa.ir new file mode 100644 index 0000000000..1410363167 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.post_ssa.ir @@ -0,0 +1,543 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@11} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + (assert tmp%23#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(awst_tmp%21#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (! tmp%27#0) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (! tmp%33#0) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#1: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#1) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + (assert tmp%40#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(awst_tmp%21#1, tmp%41#0, tmp%42#0) + return 1u + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + let ternary_result%6#4: uint64 = ternary_result%6#0 + goto block@3 + block@2: // ternary_false_L90 + let ternary_result%6#4: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L90 + let ternary_result%6#2: uint64 = ternary_result%6#4 + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#2 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + let (total#5: uint64, item_index_internal%2#5: uint64) = (total#0, item_index_internal%2#0) + goto block@1 + block@1: // for_header_L247 + let (total#1: uint64, item_index_internal%2#1: uint64) = (total#5, item_index_internal%2#5) + let continue_looping%3#0: uint64 = (< item_index_internal%2#1 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item#0: bytes = (extract3 array_value%1#0 item_index_internal%2#1 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#2: uint64 = (+ total#1 tmp%5#0) + let item_index_internal%2#2: uint64 = (+ item_index_internal%2#1 1u) + let (total#5: uint64, item_index_internal%2#5: uint64) = (total#2, item_index_internal%2#2) + goto block@1 + block@4: // after_for_L247 + return total#1 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 8u) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + let (note#7: bytes, current_index#9: uint64, question_index#1: uint64) = (note#0, current_index#0, range_item%28#0) + goto block@1 + block@1: // for_header_L144 + let (note#3: bytes, current_index#6: uint64, question_index#0: uint64) = (note#7, current_index#9, question_index#1) + let continue_looping%29#0: uint64 = (< question_index#0 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 question_index#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + let (note#10: bytes, current_index#12: uint64, option_index#1: uint64) = (note#3, current_index#6, range_item%37#0) + goto block@3 + block@3: // for_header_L146 + let (note#1: bytes, current_index#1: uint64, option_index#0: uint64) = (note#10, current_index#12, option_index#1) + let continue_looping%38#0: uint64 = (< option_index#0 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#1) + let tmp%39#0: uint64 = (! option_index#0) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + let ternary_result%40#4: bytes = ternary_result%40#0 + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let ternary_result%43#0: bytes = (concat tmp%44#0 "]") + let ternary_result%43#4: bytes = ternary_result%43#0 + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + let ternary_result%51#5: bytes = ternary_result%51#0 + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#1: bytes = "" + let ternary_result%51#5: bytes = ternary_result%51#1 + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%51#2: bytes = ternary_result%51#5 + let ternary_result%43#4: bytes = ternary_result%51#2 + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%43#2: bytes = ternary_result%43#4 + let ternary_result%40#4: bytes = ternary_result%43#2 + goto block@13 + block@13: // ternary_merge_L149 + let ternary_result%40#2: bytes = ternary_result%40#4 + let note#2: bytes = (concat note#1 ternary_result%40#2) + let current_index#5: uint64 = (+ current_index#1 1u) + let range_item%37#5: uint64 = (+ option_index#0 1u) + let (note#10: bytes, current_index#12: uint64, option_index#1: uint64) = (note#2, current_index#5, range_item%37#5) + goto block@3 + block@15: // after_for_L146 + let range_item%28#6: uint64 = (+ question_index#0 1u) + let (note#7: bytes, current_index#9: uint64, question_index#1: uint64) = (note#1, current_index#1, range_item%28#6) + goto block@1 + block@17: // after_for_L144 + let note#4: bytes = (concat note#3 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#4) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + goto [block@3, block@4, ...block@6][fee_source#0] + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + let ternary_result%4#4: uint64 = ternary_result%4#0 + goto block@3 + block@2: // ternary_false_L175 + let ternary_result%4#4: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L175 + let ternary_result%4#2: uint64 = ternary_result%4#4 + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#2 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let encoded_tuple_buffer%14#2: bytes = (concat val_as_bytes%1#0 val_as_bytes%8#0) + let encoded_tuple_buffer%14#3: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%10#0) + let encoded_tuple_buffer%14#4: bytes = (concat encoded_tuple_buffer%14#3 val_as_bytes%12#0) + return encoded_tuple_buffer%14#4 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + let and_result%11#5: uint64 = and_result%11#0 + goto block@6 + block@5: // bool_false_L222 + let and_result%11#1: uint64 = 0u + let and_result%11#5: uint64 = and_result%11#1 + goto block@6 + block@6: // bool_merge_L222 + let and_result%11#2: uint64 = and_result%11#5 + return and_result%11#2 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (votes#0: bytes, exists#0: uint64) = (box_get tmp%0#0) + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + let ternary_result%2#4: uint64 = ternary_result%2#0 + goto block@3 + block@2: // ternary_false_L190 + let ternary_result%2#4: uint64 = awst_tmp%0#0 + goto block@3 + block@3: // ternary_merge_L190 + let ternary_result%2#2: uint64 = ternary_result%2#4 + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#2 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%15#0: uint64 = (+ 34u tmp%13#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + let (cumulative_offset#5: uint64, question_index#1: uint64) = (cumulative_offset#0, range_item%23#0) + goto block@4 + block@4: // for_header_L207 + let (cumulative_offset#1: uint64, question_index#0: uint64) = (cumulative_offset#5, question_index#1) + let continue_looping%24#0: uint64 = (< question_index#0 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 question_index#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 question_index#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#1 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#2: uint64 = (+ cumulative_offset#1 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + let range_item%23#2: uint64 = (+ question_index#0 1u) + let (cumulative_offset#5: uint64, question_index#1: uint64) = (cumulative_offset#2, range_item%23#2) + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/examples/voting/out/voting_VotingRoundApp.ssa.ir b/examples/voting/out/voting_VotingRoundApp.ssa.ir new file mode 100644 index 0000000000..35b7db7300 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.ssa.ir @@ -0,0 +1,567 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@9} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (== tmp%15#0 NoOp) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + let (maybe_value%18#0: uint64, maybe_value_did_exist%19#0: uint64) = (awst_tmp%21#0, tmp%23#0) + (assert maybe_value_did_exist%19#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(maybe_value%18#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (== tmp%27#0 NoOp) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (== tmp%33#0 NoOp) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#1: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#1) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + let (maybe_value%36#0: uint64, maybe_value_did_exist%37#0: uint64) = (awst_tmp%21#1, tmp%40#0) + (assert maybe_value_did_exist%37#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(maybe_value%36#0, tmp%41#0, tmp%42#0) + return 1u + block@9: // switch_case_default_L51 + goto block@10 + block@10: // switch_case_next_L51 + goto block@11 + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L90 + let ternary_result%6#1: uint64 = awst_tmp%4#0 + goto block@3 + block@3: // ternary_merge_L90 + let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, ternary_result%6#1 <- block@2) + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#2 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + goto block@1 + block@1: // for_header_L247 + let item_index_internal%2#1: uint64 = φ(item_index_internal%2#0 <- block@0, item_index_internal%2#2 <- block@3) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@3) + let continue_looping%3#0: uint64 = (< item_index_internal%2#1 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item_index%4#0: uint64 = (* item_index_internal%2#1 1u) + let item#0: bytes = (extract3 array_value%1#0 item_index%4#0 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#2: uint64 = (+ total#1 tmp%5#0) + goto block@3 + block@3: // for_footer_L247 + let item_index_internal%2#2: uint64 = (+ item_index_internal%2#1 1u) + goto block@1 + block@4: // after_for_L247 + return total#1 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let bytes_per_option#0: uint64 = 8u + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 bytes_per_option#0) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (== app_global_get_ex_value%0#0 0u) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + goto block@1 + block@1: // for_header_L144 + let range_item%28#1: uint64 = φ(range_item%28#0 <- block@0, range_item%28#6 <- block@16) + let current_index#6: uint64 = φ(current_index#0 <- block@0, current_index#1 <- block@16) + let note#3: bytes = φ(note#0 <- block@0, note#1 <- block@16) + let continue_looping%29#0: uint64 = (< range_item%28#1 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let question_index#0: uint64 = range_item%28#1 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let item_index%35#0: uint64 = (* question_index#0 1u) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 item_index%35#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + goto block@3 + block@3: // for_header_L146 + let range_item%37#1: uint64 = φ(range_item%37#0 <- block@2, range_item%37#5 <- block@14) + let current_index#1: uint64 = φ(current_index#6 <- block@2, current_index#5 <- block@14) + let note#1: bytes = φ(note#3 <- block@2, note#2 <- block@14) + let continue_looping%38#0: uint64 = (< range_item%37#1 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let option_index#0: uint64 = range_item%37#1 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#1) + let tmp%39#0: uint64 = (== option_index#0 0u) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let tmp%45#0: bytes = (concat "" tmp%44#0) + let ternary_result%43#0: bytes = (concat tmp%45#0 "]") + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#1: bytes = "" + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@9, ternary_result%51#1 <- block@10) + let ternary_result%43#1: bytes = ternary_result%51#2 + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%43#2: bytes = φ(ternary_result%43#0 <- block@7, ternary_result%43#1 <- block@11) + let ternary_result%40#1: bytes = ternary_result%43#2 + goto block@13 + block@13: // ternary_merge_L149 + let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@5, ternary_result%40#1 <- block@12) + let note#2: bytes = (concat note#1 ternary_result%40#2) + let current_index#5: uint64 = (+ current_index#1 1u) + goto block@14 + block@14: // for_footer_L146 + let range_item%37#5: uint64 = (+ range_item%37#1 1u) + goto block@3 + block@15: // after_for_L146 + goto block@16 + block@16: // for_footer_L144 + let range_item%28#6: uint64 = (+ range_item%28#1 1u) + goto block@1 + block@17: // after_for_L144 + let note#4: bytes = (concat note#3 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#4) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + switch fee_source#0 {0u => block@3, 1u => block@4, * => block@5} + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@5: // switch_case_default_L27 + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (tuple_assignment%0#0: bytes, tuple_assignment%1#0: uint64) = (box_get "V") + let box_data#0: bytes = tuple_assignment%0#0 + let exists#0: uint64 = tuple_assignment%1#0 + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L175 + let ternary_result%4#1: uint64 = awst_tmp%2#0 + goto block@3 + block@3: // ternary_merge_L175 + let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, ternary_result%4#1 <- block@2) + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#2 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let current_tail_offset%13#0: uint64 = 32u + let encoded_tuple_buffer%14#0: bytes = 0x + let encoded_tuple_buffer%14#1: bytes = (concat encoded_tuple_buffer%14#0 val_as_bytes%1#0) + let encoded_tuple_buffer%14#2: bytes = (concat encoded_tuple_buffer%14#1 val_as_bytes%8#0) + let encoded_tuple_buffer%14#3: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%10#0) + let encoded_tuple_buffer%14#4: bytes = (concat encoded_tuple_buffer%14#3 val_as_bytes%12#0) + return encoded_tuple_buffer%14#4 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L222 + let and_result%11#1: uint64 = 0u + goto block@6 + block@6: // bool_merge_L222 + let and_result%11#2: uint64 = φ(and_result%11#0 <- block@4, and_result%11#1 <- block@5) + return and_result%11#2 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (tuple_assignment%1#0: bytes, tuple_assignment%2#0: uint64) = (box_get tmp%0#0) + let votes#0: bytes = tuple_assignment%1#0 + let exists#0: uint64 = tuple_assignment%2#0 + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L190 + let ternary_result%2#1: uint64 = awst_tmp%0#0 + goto block@3 + block@3: // ternary_merge_L190 + let ternary_result%2#2: uint64 = φ(ternary_result%2#0 <- block@1, ternary_result%2#1 <- block@2) + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#2 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%14#0: uint64 = (* 1u tmp%13#0) + let tmp%15#0: uint64 = (+ 34u tmp%14#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + goto block@4 + block@4: // for_header_L207 + let range_item%23#1: uint64 = φ(range_item%23#0 <- block@3, range_item%23#2 <- block@6) + let cumulative_offset#1: uint64 = φ(cumulative_offset#0 <- block@3, cumulative_offset#2 <- block@6) + let continue_looping%24#0: uint64 = (< range_item%23#1 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let question_index#0: uint64 = range_item%23#1 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let item_index%28#0: uint64 = (* question_index#0 1u) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 item_index%28#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let item_index%34#0: uint64 = (* question_index#0 1u) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 item_index%34#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#1 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#2: uint64 = (+ cumulative_offset#1 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + goto block@6 + block@6: // for_footer_L207 + let range_item%23#2: uint64 = (+ range_item%23#1 1u) + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (tuple_assignment%0#0: bytes, tuple_assignment%1#0: uint64) = (box_get "V") + let box_data#0: bytes = tuple_assignment%0#0 + let exists#0: uint64 = tuple_assignment%1#0 + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_1.ir b/examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..62983768e0 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_1.ir @@ -0,0 +1,528 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@11} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + (assert tmp%23#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(awst_tmp%21#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (! tmp%27#0) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (! tmp%33#0) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#1: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#1) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + (assert tmp%40#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(awst_tmp%21#1, tmp%41#0, tmp%42#0) + return 1u + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L90 + goto block@3 + block@3: // ternary_merge_L90 + let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, awst_tmp%4#0 <- block@2) + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#2 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + goto block@1 + block@1: // for_header_L247 + let item_index_internal%2#1: uint64 = φ(item_index_internal%2#0 <- block@0, item_index_internal%2#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%3#0: uint64 = (< item_index_internal%2#1 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item#0: bytes = (extract3 array_value%1#0 item_index_internal%2#1 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#2: uint64 = (+ total#1 tmp%5#0) + let item_index_internal%2#2: uint64 = (+ item_index_internal%2#1 1u) + goto block@1 + block@4: // after_for_L247 + return total#1 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 8u) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + goto block@1 + block@1: // for_header_L144 + let question_index#0: uint64 = φ(range_item%28#0 <- block@0, range_item%28#6 <- block@15) + let current_index#6: uint64 = φ(current_index#0 <- block@0, current_index#1 <- block@15) + let note#3: bytes = φ(note#0 <- block@0, note#1 <- block@15) + let continue_looping%29#0: uint64 = (< question_index#0 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 question_index#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + goto block@3 + block@3: // for_header_L146 + let option_index#0: uint64 = φ(range_item%37#0 <- block@2, range_item%37#5 <- block@13) + let current_index#1: uint64 = φ(current_index#6 <- block@2, current_index#5 <- block@13) + let note#1: bytes = φ(note#3 <- block@2, note#2 <- block@13) + let continue_looping%38#0: uint64 = (< option_index#0 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#1) + let tmp%39#0: uint64 = (! option_index#0) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let ternary_result%43#0: bytes = (concat tmp%44#0 "]") + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#1: bytes = "" + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@9, ternary_result%51#1 <- block@10) + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%43#2: bytes = φ(ternary_result%43#0 <- block@7, ternary_result%51#2 <- block@11) + goto block@13 + block@13: // ternary_merge_L149 + let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@5, ternary_result%43#2 <- block@12) + let note#2: bytes = (concat note#1 ternary_result%40#2) + let current_index#5: uint64 = (+ current_index#1 1u) + let range_item%37#5: uint64 = (+ option_index#0 1u) + goto block@3 + block@15: // after_for_L146 + let range_item%28#6: uint64 = (+ question_index#0 1u) + goto block@1 + block@17: // after_for_L144 + let note#4: bytes = (concat note#3 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#4) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + goto [block@3, block@4, ...block@6][fee_source#0] + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L175 + goto block@3 + block@3: // ternary_merge_L175 + let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, awst_tmp%2#0 <- block@2) + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#2 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let encoded_tuple_buffer%14#1: bytes = (concat 0x val_as_bytes%1#0) + let encoded_tuple_buffer%14#2: bytes = (concat encoded_tuple_buffer%14#1 val_as_bytes%8#0) + let encoded_tuple_buffer%14#3: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%10#0) + let encoded_tuple_buffer%14#4: bytes = (concat encoded_tuple_buffer%14#3 val_as_bytes%12#0) + return encoded_tuple_buffer%14#4 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L222 + let and_result%11#1: uint64 = 0u + goto block@6 + block@6: // bool_merge_L222 + let and_result%11#2: uint64 = φ(and_result%11#0 <- block@4, and_result%11#1 <- block@5) + return and_result%11#2 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (votes#0: bytes, exists#0: uint64) = (box_get tmp%0#0) + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L190 + goto block@3 + block@3: // ternary_merge_L190 + let ternary_result%2#2: uint64 = φ(ternary_result%2#0 <- block@1, awst_tmp%0#0 <- block@2) + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#2 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%15#0: uint64 = (+ 34u tmp%13#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + goto block@4 + block@4: // for_header_L207 + let question_index#0: uint64 = φ(range_item%23#0 <- block@3, range_item%23#2 <- block@5) + let cumulative_offset#1: uint64 = φ(cumulative_offset#0 <- block@3, cumulative_offset#2 <- block@5) + let continue_looping%24#0: uint64 = (< question_index#0 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 question_index#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 question_index#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#1 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#2: uint64 = (+ cumulative_offset#1 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + let range_item%23#2: uint64 = (+ question_index#0 1u) + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_2.ir b/examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..4796a6ada8 --- /dev/null +++ b/examples/voting/out/voting_VotingRoundApp.ssa.opt_pass_2.ir @@ -0,0 +1,527 @@ +contract examples.voting.voting.VotingRoundApp: + program approval: + subroutine examples.voting.voting.VotingRoundApp.approval_program() -> uint64: + block@0: // L51 + let app_id%0#0: uint64 = (txn ApplicationID) + goto app_id%0#0 ? block@2 : block@1 + block@1: // on_create_L52 + examples.voting.voting.VotingRoundApp.__init__() + goto block@2 + block@2: // entrypoint_L52 + let tmp%1#0: uint64 = (txn NumAppArgs) + goto tmp%1#0 ? block@3 : block@11 + block@3: // abi_routing_L51 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "create(string,byte[],string,uint64,uint64,uint8[],uint64,string)void" => block@4, method "bootstrap(pay)void" => block@5, method "close()void" => block@6, method "get_preconditions(byte[])(uint64,uint64,uint64,uint64)" => block@7, method "vote(pay,byte[],uint8[])void" => block@8, * => block@11} + block@4: // create_route_L72 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: uint64 = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: uint64 = (! tmp%5#0) + (assert tmp%6#0) // is creating + let tmp%7#0: bytes = (txna ApplicationArgs 1) + let tmp%8#0: bytes = (txna ApplicationArgs 2) + let tmp%9#0: bytes = (txna ApplicationArgs 3) + let tmp%10#0: bytes = (txna ApplicationArgs 4) + let tmp%11#0: bytes = (txna ApplicationArgs 5) + let tmp%12#0: bytes = (txna ApplicationArgs 6) + let tmp%13#0: bytes = (txna ApplicationArgs 7) + let tmp%14#0: bytes = (txna ApplicationArgs 8) + examples.voting.voting.VotingRoundApp.create(tmp%7#0, tmp%8#0, tmp%9#0, tmp%10#0, tmp%11#0, tmp%12#0, tmp%13#0, tmp%14#0) + return 1u + block@5: // bootstrap_route_L98 + let tmp%15#0: uint64 = (txn OnCompletion) + let tmp%16#0: uint64 = (! tmp%15#0) + (assert tmp%16#0) // OnCompletion is NoOp + let tmp%17#0: uint64 = (txn ApplicationID) + (assert tmp%17#0) // is not creating + let tmp%20#0: uint64 = (txn GroupIndex) + let awst_tmp%21#0: uint64 = (- tmp%20#0 1u) + let tmp%22#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#0) + let tmp%23#0: uint64 = (== tmp%22#0 pay) + (assert tmp%23#0) // transaction type is pay + examples.voting.voting.VotingRoundApp.bootstrap(awst_tmp%21#0) + return 1u + block@6: // close_route_L122 + 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 + examples.voting.voting.VotingRoundApp.close() + return 1u + block@7: // get_preconditions_route_L171 + let tmp%27#0: uint64 = (txn OnCompletion) + let tmp%28#0: uint64 = (! tmp%27#0) + (assert tmp%28#0) // OnCompletion is NoOp + let tmp%29#0: uint64 = (txn ApplicationID) + (assert tmp%29#0) // is not creating + let tmp%30#0: bytes = (txna ApplicationArgs 1) + let tmp%31#0: bytes = examples.voting.voting.VotingRoundApp.get_preconditions(tmp%30#0) + let tmp%32#0: bytes = (concat 0x151f7c75 tmp%31#0) + (log tmp%32#0) + return 1u + block@8: // vote_route_L180 + let tmp%33#0: uint64 = (txn OnCompletion) + let tmp%34#0: uint64 = (! tmp%33#0) + (assert tmp%34#0) // OnCompletion is NoOp + let tmp%35#0: uint64 = (txn ApplicationID) + (assert tmp%35#0) // is not creating + let tmp%38#0: uint64 = (txn GroupIndex) + let awst_tmp%21#1: uint64 = (- tmp%38#0 1u) + let tmp%39#0: uint64 = ((gtxns TypeEnum) awst_tmp%21#1) + let tmp%40#0: uint64 = (== tmp%39#0 pay) + (assert tmp%40#0) // transaction type is pay + let tmp%41#0: bytes = (txna ApplicationArgs 1) + let tmp%42#0: bytes = (txna ApplicationArgs 2) + examples.voting.voting.VotingRoundApp.vote(awst_tmp%21#1, tmp%41#0, tmp%42#0) + return 1u + block@11: // after_if_else_L51 + fail // reject transaction + + subroutine examples.voting.voting.VotingRoundApp.create(vote_id: bytes, snapshot_public_key: bytes, metadata_ipfs_cid: bytes, start_time: bytes, end_time: bytes, option_counts: bytes, quorum: bytes, nft_image_url: bytes) -> void: + block@0: // L73 + let st#0: uint64 = (btoi start_time#0) + let et#0: uint64 = (btoi end_time#0) + let tmp%0#0: uint64 = (< st#0 et#0) + (assert tmp%0#0) // End time should be after start time + let tmp%1#0: uint64 = (global LatestTimestamp) + let tmp%2#0: uint64 = (>= et#0 tmp%1#0) + (assert tmp%2#0) // End time should be in the future + let new_state_value%3#0: bytes = ((extract 2 0) vote_id#0) + (app_global_put "vote_id" new_state_value%3#0) + let awst_tmp%4#0: uint64 = (len snapshot_public_key#0) + let tmp%5#0: uint64 = (< 2u awst_tmp%4#0) + goto tmp%5#0 ? block@1 : block@2 + block@1: // ternary_true_L90 + let ternary_result%6#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L90 + goto block@3 + block@3: // ternary_merge_L90 + let ternary_result%6#2: uint64 = φ(ternary_result%6#0 <- block@1, awst_tmp%4#0 <- block@2) + let base_length%7#0: uint64 = (len snapshot_public_key#0) + let new_state_value%8#0: bytes = (substring3 snapshot_public_key#0 ternary_result%6#2 base_length%7#0) + (app_global_put "snapshot_public_key" new_state_value%8#0) + let new_state_value%9#0: bytes = ((extract 2 0) metadata_ipfs_cid#0) + (app_global_put "metadata_ipfs_cid" new_state_value%9#0) + (app_global_put "start_time" st#0) + (app_global_put "end_time" et#0) + let new_state_value%10#0: uint64 = (btoi quorum#0) + (app_global_put "quorum" new_state_value%10#0) + let new_state_value%11#0: bytes = ((extract 2 0) nft_image_url#0) + (app_global_put "nft_image_url" new_state_value%11#0) + examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + return + + subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> void: + block@0: // L233 + let tmp%0#0: uint64 = (extract_uint16 option_counts#0 0u) + (assert tmp%0#0) // option_counts should be non-empty + let tmp%1#0: uint64 = (extract_uint16 option_counts#0 0u) + let tmp%2#0: uint64 = (<= tmp%1#0 112u) + (assert tmp%2#0) // Can't have more than 112 questions + (app_global_put "option_counts" option_counts#0) + let total_options#0: uint64 = examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts#0) + let tmp%3#0: uint64 = (<= total_options#0 128u) + (assert tmp%3#0) // Can't have more than 128 vote options + (app_global_put "total_options" total_options#0) + return + + subroutine examples.voting.voting.VotingRoundApp.calculate_total_options_count(option_counts: bytes) -> uint64: + block@0: // L245 + let total#0: uint64 = 0u + let array_length%0#0: uint64 = (extract_uint16 option_counts#0 0u) + let array_value%1#0: bytes = ((extract 2 0) option_counts#0) + let item_index_internal%2#0: uint64 = 0u + goto block@1 + block@1: // for_header_L247 + let item_index_internal%2#1: uint64 = φ(item_index_internal%2#0 <- block@0, item_index_internal%2#2 <- block@2) + let total#1: uint64 = φ(total#0 <- block@0, total#2 <- block@2) + let continue_looping%3#0: uint64 = (< item_index_internal%2#1 array_length%0#0) + goto continue_looping%3#0 ? block@2 : block@4 + block@2: // for_body_L247 + let item#0: bytes = (extract3 array_value%1#0 item_index_internal%2#1 1u) + let tmp%5#0: uint64 = (btoi item#0) + let total#2: uint64 = (+ total#1 tmp%5#0) + let item_index_internal%2#2: uint64 = (+ item_index_internal%2#1 1u) + goto block@1 + block@4: // after_for_L247 + return total#1 + + subroutine examples.voting.voting.VotingRoundApp.bootstrap(fund_min_bal_req: uint64) -> void: + block@0: // L99 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Must not be already bootstrapped + (app_global_put "is_bootstrapped" 1u) + let (app_global_get_ex_value%3#0: uint64, app_global_get_ex_did_exist%4#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%4#0) // check value exists + let tmp%5#0: uint64 = (* app_global_get_ex_value%3#0 400u) + let tmp%6#0: uint64 = (* tmp%5#0 8u) + let box_cost#0: uint64 = (+ 2900u tmp%6#0) + let min_balance_req#0: uint64 = (+ 201000u box_cost#0) + let tmp%7#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%8#0: bytes = (global CurrentApplicationAddress) + let tmp%9#0: uint64 = (== tmp%7#0 tmp%8#0) + (assert tmp%9#0) // Payment must be to app address + let tmp%10#0: bytes = (itob min_balance_req#0) + (log tmp%10#0) + let tmp%11#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%12#0: uint64 = (== tmp%11#0 min_balance_req#0) + (assert tmp%12#0) // Payment must be for the exact min balance requirement + let (app_global_get_ex_value%13#0: uint64, app_global_get_ex_did_exist%14#0: uint64) = (app_global_get_ex 0u "total_options") + (assert app_global_get_ex_did_exist%14#0) // check value exists + let tmp%15#0: uint64 = (* app_global_get_ex_value%13#0 8u) + let tmp%16#0: uint64 = (box_create "V" tmp%15#0) + (assert tmp%16#0) + return + + subroutine examples.voting.voting.VotingRoundApp.close() -> void: + block@0: // L123 + algopy.ensure_budget(20000u, 0u) + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%1#0) // check value exists + let tmp%2#0: uint64 = (! app_global_get_ex_value%0#0) + (assert tmp%2#0) // Already closed + let new_state_value%3#0: uint64 = (global LatestTimestamp) + (app_global_put "close_time" new_state_value%3#0) + let (app_global_get_ex_value%4#0: bytes, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let tmp%6#0: bytes = (concat "{\"standard\":\"arc69\",\"description\":\"This is a voting result NFT for voting round with ID " app_global_get_ex_value%4#0) + let tmp%7#0: bytes = (concat tmp%6#0 ".\",\"properties\":{\"metadata\":\"ipfs://") + let (app_global_get_ex_value%8#0: bytes, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "metadata_ipfs_cid") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: bytes = (concat tmp%7#0 app_global_get_ex_value%8#0) + let tmp%11#0: bytes = (concat tmp%10#0 "\",\"id\":\"") + let (app_global_get_ex_value%12#0: bytes, app_global_get_ex_did_exist%13#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%13#0) // check value exists + let tmp%14#0: bytes = (concat tmp%11#0 app_global_get_ex_value%12#0) + let tmp%15#0: bytes = (concat tmp%14#0 "\",\"quorum\":") + let (app_global_get_ex_value%16#0: uint64, app_global_get_ex_did_exist%17#0: uint64) = (app_global_get_ex 0u "quorum") + (assert app_global_get_ex_did_exist%17#0) // check value exists + let tmp%18#0: bytes = (itob app_global_get_ex_value%16#0) + let tmp%19#0: bytes = (concat tmp%15#0 tmp%18#0) + let tmp%20#0: bytes = (concat tmp%19#0 ",\"voterCount\":") + let (app_global_get_ex_value%21#0: uint64, app_global_get_ex_did_exist%22#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%22#0) // check value exists + let tmp%23#0: bytes = (itob app_global_get_ex_value%21#0) + let tmp%24#0: bytes = (concat tmp%20#0 tmp%23#0) + let note#0: bytes = (concat tmp%24#0 ",\"tallies\":[") + let current_index#0: uint64 = 0u + let (app_global_get_ex_value%25#0: bytes, app_global_get_ex_did_exist%26#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%26#0) // check value exists + let tmp%27#0: uint64 = (extract_uint16 app_global_get_ex_value%25#0 0u) + let range_item%28#0: uint64 = 0u + goto block@1 + block@1: // for_header_L144 + let question_index#0: uint64 = φ(range_item%28#0 <- block@0, range_item%28#6 <- block@15) + let current_index#6: uint64 = φ(current_index#0 <- block@0, current_index#1 <- block@15) + let note#3: bytes = φ(note#0 <- block@0, note#1 <- block@15) + let continue_looping%29#0: uint64 = (< question_index#0 tmp%27#0) + goto continue_looping%29#0 ? block@2 : block@17 + block@2: // for_body_L144 + let (app_global_get_ex_value%30#0: bytes, app_global_get_ex_did_exist%31#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%31#0) // check value exists + let array_length%32#0: uint64 = (extract_uint16 app_global_get_ex_value%30#0 0u) + let index_is_in_bounds%33#0: uint64 = (< question_index#0 array_length%32#0) + (assert index_is_in_bounds%33#0) // Index access is out of bounds + let array_data_sans_header%34#0: bytes = ((extract 2 0) app_global_get_ex_value%30#0) + let tmp%36#0: bytes = (extract3 array_data_sans_header%34#0 question_index#0 1u) + let question_options#0: uint64 = (btoi tmp%36#0) + let range_item%37#0: uint64 = 0u + goto block@3 + block@3: // for_header_L146 + let option_index#0: uint64 = φ(range_item%37#0 <- block@2, range_item%37#5 <- block@13) + let current_index#1: uint64 = φ(current_index#6 <- block@2, current_index#5 <- block@13) + let note#1: bytes = φ(note#3 <- block@2, note#2 <- block@13) + let continue_looping%38#0: uint64 = (< option_index#0 question_options#0) + goto continue_looping%38#0 ? block@4 : block@15 + block@4: // for_body_L146 + let votes_for_option#0: uint64 = examples.voting.voting.get_vote_from_box(current_index#1) + let tmp%39#0: uint64 = (! option_index#0) + goto tmp%39#0 ? block@5 : block@6 + block@5: // ternary_true_L149 + let ternary_result%40#0: bytes = "[" + goto block@13 + block@6: // ternary_false_L149 + let tmp%41#0: uint64 = (- question_options#0 1u) + let tmp%42#0: uint64 = (== option_index#0 tmp%41#0) + goto tmp%42#0 ? block@7 : block@8 + block@7: // ternary_true_L151 + let tmp%44#0: bytes = (itob votes_for_option#0) + let ternary_result%43#0: bytes = (concat tmp%44#0 "]") + goto block@12 + block@8: // ternary_false_L151 + let (app_global_get_ex_value%46#0: bytes, app_global_get_ex_did_exist%47#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%47#0) // check value exists + let tmp%48#0: uint64 = (extract_uint16 app_global_get_ex_value%46#0 0u) + let tmp%49#0: uint64 = (- tmp%48#0 1u) + let tmp%50#0: uint64 = (== question_index#0 tmp%49#0) + goto tmp%50#0 ? block@9 : block@10 + block@9: // ternary_true_L153 + let ternary_result%51#0: bytes = "," + goto block@11 + block@10: // ternary_false_L153 + let ternary_result%51#1: bytes = "" + goto block@11 + block@11: // ternary_merge_L153 + let ternary_result%51#2: bytes = φ(ternary_result%51#0 <- block@9, ternary_result%51#1 <- block@10) + goto block@12 + block@12: // ternary_merge_L151 + let ternary_result%43#2: bytes = φ(ternary_result%43#0 <- block@7, ternary_result%51#2 <- block@11) + goto block@13 + block@13: // ternary_merge_L149 + let ternary_result%40#2: bytes = φ(ternary_result%40#0 <- block@5, ternary_result%43#2 <- block@12) + let note#2: bytes = (concat note#1 ternary_result%40#2) + let current_index#5: uint64 = (+ current_index#1 1u) + let range_item%37#5: uint64 = (+ option_index#0 1u) + goto block@3 + block@15: // after_for_L146 + let range_item%28#6: uint64 = (+ question_index#0 1u) + goto block@1 + block@17: // after_for_L144 + let note#4: bytes = (concat note#3 "]}}") + itxn_begin + ((itxn_field TypeEnum) acfg) + ((itxn_field ConfigAssetTotal) 1u) + ((itxn_field ConfigAssetDecimals) 0u) + ((itxn_field ConfigAssetDefaultFrozen) 0u) + let (app_global_get_ex_value%52#0: bytes, app_global_get_ex_did_exist%53#0: uint64) = (app_global_get_ex 0u "vote_id") + (assert app_global_get_ex_did_exist%53#0) // check value exists + let tmp%54#0: bytes = (concat "[VOTE RESULT] " app_global_get_ex_value%52#0) + ((itxn_field ConfigAssetName) tmp%54#0) + ((itxn_field ConfigAssetUnitName) "VOTERSLT") + let (app_global_get_ex_value%55#0: bytes, app_global_get_ex_did_exist%56#0: uint64) = (app_global_get_ex 0u "nft_image_url") + (assert app_global_get_ex_did_exist%56#0) // check value exists + ((itxn_field ConfigAssetURL) app_global_get_ex_value%55#0) + ((itxn_field Note) note#4) + itxn_submit + let new_state_value%57#0: uint64 = (itxn CreatedAssetID) + (app_global_put "nft_asset_id" new_state_value%57#0) + return + + subroutine algopy.ensure_budget(required_budget: uint64, fee_source: uint64) -> void: + block@0: // L14 + let required_budget_with_buffer#0: uint64 = (+ required_budget#0 10u) + goto block@1 + block@1: // while_top_L21 + let tmp%0#0: uint64 = (global OpcodeBudget) + let tmp%1#0: uint64 = (> required_budget_with_buffer#0 tmp%0#0) + goto tmp%1#0 ? block@2 : block@7 + block@2: // while_body_L21 + itxn_begin + ((itxn_field TypeEnum) appl) + ((itxn_field OnCompletion) DeleteApplication) + ((itxn_field ApprovalProgram) 0x068101) + ((itxn_field ClearStateProgram) 0x068101) + goto [block@3, block@4, ...block@6][fee_source#0] + block@3: // switch_case_0_L29 + ((itxn_field Fee) 0u) + goto block@6 + block@4: // switch_case_1_L31 + let tmp%2#0: uint64 = (global MinTxnFee) + ((itxn_field Fee) tmp%2#0) + goto block@6 + block@6: // switch_case_next_L27 + itxn_submit + goto block@1 + block@7: // after_while_L21 + return + + subroutine examples.voting.voting.get_vote_from_box(index: uint64) -> uint64: + block@0: // L263 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let tmp%3#0: uint64 = (btoi tmp%2#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.get_preconditions(signature: bytes) -> bytes: + block@0: // L172 + let tmp%0#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + let val_as_bytes%1#0: bytes = (itob tmp%0#0) + let awst_tmp%2#0: uint64 = (len signature#0) + let tmp%3#0: uint64 = (< 2u awst_tmp%2#0) + goto tmp%3#0 ? block@1 : block@2 + block@1: // ternary_true_L175 + let ternary_result%4#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L175 + goto block@3 + block@3: // ternary_merge_L175 + let ternary_result%4#2: uint64 = φ(ternary_result%4#0 <- block@1, awst_tmp%2#0 <- block@2) + let base_length%5#0: uint64 = (len signature#0) + let tmp%6#0: bytes = (substring3 signature#0 ternary_result%4#2 base_length%5#0) + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%6#0) + let val_as_bytes%8#0: bytes = (itob tmp%7#0) + let tmp%9#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let val_as_bytes%10#0: bytes = (itob tmp%9#0) + let tmp%11#0: uint64 = (global LatestTimestamp) + let val_as_bytes%12#0: bytes = (itob tmp%11#0) + let encoded_tuple_buffer%14#2: bytes = (concat val_as_bytes%1#0 val_as_bytes%8#0) + let encoded_tuple_buffer%14#3: bytes = (concat encoded_tuple_buffer%14#2 val_as_bytes%10#0) + let encoded_tuple_buffer%14#4: bytes = (concat encoded_tuple_buffer%14#3 val_as_bytes%12#0) + return encoded_tuple_buffer%14#4 + + subroutine examples.voting.voting.VotingRoundApp.voting_open() -> uint64: + block@0: // L220 + let (app_global_get_ex_value%0#0: uint64, app_global_get_ex_did_exist%1#0: uint64) = (app_global_get_ex 0u "is_bootstrapped") + (assert app_global_get_ex_did_exist%1#0) // check value exists + goto app_global_get_ex_value%0#0 ? block@1 : block@5 + block@1: // and_contd_L222 + let (app_global_get_ex_value%2#0: uint64, app_global_get_ex_did_exist%3#0: uint64) = (app_global_get_ex 0u "close_time") + (assert app_global_get_ex_did_exist%3#0) // check value exists + goto app_global_get_ex_value%2#0 ? block@5 : block@2 + block@2: // and_contd_L222 + let (app_global_get_ex_value%4#0: uint64, app_global_get_ex_did_exist%5#0: uint64) = (app_global_get_ex 0u "start_time") + (assert app_global_get_ex_did_exist%5#0) // check value exists + let awst_tmp%6#0: uint64 = (global LatestTimestamp) + let tmp%7#0: uint64 = (<= app_global_get_ex_value%4#0 awst_tmp%6#0) + goto tmp%7#0 ? block@3 : block@5 + block@3: // and_contd_L224 + let (app_global_get_ex_value%8#0: uint64, app_global_get_ex_did_exist%9#0: uint64) = (app_global_get_ex 0u "end_time") + (assert app_global_get_ex_did_exist%9#0) // check value exists + let tmp%10#0: uint64 = (<= awst_tmp%6#0 app_global_get_ex_value%8#0) + goto tmp%10#0 ? block@4 : block@5 + block@4: // bool_true_L222 + let and_result%11#0: uint64 = 1u + goto block@6 + block@5: // bool_false_L222 + let and_result%11#1: uint64 = 0u + goto block@6 + block@6: // bool_merge_L222 + let and_result%11#2: uint64 = φ(and_result%11#0 <- block@4, and_result%11#1 <- block@5) + return and_result%11#2 + + subroutine examples.voting.voting.VotingRoundApp.allowed_to_vote(signature: bytes) -> uint64: + block@0: // L253 + algopy.ensure_budget(2000u, 2u) + let tmp%0#0: bytes = (txn Sender) + let (app_global_get_ex_value%1#0: bytes, app_global_get_ex_did_exist%2#0: uint64) = (app_global_get_ex 0u "snapshot_public_key") + (assert app_global_get_ex_did_exist%2#0) // check value exists + let tmp%3#0: uint64 = (ed25519verify_bare tmp%0#0 signature#0 app_global_get_ex_value%1#0) + return tmp%3#0 + + subroutine examples.voting.voting.VotingRoundApp.already_voted() -> uint64: + block@0: // L228 + let tmp%0#0: bytes = (txn Sender) + let (votes#0: bytes, exists#0: uint64) = (box_get tmp%0#0) + return exists#0 + + subroutine examples.voting.voting.VotingRoundApp.vote(fund_min_bal_req: uint64, signature: bytes, answer_ids: bytes) -> void: + block@0: // L181 + algopy.ensure_budget(7700u, 0u) + let awst_tmp%0#0: uint64 = (len signature#0) + let tmp%1#0: uint64 = (< 2u awst_tmp%0#0) + goto tmp%1#0 ? block@1 : block@2 + block@1: // ternary_true_L190 + let ternary_result%2#0: uint64 = 2u + goto block@3 + block@2: // ternary_false_L190 + goto block@3 + block@3: // ternary_merge_L190 + let ternary_result%2#2: uint64 = φ(ternary_result%2#0 <- block@1, awst_tmp%0#0 <- block@2) + let base_length%3#0: uint64 = (len signature#0) + let tmp%4#0: bytes = (substring3 signature#0 ternary_result%2#2 base_length%3#0) + let tmp%5#0: uint64 = examples.voting.voting.VotingRoundApp.allowed_to_vote(tmp%4#0) + (assert tmp%5#0) // Not allowed to vote + let tmp%6#0: uint64 = examples.voting.voting.VotingRoundApp.voting_open() + (assert tmp%6#0) // Voting not open + let tmp%7#0: uint64 = examples.voting.voting.VotingRoundApp.already_voted() + let tmp%8#0: uint64 = (! tmp%7#0) + (assert tmp%8#0) // Already voted + let (app_global_get_ex_value%9#0: bytes, app_global_get_ex_did_exist%10#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%10#0) // check value exists + let questions_count#0: uint64 = (extract_uint16 app_global_get_ex_value%9#0 0u) + let tmp%11#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%12#0: uint64 = (== tmp%11#0 questions_count#0) + (assert tmp%12#0) // Number of answers incorrect + let tmp%13#0: uint64 = (extract_uint16 answer_ids#0 0u) + let tmp%15#0: uint64 = (+ 34u tmp%13#0) + let tmp%16#0: uint64 = (* tmp%15#0 400u) + let min_bal_req#0: uint64 = (+ 2500u tmp%16#0) + let tmp%17#0: bytes = ((gtxns Receiver) fund_min_bal_req#0) + let tmp%18#0: bytes = (global CurrentApplicationAddress) + let tmp%19#0: uint64 = (== tmp%17#0 tmp%18#0) + (assert tmp%19#0) // Payment must be to app address + let tmp%20#0: bytes = (itob min_bal_req#0) + (log tmp%20#0) + let tmp%21#0: uint64 = ((gtxns Amount) fund_min_bal_req#0) + let tmp%22#0: uint64 = (== tmp%21#0 min_bal_req#0) + (assert tmp%22#0) // Payment must be the exact min balance + let cumulative_offset#0: uint64 = 0u + let range_item%23#0: uint64 = 0u + goto block@4 + block@4: // for_header_L207 + let question_index#0: uint64 = φ(range_item%23#0 <- block@3, range_item%23#2 <- block@5) + let cumulative_offset#1: uint64 = φ(cumulative_offset#0 <- block@3, cumulative_offset#2 <- block@5) + let continue_looping%24#0: uint64 = (< question_index#0 questions_count#0) + goto continue_looping%24#0 ? block@5 : block@7 + block@5: // for_body_L207 + let array_length%25#0: uint64 = (extract_uint16 answer_ids#0 0u) + let index_is_in_bounds%26#0: uint64 = (< question_index#0 array_length%25#0) + (assert index_is_in_bounds%26#0) // Index access is out of bounds + let array_data_sans_header%27#0: bytes = ((extract 2 0) answer_ids#0) + let answer_option_index#0: bytes = (extract3 array_data_sans_header%27#0 question_index#0 1u) + let (app_global_get_ex_value%29#0: bytes, app_global_get_ex_did_exist%30#0: uint64) = (app_global_get_ex 0u "option_counts") + (assert app_global_get_ex_did_exist%30#0) // check value exists + let array_length%31#0: uint64 = (extract_uint16 app_global_get_ex_value%29#0 0u) + let index_is_in_bounds%32#0: uint64 = (< question_index#0 array_length%31#0) + (assert index_is_in_bounds%32#0) // Index access is out of bounds + let array_data_sans_header%33#0: bytes = ((extract 2 0) app_global_get_ex_value%29#0) + let options_count#0: bytes = (extract3 array_data_sans_header%33#0 question_index#0 1u) + let tmp%35#0: uint64 = (btoi answer_option_index#0) + let tmp%36#0: uint64 = (btoi options_count#0) + let tmp%37#0: uint64 = (< tmp%35#0 tmp%36#0) + (assert tmp%37#0) // Answer option index invalid + let tmp%38#0: uint64 = (btoi answer_option_index#0) + let tmp%39#0: uint64 = (+ cumulative_offset#1 tmp%38#0) + examples.voting.voting.increment_vote_in_box(tmp%39#0) + let tmp%40#0: uint64 = (btoi options_count#0) + let cumulative_offset#2: uint64 = (+ cumulative_offset#1 tmp%40#0) + let tmp%41#0: bytes = (txn Sender) + (box_put tmp%41#0 answer_ids#0) + let (app_global_get_ex_value%42#0: uint64, app_global_get_ex_did_exist%43#0: uint64) = (app_global_get_ex 0u "voter_count") + (assert app_global_get_ex_did_exist%43#0) // check value exists + let new_state_value%44#0: uint64 = (+ app_global_get_ex_value%42#0 1u) + (app_global_put "voter_count" new_state_value%44#0) + let range_item%23#2: uint64 = (+ question_index#0 1u) + goto block@4 + block@7: // after_for_L207 + return + + subroutine examples.voting.voting.increment_vote_in_box(index: uint64) -> void: + block@0: // L270 + let (box_data#0: bytes, exists#0: uint64) = (box_get "V") + (assert exists#0) // Box not created + let tmp%2#0: bytes = (extract3 box_data#0 index#0 8u) + let current_vote#0: uint64 = (btoi tmp%2#0) + let tmp%3#0: uint64 = (+ current_vote#0 1u) + let tmp%4#0: bytes = (itob tmp%3#0) + (box_replace "V" index#0 tmp%4#0) + return + + subroutine examples.voting.voting.VotingRoundApp.__init__() -> void: + block@0: // L52 + (app_global_put "is_bootstrapped" 0u) + (app_global_put "voter_count" 0u) + (app_global_put "close_time" 0u) + (app_global_put "nft_asset_id" 0u) + (app_global_put "snapshot_public_key" "") + (app_global_put "vote_id" "") + (app_global_put "metadata_ipfs_cid" "") + (app_global_put "start_time" 0u) + (app_global_put "end_time" 0u) + (app_global_put "quorum" 0u) + (app_global_put "nft_image_url" "") + (app_global_put "option_counts" 0x0000) + (app_global_put "total_options" 0u) + return + + program clear-state: + subroutine examples.voting.voting.VotingRoundApp.clear_state_program() -> uint64: + block@0: // L69 + return 1u \ No newline at end of file diff --git a/real_examples/arc4/voting/voting.py b/examples/voting/voting.py similarity index 73% rename from real_examples/arc4/voting/voting.py rename to examples/voting/voting.py index 2c0ef92b64..28fc8b00ad 100644 --- a/real_examples/arc4/voting/voting.py +++ b/examples/voting/voting.py @@ -8,22 +8,22 @@ Global, InnerTransaction, OpUpFeeSource, + PaymentTransaction, Transaction, TransactionType, UInt64, arc4, btoi, - ed25519verify, ensure_budget, extract, itob, log, subroutine, urange, + ed25519verify_bare, ) -from algopy.arc4 import DynamicArray, UInt8 -VoteIndexArray: typing.TypeAlias = DynamicArray[UInt8] +VoteIndexArray: typing.TypeAlias = arc4.DynamicArray[arc4.UInt8] VOTE_INDEX_BYTES = 1 VOTE_COUNT_BYTES = 8 @@ -41,55 +41,62 @@ TALLY_BOX_KEY = b"V" -class VotingContract(ARC4Contract): +class VotingPreconditions(arc4.Struct): + is_voting_open: arc4.UInt64 + is_allowed_to_vote: arc4.UInt64 + has_already_voted: arc4.UInt64 + current_time: arc4.UInt64 + + +class VotingRoundApp(ARC4Contract): def __init__(self) -> None: self.is_bootstrapped = False + # The minimum number of voters who have voted self.voter_count = UInt64(0) self.close_time = UInt64(0) self.nft_asset_id = UInt64(0) - empty_bytes = Bytes(b"") - - self.snapshot_public_key: Bytes = empty_bytes - self.vote_id: arc4.String = arc4.String.from_bytes(empty_bytes) - self.metadata_ipfs_cid: arc4.String = arc4.String.from_bytes(empty_bytes) - self.start_time: UInt64 = UInt64(0) - self.end_time: UInt64 = UInt64(0) - self.quorum: UInt64 = UInt64(0) - self.nft_image_url: arc4.String = arc4.String.from_bytes(empty_bytes) - ##self.option_counts: VoteIndexArray = DynamicArray[UInt8].from_bytes(empty_bytes) - self.option_counts: VoteIndexArray = VoteIndexArray.from_bytes(empty_bytes) - self.total_options: UInt64 = UInt64(0) + self.snapshot_public_key = Bytes() + self.vote_id = Bytes() + self.metadata_ipfs_cid = Bytes() + self.start_time = UInt64(0) + self.end_time = UInt64(0) + self.quorum = UInt64(0) + self.nft_image_url = Bytes() + self.option_counts = VoteIndexArray() + self.total_options = UInt64(0) def clear_state_program(self) -> bool: return True - @arc4.abimethod(create=True, allow_actions=["no_op"]) + @arc4.abimethod(create=True) def create( self, vote_id: arc4.String, - snapshot_public_key: Bytes, + snapshot_public_key: arc4.DynamicBytes, metadata_ipfs_cid: arc4.String, - start_time: UInt64, - end_time: UInt64, + start_time: arc4.UInt64, + end_time: arc4.UInt64, option_counts: VoteIndexArray, - quorum: UInt64, + quorum: arc4.UInt64, nft_image_url: arc4.String, ) -> None: - assert start_time < end_time, "End time should be after start time" - assert end_time >= Global.latest_timestamp(), "End time should be in the future" - - self.vote_id = vote_id - self.snapshot_public_key = snapshot_public_key - self.metadata_ipfs_cid = metadata_ipfs_cid - self.start_time = start_time - self.end_time = end_time - self.quorum = quorum - self.nft_image_url = nft_image_url + st = start_time.decode() + et = end_time.decode() + assert st < et, "End time should be after start time" + assert et >= Global.latest_timestamp(), "End time should be in the future" + + self.vote_id = vote_id.decode() + self.snapshot_public_key = snapshot_public_key.bytes[2:] + self.metadata_ipfs_cid = metadata_ipfs_cid.decode() + self.start_time = st + self.end_time = et + self.quorum = quorum.decode() + self.nft_image_url = nft_image_url.decode() self.store_option_counts(option_counts) @arc4.abimethod() - def bootstrap(self, fund_min_bal_req: arc4.PaymentTransaction) -> None: + def bootstrap(self, fund_min_bal_req: PaymentTransaction) -> None: assert not self.is_bootstrapped, "Must not be already bootstrapped" self.is_bootstrapped = True @@ -110,7 +117,7 @@ def bootstrap(self, fund_min_bal_req: arc4.PaymentTransaction) -> None: fund_min_bal_req.amount == min_balance_req ), "Payment must be for the exact min balance requirement" - Box.create(TALLY_BOX_KEY, self.total_options) + assert Box.create(TALLY_BOX_KEY, self.total_options * VOTE_COUNT_BYTES) @arc4.abimethod() def close(self) -> None: @@ -119,12 +126,13 @@ def close(self) -> None: self.close_time = Global.latest_timestamp() note = ( - b'{"standard":"arc69","description":"This is a voting result NFT for voting round with ID ' - + self.vote_id.decode() + b'{"standard":"arc69",' + b'"description":"This is a voting result NFT for voting round with ID ' + + self.vote_id + b'.","properties":{"metadata":"ipfs://' - + self.metadata_ipfs_cid.decode() + + self.metadata_ipfs_cid + b'","id":"' - + self.vote_id.decode() + + self.vote_id + b'","quorum":' + itob(self.quorum) + b',"voterCount":' @@ -153,40 +161,40 @@ def close(self) -> None: CreateInnerTransaction.set_config_asset_total(1) CreateInnerTransaction.set_config_asset_decimals(0) CreateInnerTransaction.set_config_asset_default_frozen(False) - CreateInnerTransaction.set_config_asset_name(b"[VOTE RESULT] " + self.vote_id.decode()) + CreateInnerTransaction.set_config_asset_name(b"[VOTE RESULT] " + self.vote_id) CreateInnerTransaction.set_config_asset_unit_name(b"VOTERSLT") - CreateInnerTransaction.set_config_asset_url(self.nft_image_url.decode()) + CreateInnerTransaction.set_config_asset_url(self.nft_image_url) CreateInnerTransaction.set_note(note) CreateInnerTransaction.submit() self.nft_asset_id = InnerTransaction.created_asset_id() - @arc4.abimethod() - def get_preconditions(self, signature: Bytes) -> tuple[bool, bool, bool, UInt64]: - return ( - self.voting_open(), - self.allowed_to_vote(signature), - self.already_voted(), - Global.latest_timestamp(), + @arc4.abimethod(readonly=True) + def get_preconditions(self, signature: arc4.DynamicBytes) -> VotingPreconditions: + return VotingPreconditions( + is_voting_open=arc4.UInt64(self.voting_open()), + is_allowed_to_vote=arc4.UInt64(self.allowed_to_vote(signature.bytes[2:])), + has_already_voted=arc4.UInt64(self.already_voted()), + current_time=arc4.UInt64(Global.latest_timestamp()), ) @arc4.abimethod() def vote( self, - fund_min_bal_req: arc4.PaymentTransaction, - signature: Bytes, + fund_min_bal_req: PaymentTransaction, + signature: arc4.DynamicBytes, answer_ids: VoteIndexArray, ) -> None: # return pt.Seq( ensure_budget(7700, fee_source=OpUpFeeSource.GroupCredit) # Check voting preconditions - assert self.allowed_to_vote(signature), "Not allowed to vote" + assert self.allowed_to_vote(signature.bytes[2:]), "Not allowed to vote" assert self.voting_open(), "Voting not open" assert not self.already_voted(), "Already voted" questions_count = self.option_counts.length assert answer_ids.length == questions_count, "Number of answers incorrect" # Check voter box is funded min_bal_req = BOX_FLAT_MIN_BALANCE + ( - (32 + 2) * VOTE_INDEX_BYTES * answer_ids.length * BOX_BYTE_MIN_BALANCE + (32 + 2 + VOTE_INDEX_BYTES * answer_ids.length) * BOX_BYTE_MIN_BALANCE ) assert ( fund_min_bal_req.receiver == Global.current_application_address() @@ -243,9 +251,8 @@ def calculate_total_options_count(self, option_counts: VoteIndexArray) -> UInt64 @subroutine def allowed_to_vote(self, signature: Bytes) -> bool: - # TODO: opup / ensure budget ensure_budget(2000) - return ed25519verify( + return ed25519verify_bare( Transaction.sender().bytes, signature, self.snapshot_public_key, @@ -264,4 +271,4 @@ def increment_vote_in_box(index: UInt64) -> None: box_data, exists = Box.get(TALLY_BOX_KEY) assert exists, "Box not created" current_vote = btoi(extract(box_data, index, VOTE_COUNT_BYTES)) - Box.replace(box_data, index, itob(current_vote + 1)) + Box.replace(TALLY_BOX_KEY, index, itob(current_vote + 1)) diff --git a/examples/with_reentrancy/algopy.log b/examples/with_reentrancy/algopy.log index 69163a3287..809cfe28a2 100644 --- a/examples/with_reentrancy/algopy.log +++ b/examples/with_reentrancy/algopy.log @@ -1,7 +1,8 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 with_reentrancy -info: Building AWST for __init__.py -info: Building AWST for with_reentrancy -info: Building AWST for with_reentrancy/contract.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug with_reentrancy +debug: Building AWST for __init__.py +debug: Building AWST for with_reentrancy +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for with_reentrancy/contract.py with_reentrancy/contract.py:9 warning: expression result is ignored debug: Sealing block@0: // L26 debug: Terminated block@0: // L26 @@ -73,6 +74,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -83,6 +85,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -93,6 +96,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -103,6 +107,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -115,6 +120,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: a#2, result#2 debug: Replacing {result#2} with a#2 made 1 modifications +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -126,6 +132,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable digits#0 debug: Optimizer: Simplify Conditional Branches @@ -137,6 +144,7 @@ debug: Splitting parallel copies prior to optimization debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -148,6 +156,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.WithReentrancy.ap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -157,6 +166,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.fibonacci debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -166,6 +176,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.silly debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -175,6 +186,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.silly2 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -184,6 +196,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.silly3 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -195,6 +208,7 @@ debug: Optimizer: Arithmetic Simplification debug: Folded len("0123456789") to 10 debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Removing unused variable radix#0 debug: Optimizer: Simplify Conditional Branches @@ -205,6 +219,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.WithReentrancy.cl debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -216,6 +231,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.WithReentrancy.ap debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -225,6 +241,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.fibonacci debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -234,6 +251,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.silly debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -243,6 +261,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.silly2 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -252,6 +271,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.silly3 debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -262,6 +282,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.itoa debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -271,6 +292,7 @@ debug: Optimizing subroutine examples.with_reentrancy.contract.WithReentrancy.cl debug: Optimizer: Arithmetic Simplification debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables debug: Optimizer: Simplify Conditional Branches debug: Optimizer: Remove Linear Jump @@ -344,74 +366,74 @@ debug: Coalescing local variables in examples.with_reentrancy.contract.WithReent debug: Coalescing resulted in 0 replacement/s debug: Output IR to /examples/with_reentrancy/out/contract_WithReentrancy.final.ir debug: Inserted main_block@0.ops[2]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[4]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[4]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted main_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced main_block@0.ops[8]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced main_block@0.ops[8]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted fibonacci_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced fibonacci_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced fibonacci_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted fibonacci_after_if_else@2.ops[3]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced fibonacci_after_if_else@2.ops[5]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced fibonacci_after_if_else@2.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted fibonacci_after_if_else@2.ops[11]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced fibonacci_after_if_else@2.ops[13]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced fibonacci_after_if_else@2.ops[13]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted fibonacci_after_if_else@2.ops[19]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced fibonacci_after_if_else@2.ops[21]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced fibonacci_after_if_else@2.ops[21]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted fibonacci_after_if_else@2.ops[15]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced fibonacci_after_if_else@2.ops[18]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced fibonacci_after_if_else@2.ops[18]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Inserted fibonacci_after_if_else@2.ops[7]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced fibonacci_after_if_else@2.ops[18]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced fibonacci_after_if_else@2.ops[18]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.with_reentrancy.contract.fibonacci debug: Inserted silly_block@0.ops[12]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced silly_block@0.ops[14]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced silly_block@0.ops[14]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted silly_block@0.ops[8]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced silly_block@0.ops[11]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced silly_block@0.ops[11]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted silly_block@0.ops[5]: 'store result#0 to l-stack (copy)' -debug: Replaced silly_block@0.ops[18]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced silly_block@0.ops[18]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted silly2_block@0.ops[12]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced silly2_block@0.ops[14]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced silly2_block@0.ops[14]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted silly2_block@0.ops[8]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced silly2_block@0.ops[11]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced silly2_block@0.ops[11]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted silly2_block@0.ops[5]: 'store result#0 to l-stack (copy)' -debug: Replaced silly2_block@0.ops[18]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced silly2_block@0.ops[18]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted silly3_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced silly3_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced silly3_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted silly3_block@0.ops[7]: 'store is_even#0 to l-stack (copy)' -debug: Replaced silly3_block@0.ops[13]: 'load is_even#0 from scratch' with 'load is_even#0 from l-stack (no copy)' +debug: Replaced silly3_block@0.ops[13]: 'load is_even#0' with 'load is_even#0 from l-stack (no copy)' debug: Inserted silly3_if_body@1.ops[3]: 'store result#0 to l-stack (copy)' -debug: Replaced silly3_if_body@1.ops[5]: 'load result#0 from scratch' with 'load result#0 from l-stack (no copy)' +debug: Replaced silly3_if_body@1.ops[5]: 'load result#0' with 'load result#0 from l-stack (no copy)' debug: Inserted silly3_if_body@1.ops[8]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced silly3_if_body@1.ops[10]: 'load tmp%1#0 from scratch' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced silly3_if_body@1.ops[10]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted silly3_after_if_else@5.ops[6]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced silly3_after_if_else@5.ops[8]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced silly3_after_if_else@5.ops[8]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted silly3_after_if_else@5.ops[2]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced silly3_after_if_else@5.ops[5]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced silly3_after_if_else@5.ops[5]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Found 3 edge set/s for examples.with_reentrancy.contract.silly3 debug: examples.with_reentrancy.contract.silly3 f-stack entry: ['result#0'] debug: examples.with_reentrancy.contract.silly3 f-stack on first store: ['is_even#0', 'a#0'] debug: Simplified frame_dig 0; frame_bury 0; retsub to retsub debug: Inserted itoa_block@0.ops[3]: 'store tmp%0#0 to l-stack (copy)' -debug: Replaced itoa_block@0.ops[5]: 'load tmp%0#0 from scratch' with 'load tmp%0#0 from l-stack (no copy)' +debug: Replaced itoa_block@0.ops[5]: 'load tmp%0#0' with 'load tmp%0#0 from l-stack (no copy)' debug: Inserted itoa_if_body@1.ops[8]: 'store tmp%2#0 to l-stack (copy)' -debug: Replaced itoa_if_body@1.ops[10]: 'load tmp%2#0 from scratch' with 'load tmp%2#0 from l-stack (no copy)' +debug: Replaced itoa_if_body@1.ops[10]: 'load tmp%2#0' with 'load tmp%2#0 from l-stack (no copy)' debug: Inserted itoa_if_body@1.ops[3]: 'store index_plus_1%1#0 to l-stack (copy)' -debug: Replaced itoa_if_body@1.ops[7]: 'load index_plus_1%1#0 from scratch' with 'load index_plus_1%1#0 from l-stack (no copy)' +debug: Replaced itoa_if_body@1.ops[7]: 'load index_plus_1%1#0' with 'load index_plus_1%1#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[3]: 'store tmp%3#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[5]: 'load tmp%3#0 from scratch' with 'load tmp%3#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[5]: 'load tmp%3#0' with 'load tmp%3#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[11]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[13]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[13]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[25]: 'store tmp%8#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[27]: 'load tmp%8#0 from scratch' with 'load tmp%8#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[27]: 'load tmp%8#0' with 'load tmp%8#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[21]: 'store tmp%7#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[24]: 'load tmp%7#0 from scratch' with 'load tmp%7#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[24]: 'load tmp%7#0' with 'load tmp%7#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[16]: 'store index_plus_1%6#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[20]: 'load index_plus_1%6#0 from scratch' with 'load index_plus_1%6#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[20]: 'load index_plus_1%6#0' with 'load index_plus_1%6#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[14]: 'store tmp%5#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[20]: 'load tmp%5#0 from scratch' with 'load tmp%5#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[20]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted itoa_after_if_else@2.ops[7]: 'store tmp%4#0 to l-stack (copy)' -debug: Replaced itoa_after_if_else@2.ops[26]: 'load tmp%4#0 from scratch' with 'load tmp%4#0 from l-stack (no copy)' +debug: Replaced itoa_after_if_else@2.ops[26]: 'load tmp%4#0' with 'load tmp%4#0 from l-stack (no copy)' debug: Found 1 edge set/s for examples.with_reentrancy.contract.itoa debug: Simplified uncover 2; uncover 2 to cover 2 -info: Writing /examples/with_reentrancy/out/contract.approval.teal -info: Writing /examples/with_reentrancy/out/contract.approval.debug.teal -info: Writing /examples/with_reentrancy/out/contract.clear.teal -info: Writing /examples/with_reentrancy/out/contract.clear.debug.teal +info: Writing with_reentrancy/out/contract.approval.teal +info: Writing with_reentrancy/out/contract.approval.debug.teal +info: Writing with_reentrancy/out/contract.clear.teal +info: Writing with_reentrancy/out/contract.clear.debug.teal >> exit code = 0 \ No newline at end of file diff --git a/examples/with_reentrancy/out/contract.approval.debug.teal b/examples/with_reentrancy/out/contract.approval.debug.teal index a4c23ccf94..bd6d682524 100644 --- a/examples/with_reentrancy/out/contract.approval.debug.teal +++ b/examples/with_reentrancy/out/contract.approval.debug.teal @@ -57,7 +57,7 @@ silly_block@0: frame_dig -1 // load x#0 from parameters (𝕡) x#0 | result#0,x#0 x: UInt64 File "with_reentrancy/contract.py", line 33 callsub itoa // (𝕡) x#0 | result#0,{itoa} itoa(x) File "with_reentrancy/contract.py", line 36 byte "silly = " // (𝕡) x#0 | result#0,tmp%0#0,"silly = " b"silly = " File "with_reentrancy/contract.py", line 36 - uncover 1 // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 36 + swap // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 36 concat // (𝕡) x#0 | result#0,{concat} Bytes(b"silly = ") + itoa(x) File "with_reentrancy/contract.py", line 36 log // (𝕡) x#0 | result#0 log(Bytes(b"silly = ") + itoa(x)) File "with_reentrancy/contract.py", line 36 retsub // result#0 return result File "with_reentrancy/contract.py", line 37 @@ -77,7 +77,7 @@ silly2_block@0: frame_dig -1 // load x#0 from parameters (𝕡) x#0 | result#0,x#0 x: UInt64 File "with_reentrancy/contract.py", line 41 callsub itoa // (𝕡) x#0 | result#0,{itoa} itoa(x) File "with_reentrancy/contract.py", line 44 byte "silly2 = " // (𝕡) x#0 | result#0,tmp%0#0,"silly2 = " b"silly2 = " File "with_reentrancy/contract.py", line 44 - uncover 1 // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly2 = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 44 + swap // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly2 = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 44 concat // (𝕡) x#0 | result#0,{concat} Bytes(b"silly2 = ") + itoa(x) File "with_reentrancy/contract.py", line 44 log // (𝕡) x#0 | result#0 log(Bytes(b"silly2 = ") + itoa(x)) File "with_reentrancy/contract.py", line 44 retsub // result#0 return result File "with_reentrancy/contract.py", line 45 @@ -94,11 +94,11 @@ silly3_block@0: % // (𝕡) x#0 | (𝕗) result#0 | {%} x % 2 File "with_reentrancy/contract.py", line 50 ! // (𝕡) x#0 | (𝕗) result#0 | {!} x % 2 == 0 File "with_reentrancy/contract.py", line 50 dup // store is_even#0 to l-stack (copy) (𝕡) x#0 | (𝕗) result#0 | is_even#0,is_even#0 is_even File "with_reentrancy/contract.py", line 50 - cover 1 // store is_even#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0 is_even File "with_reentrancy/contract.py", line 50 + swap // store is_even#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0 is_even File "with_reentrancy/contract.py", line 50 frame_dig -1 // load x#0 from parameters (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0,x#0 x: UInt64 File "with_reentrancy/contract.py", line 49 int 2 // (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0,x#0,2 2 File "with_reentrancy/contract.py", line 51 + // (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0,{+} x + 2 File "with_reentrancy/contract.py", line 51 - cover 1 // store a#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | is_even#0 a File "with_reentrancy/contract.py", line 51 + swap // store a#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | is_even#0 a File "with_reentrancy/contract.py", line 51 bz silly3_else_body@2 // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | if is_even: File "with_reentrancy/contract.py", line 52 // Implicit fall through to silly3_if_body@1 // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | if is_even: File "with_reentrancy/contract.py", line 52 @@ -135,7 +135,7 @@ silly3_after_if_else@5: frame_dig -1 // load x#0 from parameters (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | x#0 x: UInt64 File "with_reentrancy/contract.py", line 49 callsub itoa // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | {itoa} itoa(x) File "with_reentrancy/contract.py", line 60 byte "silly3 = " // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | tmp%2#0,"silly3 = " b"silly3 = " File "with_reentrancy/contract.py", line 60 - uncover 1 // load tmp%2#0 from l-stack (no copy) (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | "silly3 = ",tmp%2#0 itoa(x) File "with_reentrancy/contract.py", line 60 + swap // load tmp%2#0 from l-stack (no copy) (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | "silly3 = ",tmp%2#0 itoa(x) File "with_reentrancy/contract.py", line 60 concat // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | {concat} Bytes(b"silly3 = ") + itoa(x) File "with_reentrancy/contract.py", line 60 log // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | log(Bytes(b"silly3 = ") + itoa(x)) File "with_reentrancy/contract.py", line 60 retsub // virtual: 2 ops result#0 result = a * 2 File "with_reentrancy/contract.py", line 53 diff --git a/examples/with_reentrancy/out/contract.approval.teal b/examples/with_reentrancy/out/contract.approval.teal index c7e3675253..98fa65eb7d 100644 --- a/examples/with_reentrancy/out/contract.approval.teal +++ b/examples/with_reentrancy/out/contract.approval.teal @@ -54,7 +54,7 @@ silly_block@0: frame_dig -1 callsub itoa byte "silly = " - uncover 1 + swap concat log retsub @@ -74,7 +74,7 @@ silly2_block@0: frame_dig -1 callsub itoa byte "silly2 = " - uncover 1 + swap concat log retsub @@ -91,11 +91,11 @@ silly3_block@0: % ! dup - cover 1 + swap frame_dig -1 int 2 + - cover 1 + swap bz silly3_else_body@2 silly3_if_body@1: @@ -128,7 +128,7 @@ silly3_after_if_else@5: frame_dig -1 callsub itoa byte "silly3 = " - uncover 1 + swap concat log retsub diff --git a/examples/with_reentrancy/out/contract.approval_unoptimized.debug.teal b/examples/with_reentrancy/out/contract.approval_unoptimized.debug.teal index 0690f8ace5..4493a0db66 100644 --- a/examples/with_reentrancy/out/contract.approval_unoptimized.debug.teal +++ b/examples/with_reentrancy/out/contract.approval_unoptimized.debug.teal @@ -57,7 +57,7 @@ silly_block@0: frame_dig -1 // load x#0 from parameters (𝕡) x#0 | result#0,x#0 x: UInt64 File "with_reentrancy/contract.py", line 33 callsub itoa // (𝕡) x#0 | result#0,{itoa} itoa(x) File "with_reentrancy/contract.py", line 36 byte "silly = " // (𝕡) x#0 | result#0,tmp%0#0,"silly = " b"silly = " File "with_reentrancy/contract.py", line 36 - uncover 1 // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 36 + swap // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 36 concat // (𝕡) x#0 | result#0,{concat} Bytes(b"silly = ") + itoa(x) File "with_reentrancy/contract.py", line 36 log // (𝕡) x#0 | result#0 log(Bytes(b"silly = ") + itoa(x)) File "with_reentrancy/contract.py", line 36 retsub // result#0 return result File "with_reentrancy/contract.py", line 37 @@ -77,7 +77,7 @@ silly2_block@0: frame_dig -1 // load x#0 from parameters (𝕡) x#0 | result#0,x#0 x: UInt64 File "with_reentrancy/contract.py", line 41 callsub itoa // (𝕡) x#0 | result#0,{itoa} itoa(x) File "with_reentrancy/contract.py", line 44 byte "silly2 = " // (𝕡) x#0 | result#0,tmp%0#0,"silly2 = " b"silly2 = " File "with_reentrancy/contract.py", line 44 - uncover 1 // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly2 = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 44 + swap // load tmp%0#0 from l-stack (no copy) (𝕡) x#0 | result#0,"silly2 = ",tmp%0#0 itoa(x) File "with_reentrancy/contract.py", line 44 concat // (𝕡) x#0 | result#0,{concat} Bytes(b"silly2 = ") + itoa(x) File "with_reentrancy/contract.py", line 44 log // (𝕡) x#0 | result#0 log(Bytes(b"silly2 = ") + itoa(x)) File "with_reentrancy/contract.py", line 44 retsub // result#0 return result File "with_reentrancy/contract.py", line 45 @@ -95,11 +95,11 @@ silly3_block@0: int 0 // (𝕡) x#0 | (𝕗) result#0 | tmp%0#0,0 0 File "with_reentrancy/contract.py", line 50 == // (𝕡) x#0 | (𝕗) result#0 | {==} x % 2 == 0 File "with_reentrancy/contract.py", line 50 dup // store is_even#0 to l-stack (copy) (𝕡) x#0 | (𝕗) result#0 | is_even#0,is_even#0 is_even File "with_reentrancy/contract.py", line 50 - cover 1 // store is_even#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0 is_even File "with_reentrancy/contract.py", line 50 + swap // store is_even#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0 is_even File "with_reentrancy/contract.py", line 50 frame_dig -1 // load x#0 from parameters (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0,x#0 x: UInt64 File "with_reentrancy/contract.py", line 49 int 2 // (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0,x#0,2 2 File "with_reentrancy/contract.py", line 51 + // (𝕡) x#0 | (𝕗) result#0,is_even#0 | is_even#0,{+} x + 2 File "with_reentrancy/contract.py", line 51 - cover 1 // store a#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | is_even#0 a File "with_reentrancy/contract.py", line 51 + swap // store a#0 to f-stack (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | is_even#0 a File "with_reentrancy/contract.py", line 51 bz silly3_else_body@2 // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | if is_even: File "with_reentrancy/contract.py", line 52 // Implicit fall through to silly3_if_body@1 // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | if is_even: File "with_reentrancy/contract.py", line 52 @@ -136,7 +136,7 @@ silly3_after_if_else@5: frame_dig -1 // load x#0 from parameters (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | x#0 x: UInt64 File "with_reentrancy/contract.py", line 49 callsub itoa // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | {itoa} itoa(x) File "with_reentrancy/contract.py", line 60 byte "silly3 = " // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | tmp%2#0,"silly3 = " b"silly3 = " File "with_reentrancy/contract.py", line 60 - uncover 1 // load tmp%2#0 from l-stack (no copy) (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | "silly3 = ",tmp%2#0 itoa(x) File "with_reentrancy/contract.py", line 60 + swap // load tmp%2#0 from l-stack (no copy) (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | "silly3 = ",tmp%2#0 itoa(x) File "with_reentrancy/contract.py", line 60 concat // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | {concat} Bytes(b"silly3 = ") + itoa(x) File "with_reentrancy/contract.py", line 60 log // (𝕡) x#0 | (𝕗) result#0,is_even#0,a#0 | log(Bytes(b"silly3 = ") + itoa(x)) File "with_reentrancy/contract.py", line 60 retsub // virtual: 2 ops result#0 result = a * 2 File "with_reentrancy/contract.py", line 53 @@ -149,7 +149,7 @@ itoa: itoa_block@0: byte "0123456789" // (𝕡) i#0 | "0123456789" b"0123456789" File "with_reentrancy/contract.py", line 18 dup // store digits#0 to l-stack (copy) (𝕡) i#0 | digits#0,digits#0 digits File "with_reentrancy/contract.py", line 18 - cover 1 // store digits#0 to x-stack (no copy) (𝕡) i#0 | (𝕏) digits#0 | digits#0 digits File "with_reentrancy/contract.py", line 18 + swap // store digits#0 to x-stack (no copy) (𝕡) i#0 | (𝕏) digits#0 | digits#0 digits File "with_reentrancy/contract.py", line 18 len // (𝕡) i#0 | (𝕏) digits#0 | {len} digits.length File "with_reentrancy/contract.py", line 19 dup // store radix#0 to l-stack (copy) (𝕡) i#0 | (𝕏) digits#0 | radix#0,radix#0 radix File "with_reentrancy/contract.py", line 19 cover 2 // store radix#0 to f-stack (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0 radix File "with_reentrancy/contract.py", line 19 @@ -162,11 +162,11 @@ itoa_if_body@1: frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | i#0 digits#0 i: UInt64 File "with_reentrancy/contract.py", line 17 int 1 // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | i#0,1 digits[i] File "with_reentrancy/contract.py", line 21 + // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | {+} digits[i] File "with_reentrancy/contract.py", line 21 - uncover 1 // load digits#0 from x-stack (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0 digits File "with_reentrancy/contract.py", line 18 + swap // load digits#0 from x-stack (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0 digits File "with_reentrancy/contract.py", line 18 frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | index_plus_1%1#0,digits#0,i#0 i: UInt64 File "with_reentrancy/contract.py", line 17 uncover 2 // load index_plus_1%1#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | digits#0,i#0,index_plus_1%1#0 digits[i] File "with_reentrancy/contract.py", line 21 substring3 // (𝕡) i#0 | (𝕗) radix#0 | {substring3} digits[i] File "with_reentrancy/contract.py", line 21 - uncover 1 + swap retsub // tmp%2#0 return digits[i] File "with_reentrancy/contract.py", line 21 itoa_after_if_else@2: @@ -176,9 +176,9 @@ itoa_after_if_else@2: cover 2 // store radix#0 to l-stack (copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,i#0,radix#0 radix File "with_reentrancy/contract.py", line 19 / // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,{/} i // radix File "with_reentrancy/contract.py", line 22 callsub itoa // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | radix#0,{itoa} itoa(i // radix) File "with_reentrancy/contract.py", line 22 - cover 1 // store tmp%4#0 to l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0 itoa(i // radix) File "with_reentrancy/contract.py", line 22 + swap // store tmp%4#0 to l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0 itoa(i // radix) File "with_reentrancy/contract.py", line 22 frame_dig -1 // load i#0 from parameters (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,radix#0,i#0 i: UInt64 File "with_reentrancy/contract.py", line 17 - uncover 1 // load radix#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,i#0,radix#0 radix File "with_reentrancy/contract.py", line 19 + swap // load radix#0 from l-stack (no copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,i#0,radix#0 radix File "with_reentrancy/contract.py", line 19 % // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,{%} i % radix File "with_reentrancy/contract.py", line 22 dup // load tmp%5#0 from l-stack (copy) (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,tmp%5#0,tmp%5#0 i % radix File "with_reentrancy/contract.py", line 22 int 1 // (𝕡) i#0 | (𝕗) radix#0 | (𝕏) digits#0 | tmp%4#0,tmp%5#0,tmp%5#0,1 digits[i % radix] File "with_reentrancy/contract.py", line 22 @@ -187,6 +187,6 @@ itoa_after_if_else@2: cover 2 // virtual: 2 ops (𝕡) i#0 | (𝕗) radix#0 | tmp%4#0,digits#0,tmp%5#0,index_plus_1%6#0 digits[i % radix] File "with_reentrancy/contract.py", line 22 substring3 // (𝕡) i#0 | (𝕗) radix#0 | tmp%4#0,{substring3} digits[i % radix] File "with_reentrancy/contract.py", line 22 concat // (𝕡) i#0 | (𝕗) radix#0 | {concat} itoa(i // radix) + digits[i % radix] File "with_reentrancy/contract.py", line 22 - uncover 1 + swap retsub // tmp%8#0 return itoa(i // radix) + digits[i % radix] File "with_reentrancy/contract.py", line 22 diff --git a/examples/with_reentrancy/out/contract.approval_unoptimized.teal b/examples/with_reentrancy/out/contract.approval_unoptimized.teal index 93fae176df..e4db5e4e71 100644 --- a/examples/with_reentrancy/out/contract.approval_unoptimized.teal +++ b/examples/with_reentrancy/out/contract.approval_unoptimized.teal @@ -54,7 +54,7 @@ silly_block@0: frame_dig -1 callsub itoa byte "silly = " - uncover 1 + swap concat log retsub @@ -74,7 +74,7 @@ silly2_block@0: frame_dig -1 callsub itoa byte "silly2 = " - uncover 1 + swap concat log retsub @@ -92,11 +92,11 @@ silly3_block@0: int 0 == dup - cover 1 + swap frame_dig -1 int 2 + - cover 1 + swap bz silly3_else_body@2 silly3_if_body@1: @@ -129,7 +129,7 @@ silly3_after_if_else@5: frame_dig -1 callsub itoa byte "silly3 = " - uncover 1 + swap concat log retsub @@ -142,7 +142,7 @@ itoa: itoa_block@0: byte "0123456789" dup - cover 1 + swap len dup cover 2 @@ -154,11 +154,11 @@ itoa_if_body@1: frame_dig -1 int 1 + - uncover 1 + swap frame_dig -1 uncover 2 substring3 - uncover 1 + swap retsub itoa_after_if_else@2: @@ -168,9 +168,9 @@ itoa_after_if_else@2: cover 2 / callsub itoa - cover 1 + swap frame_dig -1 - uncover 1 + swap % dup int 1 @@ -179,6 +179,6 @@ itoa_after_if_else@2: cover 2 substring3 concat - uncover 1 + swap retsub diff --git a/examples/with_structs.algopy.log b/examples/with_structs.algopy.log index 4f3fa340e0..ceb7993f38 100644 --- a/examples/with_structs.algopy.log +++ b/examples/with_structs.algopy.log @@ -1,6 +1,7 @@ ->> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 with_structs.py -info: Building AWST for __init__.py -info: Building AWST for with_structs.py +>> poetry run algopy -O1 --output-ssa-ir --output-optimization-ir --output-final-ir --output-cssa-ir --output-post-ssa-ir --output-parallel-copies-ir --out-dir=out --debug-level=1 --log-level=debug with_structs.py +debug: Building AWST for __init__.py +debug: Building AWST for embedded algopy lib at /algopy.py +debug: Building AWST for with_structs.py warning: No contracts found in explicitly named source file: /examples/with_structs.py error: No contracts discovered in any source files >> exit code = 0 \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 8bddbae4cb..20f52a00a4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,112 +1,99 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "aiohttp" -version = "3.8.6" +version = "3.9.1" description = "Async http client/server framework (asyncio)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:41d55fc043954cddbbd82503d9cc3f4814a40bcef30b3569bc7b5e34130718c1"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1d84166673694841d8953f0a8d0c90e1087739d24632fe86b1a08819168b4566"}, - {file = "aiohttp-3.8.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:253bf92b744b3170eb4c4ca2fa58f9c4b87aeb1df42f71d4e78815e6e8b73c9e"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3fd194939b1f764d6bb05490987bfe104287bbf51b8d862261ccf66f48fb4096"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6c5f938d199a6fdbdc10bbb9447496561c3a9a565b43be564648d81e1102ac22"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2817b2f66ca82ee699acd90e05c95e79bbf1dc986abb62b61ec8aaf851e81c93"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fa375b3d34e71ccccf172cab401cd94a72de7a8cc01847a7b3386204093bb47"}, - {file = "aiohttp-3.8.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9de50a199b7710fa2904be5a4a9b51af587ab24c8e540a7243ab737b45844543"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e1d8cb0b56b3587c5c01de3bf2f600f186da7e7b5f7353d1bf26a8ddca57f965"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:8e31e9db1bee8b4f407b77fd2507337a0a80665ad7b6c749d08df595d88f1cf5"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7bc88fc494b1f0311d67f29fee6fd636606f4697e8cc793a2d912ac5b19aa38d"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ec00c3305788e04bf6d29d42e504560e159ccaf0be30c09203b468a6c1ccd3b2"}, - {file = "aiohttp-3.8.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad1407db8f2f49329729564f71685557157bfa42b48f4b93e53721a16eb813ed"}, - {file = "aiohttp-3.8.6-cp310-cp310-win32.whl", hash = "sha256:ccc360e87341ad47c777f5723f68adbb52b37ab450c8bc3ca9ca1f3e849e5fe2"}, - {file = "aiohttp-3.8.6-cp310-cp310-win_amd64.whl", hash = "sha256:93c15c8e48e5e7b89d5cb4613479d144fda8344e2d886cf694fd36db4cc86865"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e2f9cc8e5328f829f6e1fb74a0a3a939b14e67e80832975e01929e320386b34"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e6a00ffcc173e765e200ceefb06399ba09c06db97f401f920513a10c803604ca"}, - {file = "aiohttp-3.8.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:41bdc2ba359032e36c0e9de5a3bd00d6fb7ea558a6ce6b70acedf0da86458321"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14cd52ccf40006c7a6cd34a0f8663734e5363fd981807173faf3a017e202fec9"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2d5b785c792802e7b275c420d84f3397668e9d49ab1cb52bd916b3b3ffcf09ad"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1bed815f3dc3d915c5c1e556c397c8667826fbc1b935d95b0ad680787896a358"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96603a562b546632441926cd1293cfcb5b69f0b4159e6077f7c7dbdfb686af4d"}, - {file = "aiohttp-3.8.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d76e8b13161a202d14c9584590c4df4d068c9567c99506497bdd67eaedf36403"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e3f1e3f1a1751bb62b4a1b7f4e435afcdade6c17a4fd9b9d43607cebd242924a"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:76b36b3124f0223903609944a3c8bf28a599b2cc0ce0be60b45211c8e9be97f8"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:a2ece4af1f3c967a4390c284797ab595a9f1bc1130ef8b01828915a05a6ae684"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:16d330b3b9db87c3883e565340d292638a878236418b23cc8b9b11a054aaa887"}, - {file = "aiohttp-3.8.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:42c89579f82e49db436b69c938ab3e1559e5a4409eb8639eb4143989bc390f2f"}, - {file = "aiohttp-3.8.6-cp311-cp311-win32.whl", hash = "sha256:efd2fcf7e7b9d7ab16e6b7d54205beded0a9c8566cb30f09c1abe42b4e22bdcb"}, - {file = "aiohttp-3.8.6-cp311-cp311-win_amd64.whl", hash = "sha256:3b2ab182fc28e7a81f6c70bfbd829045d9480063f5ab06f6e601a3eddbbd49a0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:fdee8405931b0615220e5ddf8cd7edd8592c606a8e4ca2a00704883c396e4479"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d25036d161c4fe2225d1abff2bd52c34ed0b1099f02c208cd34d8c05729882f0"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5d791245a894be071d5ab04bbb4850534261a7d4fd363b094a7b9963e8cdbd31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0cccd1de239afa866e4ce5c789b3032442f19c261c7d8a01183fd956b1935349"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1f13f60d78224f0dace220d8ab4ef1dbc37115eeeab8c06804fec11bec2bbd07"}, - {file = "aiohttp-3.8.6-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8a9b5a0606faca4f6cc0d338359d6fa137104c337f489cd135bb7fbdbccb1e39"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:13da35c9ceb847732bf5c6c5781dcf4780e14392e5d3b3c689f6d22f8e15ae31"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:4d4cbe4ffa9d05f46a28252efc5941e0462792930caa370a6efaf491f412bc66"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:229852e147f44da0241954fc6cb910ba074e597f06789c867cb7fb0621e0ba7a"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:713103a8bdde61d13490adf47171a1039fd880113981e55401a0f7b42c37d071"}, - {file = "aiohttp-3.8.6-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:45ad816b2c8e3b60b510f30dbd37fe74fd4a772248a52bb021f6fd65dff809b6"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win32.whl", hash = "sha256:2b8d4e166e600dcfbff51919c7a3789ff6ca8b3ecce16e1d9c96d95dd569eb4c"}, - {file = "aiohttp-3.8.6-cp36-cp36m-win_amd64.whl", hash = "sha256:0912ed87fee967940aacc5306d3aa8ba3a459fcd12add0b407081fbefc931e53"}, - {file = "aiohttp-3.8.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e2a988a0c673c2e12084f5e6ba3392d76c75ddb8ebc6c7e9ead68248101cd446"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebf3fd9f141700b510d4b190094db0ce37ac6361a6806c153c161dc6c041ccda"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3161ce82ab85acd267c8f4b14aa226047a6bee1e4e6adb74b798bd42c6ae1f80"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d95fc1bf33a9a81469aa760617b5971331cdd74370d1214f0b3109272c0e1e3c"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c43ecfef7deaf0617cee936836518e7424ee12cb709883f2c9a1adda63cc460"}, - {file = "aiohttp-3.8.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca80e1b90a05a4f476547f904992ae81eda5c2c85c66ee4195bb8f9c5fb47f28"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:90c72ebb7cb3a08a7f40061079817133f502a160561d0675b0a6adf231382c92"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bb54c54510e47a8c7c8e63454a6acc817519337b2b78606c4e840871a3e15349"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:de6a1c9f6803b90e20869e6b99c2c18cef5cc691363954c93cb9adeb26d9f3ae"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:a3628b6c7b880b181a3ae0a0683698513874df63783fd89de99b7b7539e3e8a8"}, - {file = "aiohttp-3.8.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:fc37e9aef10a696a5a4474802930079ccfc14d9f9c10b4662169671ff034b7df"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win32.whl", hash = "sha256:f8ef51e459eb2ad8e7a66c1d6440c808485840ad55ecc3cafefadea47d1b1ba2"}, - {file = "aiohttp-3.8.6-cp37-cp37m-win_amd64.whl", hash = "sha256:b2fe42e523be344124c6c8ef32a011444e869dc5f883c591ed87f84339de5976"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9e2ee0ac5a1f5c7dd3197de309adfb99ac4617ff02b0603fd1e65b07dc772e4b"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01770d8c04bd8db568abb636c1fdd4f7140b284b8b3e0b4584f070180c1e5c62"}, - {file = "aiohttp-3.8.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:3c68330a59506254b556b99a91857428cab98b2f84061260a67865f7f52899f5"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89341b2c19fb5eac30c341133ae2cc3544d40d9b1892749cdd25892bbc6ac951"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:71783b0b6455ac8f34b5ec99d83e686892c50498d5d00b8e56d47f41b38fbe04"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f628dbf3c91e12f4d6c8b3f092069567d8eb17814aebba3d7d60c149391aee3a"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b04691bc6601ef47c88f0255043df6f570ada1a9ebef99c34bd0b72866c217ae"}, - {file = "aiohttp-3.8.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7ee912f7e78287516df155f69da575a0ba33b02dd7c1d6614dbc9463f43066e3"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9c19b26acdd08dd239e0d3669a3dddafd600902e37881f13fbd8a53943079dbc"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:99c5ac4ad492b4a19fc132306cd57075c28446ec2ed970973bbf036bcda1bcc6"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:f0f03211fd14a6a0aed2997d4b1c013d49fb7b50eeb9ffdf5e51f23cfe2c77fa"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:8d399dade330c53b4106160f75f55407e9ae7505263ea86f2ccca6bfcbdb4921"}, - {file = "aiohttp-3.8.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ec4fd86658c6a8964d75426517dc01cbf840bbf32d055ce64a9e63a40fd7b771"}, - {file = "aiohttp-3.8.6-cp38-cp38-win32.whl", hash = "sha256:33164093be11fcef3ce2571a0dccd9041c9a93fa3bde86569d7b03120d276c6f"}, - {file = "aiohttp-3.8.6-cp38-cp38-win_amd64.whl", hash = "sha256:bdf70bfe5a1414ba9afb9d49f0c912dc524cf60141102f3a11143ba3d291870f"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d52d5dc7c6682b720280f9d9db41d36ebe4791622c842e258c9206232251ab2b"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4ac39027011414dbd3d87f7edb31680e1f430834c8cef029f11c66dad0670aa5"}, - {file = "aiohttp-3.8.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3f5c7ce535a1d2429a634310e308fb7d718905487257060e5d4598e29dc17f0b"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b30e963f9e0d52c28f284d554a9469af073030030cef8693106d918b2ca92f54"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:918810ef188f84152af6b938254911055a72e0f935b5fbc4c1a4ed0b0584aed1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fcf3eabd3fd1a5e6092d1242295fa37d0354b2eb2077e6eb670accad78e40e1"}, - {file = "aiohttp-3.8.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:255ba9d6d5ff1a382bb9a578cd563605aa69bec845680e21c44afc2670607a95"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d67f8baed00870aa390ea2590798766256f31dc5ed3ecc737debb6e97e2ede78"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:86f20cee0f0a317c76573b627b954c412ea766d6ada1a9fcf1b805763ae7feeb"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:39a312d0e991690ccc1a61f1e9e42daa519dcc34ad03eb6f826d94c1190190dd"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e827d48cf802de06d9c935088c2924e3c7e7533377d66b6f31ed175c1620e05e"}, - {file = "aiohttp-3.8.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:bd111d7fc5591ddf377a408ed9067045259ff2770f37e2d94e6478d0f3fc0c17"}, - {file = "aiohttp-3.8.6-cp39-cp39-win32.whl", hash = "sha256:caf486ac1e689dda3502567eb89ffe02876546599bbf915ec94b1fa424eeffd4"}, - {file = "aiohttp-3.8.6-cp39-cp39-win_amd64.whl", hash = "sha256:3f0e27e5b733803333bb2371249f41cf42bae8884863e8e8965ec69bebe53132"}, - {file = "aiohttp-3.8.6.tar.gz", hash = "sha256:b0cf2a4501bff9330a8a5248b4ce951851e415bdcce9dc158e76cfd55e15085c"}, + {file = "aiohttp-3.9.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e1f80197f8b0b846a8d5cf7b7ec6084493950d0882cc5537fb7b96a69e3c8590"}, + {file = "aiohttp-3.9.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c72444d17777865734aa1a4d167794c34b63e5883abb90356a0364a28904e6c0"}, + {file = "aiohttp-3.9.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9b05d5cbe9dafcdc733262c3a99ccf63d2f7ce02543620d2bd8db4d4f7a22f83"}, + {file = "aiohttp-3.9.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c4fa235d534b3547184831c624c0b7c1e262cd1de847d95085ec94c16fddcd5"}, + {file = "aiohttp-3.9.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:289ba9ae8e88d0ba16062ecf02dd730b34186ea3b1e7489046fc338bdc3361c4"}, + {file = "aiohttp-3.9.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bff7e2811814fa2271be95ab6e84c9436d027a0e59665de60edf44e529a42c1f"}, + {file = "aiohttp-3.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81b77f868814346662c96ab36b875d7814ebf82340d3284a31681085c051320f"}, + {file = "aiohttp-3.9.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3b9c7426923bb7bd66d409da46c41e3fb40f5caf679da624439b9eba92043fa6"}, + {file = "aiohttp-3.9.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:8d44e7bf06b0c0a70a20f9100af9fcfd7f6d9d3913e37754c12d424179b4e48f"}, + {file = "aiohttp-3.9.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:22698f01ff5653fe66d16ffb7658f582a0ac084d7da1323e39fd9eab326a1f26"}, + {file = "aiohttp-3.9.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ca7ca5abfbfe8d39e653870fbe8d7710be7a857f8a8386fc9de1aae2e02ce7e4"}, + {file = "aiohttp-3.9.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:8d7f98fde213f74561be1d6d3fa353656197f75d4edfbb3d94c9eb9b0fc47f5d"}, + {file = "aiohttp-3.9.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5216b6082c624b55cfe79af5d538e499cd5f5b976820eac31951fb4325974501"}, + {file = "aiohttp-3.9.1-cp310-cp310-win32.whl", hash = "sha256:0e7ba7ff228c0d9a2cd66194e90f2bca6e0abca810b786901a569c0de082f489"}, + {file = "aiohttp-3.9.1-cp310-cp310-win_amd64.whl", hash = "sha256:c7e939f1ae428a86e4abbb9a7c4732bf4706048818dfd979e5e2839ce0159f23"}, + {file = "aiohttp-3.9.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:df9cf74b9bc03d586fc53ba470828d7b77ce51b0582d1d0b5b2fb673c0baa32d"}, + {file = "aiohttp-3.9.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ecca113f19d5e74048c001934045a2b9368d77b0b17691d905af18bd1c21275e"}, + {file = "aiohttp-3.9.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8cef8710fb849d97c533f259103f09bac167a008d7131d7b2b0e3a33269185c0"}, + {file = "aiohttp-3.9.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bea94403a21eb94c93386d559bce297381609153e418a3ffc7d6bf772f59cc35"}, + {file = "aiohttp-3.9.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:91c742ca59045dce7ba76cab6e223e41d2c70d79e82c284a96411f8645e2afff"}, + {file = "aiohttp-3.9.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6c93b7c2e52061f0925c3382d5cb8980e40f91c989563d3d32ca280069fd6a87"}, + {file = "aiohttp-3.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee2527134f95e106cc1653e9ac78846f3a2ec1004cf20ef4e02038035a74544d"}, + {file = "aiohttp-3.9.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11ff168d752cb41e8492817e10fb4f85828f6a0142b9726a30c27c35a1835f01"}, + {file = "aiohttp-3.9.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b8c3a67eb87394386847d188996920f33b01b32155f0a94f36ca0e0c635bf3e3"}, + {file = "aiohttp-3.9.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c7b5d5d64e2a14e35a9240b33b89389e0035e6de8dbb7ffa50d10d8b65c57449"}, + {file = "aiohttp-3.9.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:69985d50a2b6f709412d944ffb2e97d0be154ea90600b7a921f95a87d6f108a2"}, + {file = "aiohttp-3.9.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:c9110c06eaaac7e1f5562caf481f18ccf8f6fdf4c3323feab28a93d34cc646bd"}, + {file = "aiohttp-3.9.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d737e69d193dac7296365a6dcb73bbbf53bb760ab25a3727716bbd42022e8d7a"}, + {file = "aiohttp-3.9.1-cp311-cp311-win32.whl", hash = "sha256:4ee8caa925aebc1e64e98432d78ea8de67b2272252b0a931d2ac3bd876ad5544"}, + {file = "aiohttp-3.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:a34086c5cc285be878622e0a6ab897a986a6e8bf5b67ecb377015f06ed316587"}, + {file = "aiohttp-3.9.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f800164276eec54e0af5c99feb9494c295118fc10a11b997bbb1348ba1a52065"}, + {file = "aiohttp-3.9.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:500f1c59906cd142d452074f3811614be04819a38ae2b3239a48b82649c08821"}, + {file = "aiohttp-3.9.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0b0a6a36ed7e164c6df1e18ee47afbd1990ce47cb428739d6c99aaabfaf1b3af"}, + {file = "aiohttp-3.9.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69da0f3ed3496808e8cbc5123a866c41c12c15baaaead96d256477edf168eb57"}, + {file = "aiohttp-3.9.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:176df045597e674fa950bf5ae536be85699e04cea68fa3a616cf75e413737eb5"}, + {file = "aiohttp-3.9.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b796b44111f0cab6bbf66214186e44734b5baab949cb5fb56154142a92989aeb"}, + {file = "aiohttp-3.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f27fdaadce22f2ef950fc10dcdf8048407c3b42b73779e48a4e76b3c35bca26c"}, + {file = "aiohttp-3.9.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bcb6532b9814ea7c5a6a3299747c49de30e84472fa72821b07f5a9818bce0f66"}, + {file = "aiohttp-3.9.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:54631fb69a6e44b2ba522f7c22a6fb2667a02fd97d636048478db2fd8c4e98fe"}, + {file = "aiohttp-3.9.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:4b4c452d0190c5a820d3f5c0f3cd8a28ace48c54053e24da9d6041bf81113183"}, + {file = "aiohttp-3.9.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:cae4c0c2ca800c793cae07ef3d40794625471040a87e1ba392039639ad61ab5b"}, + {file = "aiohttp-3.9.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:565760d6812b8d78d416c3c7cfdf5362fbe0d0d25b82fed75d0d29e18d7fc30f"}, + {file = "aiohttp-3.9.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:54311eb54f3a0c45efb9ed0d0a8f43d1bc6060d773f6973efd90037a51cd0a3f"}, + {file = "aiohttp-3.9.1-cp312-cp312-win32.whl", hash = "sha256:85c3e3c9cb1d480e0b9a64c658cd66b3cfb8e721636ab8b0e746e2d79a7a9eed"}, + {file = "aiohttp-3.9.1-cp312-cp312-win_amd64.whl", hash = "sha256:11cb254e397a82efb1805d12561e80124928e04e9c4483587ce7390b3866d213"}, + {file = "aiohttp-3.9.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:8a22a34bc594d9d24621091d1b91511001a7eea91d6652ea495ce06e27381f70"}, + {file = "aiohttp-3.9.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:598db66eaf2e04aa0c8900a63b0101fdc5e6b8a7ddd805c56d86efb54eb66672"}, + {file = "aiohttp-3.9.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2c9376e2b09895c8ca8b95362283365eb5c03bdc8428ade80a864160605715f1"}, + {file = "aiohttp-3.9.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41473de252e1797c2d2293804e389a6d6986ef37cbb4a25208de537ae32141dd"}, + {file = "aiohttp-3.9.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9c5857612c9813796960c00767645cb5da815af16dafb32d70c72a8390bbf690"}, + {file = "aiohttp-3.9.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ffcd828e37dc219a72c9012ec44ad2e7e3066bec6ff3aaa19e7d435dbf4032ca"}, + {file = "aiohttp-3.9.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:219a16763dc0294842188ac8a12262b5671817042b35d45e44fd0a697d8c8361"}, + {file = "aiohttp-3.9.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f694dc8a6a3112059258a725a4ebe9acac5fe62f11c77ac4dcf896edfa78ca28"}, + {file = "aiohttp-3.9.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:bcc0ea8d5b74a41b621ad4a13d96c36079c81628ccc0b30cfb1603e3dfa3a014"}, + {file = "aiohttp-3.9.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:90ec72d231169b4b8d6085be13023ece8fa9b1bb495e4398d847e25218e0f431"}, + {file = "aiohttp-3.9.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:cf2a0ac0615842b849f40c4d7f304986a242f1e68286dbf3bd7a835e4f83acfd"}, + {file = "aiohttp-3.9.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:0e49b08eafa4f5707ecfb321ab9592717a319e37938e301d462f79b4e860c32a"}, + {file = "aiohttp-3.9.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2c59e0076ea31c08553e868cec02d22191c086f00b44610f8ab7363a11a5d9d8"}, + {file = "aiohttp-3.9.1-cp38-cp38-win32.whl", hash = "sha256:4831df72b053b1eed31eb00a2e1aff6896fb4485301d4ccb208cac264b648db4"}, + {file = "aiohttp-3.9.1-cp38-cp38-win_amd64.whl", hash = "sha256:3135713c5562731ee18f58d3ad1bf41e1d8883eb68b363f2ffde5b2ea4b84cc7"}, + {file = "aiohttp-3.9.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:cfeadf42840c1e870dc2042a232a8748e75a36b52d78968cda6736de55582766"}, + {file = "aiohttp-3.9.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:70907533db712f7aa791effb38efa96f044ce3d4e850e2d7691abd759f4f0ae0"}, + {file = "aiohttp-3.9.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cdefe289681507187e375a5064c7599f52c40343a8701761c802c1853a504558"}, + {file = "aiohttp-3.9.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7481f581251bb5558ba9f635db70908819caa221fc79ee52a7f58392778c636"}, + {file = "aiohttp-3.9.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:49f0c1b3c2842556e5de35f122fc0f0b721334ceb6e78c3719693364d4af8499"}, + {file = "aiohttp-3.9.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0d406b01a9f5a7e232d1b0d161b40c05275ffbcbd772dc18c1d5a570961a1ca4"}, + {file = "aiohttp-3.9.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d8e4450e7fe24d86e86b23cc209e0023177b6d59502e33807b732d2deb6975f"}, + {file = "aiohttp-3.9.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c0266cd6f005e99f3f51e583012de2778e65af6b73860038b968a0a8888487a"}, + {file = "aiohttp-3.9.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab221850108a4a063c5b8a70f00dd7a1975e5a1713f87f4ab26a46e5feac5a0e"}, + {file = "aiohttp-3.9.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:c88a15f272a0ad3d7773cf3a37cc7b7d077cbfc8e331675cf1346e849d97a4e5"}, + {file = "aiohttp-3.9.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:237533179d9747080bcaad4d02083ce295c0d2eab3e9e8ce103411a4312991a0"}, + {file = "aiohttp-3.9.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:02ab6006ec3c3463b528374c4cdce86434e7b89ad355e7bf29e2f16b46c7dd6f"}, + {file = "aiohttp-3.9.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04fa38875e53eb7e354ece1607b1d2fdee2d175ea4e4d745f6ec9f751fe20c7c"}, + {file = "aiohttp-3.9.1-cp39-cp39-win32.whl", hash = "sha256:82eefaf1a996060602f3cc1112d93ba8b201dbf5d8fd9611227de2003dddb3b7"}, + {file = "aiohttp-3.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:9b05d33ff8e6b269e30a7957bd3244ffbce2a7a35a81b81c382629b80af1a8bf"}, + {file = "aiohttp-3.9.1.tar.gz", hash = "sha256:8fc49a87ac269d4529da45871e2ffb6874e87779c3d0e2ccd813c0899221239d"}, ] [package.dependencies] aiosignal = ">=1.1.2" -async-timeout = ">=4.0.0a3,<5.0" attrs = ">=17.3.0" -charset-normalizer = ">=2.0,<4.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" yarl = ">=1.0,<2.0" [package.extras] -speedups = ["Brotli", "aiodns", "cchardet"] +speedups = ["Brotli", "aiodns", "brotlicffi"] [[package]] name = "aiosignal" @@ -136,17 +123,6 @@ files = [ deprecated = ">=1.2.14,<2.0.0" py-algorand-sdk = ">=2.4.0,<3.0.0" -[[package]] -name = "async-timeout" -version = "4.0.3" -description = "Timeout context manager for asyncio programs" -optional = false -python-versions = ">=3.7" -files = [ - {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, - {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, -] - [[package]] name = "attrs" version = "23.1.0" @@ -240,36 +216,36 @@ redis = ["redis (>=2.10.5)"] [[package]] name = "cattrs" -version = "23.1.2" +version = "23.2.2" description = "Composable complex class support for attrs and dataclasses." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "cattrs-23.1.2-py3-none-any.whl", hash = "sha256:b2bb14311ac17bed0d58785e5a60f022e5431aca3932e3fc5cc8ed8639de50a4"}, - {file = "cattrs-23.1.2.tar.gz", hash = "sha256:db1c821b8c537382b2c7c66678c3790091ca0275ac486c76f3c8f3920e83c657"}, + {file = "cattrs-23.2.2-py3-none-any.whl", hash = "sha256:66064e2060ea207c5a48d065ab1910c10bb8108c28f3df8d1a7b1aa6b19d191b"}, + {file = "cattrs-23.2.2.tar.gz", hash = "sha256:b790b1c2be1ce042611e33f740e343c2593918bbf3c1cc88cdddac4defc09655"}, ] [package.dependencies] -attrs = ">=20" +attrs = ">=23.1.0" [package.extras] -bson = ["pymongo (>=4.2.0,<5.0.0)"] -cbor2 = ["cbor2 (>=5.4.6,<6.0.0)"] -msgpack = ["msgpack (>=1.0.2,<2.0.0)"] -orjson = ["orjson (>=3.5.2,<4.0.0)"] -pyyaml = ["PyYAML (>=6.0,<7.0)"] -tomlkit = ["tomlkit (>=0.11.4,<0.12.0)"] -ujson = ["ujson (>=5.4.0,<6.0.0)"] +bson = ["pymongo (>=4.4.0)"] +cbor2 = ["cbor2 (>=5.4.6)"] +msgpack = ["msgpack (>=1.0.5)"] +orjson = ["orjson (>=3.9.2)"] +pyyaml = ["pyyaml (>=6.0)"] +tomlkit = ["tomlkit (>=0.11.8)"] +ujson = ["ujson (>=5.7.0)"] [[package]] name = "certifi" -version = "2023.7.22" +version = "2023.11.17" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.7.22-py3-none-any.whl", hash = "sha256:92d6037539857d8206b8f6ae472e8b77db8058fec5937a1ef3f54304089edbb9"}, - {file = "certifi-2023.7.22.tar.gz", hash = "sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082"}, + {file = "certifi-2023.11.17-py3-none-any.whl", hash = "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474"}, + {file = "certifi-2023.11.17.tar.gz", hash = "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1"}, ] [[package]] @@ -591,6 +567,17 @@ files = [ {file = "distlib-0.3.7.tar.gz", hash = "sha256:9dafe54b34a028eafd95039d5e5d4851a13734540f1331060d31c9916e7147a8"}, ] +[[package]] +name = "docstring-parser" +version = "0.15" +description = "Parse Python docstrings in reST, Google and Numpydoc format" +optional = false +python-versions = ">=3.6,<4.0" +files = [ + {file = "docstring_parser-0.15-py3-none-any.whl", hash = "sha256:d1679b86250d269d06a99670924d6bce45adc00b08069dae8c47d98e89b667a9"}, + {file = "docstring_parser-0.15.tar.gz", hash = "sha256:48ddc093e8b1865899956fcc03b03e66bb7240c310fac5af81814580c55bf682"}, +] + [[package]] name = "execnet" version = "2.0.2" @@ -714,13 +701,13 @@ lxml = ["lxml"] [[package]] name = "identify" -version = "2.5.31" +version = "2.5.32" description = "File identification library for Python" optional = false python-versions = ">=3.8" files = [ - {file = "identify-2.5.31-py2.py3-none-any.whl", hash = "sha256:90199cb9e7bd3c5407a9b7e81b4abec4bb9d249991c79439ec8af740afc6293d"}, - {file = "identify-2.5.31.tar.gz", hash = "sha256:7736b3c7a28233637e3c36550646fc6389bedd74ae84cb788200cc8e2dd60b75"}, + {file = "identify-2.5.32-py2.py3-none-any.whl", hash = "sha256:0b7656ef6cba81664b783352c73f8c24b39cf82f926f78f4550eda928e5e0545"}, + {file = "identify-2.5.32.tar.gz", hash = "sha256:5d9979348ec1a21c768ae07e0a652924538e8bce67313a73cb0f681cf08ba407"}, ] [package.extras] @@ -728,13 +715,24 @@ license = ["ukkonen"] [[package]] name = "idna" -version = "3.4" +version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.5" files = [ - {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, - {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, + {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, + {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, +] + +[[package]] +name = "immutabledict" +version = "4.0.0" +description = "Immutable wrapper around dictionaries (a fork of frozendict)" +optional = false +python-versions = ">=3.8,<4.0" +files = [ + {file = "immutabledict-4.0.0-py3-none-any.whl", hash = "sha256:7b28ffd8a0fbd7c6068ba8ba7a6aa0e50a158e9aae33b22d1dedd03f9aac33b6"}, + {file = "immutabledict-4.0.0.tar.gz", hash = "sha256:fabf47437531e8bf65a3b5b47d501e65579323b2d1fe58f8ae01491c1fd29bf7"}, ] [[package]] @@ -768,13 +766,13 @@ testing = ["black", "isort", "pytest (>=6,!=7.0.0)", "pytest-xdist (>=2)", "twin [[package]] name = "lsprotocol" -version = "2023.0.0b1" +version = "2023.0.0" description = "Python implementation of the Language Server Protocol." optional = false python-versions = ">=3.7" files = [ - {file = "lsprotocol-2023.0.0b1-py3-none-any.whl", hash = "sha256:ade2cd0fa0ede7965698cb59cd05d3adbd19178fd73e83f72ef57a032fbb9d62"}, - {file = "lsprotocol-2023.0.0b1.tar.gz", hash = "sha256:f7a2d4655cbd5639f373ddd1789807450c543341fa0a32b064ad30dbb9f510d4"}, + {file = "lsprotocol-2023.0.0-py3-none-any.whl", hash = "sha256:e85fc87ee26c816adca9eb497bb3db1a7c79c477a11563626e712eaccf926a05"}, + {file = "lsprotocol-2023.0.0.tar.gz", hash = "sha256:c9d92e12a3f4ed9317d3068226592860aab5357d93cf5b2451dc244eee8f35f2"}, ] [package.dependencies] @@ -1166,13 +1164,13 @@ testing = ["aboutcode-toolkit (>=6.0.0)", "black", "pytest (>=6,!=7.0.0)", "pyte [[package]] name = "platformdirs" -version = "3.11.0" +version = "4.0.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.11.0-py3-none-any.whl", hash = "sha256:e9d171d00af68be50e9202731309c4e658fd8bc76f55c11c7dd760d023bda68e"}, - {file = "platformdirs-3.11.0.tar.gz", hash = "sha256:cf8ee52a3afdb965072dcc652433e0c7e3e40cf5ea1477cd4b3b1d2eb75495b3"}, + {file = "platformdirs-4.0.0-py3-none-any.whl", hash = "sha256:118c954d7e949b35437270383a3f2531e99dd93cf7ce4dc8340d3356d30f173b"}, + {file = "platformdirs-4.0.0.tar.gz", hash = "sha256:cb633b2bcf10c51af60beb0ab06d2f1d69064b43abf4c185ca6b28865f3f9731"}, ] [package.extras] @@ -1324,35 +1322,35 @@ files = [ [[package]] name = "pygls" -version = "1.1.2" +version = "1.2.0" description = "A pythonic generic language server (pronounced like 'pie glass')" optional = false python-versions = ">=3.7.9,<4" files = [ - {file = "pygls-1.1.2-py3-none-any.whl", hash = "sha256:783d29c93679bb6756772f2de9b9f53b1a6fdf3fba66aeca23e87aa8aab20ecf"}, - {file = "pygls-1.1.2.tar.gz", hash = "sha256:93fe17c01fd03307774290e685e7fa25bc1411cd72f243ff33eef21927fd0ad5"}, + {file = "pygls-1.2.0-py3-none-any.whl", hash = "sha256:e4ddf2fd27fd68a47644e25e7adc7e1810cf169b76f61f9e65ad6abae5814cf2"}, + {file = "pygls-1.2.0.tar.gz", hash = "sha256:72ec4a3532741be1a933c686ed1e138b9948af174213745527a7c3ed3147a573"}, ] [package.dependencies] -lsprotocol = "2023.0.0b1" -typeguard = ">=3.0.0,<5" +lsprotocol = "2023.0.0" [package.extras] ws = ["websockets (>=11.0.3,<12.0.0)"] [[package]] name = "pygments" -version = "2.16.1" +version = "2.17.2" description = "Pygments is a syntax highlighting package written in Python." optional = false python-versions = ">=3.7" files = [ - {file = "Pygments-2.16.1-py3-none-any.whl", hash = "sha256:13fc09fa63bc8d8671a6d247e1eb303c4b343eaee81d861f3404db2935653692"}, - {file = "Pygments-2.16.1.tar.gz", hash = "sha256:1daff0494820c69bc8941e407aa20f577374ee88364ee10a98fdbe0aece96e29"}, + {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, + {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, ] [package.extras] plugins = ["importlib-metadata"] +windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pynacl" @@ -1434,13 +1432,13 @@ testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtuale [[package]] name = "pytest-xdist" -version = "3.4.0" +version = "3.5.0" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-xdist-3.4.0.tar.gz", hash = "sha256:3a94a931dd9e268e0b871a877d09fe2efb6175c2c23d60d56a6001359002b832"}, - {file = "pytest_xdist-3.4.0-py3-none-any.whl", hash = "sha256:e513118bf787677a427e025606f55e95937565e06dfaac8d87f55301e57ae607"}, + {file = "pytest-xdist-3.5.0.tar.gz", hash = "sha256:cbb36f3d67e0c478baa57fa4edc8843887e0f6cfc42d677530a36d7472b32d8a"}, + {file = "pytest_xdist-3.5.0-py3-none-any.whl", hash = "sha256:d075629c7e00b611df89f490a5063944bee7a4362a5ff11c7cc7824a03dfce24"}, ] [package.dependencies] @@ -1553,28 +1551,28 @@ jupyter = ["ipywidgets (>=7.5.1,<9)"] [[package]] name = "ruff" -version = "0.1.5" +version = "0.1.6" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.5-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:32d47fc69261c21a4c48916f16ca272bf2f273eb635d91c65d5cd548bf1f3d96"}, - {file = "ruff-0.1.5-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:171276c1df6c07fa0597fb946139ced1c2978f4f0b8254f201281729981f3c17"}, - {file = "ruff-0.1.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17ef33cd0bb7316ca65649fc748acc1406dfa4da96a3d0cde6d52f2e866c7b39"}, - {file = "ruff-0.1.5-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b2c205827b3f8c13b4a432e9585750b93fd907986fe1aec62b2a02cf4401eee6"}, - {file = "ruff-0.1.5-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bb408e3a2ad8f6881d0f2e7ad70cddb3ed9f200eb3517a91a245bbe27101d379"}, - {file = "ruff-0.1.5-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f20dc5e5905ddb407060ca27267c7174f532375c08076d1a953cf7bb016f5a24"}, - {file = "ruff-0.1.5-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aafb9d2b671ed934998e881e2c0f5845a4295e84e719359c71c39a5363cccc91"}, - {file = "ruff-0.1.5-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a4894dddb476597a0ba4473d72a23151b8b3b0b5f958f2cf4d3f1c572cdb7af7"}, - {file = "ruff-0.1.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a00a7ec893f665ed60008c70fe9eeb58d210e6b4d83ec6654a9904871f982a2a"}, - {file = "ruff-0.1.5-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:a8c11206b47f283cbda399a654fd0178d7a389e631f19f51da15cbe631480c5b"}, - {file = "ruff-0.1.5-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fa29e67b3284b9a79b1a85ee66e293a94ac6b7bb068b307a8a373c3d343aa8ec"}, - {file = "ruff-0.1.5-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9b97fd6da44d6cceb188147b68db69a5741fbc736465b5cea3928fdac0bc1aeb"}, - {file = "ruff-0.1.5-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:721f4b9d3b4161df8dc9f09aa8562e39d14e55a4dbaa451a8e55bdc9590e20f4"}, - {file = "ruff-0.1.5-py3-none-win32.whl", hash = "sha256:f80c73bba6bc69e4fdc73b3991db0b546ce641bdcd5b07210b8ad6f64c79f1ab"}, - {file = "ruff-0.1.5-py3-none-win_amd64.whl", hash = "sha256:c21fe20ee7d76206d290a76271c1af7a5096bc4c73ab9383ed2ad35f852a0087"}, - {file = "ruff-0.1.5-py3-none-win_arm64.whl", hash = "sha256:82bfcb9927e88c1ed50f49ac6c9728dab3ea451212693fe40d08d314663e412f"}, - {file = "ruff-0.1.5.tar.gz", hash = "sha256:5cbec0ef2ae1748fb194f420fb03fb2c25c3258c86129af7172ff8f198f125ab"}, + {file = "ruff-0.1.6-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:88b8cdf6abf98130991cbc9f6438f35f6e8d41a02622cc5ee130a02a0ed28703"}, + {file = "ruff-0.1.6-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:5c549ed437680b6105a1299d2cd30e4964211606eeb48a0ff7a93ef70b902248"}, + {file = "ruff-0.1.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1cf5f701062e294f2167e66d11b092bba7af6a057668ed618a9253e1e90cfd76"}, + {file = "ruff-0.1.6-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:05991ee20d4ac4bb78385360c684e4b417edd971030ab12a4fbd075ff535050e"}, + {file = "ruff-0.1.6-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87455a0c1f739b3c069e2f4c43b66479a54dea0276dd5d4d67b091265f6fd1dc"}, + {file = "ruff-0.1.6-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:683aa5bdda5a48cb8266fcde8eea2a6af4e5700a392c56ea5fb5f0d4bfdc0240"}, + {file = "ruff-0.1.6-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:137852105586dcbf80c1717facb6781555c4e99f520c9c827bd414fac67ddfb6"}, + {file = "ruff-0.1.6-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:bd98138a98d48a1c36c394fd6b84cd943ac92a08278aa8ac8c0fdefcf7138f35"}, + {file = "ruff-0.1.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a0cd909d25f227ac5c36d4e7e681577275fb74ba3b11d288aff7ec47e3ae745"}, + {file = "ruff-0.1.6-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e8fd1c62a47aa88a02707b5dd20c5ff20d035d634aa74826b42a1da77861b5ff"}, + {file = "ruff-0.1.6-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fd89b45d374935829134a082617954120d7a1470a9f0ec0e7f3ead983edc48cc"}, + {file = "ruff-0.1.6-py3-none-musllinux_1_2_i686.whl", hash = "sha256:491262006e92f825b145cd1e52948073c56560243b55fb3b4ecb142f6f0e9543"}, + {file = "ruff-0.1.6-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:ea284789861b8b5ca9d5443591a92a397ac183d4351882ab52f6296b4fdd5462"}, + {file = "ruff-0.1.6-py3-none-win32.whl", hash = "sha256:1610e14750826dfc207ccbcdd7331b6bd285607d4181df9c1c6ae26646d6848a"}, + {file = "ruff-0.1.6-py3-none-win_amd64.whl", hash = "sha256:4558b3e178145491e9bc3b2ee3c4b42f19d19384eaa5c59d10acf6e8f8b57e33"}, + {file = "ruff-0.1.6-py3-none-win_arm64.whl", hash = "sha256:03910e81df0d8db0e30050725a5802441c2022ea3ae4fe0609b76081731accbc"}, + {file = "ruff-0.1.6.tar.gz", hash = "sha256:1b09f29b16c6ead5ea6b097ef2764b42372aebe363722f1605ecbcd2b9207184"}, ] [[package]] @@ -1600,17 +1598,17 @@ dev = ["mypy (==1.4.1)", "pip-tools (>=6.13.0,<7.0.0)", "pytest (>=7.3.1,<8.0.0) [[package]] name = "setuptools" -version = "68.2.2" +version = "69.0.2" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-68.2.2-py3-none-any.whl", hash = "sha256:b454a35605876da60632df1a60f736524eb73cc47bbc9f3f1ef1b644de74fd2a"}, - {file = "setuptools-68.2.2.tar.gz", hash = "sha256:4ac1475276d2f1c48684874089fefcd83bd7162ddaafb81fac866ba0db282a87"}, + {file = "setuptools-69.0.2-py3-none-any.whl", hash = "sha256:1e8fdff6797d3865f37397be788a4e3cba233608e9b509382a2777d25ebde7f2"}, + {file = "setuptools-69.0.2.tar.gz", hash = "sha256:735896e78a4742605974de002ac60562d286fa8051a7e2299445e8e8fbb01aa6"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.1)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] @@ -1664,24 +1662,6 @@ files = [ {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] -[[package]] -name = "typeguard" -version = "4.1.5" -description = "Run-time type checker for Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "typeguard-4.1.5-py3-none-any.whl", hash = "sha256:8923e55f8873caec136c892c3bed1f676eae7be57cdb94819281b3d3bc9c0953"}, - {file = "typeguard-4.1.5.tar.gz", hash = "sha256:ea0a113bbc111bcffc90789ebb215625c963411f7096a7e9062d4e4630c155fd"}, -] - -[package.dependencies] -typing-extensions = {version = ">=4.7.0", markers = "python_version < \"3.12\""} - -[package.extras] -doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)"] -test = ["coverage[toml] (>=7)", "mypy (>=1.2.0)", "pytest (>=7)"] - [[package]] name = "typing-extensions" version = "4.8.0" @@ -1711,19 +1691,19 @@ zstd = ["zstandard (>=0.18.0)"] [[package]] name = "virtualenv" -version = "20.24.6" +version = "20.24.7" description = "Virtual Python Environment builder" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.24.6-py3-none-any.whl", hash = "sha256:520d056652454c5098a00c0f073611ccbea4c79089331f60bf9d7ba247bb7381"}, - {file = "virtualenv-20.24.6.tar.gz", hash = "sha256:02ece4f56fbf939dbbc33c0715159951d6bf14aaf5457b092e4548e1382455af"}, + {file = "virtualenv-20.24.7-py3-none-any.whl", hash = "sha256:a18b3fd0314ca59a2e9f4b556819ed07183b3e9a3702ecfe213f593d44f7b3fd"}, + {file = "virtualenv-20.24.7.tar.gz", hash = "sha256:69050ffb42419c91f6c1284a7b24e0475d793447e35929b488bf6a0aade39353"}, ] [package.dependencies] distlib = ">=0.3.7,<1" filelock = ">=3.12.2,<4" -platformdirs = ">=3.9.1,<4" +platformdirs = ">=3.9.1,<5" [package.extras] docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.2)", "sphinx-argparse (>=0.4)", "sphinxcontrib-towncrier (>=0.2.1a0)", "towncrier (>=23.6)"] @@ -1821,85 +1801,101 @@ files = [ [[package]] name = "yarl" -version = "1.9.2" +version = "1.9.3" description = "Yet another URL library" optional = false python-versions = ">=3.7" files = [ - {file = "yarl-1.9.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:8c2ad583743d16ddbdf6bb14b5cd76bf43b0d0006e918809d5d4ddf7bde8dd82"}, - {file = "yarl-1.9.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:82aa6264b36c50acfb2424ad5ca537a2060ab6de158a5bd2a72a032cc75b9eb8"}, - {file = "yarl-1.9.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c0c77533b5ed4bcc38e943178ccae29b9bcf48ffd1063f5821192f23a1bd27b9"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee4afac41415d52d53a9833ebae7e32b344be72835bbb589018c9e938045a560"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9bf345c3a4f5ba7f766430f97f9cc1320786f19584acc7086491f45524a551ac"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2a96c19c52ff442a808c105901d0bdfd2e28575b3d5f82e2f5fd67e20dc5f4ea"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:891c0e3ec5ec881541f6c5113d8df0315ce5440e244a716b95f2525b7b9f3608"}, - {file = "yarl-1.9.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c3a53ba34a636a256d767c086ceb111358876e1fb6b50dfc4d3f4951d40133d5"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:566185e8ebc0898b11f8026447eacd02e46226716229cea8db37496c8cdd26e0"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2b0738fb871812722a0ac2154be1f049c6223b9f6f22eec352996b69775b36d4"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:32f1d071b3f362c80f1a7d322bfd7b2d11e33d2adf395cc1dd4df36c9c243095"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:e9fdc7ac0d42bc3ea78818557fab03af6181e076a2944f43c38684b4b6bed8e3"}, - {file = "yarl-1.9.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:56ff08ab5df8429901ebdc5d15941b59f6253393cb5da07b4170beefcf1b2528"}, - {file = "yarl-1.9.2-cp310-cp310-win32.whl", hash = "sha256:8ea48e0a2f931064469bdabca50c2f578b565fc446f302a79ba6cc0ee7f384d3"}, - {file = "yarl-1.9.2-cp310-cp310-win_amd64.whl", hash = "sha256:50f33040f3836e912ed16d212f6cc1efb3231a8a60526a407aeb66c1c1956dde"}, - {file = "yarl-1.9.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:646d663eb2232d7909e6601f1a9107e66f9791f290a1b3dc7057818fe44fc2b6"}, - {file = "yarl-1.9.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:aff634b15beff8902d1f918012fc2a42e0dbae6f469fce134c8a0dc51ca423bb"}, - {file = "yarl-1.9.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a83503934c6273806aed765035716216cc9ab4e0364f7f066227e1aaea90b8d0"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b25322201585c69abc7b0e89e72790469f7dad90d26754717f3310bfe30331c2"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:22a94666751778629f1ec4280b08eb11815783c63f52092a5953faf73be24191"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8ec53a0ea2a80c5cd1ab397925f94bff59222aa3cf9c6da938ce05c9ec20428d"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:159d81f22d7a43e6eabc36d7194cb53f2f15f498dbbfa8edc8a3239350f59fe7"}, - {file = "yarl-1.9.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:832b7e711027c114d79dffb92576acd1bd2decc467dec60e1cac96912602d0e6"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:95d2ecefbcf4e744ea952d073c6922e72ee650ffc79028eb1e320e732898d7e8"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:d4e2c6d555e77b37288eaf45b8f60f0737c9efa3452c6c44626a5455aeb250b9"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:783185c75c12a017cc345015ea359cc801c3b29a2966c2655cd12b233bf5a2be"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:b8cc1863402472f16c600e3e93d542b7e7542a540f95c30afd472e8e549fc3f7"}, - {file = "yarl-1.9.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:822b30a0f22e588b32d3120f6d41e4ed021806418b4c9f0bc3048b8c8cb3f92a"}, - {file = "yarl-1.9.2-cp311-cp311-win32.whl", hash = "sha256:a60347f234c2212a9f0361955007fcf4033a75bf600a33c88a0a8e91af77c0e8"}, - {file = "yarl-1.9.2-cp311-cp311-win_amd64.whl", hash = "sha256:be6b3fdec5c62f2a67cb3f8c6dbf56bbf3f61c0f046f84645cd1ca73532ea051"}, - {file = "yarl-1.9.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:38a3928ae37558bc1b559f67410df446d1fbfa87318b124bf5032c31e3447b74"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac9bb4c5ce3975aeac288cfcb5061ce60e0d14d92209e780c93954076c7c4367"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3da8a678ca8b96c8606bbb8bfacd99a12ad5dd288bc6f7979baddd62f71c63ef"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:13414591ff516e04fcdee8dc051c13fd3db13b673c7a4cb1350e6b2ad9639ad3"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf74d08542c3a9ea97bb8f343d4fcbd4d8f91bba5ec9d5d7f792dbe727f88938"}, - {file = "yarl-1.9.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6e7221580dc1db478464cfeef9b03b95c5852cc22894e418562997df0d074ccc"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:494053246b119b041960ddcd20fd76224149cfea8ed8777b687358727911dd33"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:52a25809fcbecfc63ac9ba0c0fb586f90837f5425edfd1ec9f3372b119585e45"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:e65610c5792870d45d7b68c677681376fcf9cc1c289f23e8e8b39c1485384185"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:1b1bba902cba32cdec51fca038fd53f8beee88b77efc373968d1ed021024cc04"}, - {file = "yarl-1.9.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:662e6016409828ee910f5d9602a2729a8a57d74b163c89a837de3fea050c7582"}, - {file = "yarl-1.9.2-cp37-cp37m-win32.whl", hash = "sha256:f364d3480bffd3aa566e886587eaca7c8c04d74f6e8933f3f2c996b7f09bee1b"}, - {file = "yarl-1.9.2-cp37-cp37m-win_amd64.whl", hash = "sha256:6a5883464143ab3ae9ba68daae8e7c5c95b969462bbe42e2464d60e7e2698368"}, - {file = "yarl-1.9.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5610f80cf43b6202e2c33ba3ec2ee0a2884f8f423c8f4f62906731d876ef4fac"}, - {file = "yarl-1.9.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b9a4e67ad7b646cd6f0938c7ebfd60e481b7410f574c560e455e938d2da8e0f4"}, - {file = "yarl-1.9.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:83fcc480d7549ccebe9415d96d9263e2d4226798c37ebd18c930fce43dfb9574"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5fcd436ea16fee7d4207c045b1e340020e58a2597301cfbcfdbe5abd2356c2fb"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84e0b1599334b1e1478db01b756e55937d4614f8654311eb26012091be109d59"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3458a24e4ea3fd8930e934c129b676c27452e4ebda80fbe47b56d8c6c7a63a9e"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:838162460b3a08987546e881a2bfa573960bb559dfa739e7800ceeec92e64417"}, - {file = "yarl-1.9.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f4e2d08f07a3d7d3e12549052eb5ad3eab1c349c53ac51c209a0e5991bbada78"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:de119f56f3c5f0e2fb4dee508531a32b069a5f2c6e827b272d1e0ff5ac040333"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:149ddea5abf329752ea5051b61bd6c1d979e13fbf122d3a1f9f0c8be6cb6f63c"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:674ca19cbee4a82c9f54e0d1eee28116e63bc6fd1e96c43031d11cbab8b2afd5"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:9b3152f2f5677b997ae6c804b73da05a39daa6a9e85a512e0e6823d81cdad7cc"}, - {file = "yarl-1.9.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5415d5a4b080dc9612b1b63cba008db84e908b95848369aa1da3686ae27b6d2b"}, - {file = "yarl-1.9.2-cp38-cp38-win32.whl", hash = "sha256:f7a3d8146575e08c29ed1cd287068e6d02f1c7bdff8970db96683b9591b86ee7"}, - {file = "yarl-1.9.2-cp38-cp38-win_amd64.whl", hash = "sha256:63c48f6cef34e6319a74c727376e95626f84ea091f92c0250a98e53e62c77c72"}, - {file = "yarl-1.9.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:75df5ef94c3fdc393c6b19d80e6ef1ecc9ae2f4263c09cacb178d871c02a5ba9"}, - {file = "yarl-1.9.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c027a6e96ef77d401d8d5a5c8d6bc478e8042f1e448272e8d9752cb0aff8b5c8"}, - {file = "yarl-1.9.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:f3b078dbe227f79be488ffcfc7a9edb3409d018e0952cf13f15fd6512847f3f7"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59723a029760079b7d991a401386390c4be5bfec1e7dd83e25a6a0881859e716"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b03917871bf859a81ccb180c9a2e6c1e04d2f6a51d953e6a5cdd70c93d4e5a2a"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c1012fa63eb6c032f3ce5d2171c267992ae0c00b9e164efe4d73db818465fac3"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a74dcbfe780e62f4b5a062714576f16c2f3493a0394e555ab141bf0d746bb955"}, - {file = "yarl-1.9.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8c56986609b057b4839968ba901944af91b8e92f1725d1a2d77cbac6972b9ed1"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:2c315df3293cd521033533d242d15eab26583360b58f7ee5d9565f15fee1bef4"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b7232f8dfbd225d57340e441d8caf8652a6acd06b389ea2d3222b8bc89cbfca6"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:53338749febd28935d55b41bf0bcc79d634881195a39f6b2f767870b72514caf"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:066c163aec9d3d073dc9ffe5dd3ad05069bcb03fcaab8d221290ba99f9f69ee3"}, - {file = "yarl-1.9.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8288d7cd28f8119b07dd49b7230d6b4562f9b61ee9a4ab02221060d21136be80"}, - {file = "yarl-1.9.2-cp39-cp39-win32.whl", hash = "sha256:b124e2a6d223b65ba8768d5706d103280914d61f5cae3afbc50fc3dfcc016623"}, - {file = "yarl-1.9.2-cp39-cp39-win_amd64.whl", hash = "sha256:61016e7d582bc46a5378ffdd02cd0314fb8ba52f40f9cf4d9a5e7dbef88dee18"}, - {file = "yarl-1.9.2.tar.gz", hash = "sha256:04ab9d4b9f587c06d801c2abfe9317b77cdf996c65a90d5e84ecc45010823571"}, + {file = "yarl-1.9.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:32435d134414e01d937cd9d6cc56e8413a8d4741dea36af5840c7750f04d16ab"}, + {file = "yarl-1.9.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9a5211de242754b5e612557bca701f39f8b1a9408dff73c6db623f22d20f470e"}, + {file = "yarl-1.9.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:525cd69eff44833b01f8ef39aa33a9cc53a99ff7f9d76a6ef6a9fb758f54d0ff"}, + {file = "yarl-1.9.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc94441bcf9cb8c59f51f23193316afefbf3ff858460cb47b5758bf66a14d130"}, + {file = "yarl-1.9.3-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e36021db54b8a0475805acc1d6c4bca5d9f52c3825ad29ae2d398a9d530ddb88"}, + {file = "yarl-1.9.3-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e0f17d1df951336a02afc8270c03c0c6e60d1f9996fcbd43a4ce6be81de0bd9d"}, + {file = "yarl-1.9.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c5f3faeb8100a43adf3e7925d556801d14b5816a0ac9e75e22948e787feec642"}, + {file = "yarl-1.9.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:aed37db837ecb5962469fad448aaae0f0ee94ffce2062cf2eb9aed13328b5196"}, + {file = "yarl-1.9.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:721ee3fc292f0d069a04016ef2c3a25595d48c5b8ddc6029be46f6158d129c92"}, + {file = "yarl-1.9.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b8bc5b87a65a4e64bc83385c05145ea901b613d0d3a434d434b55511b6ab0067"}, + {file = "yarl-1.9.3-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:dd952b9c64f3b21aedd09b8fe958e4931864dba69926d8a90c90d36ac4e28c9a"}, + {file = "yarl-1.9.3-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:c405d482c320a88ab53dcbd98d6d6f32ada074f2d965d6e9bf2d823158fa97de"}, + {file = "yarl-1.9.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:9df9a0d4c5624790a0dea2e02e3b1b3c69aed14bcb8650e19606d9df3719e87d"}, + {file = "yarl-1.9.3-cp310-cp310-win32.whl", hash = "sha256:d34c4f80956227f2686ddea5b3585e109c2733e2d4ef12eb1b8b4e84f09a2ab6"}, + {file = "yarl-1.9.3-cp310-cp310-win_amd64.whl", hash = "sha256:cf7a4e8de7f1092829caef66fd90eaf3710bc5efd322a816d5677b7664893c93"}, + {file = "yarl-1.9.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d61a0ca95503867d4d627517bcfdc28a8468c3f1b0b06c626f30dd759d3999fd"}, + {file = "yarl-1.9.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:73cc83f918b69110813a7d95024266072d987b903a623ecae673d1e71579d566"}, + {file = "yarl-1.9.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d81657b23e0edb84b37167e98aefb04ae16cbc5352770057893bd222cdc6e45f"}, + {file = "yarl-1.9.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26a1a8443091c7fbc17b84a0d9f38de34b8423b459fb853e6c8cdfab0eacf613"}, + {file = "yarl-1.9.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fe34befb8c765b8ce562f0200afda3578f8abb159c76de3ab354c80b72244c41"}, + {file = "yarl-1.9.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2c757f64afe53a422e45e3e399e1e3cf82b7a2f244796ce80d8ca53e16a49b9f"}, + {file = "yarl-1.9.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72a57b41a0920b9a220125081c1e191b88a4cdec13bf9d0649e382a822705c65"}, + {file = "yarl-1.9.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:632c7aeb99df718765adf58eacb9acb9cbc555e075da849c1378ef4d18bf536a"}, + {file = "yarl-1.9.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:b0b8c06afcf2bac5a50b37f64efbde978b7f9dc88842ce9729c020dc71fae4ce"}, + {file = "yarl-1.9.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:1d93461e2cf76c4796355494f15ffcb50a3c198cc2d601ad8d6a96219a10c363"}, + {file = "yarl-1.9.3-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:4003f380dac50328c85e85416aca6985536812c082387255c35292cb4b41707e"}, + {file = "yarl-1.9.3-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4d6d74a97e898c1c2df80339aa423234ad9ea2052f66366cef1e80448798c13d"}, + {file = "yarl-1.9.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b61e64b06c3640feab73fa4ff9cb64bd8182de52e5dc13038e01cfe674ebc321"}, + {file = "yarl-1.9.3-cp311-cp311-win32.whl", hash = "sha256:29beac86f33d6c7ab1d79bd0213aa7aed2d2f555386856bb3056d5fdd9dab279"}, + {file = "yarl-1.9.3-cp311-cp311-win_amd64.whl", hash = "sha256:f7271d6bd8838c49ba8ae647fc06469137e1c161a7ef97d778b72904d9b68696"}, + {file = "yarl-1.9.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:dd318e6b75ca80bff0b22b302f83a8ee41c62b8ac662ddb49f67ec97e799885d"}, + {file = "yarl-1.9.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c4b1efb11a8acd13246ffb0bee888dd0e8eb057f8bf30112e3e21e421eb82d4a"}, + {file = "yarl-1.9.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c6f034386e5550b5dc8ded90b5e2ff7db21f0f5c7de37b6efc5dac046eb19c10"}, + {file = "yarl-1.9.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cd49a908cb6d387fc26acee8b7d9fcc9bbf8e1aca890c0b2fdfd706057546080"}, + {file = "yarl-1.9.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aa4643635f26052401750bd54db911b6342eb1a9ac3e74f0f8b58a25d61dfe41"}, + {file = "yarl-1.9.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e741bd48e6a417bdfbae02e088f60018286d6c141639359fb8df017a3b69415a"}, + {file = "yarl-1.9.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c86d0d0919952d05df880a1889a4f0aeb6868e98961c090e335671dea5c0361"}, + {file = "yarl-1.9.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3d5434b34100b504aabae75f0622ebb85defffe7b64ad8f52b8b30ec6ef6e4b9"}, + {file = "yarl-1.9.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:79e1df60f7c2b148722fb6cafebffe1acd95fd8b5fd77795f56247edaf326752"}, + {file = "yarl-1.9.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:44e91a669c43f03964f672c5a234ae0d7a4d49c9b85d1baa93dec28afa28ffbd"}, + {file = "yarl-1.9.3-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:3cfa4dbe17b2e6fca1414e9c3bcc216f6930cb18ea7646e7d0d52792ac196808"}, + {file = "yarl-1.9.3-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:88d2c3cc4b2f46d1ba73d81c51ec0e486f59cc51165ea4f789677f91a303a9a7"}, + {file = "yarl-1.9.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:cccdc02e46d2bd7cb5f38f8cc3d9db0d24951abd082b2f242c9e9f59c0ab2af3"}, + {file = "yarl-1.9.3-cp312-cp312-win32.whl", hash = "sha256:96758e56dceb8a70f8a5cff1e452daaeff07d1cc9f11e9b0c951330f0a2396a7"}, + {file = "yarl-1.9.3-cp312-cp312-win_amd64.whl", hash = "sha256:c4472fe53ebf541113e533971bd8c32728debc4c6d8cc177f2bff31d011ec17e"}, + {file = "yarl-1.9.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:126638ab961633f0940a06e1c9d59919003ef212a15869708dcb7305f91a6732"}, + {file = "yarl-1.9.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c99ddaddb2fbe04953b84d1651149a0d85214780e4d0ee824e610ab549d98d92"}, + {file = "yarl-1.9.3-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8dab30b21bd6fb17c3f4684868c7e6a9e8468078db00f599fb1c14e324b10fca"}, + {file = "yarl-1.9.3-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:828235a2a169160ee73a2fcfb8a000709edf09d7511fccf203465c3d5acc59e4"}, + {file = "yarl-1.9.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fc391e3941045fd0987c77484b2799adffd08e4b6735c4ee5f054366a2e1551d"}, + {file = "yarl-1.9.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:51382c72dd5377861b573bd55dcf680df54cea84147c8648b15ac507fbef984d"}, + {file = "yarl-1.9.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:28a108cb92ce6cf867690a962372996ca332d8cda0210c5ad487fe996e76b8bb"}, + {file = "yarl-1.9.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:8f18a7832ff85dfcd77871fe677b169b1bc60c021978c90c3bb14f727596e0ae"}, + {file = "yarl-1.9.3-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:7eaf13af79950142ab2bbb8362f8d8d935be9aaf8df1df89c86c3231e4ff238a"}, + {file = "yarl-1.9.3-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:66a6dbf6ca7d2db03cc61cafe1ee6be838ce0fbc97781881a22a58a7c5efef42"}, + {file = "yarl-1.9.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1a0a4f3aaa18580038cfa52a7183c8ffbbe7d727fe581300817efc1e96d1b0e9"}, + {file = "yarl-1.9.3-cp37-cp37m-win32.whl", hash = "sha256:946db4511b2d815979d733ac6a961f47e20a29c297be0d55b6d4b77ee4b298f6"}, + {file = "yarl-1.9.3-cp37-cp37m-win_amd64.whl", hash = "sha256:2dad8166d41ebd1f76ce107cf6a31e39801aee3844a54a90af23278b072f1ccf"}, + {file = "yarl-1.9.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:bb72d2a94481e7dc7a0c522673db288f31849800d6ce2435317376a345728225"}, + {file = "yarl-1.9.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9a172c3d5447b7da1680a1a2d6ecdf6f87a319d21d52729f45ec938a7006d5d8"}, + {file = "yarl-1.9.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2dc72e891672343b99db6d497024bf8b985537ad6c393359dc5227ef653b2f17"}, + {file = "yarl-1.9.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b8d51817cf4b8d545963ec65ff06c1b92e5765aa98831678d0e2240b6e9fd281"}, + {file = "yarl-1.9.3-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:53ec65f7eee8655bebb1f6f1607760d123c3c115a324b443df4f916383482a67"}, + {file = "yarl-1.9.3-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cfd77e8e5cafba3fb584e0f4b935a59216f352b73d4987be3af51f43a862c403"}, + {file = "yarl-1.9.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e73db54c967eb75037c178a54445c5a4e7461b5203b27c45ef656a81787c0c1b"}, + {file = "yarl-1.9.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09c19e5f4404574fcfb736efecf75844ffe8610606f3fccc35a1515b8b6712c4"}, + {file = "yarl-1.9.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6280353940f7e5e2efaaabd686193e61351e966cc02f401761c4d87f48c89ea4"}, + {file = "yarl-1.9.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:c25ec06e4241e162f5d1f57c370f4078797ade95c9208bd0c60f484834f09c96"}, + {file = "yarl-1.9.3-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:7217234b10c64b52cc39a8d82550342ae2e45be34f5bff02b890b8c452eb48d7"}, + {file = "yarl-1.9.3-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:4ce77d289f8d40905c054b63f29851ecbfd026ef4ba5c371a158cfe6f623663e"}, + {file = "yarl-1.9.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5f74b015c99a5eac5ae589de27a1201418a5d9d460e89ccb3366015c6153e60a"}, + {file = "yarl-1.9.3-cp38-cp38-win32.whl", hash = "sha256:8a2538806be846ea25e90c28786136932ec385c7ff3bc1148e45125984783dc6"}, + {file = "yarl-1.9.3-cp38-cp38-win_amd64.whl", hash = "sha256:6465d36381af057d0fab4e0f24ef0e80ba61f03fe43e6eeccbe0056e74aadc70"}, + {file = "yarl-1.9.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2f3c8822bc8fb4a347a192dd6a28a25d7f0ea3262e826d7d4ef9cc99cd06d07e"}, + {file = "yarl-1.9.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b7831566595fe88ba17ea80e4b61c0eb599f84c85acaa14bf04dd90319a45b90"}, + {file = "yarl-1.9.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ff34cb09a332832d1cf38acd0f604c068665192c6107a439a92abfd8acf90fe2"}, + {file = "yarl-1.9.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fe8080b4f25dfc44a86bedd14bc4f9d469dfc6456e6f3c5d9077e81a5fedfba7"}, + {file = "yarl-1.9.3-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8535e111a064f3bdd94c0ed443105934d6f005adad68dd13ce50a488a0ad1bf3"}, + {file = "yarl-1.9.3-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0d155a092bf0ebf4a9f6f3b7a650dc5d9a5bbb585ef83a52ed36ba46f55cc39d"}, + {file = "yarl-1.9.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:778df71c8d0c8c9f1b378624b26431ca80041660d7be7c3f724b2c7a6e65d0d6"}, + {file = "yarl-1.9.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b9f9cafaf031c34d95c1528c16b2fa07b710e6056b3c4e2e34e9317072da5d1a"}, + {file = "yarl-1.9.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ca6b66f69e30f6e180d52f14d91ac854b8119553b524e0e28d5291a724f0f423"}, + {file = "yarl-1.9.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e0e7e83f31e23c5d00ff618045ddc5e916f9e613d33c5a5823bc0b0a0feb522f"}, + {file = "yarl-1.9.3-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:af52725c7c39b0ee655befbbab5b9a1b209e01bb39128dce0db226a10014aacc"}, + {file = "yarl-1.9.3-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0ab5baaea8450f4a3e241ef17e3d129b2143e38a685036b075976b9c415ea3eb"}, + {file = "yarl-1.9.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6d350388ba1129bc867c6af1cd17da2b197dff0d2801036d2d7d83c2d771a682"}, + {file = "yarl-1.9.3-cp39-cp39-win32.whl", hash = "sha256:e2a16ef5fa2382af83bef4a18c1b3bcb4284c4732906aa69422cf09df9c59f1f"}, + {file = "yarl-1.9.3-cp39-cp39-win_amd64.whl", hash = "sha256:d92d897cb4b4bf915fbeb5e604c7911021a8456f0964f3b8ebbe7f9188b9eabb"}, + {file = "yarl-1.9.3-py3-none-any.whl", hash = "sha256:271d63396460b6607b588555ea27a1a02b717ca2e3f2cf53bdde4013d7790929"}, + {file = "yarl-1.9.3.tar.gz", hash = "sha256:4a14907b597ec55740f63e52d7fee0e9ee09d5b9d57a4f399a7423268e457b57"}, ] [package.dependencies] @@ -1909,4 +1905,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "ca4a995ca5a49df1a4f20e20a89ee809346e316ad1fcd518e090ee46449023d5" +content-hash = "48f502f44044527aade56f230c25cfb0ac73c7f4554a929d35aedd90f724e335" diff --git a/pyproject.toml b/pyproject.toml index ce14a8423a..dfe1efa86d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,9 +15,13 @@ typing-extensions = "^4.8.0" attrs = "^23.1.0" structlog = "^23.2.0" networkx = "^3.1" +docstring-parser = "^0.15" +pycryptodomex = ">=3.6.0,<4" +immutabledict = "^4.0.0" # vendored mypy dependencies mypy_extensions = "^1.0.0" + [tool.poetry.group.dev.dependencies] black = {extras = ["d"], version = "^23.10.1"} mypy = "1.7.0" @@ -52,6 +56,9 @@ force-exclude = "src/wyvern/(_typeshed|_vendor)" [tool.mypy] python_version = "3.11" strict = true +untyped_calls_exclude = [ + "algosdk", +] exclude = [ "src/wyvern/_typeshed", "src/wyvern/_vendor", @@ -156,8 +163,6 @@ extend-exclude = [ "src/algopy-stubs/**" = [ "PYI021", # allow docstrings in stubs "PYI053", # allow "docstrings" in overloads - # TODO: remove the below - "E501", ] "examples/**" = [ "PT", # no pytest rules diff --git a/real_examples/arc4/voting/out/voting.awst b/real_examples/arc4/voting/out/voting.awst deleted file mode 100644 index 39c4173e57..0000000000 --- a/real_examples/arc4/voting/out/voting.awst +++ /dev/null @@ -1,118 +0,0 @@ -VOTE_INDEX_BYTES = 1 -VOTE_COUNT_BYTES = 8 -BOX_FLAT_MIN_BALANCE = 2500 -BOX_BYTE_MIN_BALANCE = 400 -ASSET_MIN_BALANCE = 100000 -TALLY_BOX_KEY = b'V' - -contract VotingContract -{ - globals { - ['is_bootstrapped']: bool - ['voter_count']: algopy.UInt64 - ['close_time']: algopy.UInt64 - ['nft_asset_id']: algopy.UInt64 - ['snapshot_public_key']: algopy.Bytes - ['vote_id']: algopy.arc4.String - ['metadata_ipfs_cid']: algopy.arc4.String - ['start_time']: algopy.UInt64 - ['end_time']: algopy.UInt64 - ['quorum']: algopy.UInt64 - ['nft_image_url']: algopy.arc4.String - ['option_counts']: algopy.arc4.DynamicArray - ['total_options']: algopy.UInt64 - } - - constructor() - { - this.globals['is_bootstrapped']: bool = false - this.globals['voter_count']: algopy.UInt64 = 0u - this.globals['close_time']: algopy.UInt64 = 0u - this.globals['nft_asset_id']: algopy.UInt64 = 0u - empty_bytes: algopy.Bytes = '' - this.globals['snapshot_public_key']: algopy.Bytes = empty_bytes - this.globals['vote_id']: algopy.arc4.String = reinterpret_cast(empty_bytes) - this.globals['metadata_ipfs_cid']: algopy.arc4.String = reinterpret_cast(empty_bytes) - this.globals['start_time']: algopy.UInt64 = 0u - this.globals['end_time']: algopy.UInt64 = 0u - this.globals['quorum']: algopy.UInt64 = 0u - this.globals['nft_image_url']: algopy.arc4.String = reinterpret_cast(empty_bytes) - this.globals['option_counts']: algopy.arc4.DynamicArray = reinterpret_cast(empty_bytes) - this.globals['total_options']: algopy.UInt64 = 0u - } - - clear_state_program(): bool - { - return true - } - - abimethod create(vote_id: algopy.arc4.String, snapshot_public_key: algopy.Bytes, metadata_ipfs_cid: algopy.arc4.String, start_time: algopy.UInt64, end_time: algopy.UInt64, option_counts: algopy.arc4.DynamicArray, quorum: algopy.UInt64, nft_image_url: algopy.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") - this.globals['vote_id']: algopy.arc4.String = vote_id - this.globals['snapshot_public_key']: algopy.Bytes = snapshot_public_key - this.globals['metadata_ipfs_cid']: algopy.arc4.String = metadata_ipfs_cid - this.globals['start_time']: algopy.UInt64 = start_time - this.globals['end_time']: algopy.UInt64 = end_time - this.globals['quorum']: algopy.UInt64 = quorum - this.globals['nft_image_url']: algopy.arc4.String = nft_image_url - this::store_option_counts(option_counts) - } - - abimethod get_preconditions(signature: algopy.Bytes): tuple[bool, bool, bool, algopy.UInt64] - { - return (this::voting_open(), this::allowed_to_vote(signature), this::already_voted(), global()) - } - - subroutine voting_open(): bool - { - return this.globals['is_bootstrapped'] and !(reinterpret_cast(this.globals['close_time'])) and this.globals['start_time'] <= tmp$0: algopy.UInt64 := global() and tmp$0 <= this.globals['end_time'] - } - - subroutine already_voted(): bool - { - (votes, exists): tuple[algopy.Bytes, bool] = box_get(reinterpret_cast(txn())) - return exists - } - - subroutine store_option_counts(option_counts: algopy.arc4.DynamicArray): 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") - this.globals['option_counts']: algopy.arc4.DynamicArray = option_counts - total_options: algopy.UInt64 = this::calculate_total_options_count(option_counts) - assert(total_options <= 128u, comment="Can't have more than 128 vote options") - this.globals['total_options']: algopy.UInt64 = total_options - } - - subroutine calculate_total_options_count(option_counts: algopy.arc4.DynamicArray): algopy.UInt64 - { - total: algopy.UInt64 = 0u - for item in option_counts { - total += abi_decode(item, algopy.UInt64) - } - return total - } - - subroutine allowed_to_vote(signature: algopy.Bytes): bool - { - algopy::ensure_budget() - return ed25519verify(reinterpret_cast(txn()), signature, this.globals['snapshot_public_key']) - } -} - -subroutine get_vote_from_box(index: algopy.UInt64): algopy.UInt64 -{ - (box_data, exists): tuple[algopy.Bytes, bool] = box_get('V') - assert(exists, comment="Box not created") - return btoi(extract3(box_data, index, 8u)) -} - -subroutine increment_vote_in_box(index: algopy.UInt64): None -{ - (box_data, exists): tuple[algopy.Bytes, bool] = box_get('V') - assert(exists, comment="Box not created") - current_vote: algopy.UInt64 = btoi(extract3(box_data, index, 8u)) - box_replace(box_data, index, itob(current_vote + 1u)) -} \ No newline at end of file diff --git a/scripts/compile_all_examples.py b/scripts/compile_all_examples.py index 4cb901f5c8..6d8939b676 100755 --- a/scripts/compile_all_examples.py +++ b/scripts/compile_all_examples.py @@ -50,6 +50,22 @@ def add(self, teal_programs: list[Path]) -> None: case [".approval_unoptimized", ".teal"]: self.unoptimized_sizes[name] = get_program_size(teal) + @classmethod + def read_file(cls, path: Path) -> "ProgramSizes": + lines = path.read_text("utf-8").splitlines() + program_sizes = ProgramSizes() + for line in lines[1:]: + name, unoptimized, optimized = line.rsplit(maxsplit=3) + program_sizes.unoptimized_sizes[name] = int(unoptimized) + program_sizes.sizes[name] = int(optimized) + return program_sizes + + def update(self, other: "ProgramSizes") -> "ProgramSizes": + return ProgramSizes( + sizes={**self.sizes, **other.sizes}, + unoptimized_sizes={**self.unoptimized_sizes, **other.unoptimized_sizes}, + ) + def __str__(self) -> str: writer = AlignedWriter() writer.add_header("Name") @@ -74,13 +90,16 @@ class CompilationResult: def get_program_size(path: Path) -> int: - program = algokit_utils.Program(path.read_text("utf-8"), ALGOD_CLIENT) - return len(program.raw_binary) + try: + program = algokit_utils.Program(path.read_text("utf-8"), ALGOD_CLIENT) + return len(program.raw_binary) + except Exception as e: + raise Exception(f"Error compiling teal application: {path}") from e def _stabilise_logs(stdout: str) -> list[str]: return [ - line.replace(str(GIT_ROOT), "").replace("\\", "/") + line.replace("\\", "/").replace(str(GIT_ROOT).replace("\\", "/"), "") for line in stdout.splitlines() if not line.startswith( ( @@ -103,6 +122,7 @@ def checked_compile(p: Path, flags: list[str], *, write_logs: bool) -> Compilati *flags, "--out-dir=out", "--debug-level=1", + "--log-level=debug", rel_path, ] result = subprocess.run( @@ -134,8 +154,8 @@ def checked_compile(p: Path, flags: list[str], *, write_logs: bool) -> Compilati return CompilationResult( rel_path=rel_path, ok=result.returncode == 0, - teal_files=list(map(Path, teal_files_written)), - final_ir_files=list(map(Path, final_ir_written)), + teal_files=[EXAMPLES_DIR / p for p in teal_files_written], + final_ir_files=[EXAMPLES_DIR / p for p in final_ir_written], ) @@ -190,15 +210,16 @@ def main(*limit_to: str) -> None: else: for item in EXAMPLES_DIR.iterdir(): if item.is_dir(): - if any(item.glob("*.py")): + if any(item.rglob("*.py")): to_compile.append(item) elif item.is_file() and item.suffix == ".py" and item.name != "__init__.py": to_compile.append(item) if not limit_to: print("Cleaning up prior runs") - for f in EXAMPLES_DIR.rglob("**/out/*"): - if f.is_file(): - f.unlink() + for ext in (".teal", ".awst", ".ir"): + for f in EXAMPLES_DIR.rglob(f"**/out/*{ext}"): + if f.is_file(): + f.unlink() program_sizes = ProgramSizes() opt_success = set() @@ -227,9 +248,10 @@ def main(*limit_to: str) -> None: print("The following had different success outcomes depending on optimization flag: ") for name in sorted(success_differs): print(" - " + name) - if not limit_to: - # TODO: incremental updates - SIZE_TALLY_PATH.write_text(str(program_sizes)) + if limit_to: + existing = ProgramSizes.read_file(SIZE_TALLY_PATH) + program_sizes = existing.update(program_sizes) + SIZE_TALLY_PATH.write_text(str(program_sizes)) if __name__ == "__main__": diff --git a/scripts/dry_run_create.py b/scripts/dry_run_create.py index af3dd26570..d3a2b9d2f4 100644 --- a/scripts/dry_run_create.py +++ b/scripts/dry_run_create.py @@ -37,7 +37,7 @@ def dryrun_create( atc = AtomicTransactionComposer() atc.add_transaction( TransactionWithSigner( - txn=ApplicationCallTxn( # type: ignore[no-untyped-call] + txn=ApplicationCallTxn( sender=account.address, sp=algod.suggested_params(), index=0, @@ -54,7 +54,7 @@ def dryrun_create( signed = atc.gather_signatures() dryrun_request = create_dryrun(algod, signed) - return algod.dryrun(dryrun_request.dictify()) # type: ignore[no-untyped-call] + return algod.dryrun(dryrun_request.dictify()) @dataclass(kw_only=True) @@ -80,7 +80,7 @@ def get_accounts( ) -> list[LocalAccount]: """gets all the accounts in the localnet kmd, defaults to the `unencrypted-default-wallet` created on private networks automatically""" - kmd = KMDClient(kmd_token, kmd_address) # type: ignore[no-untyped-call] + kmd = KMDClient(kmd_token, kmd_address) with wallet_handle_by_name(kmd, wallet_name, wallet_password) as wallet_handle: return [ LocalAccount( @@ -89,15 +89,15 @@ def get_accounts( wallet_handle, wallet_password, address, - ), # type: ignore[no-untyped-call] + ), ) - for address in kmd.list_keys(wallet_handle) # type: ignore[no-untyped-call] + for address in kmd.list_keys(wallet_handle) ] @contextlib.contextmanager def wallet_handle_by_name(kmd: KMDClient, wallet_name: str, wallet_password: str) -> Iterator[str]: - wallets = kmd.list_wallets() # type: ignore[no-untyped-call] + wallets = kmd.list_wallets() try: wallet_id = next(iter(w["id"] for w in wallets if w["name"] == wallet_name)) @@ -107,11 +107,11 @@ def wallet_handle_by_name(kmd: KMDClient, wallet_name: str, wallet_password: str wallet_handle = kmd.init_wallet_handle( wallet_id, wallet_password, - ) # type: ignore[no-untyped-call] + ) try: yield wallet_handle finally: - kmd.release_wallet_handle(wallet_handle) # type: ignore[no-untyped-call] + kmd.release_wallet_handle(wallet_handle) if __name__ == "__main__": diff --git a/scripts/generate_stubs.py b/scripts/generate_stubs.py index 7abb67617e..51295ef07c 100755 --- a/scripts/generate_stubs.py +++ b/scripts/generate_stubs.py @@ -26,7 +26,7 @@ logger = structlog.get_logger(__name__) INDENT = " " * 4 VCS_ROOT = Path(__file__).parent.parent -CLS_ADDRESS = "Address" +CLS_ACCOUNT = "Account" CLS_BYTES = "Bytes" CLS_UINT64 = "UInt64" CLS_BIGINT = "BigUInt" @@ -35,7 +35,7 @@ "bytes": bytes, "str": str, "bool": wtypes.bool_wtype, - CLS_ADDRESS: wtypes.address_wtype, + CLS_ACCOUNT: wtypes.account_wtype, CLS_BYTES: wtypes.bytes_wtype, CLS_UINT64: wtypes.uint64_wtype, CLS_BIGINT: wtypes.biguint_wtype, @@ -342,25 +342,25 @@ def sub_types(type_name: StackType, *, covariant: bool) -> list[str]: uint64 = [CLS_UINT64, UINT64_LITERAL] if covariant else [CLS_UINT64] bigint = [CLS_BIGINT] if covariant else [CLS_BIGINT] boolean = ["bool"] - address = [CLS_ADDRESS] + account = [CLS_ACCOUNT] sub_types = { StackType.bytes: bytes_, - StackType.bytes_32: bytes_ + address - if covariant - else bytes_, # TODO: maybe only Address and not Bytes? + StackType.bytes_32: bytes_ + account if covariant else account, StackType.uint64: uint64, StackType.bool: boolean + uint64 if covariant else boolean, StackType.any: bytes_ + uint64, StackType.box_name: bytes_, - StackType.address: address, - StackType.address_or_index: address + uint64, + StackType.address: account, + StackType.address_or_index: account + uint64, StackType.bigint: bigint, } try: return sub_types[type_name] except KeyError as ex: - raise NotImplementedError("Unsupported type:" + type_name) from ex + raise NotImplementedError( + f"Could not map stack type {type_name} to an algopy type:" + type_name + ) from ex def sub_type(type_name: StackType, *, covariant: bool) -> str: @@ -425,7 +425,7 @@ def build_stub( if arg.doc: doc.append(f":param {python_type} {arg.name}: {arg.doc}") if function.args: - args.append("/") # TODO: remove once we go big 🧠 + args.append("/") # TODO: remove once we support kwargs signature.append(", ".join(args)) return_types = [ @@ -794,8 +794,8 @@ def build_wtype(wtype: wtypes.WType) -> str: return "wtypes.bool_wtype" case wtypes.uint64_wtype: return "wtypes.uint64_wtype" - case wtypes.address_wtype: - return "wtypes.address_wtype" + case wtypes.account_wtype: + return "wtypes.account_wtype" case wtypes.bytes_wtype: return "wtypes.bytes_wtype" case wtypes.biguint_wtype: @@ -883,7 +883,7 @@ def output_stub( "import enum", "from typing import Never", "", - f"from algopy._primitives import {CLS_ADDRESS}, {CLS_BIGINT}, {CLS_BYTES}, {CLS_UINT64}", + f"from algopy import {CLS_ACCOUNT}, {CLS_BIGINT}, {CLS_BYTES}, {CLS_UINT64}", ] for arg_enum in enums: diff --git a/scripts/transform_lang_spec.py b/scripts/transform_lang_spec.py index 47249c7d92..d118238cea 100644 --- a/scripts/transform_lang_spec.py +++ b/scripts/transform_lang_spec.py @@ -12,9 +12,8 @@ STACK_INPUT_NAMES = "ABCDE" -STACK_OUTPUT_NAMES_FEW = "XYZ" # 1, 2, 3 -STACK_OUTPUT_NAMES_MANY = "WXYZ" # many -# TODO: lots? +STACK_OUTPUT_NAMES_FEW = "XYZ" # 3 or less var +STACK_OUTPUT_NAMES_MANY = "WXYZ" # 4 var VARIABLE_SIZE_OPCODES = { diff --git a/src/algopy-stubs/__init__.pyi b/src/algopy-stubs/__init__.pyi index 463fbc8664..40798d8ae2 100644 --- a/src/algopy-stubs/__init__.pyi +++ b/src/algopy-stubs/__init__.pyi @@ -7,8 +7,10 @@ from algopy._contract import * from algopy._gen import * from algopy._hints import * from algopy._primitives import * +from algopy._reference import * from algopy._storage import * from algopy._struct import * +from algopy._transactions import * from algopy._unsigned_builtins import * from algopy._util import * from algopy.arc4 import ( diff --git a/src/algopy-stubs/_array.pyi b/src/algopy-stubs/_array.pyi index 46ae64465e..9ba80c7ecb 100644 --- a/src/algopy-stubs/_array.pyi +++ b/src/algopy-stubs/_array.pyi @@ -1,7 +1,7 @@ import typing as t from collections.abc import Iterable, Sized -from algopy._primitives import UInt64 +from algopy import UInt64 # words = ["help", "me"] # AVM: diff --git a/src/algopy-stubs/_contract.pyi b/src/algopy-stubs/_contract.pyi index 5f3d2dba00..b5d521c69e 100644 --- a/src/algopy-stubs/_contract.pyi +++ b/src/algopy-stubs/_contract.pyi @@ -1,6 +1,6 @@ import abc -from algopy._primitives import UInt64 +from algopy import UInt64 class Contract(abc.ABC): def __init_subclass__(cls, name: str | None = None, **kwargs: object): ... diff --git a/src/algopy-stubs/_gen.pyi b/src/algopy-stubs/_gen.pyi index 8372be1cf8..227c0bebb4 100644 --- a/src/algopy-stubs/_gen.pyi +++ b/src/algopy-stubs/_gen.pyi @@ -1,7 +1,7 @@ import enum from typing import Never -from algopy._primitives import Address, BigUInt, Bytes, UInt64 +from algopy import Account, BigUInt, Bytes, UInt64 class Base64(enum.StrEnum): URLEncoding = enum.auto() @@ -25,7 +25,7 @@ def addw(a: UInt64 | int, b: UInt64 | int, /) -> tuple[UInt64, UInt64]: """ -def app_opted_in(a: Address | UInt64 | int, b: UInt64 | int, /) -> bool: +def app_opted_in(a: Account | UInt64 | int, b: UInt64 | int, /) -> bool: """ 1 if account A is opted in to application B, else 0 params: Txn.Accounts offset (or, since v4, an _available_ account address), _available_ application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise. @@ -48,7 +48,7 @@ def arg(a: UInt64 | int, /) -> Bytes: """ -def balance(a: Address | UInt64 | int, /) -> UInt64: +def balance(a: Account | UInt64 | int, /) -> UInt64: """ balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted. Changes caused by inner transactions are observable immediately following `itxn_submit` params: Txn.Accounts offset (or, since v4, an _available_ account address). Return: value. @@ -388,7 +388,7 @@ def itob(a: UInt64 | int, /) -> Bytes: """ -def keccak256(a: Bytes | bytes, /) -> Bytes: +def keccak256(a: Bytes | bytes, /) -> Account: """ Keccak256 hash of value A, yields [32]byte @@ -411,7 +411,7 @@ def log(a: Bytes | bytes, /) -> None: """ -def min_balance(a: Address | UInt64 | int, /) -> UInt64: +def min_balance(a: Account | UInt64 | int, /) -> UInt64: """ minimum required balance for account A, in microalgos. Required balance is affected by ASA, App, and Box usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes. Changes caused by inner transactions or box usage are observable immediately following the opcode effecting the change. params: Txn.Accounts offset (or, since v4, an _available_ account address). Return: value. @@ -481,7 +481,7 @@ def setbyte(a: Bytes | bytes, b: UInt64 | int, c: UInt64 | int, /) -> Bytes: """ -def sha256(a: Bytes | bytes, /) -> Bytes: +def sha256(a: Bytes | bytes, /) -> Account: """ SHA256 hash of value A, yields [32]byte @@ -503,7 +503,7 @@ def sha3_256(a: Bytes | bytes, /) -> Bytes: """ -def sha512_256(a: Bytes | bytes, /) -> Bytes: +def sha512_256(a: Bytes | bytes, /) -> Account: """ SHA512_256 hash of value A, yields [32]byte @@ -575,7 +575,7 @@ def vrf_verify( class AcctParamsGet: @staticmethod - def acct_balance(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_balance(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -587,7 +587,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: Account balance in microalgos """ @staticmethod - def acct_min_balance(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_min_balance(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -599,7 +599,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: Minimum required balance for account, in microalgos """ @staticmethod - def acct_auth_addr(a: Address | UInt64 | int, /) -> tuple[Address, bool]: + def acct_auth_addr(a: Account | UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -608,10 +608,10 @@ class AcctParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: acct_params_get F - :returns tuple[Address, bool]: Address the account is rekeyed to. + :returns tuple[Account, bool]: Address the account is rekeyed to. """ @staticmethod - def acct_total_num_uint(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_num_uint(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -623,7 +623,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The total number of uint64 values allocated by this account in Global and Local States. """ @staticmethod - def acct_total_num_byte_slice(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_num_byte_slice(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -635,7 +635,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The total number of byte array values allocated by this account in Global and Local States. """ @staticmethod - def acct_total_extra_app_pages(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_extra_app_pages(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -647,7 +647,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The number of extra app code pages used by this account. """ @staticmethod - def acct_total_apps_created(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_apps_created(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -659,7 +659,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The number of existing apps created by this account. """ @staticmethod - def acct_total_apps_opted_in(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_apps_opted_in(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -671,7 +671,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The number of apps this account is opted into. """ @staticmethod - def acct_total_assets_created(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_assets_created(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -683,7 +683,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The number of existing ASAs created by this account. """ @staticmethod - def acct_total_assets(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_assets(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -695,7 +695,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The numbers of ASAs held by this account (including ASAs this account created). """ @staticmethod - def acct_total_boxes(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_boxes(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -707,7 +707,7 @@ class AcctParamsGet: :returns tuple[UInt64, bool]: The number of existing boxes created by this account's app. """ @staticmethod - def acct_total_box_bytes(a: Address | UInt64 | int, /) -> tuple[UInt64, bool]: + def acct_total_box_bytes(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A. Y is 1 if A owns positive algos, else 0 @@ -796,7 +796,7 @@ class AppGlobals: class AppLocals: @staticmethod - def get_bytes(a: Address | UInt64 | int, b: Bytes | bytes, /) -> Bytes: + def get_bytes(a: Account | UInt64 | int, b: Bytes | bytes, /) -> Bytes: """ local state of the key B in the current application in account A params: Txn.Accounts offset (or, since v4, an _available_ account address), state key. Return: value. The value is zero (of type uint64) if the key does not exist. @@ -808,7 +808,7 @@ class AppLocals: """ @staticmethod - def get_uint64(a: Address | UInt64 | int, b: Bytes | bytes, /) -> UInt64: + def get_uint64(a: Account | UInt64 | int, b: Bytes | bytes, /) -> UInt64: """ local state of the key B in the current application in account A params: Txn.Accounts offset (or, since v4, an _available_ account address), state key. Return: value. The value is zero (of type uint64) if the key does not exist. @@ -821,7 +821,7 @@ class AppLocals: """ @staticmethod def get_ex_bytes( - a: Address | UInt64 | int, b: UInt64 | int, c: Bytes | bytes, / + a: Account | UInt64 | int, b: UInt64 | int, c: Bytes | bytes, / ) -> tuple[Bytes, bool]: """ X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 @@ -835,7 +835,7 @@ class AppLocals: """ @staticmethod def get_ex_uint64( - a: Address | UInt64 | int, b: UInt64 | int, c: Bytes | bytes, / + a: Account | UInt64 | int, b: UInt64 | int, c: Bytes | bytes, / ) -> tuple[UInt64, bool]: """ X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 @@ -848,7 +848,7 @@ class AppLocals: """ @staticmethod - def delete(a: Address | UInt64 | int, b: Bytes | bytes, /) -> None: + def delete(a: Account | UInt64 | int, b: Bytes | bytes, /) -> None: """ delete key B from account A's local state of the current application params: Txn.Accounts offset (or, since v4, an _available_ account address), state key. @@ -863,7 +863,7 @@ class AppLocals: """ @staticmethod def put( - a: Address | UInt64 | int, b: Bytes | bytes, c: Bytes | bytes | UInt64 | int, / + a: Account | UInt64 | int, b: Bytes | bytes, c: Bytes | bytes | UInt64 | int, / ) -> None: """ write C to key B in account A's local state of the current application @@ -969,7 +969,7 @@ class AppParamsGet: :returns tuple[UInt64, bool]: Number of Extra Program Pages of code space """ @staticmethod - def app_creator(a: UInt64 | int, /) -> tuple[Address, bool]: + def app_creator(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from app A. Y is 1 if A exists, else 0 params: Txn.ForeignApps offset or an _available_ app id. Return: did_exist flag (1 if the application existed and 0 otherwise), value. @@ -979,10 +979,10 @@ class AppParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: app_params_get F - :returns tuple[Address, bool]: Creator address + :returns tuple[Account, bool]: Creator address """ @staticmethod - def app_address(a: UInt64 | int, /) -> tuple[Address, bool]: + def app_address(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from app A. Y is 1 if A exists, else 0 params: Txn.ForeignApps offset or an _available_ app id. Return: did_exist flag (1 if the application existed and 0 otherwise), value. @@ -992,12 +992,12 @@ class AppParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: app_params_get F - :returns tuple[Address, bool]: Address for which this application has authority + :returns tuple[Account, bool]: Address for which this application has authority """ class AssetHoldingGet: @staticmethod - def asset_balance(a: Address | UInt64 | int, b: UInt64 | int, /) -> tuple[UInt64, bool]: + def asset_balance(a: Account | UInt64 | int, b: UInt64 | int, /) -> tuple[UInt64, bool]: """ X is field F from account A's holding of asset B. Y is 1 if A is opted into B, else 0 params: Txn.Accounts offset (or, since v4, an _available_ address), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1010,7 +1010,7 @@ class AssetHoldingGet: :returns tuple[UInt64, bool]: Amount of the asset unit held by this account """ @staticmethod - def asset_frozen(a: Address | UInt64 | int, b: UInt64 | int, /) -> tuple[bool, bool]: + def asset_frozen(a: Account | UInt64 | int, b: UInt64 | int, /) -> tuple[bool, bool]: """ X is field F from account A's holding of asset B. Y is 1 if A is opted into B, else 0 params: Txn.Accounts offset (or, since v4, an _available_ address), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1103,7 +1103,7 @@ class AssetParamsGet: :returns tuple[Bytes, bool]: URL with additional info about the asset """ @staticmethod - def asset_metadata_hash(a: UInt64 | int, /) -> tuple[Bytes, bool]: + def asset_metadata_hash(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1113,10 +1113,10 @@ class AssetParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: asset_params_get F - :returns tuple[Bytes, bool]: Arbitrary commitment + :returns tuple[Account, bool]: Arbitrary commitment """ @staticmethod - def asset_manager(a: UInt64 | int, /) -> tuple[Address, bool]: + def asset_manager(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1126,10 +1126,10 @@ class AssetParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: asset_params_get F - :returns tuple[Address, bool]: Manager address + :returns tuple[Account, bool]: Manager address """ @staticmethod - def asset_reserve(a: UInt64 | int, /) -> tuple[Address, bool]: + def asset_reserve(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1139,10 +1139,10 @@ class AssetParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: asset_params_get F - :returns tuple[Address, bool]: Reserve address + :returns tuple[Account, bool]: Reserve address """ @staticmethod - def asset_freeze(a: UInt64 | int, /) -> tuple[Address, bool]: + def asset_freeze(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1152,10 +1152,10 @@ class AssetParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: asset_params_get F - :returns tuple[Address, bool]: Freeze address + :returns tuple[Account, bool]: Freeze address """ @staticmethod - def asset_clawback(a: UInt64 | int, /) -> tuple[Address, bool]: + def asset_clawback(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1165,10 +1165,10 @@ class AssetParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: asset_params_get F - :returns tuple[Address, bool]: Clawback address + :returns tuple[Account, bool]: Clawback address """ @staticmethod - def asset_creator(a: UInt64 | int, /) -> tuple[Address, bool]: + def asset_creator(a: UInt64 | int, /) -> tuple[Account, bool]: """ X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value. @@ -1178,7 +1178,7 @@ class AssetParamsGet: Stack: [..., A] -> [..., X, Y] TEAL: asset_params_get F - :returns tuple[Address, bool]: Creator address + :returns tuple[Account, bool]: Creator address """ class Block: @@ -1325,7 +1325,7 @@ class CreateInnerTransaction: """ @staticmethod - def set_sender(a: Address, /) -> None: + def set_sender(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1335,7 +1335,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod def set_fee(a: UInt64 | int, /) -> None: @@ -1364,7 +1364,7 @@ class CreateInnerTransaction: :param Bytes | bytes a: Any data up to 1024 bytes """ @staticmethod - def set_receiver(a: Address, /) -> None: + def set_receiver(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1374,7 +1374,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod def set_amount(a: UInt64 | int, /) -> None: @@ -1390,7 +1390,7 @@ class CreateInnerTransaction: :param UInt64 | int a: microalgos """ @staticmethod - def set_close_remainder_to(a: Address, /) -> None: + def set_close_remainder_to(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1400,10 +1400,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod - def set_vote_pk(a: Bytes | bytes | Address, /) -> None: + def set_vote_pk(a: Bytes | bytes | Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1413,10 +1413,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Bytes | bytes | Address a: 32 byte address + :param Bytes | bytes | Account a: 32 byte address """ @staticmethod - def set_selection_pk(a: Bytes | bytes | Address, /) -> None: + def set_selection_pk(a: Bytes | bytes | Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1426,7 +1426,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Bytes | bytes | Address a: 32 byte address + :param Bytes | bytes | Account a: 32 byte address """ @staticmethod def set_vote_first(a: UInt64 | int, /) -> None: @@ -1520,7 +1520,7 @@ class CreateInnerTransaction: :param UInt64 | int a: value in Asset's units """ @staticmethod - def set_asset_sender(a: Address, /) -> None: + def set_asset_sender(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1530,10 +1530,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address. Source of assets if Sender is the Asset's Clawback address. + :param Account a: 32 byte address. Source of assets if Sender is the Asset's Clawback address. """ @staticmethod - def set_asset_receiver(a: Address, /) -> None: + def set_asset_receiver(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1543,10 +1543,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod - def set_asset_close_to(a: Address, /) -> None: + def set_asset_close_to(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1556,7 +1556,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod def set_application_id(a: UInt64 | int, /) -> None: @@ -1598,7 +1598,7 @@ class CreateInnerTransaction: :param Bytes | bytes a: Arguments passed to the application in the ApplicationCall transaction """ @staticmethod - def set_accounts(a: Address, /) -> None: + def set_accounts(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1608,7 +1608,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: Accounts listed in the ApplicationCall transaction + :param Account a: Accounts listed in the ApplicationCall transaction """ @staticmethod def set_approval_program(a: Bytes | bytes, /) -> None: @@ -1637,7 +1637,7 @@ class CreateInnerTransaction: :param Bytes | bytes a: Clear state program """ @staticmethod - def set_rekey_to(a: Address, /) -> None: + def set_rekey_to(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1647,7 +1647,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte Sender's new AuthAddr + :param Account a: 32 byte Sender's new AuthAddr """ @staticmethod def set_config_asset(a: UInt64 | int, /) -> None: @@ -1741,7 +1741,7 @@ class CreateInnerTransaction: :param Bytes | bytes a: URL """ @staticmethod - def set_config_asset_metadata_hash(a: Bytes | bytes | Address, /) -> None: + def set_config_asset_metadata_hash(a: Bytes | bytes | Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1751,10 +1751,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Bytes | bytes | Address a: 32 byte commitment to unspecified asset metadata + :param Bytes | bytes | Account a: 32 byte commitment to unspecified asset metadata """ @staticmethod - def set_config_asset_manager(a: Address, /) -> None: + def set_config_asset_manager(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1764,10 +1764,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod - def set_config_asset_reserve(a: Address, /) -> None: + def set_config_asset_reserve(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1777,10 +1777,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod - def set_config_asset_freeze(a: Address, /) -> None: + def set_config_asset_freeze(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1790,10 +1790,10 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod - def set_config_asset_clawback(a: Address, /) -> None: + def set_config_asset_clawback(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1803,7 +1803,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address + :param Account a: 32 byte address """ @staticmethod def set_freeze_asset(a: UInt64 | int, /) -> None: @@ -1819,7 +1819,7 @@ class CreateInnerTransaction: :param UInt64 | int a: Asset ID being frozen or un-frozen """ @staticmethod - def set_freeze_asset_account(a: Address, /) -> None: + def set_freeze_asset_account(a: Account, /) -> None: """ set field F of the current inner transaction to A `itxn_field` fails if A is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if A is an account, asset, or app that is not _available_, or an attempt is made extend an array field beyond the limit imposed by consensus parameters. (Addresses set into asset params of acfg transactions need not be _available_.) @@ -1829,7 +1829,7 @@ class CreateInnerTransaction: Stack: [..., A] -> [...] TEAL: itxn_field F - :param Address a: 32 byte address of the account whose asset slot is being frozen or un-frozen + :param Account a: 32 byte address of the account whose asset slot is being frozen or un-frozen """ @staticmethod def set_freeze_asset_frozen(a: bool | UInt64 | int, /) -> None: @@ -2026,7 +2026,7 @@ class Global: :returns UInt64: rounds """ @staticmethod - def zero_address() -> Address: + def zero_address() -> Account: """ global field F @@ -2035,7 +2035,7 @@ class Global: Stack: [...] -> [..., X] TEAL: global F - :returns Address: 32 byte address of all zero bytes + :returns Account: 32 byte address of all zero bytes """ @staticmethod def group_size() -> UInt64: @@ -2098,7 +2098,7 @@ class Global: :returns UInt64: ID of current application executing. Application mode only. """ @staticmethod - def creator_address() -> Address: + def creator_address() -> Account: """ global field F @@ -2107,10 +2107,10 @@ class Global: Stack: [...] -> [..., X] TEAL: global F - :returns Address: Address of the creator of the current application. Application mode only. + :returns Account: Address of the creator of the current application. Application mode only. """ @staticmethod - def current_application_address() -> Address: + def current_application_address() -> Account: """ global field F @@ -2119,10 +2119,10 @@ class Global: Stack: [...] -> [..., X] TEAL: global F - :returns Address: Address that the current application controls. Application mode only. + :returns Account: Address that the current application controls. Application mode only. """ @staticmethod - def group_id() -> Bytes: + def group_id() -> Account: """ global field F @@ -2131,7 +2131,7 @@ class Global: Stack: [...] -> [..., X] TEAL: global F - :returns Bytes: ID of the transaction group. 32 zero bytes if the transaction is not part of a group. + :returns Account: ID of the transaction group. 32 zero bytes if the transaction is not part of a group. """ @staticmethod def opcode_budget() -> UInt64: @@ -2158,7 +2158,7 @@ class Global: :returns UInt64: The application ID of the application that called this application. 0 if this application is at the top-level. Application mode only. """ @staticmethod - def caller_application_address() -> Address: + def caller_application_address() -> Account: """ global field F @@ -2167,12 +2167,12 @@ class Global: Stack: [...] -> [..., X] TEAL: global F - :returns Address: The application address of the application that called this application. ZeroAddress if this application is at the top-level. Application mode only. + :returns Account: The application address of the application that called this application. ZeroAddress if this application is at the top-level. Application mode only. """ class InnerTransaction: @staticmethod - def sender() -> Address: + def sender() -> Account: """ field F of the last inner transaction @@ -2181,7 +2181,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def fee() -> UInt64: @@ -2244,7 +2244,7 @@ class InnerTransaction: :returns Bytes: Any data up to 1024 bytes """ @staticmethod - def lease() -> Bytes: + def lease() -> Account: """ field F of the last inner transaction @@ -2253,10 +2253,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Bytes: 32 byte lease value + :returns Account: 32 byte lease value """ @staticmethod - def receiver() -> Address: + def receiver() -> Account: """ field F of the last inner transaction @@ -2265,7 +2265,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def amount() -> UInt64: @@ -2280,7 +2280,7 @@ class InnerTransaction: :returns UInt64: microalgos """ @staticmethod - def close_remainder_to() -> Address: + def close_remainder_to() -> Account: """ field F of the last inner transaction @@ -2289,10 +2289,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def vote_pk() -> Bytes: + def vote_pk() -> Account: """ field F of the last inner transaction @@ -2301,10 +2301,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def selection_pk() -> Bytes: + def selection_pk() -> Account: """ field F of the last inner transaction @@ -2313,7 +2313,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod def vote_first() -> UInt64: @@ -2400,7 +2400,7 @@ class InnerTransaction: :returns UInt64: value in Asset's units """ @staticmethod - def asset_sender() -> Address: + def asset_sender() -> Account: """ field F of the last inner transaction @@ -2409,10 +2409,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address. Source of assets if Sender is the Asset's Clawback address. + :returns Account: 32 byte address. Source of assets if Sender is the Asset's Clawback address. """ @staticmethod - def asset_receiver() -> Address: + def asset_receiver() -> Account: """ field F of the last inner transaction @@ -2421,10 +2421,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def asset_close_to() -> Address: + def asset_close_to() -> Account: """ field F of the last inner transaction @@ -2433,7 +2433,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def group_index() -> UInt64: @@ -2448,7 +2448,7 @@ class InnerTransaction: :returns UInt64: Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1 """ @staticmethod - def tx_id() -> Bytes: + def tx_id() -> Account: """ field F of the last inner transaction @@ -2457,7 +2457,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Bytes: The computed ID for this transaction. 32 bytes. + :returns Account: The computed ID for this transaction. 32 bytes. """ @staticmethod def application_id() -> UInt64: @@ -2508,7 +2508,7 @@ class InnerTransaction: :returns UInt64: Number of ApplicationArgs """ @staticmethod - def accounts(a: UInt64 | int, /) -> Address: + def accounts(a: UInt64 | int, /) -> Account: """ Ath value of the array field F of the last inner transaction @@ -2517,7 +2517,7 @@ class InnerTransaction: Stack: [..., A] -> [..., X] TEAL: itxnas F - :returns Address: Accounts listed in the ApplicationCall transaction + :returns Account: Accounts listed in the ApplicationCall transaction """ @staticmethod def num_accounts() -> UInt64: @@ -2556,7 +2556,7 @@ class InnerTransaction: :returns Bytes: Clear state program """ @staticmethod - def rekey_to() -> Address: + def rekey_to() -> Account: """ field F of the last inner transaction @@ -2565,7 +2565,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte Sender's new AuthAddr + :returns Account: 32 byte Sender's new AuthAddr """ @staticmethod def config_asset() -> UInt64: @@ -2652,7 +2652,7 @@ class InnerTransaction: :returns Bytes: URL """ @staticmethod - def config_asset_metadata_hash() -> Bytes: + def config_asset_metadata_hash() -> Account: """ field F of the last inner transaction @@ -2661,10 +2661,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Bytes: 32 byte commitment to unspecified asset metadata + :returns Account: 32 byte commitment to unspecified asset metadata """ @staticmethod - def config_asset_manager() -> Address: + def config_asset_manager() -> Account: """ field F of the last inner transaction @@ -2673,10 +2673,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_reserve() -> Address: + def config_asset_reserve() -> Account: """ field F of the last inner transaction @@ -2685,10 +2685,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_freeze() -> Address: + def config_asset_freeze() -> Account: """ field F of the last inner transaction @@ -2697,10 +2697,10 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_clawback() -> Address: + def config_asset_clawback() -> Account: """ field F of the last inner transaction @@ -2709,7 +2709,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def freeze_asset() -> UInt64: @@ -2724,7 +2724,7 @@ class InnerTransaction: :returns UInt64: Asset ID being frozen or un-frozen """ @staticmethod - def freeze_asset_account() -> Address: + def freeze_asset_account() -> Account: """ field F of the last inner transaction @@ -2733,7 +2733,7 @@ class InnerTransaction: Stack: [...] -> [..., X] TEAL: itxn F - :returns Address: 32 byte address of the account whose asset slot is being frozen or un-frozen + :returns Account: 32 byte address of the account whose asset slot is being frozen or un-frozen """ @staticmethod def freeze_asset_frozen() -> bool: @@ -2990,7 +2990,7 @@ class InnerTransaction: class InnerTransactionGroup: @staticmethod - def sender(t: int, /) -> Address: + def sender(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3000,7 +3000,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def fee(t: int, /) -> UInt64: @@ -3068,7 +3068,7 @@ class InnerTransactionGroup: :returns Bytes: Any data up to 1024 bytes """ @staticmethod - def lease(t: int, /) -> Bytes: + def lease(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3078,10 +3078,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Bytes: 32 byte lease value + :returns Account: 32 byte lease value """ @staticmethod - def receiver(t: int, /) -> Address: + def receiver(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3091,7 +3091,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def amount(t: int, /) -> UInt64: @@ -3107,7 +3107,7 @@ class InnerTransactionGroup: :returns UInt64: microalgos """ @staticmethod - def close_remainder_to(t: int, /) -> Address: + def close_remainder_to(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3117,10 +3117,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def vote_pk(t: int, /) -> Bytes: + def vote_pk(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3130,10 +3130,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def selection_pk(t: int, /) -> Bytes: + def selection_pk(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3143,7 +3143,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod def vote_first(t: int, /) -> UInt64: @@ -3237,7 +3237,7 @@ class InnerTransactionGroup: :returns UInt64: value in Asset's units """ @staticmethod - def asset_sender(t: int, /) -> Address: + def asset_sender(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3247,10 +3247,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address. Source of assets if Sender is the Asset's Clawback address. + :returns Account: 32 byte address. Source of assets if Sender is the Asset's Clawback address. """ @staticmethod - def asset_receiver(t: int, /) -> Address: + def asset_receiver(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3260,10 +3260,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def asset_close_to(t: int, /) -> Address: + def asset_close_to(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3273,7 +3273,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def group_index(t: int, /) -> UInt64: @@ -3289,7 +3289,7 @@ class InnerTransactionGroup: :returns UInt64: Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1 """ @staticmethod - def tx_id(t: int, /) -> Bytes: + def tx_id(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3299,7 +3299,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Bytes: The computed ID for this transaction. 32 bytes. + :returns Account: The computed ID for this transaction. 32 bytes. """ @staticmethod def application_id(t: int, /) -> UInt64: @@ -3354,7 +3354,7 @@ class InnerTransactionGroup: :returns UInt64: Number of ApplicationArgs """ @staticmethod - def accounts(t: int, a: UInt64 | int, /) -> Address: + def accounts(t: int, a: UInt64 | int, /) -> Account: """ Ath value of the array field F from the Tth transaction in the last inner group submitted @@ -3364,7 +3364,7 @@ class InnerTransactionGroup: TEAL: gitxnas T F :param int t: transaction group index - :returns Address: Accounts listed in the ApplicationCall transaction + :returns Account: Accounts listed in the ApplicationCall transaction """ @staticmethod def num_accounts(t: int, /) -> UInt64: @@ -3406,7 +3406,7 @@ class InnerTransactionGroup: :returns Bytes: Clear state program """ @staticmethod - def rekey_to(t: int, /) -> Address: + def rekey_to(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3416,7 +3416,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte Sender's new AuthAddr + :returns Account: 32 byte Sender's new AuthAddr """ @staticmethod def config_asset(t: int, /) -> UInt64: @@ -3510,7 +3510,7 @@ class InnerTransactionGroup: :returns Bytes: URL """ @staticmethod - def config_asset_metadata_hash(t: int, /) -> Bytes: + def config_asset_metadata_hash(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3520,10 +3520,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Bytes: 32 byte commitment to unspecified asset metadata + :returns Account: 32 byte commitment to unspecified asset metadata """ @staticmethod - def config_asset_manager(t: int, /) -> Address: + def config_asset_manager(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3533,10 +3533,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_reserve(t: int, /) -> Address: + def config_asset_reserve(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3546,10 +3546,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_freeze(t: int, /) -> Address: + def config_asset_freeze(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3559,10 +3559,10 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_clawback(t: int, /) -> Address: + def config_asset_clawback(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3572,7 +3572,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def freeze_asset(t: int, /) -> UInt64: @@ -3588,7 +3588,7 @@ class InnerTransactionGroup: :returns UInt64: Asset ID being frozen or un-frozen """ @staticmethod - def freeze_asset_account(t: int, /) -> Address: + def freeze_asset_account(t: int, /) -> Account: """ field F of the Tth transaction in the last inner group submitted @@ -3598,7 +3598,7 @@ class InnerTransactionGroup: TEAL: gitxn T F :param int t: transaction group index - :returns Address: 32 byte address of the account whose asset slot is being frozen or un-frozen + :returns Account: 32 byte address of the account whose asset slot is being frozen or un-frozen """ @staticmethod def freeze_asset_frozen(t: int, /) -> bool: @@ -3920,7 +3920,7 @@ class JsonRef: class Transaction: @staticmethod - def sender() -> Address: + def sender() -> Account: """ field F of current transaction @@ -3929,7 +3929,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def fee() -> UInt64: @@ -3992,7 +3992,7 @@ class Transaction: :returns Bytes: Any data up to 1024 bytes """ @staticmethod - def lease() -> Bytes: + def lease() -> Account: """ field F of current transaction @@ -4001,10 +4001,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Bytes: 32 byte lease value + :returns Account: 32 byte lease value """ @staticmethod - def receiver() -> Address: + def receiver() -> Account: """ field F of current transaction @@ -4013,7 +4013,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def amount() -> UInt64: @@ -4028,7 +4028,7 @@ class Transaction: :returns UInt64: microalgos """ @staticmethod - def close_remainder_to() -> Address: + def close_remainder_to() -> Account: """ field F of current transaction @@ -4037,10 +4037,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def vote_pk() -> Bytes: + def vote_pk() -> Account: """ field F of current transaction @@ -4049,10 +4049,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def selection_pk() -> Bytes: + def selection_pk() -> Account: """ field F of current transaction @@ -4061,7 +4061,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod def vote_first() -> UInt64: @@ -4148,7 +4148,7 @@ class Transaction: :returns UInt64: value in Asset's units """ @staticmethod - def asset_sender() -> Address: + def asset_sender() -> Account: """ field F of current transaction @@ -4157,10 +4157,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address. Source of assets if Sender is the Asset's Clawback address. + :returns Account: 32 byte address. Source of assets if Sender is the Asset's Clawback address. """ @staticmethod - def asset_receiver() -> Address: + def asset_receiver() -> Account: """ field F of current transaction @@ -4169,10 +4169,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def asset_close_to() -> Address: + def asset_close_to() -> Account: """ field F of current transaction @@ -4181,7 +4181,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def group_index() -> UInt64: @@ -4196,7 +4196,7 @@ class Transaction: :returns UInt64: Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1 """ @staticmethod - def tx_id() -> Bytes: + def tx_id() -> Account: """ field F of current transaction @@ -4205,7 +4205,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Bytes: The computed ID for this transaction. 32 bytes. + :returns Account: The computed ID for this transaction. 32 bytes. """ @staticmethod def application_id() -> UInt64: @@ -4256,7 +4256,7 @@ class Transaction: :returns UInt64: Number of ApplicationArgs """ @staticmethod - def accounts(a: UInt64 | int, /) -> Address: + def accounts(a: UInt64 | int, /) -> Account: """ Ath value of the array field F of the current transaction @@ -4265,7 +4265,7 @@ class Transaction: Stack: [..., A] -> [..., X] TEAL: txnas F - :returns Address: Accounts listed in the ApplicationCall transaction + :returns Account: Accounts listed in the ApplicationCall transaction """ @staticmethod def num_accounts() -> UInt64: @@ -4304,7 +4304,7 @@ class Transaction: :returns Bytes: Clear state program """ @staticmethod - def rekey_to() -> Address: + def rekey_to() -> Account: """ field F of current transaction @@ -4313,7 +4313,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte Sender's new AuthAddr + :returns Account: 32 byte Sender's new AuthAddr """ @staticmethod def config_asset() -> UInt64: @@ -4400,7 +4400,7 @@ class Transaction: :returns Bytes: URL """ @staticmethod - def config_asset_metadata_hash() -> Bytes: + def config_asset_metadata_hash() -> Account: """ field F of current transaction @@ -4409,10 +4409,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Bytes: 32 byte commitment to unspecified asset metadata + :returns Account: 32 byte commitment to unspecified asset metadata """ @staticmethod - def config_asset_manager() -> Address: + def config_asset_manager() -> Account: """ field F of current transaction @@ -4421,10 +4421,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_reserve() -> Address: + def config_asset_reserve() -> Account: """ field F of current transaction @@ -4433,10 +4433,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_freeze() -> Address: + def config_asset_freeze() -> Account: """ field F of current transaction @@ -4445,10 +4445,10 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_clawback() -> Address: + def config_asset_clawback() -> Account: """ field F of current transaction @@ -4457,7 +4457,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def freeze_asset() -> UInt64: @@ -4472,7 +4472,7 @@ class Transaction: :returns UInt64: Asset ID being frozen or un-frozen """ @staticmethod - def freeze_asset_account() -> Address: + def freeze_asset_account() -> Account: """ field F of current transaction @@ -4481,7 +4481,7 @@ class Transaction: Stack: [...] -> [..., X] TEAL: txn F - :returns Address: 32 byte address of the account whose asset slot is being frozen or un-frozen + :returns Account: 32 byte address of the account whose asset slot is being frozen or un-frozen """ @staticmethod def freeze_asset_frozen() -> bool: @@ -4738,7 +4738,7 @@ class Transaction: class TransactionGroup: @staticmethod - def sender(a: UInt64 | int, /) -> Address: + def sender(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -4748,7 +4748,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def fee(a: UInt64 | int, /) -> UInt64: @@ -4816,7 +4816,7 @@ class TransactionGroup: :returns Bytes: Any data up to 1024 bytes """ @staticmethod - def lease(a: UInt64 | int, /) -> Bytes: + def lease(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -4826,10 +4826,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Bytes: 32 byte lease value + :returns Account: 32 byte lease value """ @staticmethod - def receiver(a: UInt64 | int, /) -> Address: + def receiver(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -4839,7 +4839,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def amount(a: UInt64 | int, /) -> UInt64: @@ -4855,7 +4855,7 @@ class TransactionGroup: :returns UInt64: microalgos """ @staticmethod - def close_remainder_to(a: UInt64 | int, /) -> Address: + def close_remainder_to(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -4865,10 +4865,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def vote_pk(a: UInt64 | int, /) -> Bytes: + def vote_pk(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -4878,10 +4878,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def selection_pk(a: UInt64 | int, /) -> Bytes: + def selection_pk(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -4891,7 +4891,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Bytes: 32 byte address + :returns Account: 32 byte address """ @staticmethod def vote_first(a: UInt64 | int, /) -> UInt64: @@ -4985,7 +4985,7 @@ class TransactionGroup: :returns UInt64: value in Asset's units """ @staticmethod - def asset_sender(a: UInt64 | int, /) -> Address: + def asset_sender(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -4995,10 +4995,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address. Source of assets if Sender is the Asset's Clawback address. + :returns Account: 32 byte address. Source of assets if Sender is the Asset's Clawback address. """ @staticmethod - def asset_receiver(a: UInt64 | int, /) -> Address: + def asset_receiver(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5008,10 +5008,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def asset_close_to(a: UInt64 | int, /) -> Address: + def asset_close_to(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5021,7 +5021,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def group_index(a: UInt64 | int, /) -> UInt64: @@ -5037,7 +5037,7 @@ class TransactionGroup: :returns UInt64: Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1 """ @staticmethod - def tx_id(a: UInt64 | int, /) -> Bytes: + def tx_id(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5047,7 +5047,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Bytes: The computed ID for this transaction. 32 bytes. + :returns Account: The computed ID for this transaction. 32 bytes. """ @staticmethod def application_id(a: UInt64 | int, /) -> UInt64: @@ -5101,7 +5101,7 @@ class TransactionGroup: :returns UInt64: Number of ApplicationArgs """ @staticmethod - def accounts(a: UInt64 | int, b: UInt64 | int, /) -> Address: + def accounts(a: UInt64 | int, b: UInt64 | int, /) -> Account: """ Bth value of the array field F from the Ath transaction in the current group @@ -5110,7 +5110,7 @@ class TransactionGroup: Stack: [..., A, B] -> [..., X] TEAL: gtxnsas F - :returns Address: Accounts listed in the ApplicationCall transaction + :returns Account: Accounts listed in the ApplicationCall transaction """ @staticmethod def num_accounts(a: UInt64 | int, /) -> UInt64: @@ -5152,7 +5152,7 @@ class TransactionGroup: :returns Bytes: Clear state program """ @staticmethod - def rekey_to(a: UInt64 | int, /) -> Address: + def rekey_to(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5162,7 +5162,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte Sender's new AuthAddr + :returns Account: 32 byte Sender's new AuthAddr """ @staticmethod def config_asset(a: UInt64 | int, /) -> UInt64: @@ -5256,7 +5256,7 @@ class TransactionGroup: :returns Bytes: URL """ @staticmethod - def config_asset_metadata_hash(a: UInt64 | int, /) -> Bytes: + def config_asset_metadata_hash(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5266,10 +5266,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Bytes: 32 byte commitment to unspecified asset metadata + :returns Account: 32 byte commitment to unspecified asset metadata """ @staticmethod - def config_asset_manager(a: UInt64 | int, /) -> Address: + def config_asset_manager(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5279,10 +5279,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_reserve(a: UInt64 | int, /) -> Address: + def config_asset_reserve(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5292,10 +5292,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_freeze(a: UInt64 | int, /) -> Address: + def config_asset_freeze(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5305,10 +5305,10 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod - def config_asset_clawback(a: UInt64 | int, /) -> Address: + def config_asset_clawback(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5318,7 +5318,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address + :returns Account: 32 byte address """ @staticmethod def freeze_asset(a: UInt64 | int, /) -> UInt64: @@ -5334,7 +5334,7 @@ class TransactionGroup: :returns UInt64: Asset ID being frozen or un-frozen """ @staticmethod - def freeze_asset_account(a: UInt64 | int, /) -> Address: + def freeze_asset_account(a: UInt64 | int, /) -> Account: """ field F of the Ath transaction in the current group for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction. @@ -5344,7 +5344,7 @@ class TransactionGroup: Stack: [..., A] -> [..., X] TEAL: gtxns F - :returns Address: 32 byte address of the account whose asset slot is being frozen or un-frozen + :returns Account: 32 byte address of the account whose asset slot is being frozen or un-frozen """ @staticmethod def freeze_asset_frozen(a: UInt64 | int, /) -> bool: diff --git a/src/algopy-stubs/_primitives.pyi b/src/algopy-stubs/_primitives.pyi index 041590f8b3..f189d0628b 100644 --- a/src/algopy-stubs/_primitives.pyi +++ b/src/algopy-stubs/_primitives.pyi @@ -72,6 +72,9 @@ class UInt64: # used to turn this into an index e.g. to a list class Bytes(t.Iterable[Bytes]): + @t.overload + def __init__(self) -> None: ... + @t.overload def __init__(self, value: bytes, /): ... @staticmethod def from_base32(value: t.LiteralString, /) -> Bytes: ... @@ -93,8 +96,8 @@ class Bytes(t.Iterable[Bytes]): def __iter__(self) -> t.Iterator[Bytes]: ... # mypy suggests due to Liskov below should be other: object # need to consider ramifications here, ignoring it for now - def __eq__(self, other: Bytes | bytes | Address) -> bool: ... # type: ignore[override] - def __ne__(self, other: Bytes | bytes | Address) -> bool: ... # type: ignore[override] + def __eq__(self, other: Bytes | bytes) -> bool: ... # type: ignore[override] + def __ne__(self, other: Bytes | bytes) -> bool: ... # type: ignore[override] # bitwise operators # & def __and__(self, other: Bytes | bytes) -> Bytes: ... @@ -168,39 +171,3 @@ class BigUInt: @classmethod def from_bytes(cls, value: Bytes) -> BigUInt: """no validation happens here wrt length""" - -class Address: - """Address is a Bytes that should be exactly len() == 32 - - Note that Bytes are immutable objects, so this being a subclass of Bytes - should be okay and won't allow violating this invariant. - """ - - def __init__(self, value: t.LiteralString, /): - """ - `value` should be a 58 character base32 string, - ie a base32 string-encoded 32 bytes public key + 4 bytes checksum - """ - def __eq__(self, other: Address | Bytes | bytes | t.LiteralString) -> bool: ... # type: ignore[override] - def __ne__(self, other: Address | Bytes | bytes | t.LiteralString) -> bool: ... # type: ignore[override] - @property - def bytes(self) -> Bytes: - """Get the byte[] backing this value. Note that Bytes is immutable""" - @staticmethod - def from_bytes(value: Bytes) -> Address: - """no validation happens here wrt length""" - -class Asset: - def __init__(self, asset_id: UInt64 | int): ... - @property - def asset_id(self) -> UInt64: ... - def __eq__(self, other: Asset) -> bool: ... # type: ignore[override] - def __ne__(self, other: Asset) -> bool: ... # type: ignore[override] - - # truthiness - def __bool__(self) -> bool: ... # returns True iff asset_id > 0 - # @abc.abstractmethod - # def holding(self, account: Account) -> AssetHolding: ... - # @abc.abstractmethod - # @property - # def params(self) -> AssetParams: ... diff --git a/src/algopy-stubs/_reference.pyi b/src/algopy-stubs/_reference.pyi new file mode 100644 index 0000000000..26c4f795af --- /dev/null +++ b/src/algopy-stubs/_reference.pyi @@ -0,0 +1,143 @@ +import typing as t + +from algopy import Bytes, UInt64 + +class Account: + def __init__(self, address: t.LiteralString): + """ + `value` should be a 58 character base32 string, + ie a base32 string-encoded 32 bytes public key + 4 bytes checksum + """ + def __eq__(self, other: Account | t.LiteralString) -> bool: ... # type: ignore[override] + def __ne__(self, other: Account | t.LiteralString) -> bool: ... # type: ignore[override] + # truthiness + def __bool__(self) -> bool: ... # returns True iff not equal to the zero address + @property + def bytes(self) -> Bytes: + """Get the byte[] backing this value. Note that Bytes is immutable""" + @staticmethod + def from_bytes(value: Bytes) -> Account: + """no validation happens here wrt length""" + @property + def balance(self) -> UInt64: + """Account balance in microalgos""" + @property + def min_balance(self) -> UInt64: + """Minimum required balance for account, in microalgos""" + @property + def auth_address(self) -> Account: + """Address the account is rekeyed to""" + @property + def total_num_uint(self) -> UInt64: + """The total number of uint64 values allocated by this account in Global and Local States.""" + @property + def total_num_byte_slice(self) -> Bytes: + """The total number of byte array values allocated by this account in Global and Local States.""" + @property + def total_extra_app_pages(self) -> UInt64: + """The number of extra app code pages used by this account.""" + @property + def total_apps_created(self) -> UInt64: + """The number of existing apps created by this account.""" + @property + def total_apps_opted_in(self) -> UInt64: + """The number of apps this account is opted into.""" + @property + def total_assets_created(self) -> UInt64: + """The number of existing ASAs created by this account.""" + @property + def total_assets(self) -> UInt64: + """The numbers of ASAs held by this account (including ASAs this account created).""" + @property + def total_boxes(self) -> UInt64: + """The number of existing boxes created by this account's app.""" + @property + def total_box_bytes(self) -> UInt64: + """The total number of bytes used by this account's app's box keys and values.""" + +class Asset: + def __init__(self, asset_id: UInt64 | int): ... + @property + def asset_id(self) -> UInt64: ... + def __eq__(self, other: Asset) -> bool: ... # type: ignore[override] + def __ne__(self, other: Asset) -> bool: ... # type: ignore[override] + + # truthiness + def __bool__(self) -> bool: ... # returns True iff asset_id > 0 + @property + def total(self) -> UInt64: + """Total number of units of this asset""" + @property + def decimals(self) -> UInt64: + """See AssetParams.Decimals""" + @property + def default_frozen(self) -> bool: + """Frozen by default or not""" + @property + def unit_name(self) -> Bytes: + """Asset unit name""" + @property + def name(self) -> Bytes: + """Asset name""" + @property + def url(self) -> Bytes: + """URL with additional info about the asset""" + @property + def metadata_hash(self) -> Bytes: + """Arbitrary commitment""" + @property + def manager(self) -> Account: + """Manager address""" + @property + def reserve(self) -> Account: + """Reserve address""" + @property + def freeze(self) -> Account: + """Freeze address""" + @property + def clawback(self) -> Account: + """Clawback address""" + @property + def creator(self) -> Account: + """Creator address""" + def balance(self, account: Account) -> UInt64: + """Amount of the asset unit held by this account""" + def frozen(self, account: Account) -> bool: + """Is the asset frozen or not""" + +class Application: + def __init__(self, application_id: UInt64 | int): ... + @property + def application_id(self) -> UInt64: ... + def __eq__(self, other: Application) -> bool: ... # type: ignore[override] + def __ne__(self, other: Application) -> bool: ... # type: ignore[override] + + # truthiness + def __bool__(self) -> bool: ... # returns True iff application_id > 0 + @property + def approval_program(self) -> Bytes: + """Bytecode of Approval Program""" + @property + def clear_state_program(self) -> Bytes: + """Bytecode of Clear State Program""" + @property + def global_num_uint(self) -> UInt64: + """Number of uint64 values allowed in Global State""" + @property + def global_num_byte_slice(self) -> UInt64: + """Number of byte array values allowed in Global State""" + @property + def local_num_uint(self) -> UInt64: + """Number of uint64 values allowed in Local State""" + @property + def local_num_byte_slice(self) -> UInt64: + """Number of byte array values allowed in Local State""" + @property + def extra_program_pages(self) -> UInt64: + """Number of Extra Program Pages of code space""" + @property + def creator(self) -> Account: + """Creator address""" + @property + def address(self) -> Account: + """Address for which this application has authority""" diff --git a/src/algopy-stubs/_storage.pyi b/src/algopy-stubs/_storage.pyi index 2747adacb8..df5c477a5f 100644 --- a/src/algopy-stubs/_storage.pyi +++ b/src/algopy-stubs/_storage.pyi @@ -1,6 +1,6 @@ -from typing import Generic, TypeVar, TypeAlias +from typing import Generic, TypeAlias, TypeVar -from algopy._primitives import Address, UInt64 +from algopy import Account, UInt64 _T = TypeVar("_T") @@ -8,9 +8,9 @@ AccountIndex: TypeAlias = UInt64 | int class Local(Generic[_T]): def __init__(self, type_: type[_T], /) -> None: ... - def __getitem__(self, account: Address | AccountIndex) -> _T: ... - def __setitem__(self, account: Address | AccountIndex, value: _T) -> None: ... - def __delitem__(self, account: Address | AccountIndex) -> None: ... - def __contains__(self, account: Address | AccountIndex) -> bool: ... - def get(self, account: Address | AccountIndex, default: _T) -> _T: ... - def maybe(self, account: Address | AccountIndex) -> tuple[_T, bool]: ... + def __getitem__(self, account: Account | AccountIndex) -> _T: ... + def __setitem__(self, account: Account | AccountIndex, value: _T) -> None: ... + def __delitem__(self, account: Account | AccountIndex) -> None: ... + def __contains__(self, account: Account | AccountIndex) -> bool: ... + def get(self, account: Account | AccountIndex, default: _T) -> _T: ... + def maybe(self, account: Account | AccountIndex) -> tuple[_T, bool]: ... diff --git a/src/algopy-stubs/_transactions.pyi b/src/algopy-stubs/_transactions.pyi new file mode 100644 index 0000000000..943a8f1347 --- /dev/null +++ b/src/algopy-stubs/_transactions.pyi @@ -0,0 +1,169 @@ +import typing + +from algopy import Account, Application, Asset, Bytes, OnCompleteAction, TransactionType, UInt64 + +class TransactionBase(typing.Protocol): + def __init__(self, group_index: UInt64 | int): ... + @property + def sender(self) -> Account: ... + @property + def fee(self) -> UInt64: ... + @property + def first_valid(self) -> UInt64: ... + @property + def first_valid_time(self) -> UInt64: ... + @property + def last_valid(self) -> UInt64: ... + @property + def note(self) -> Bytes: ... + @property + def lease(self) -> Bytes: ... + @property + def type_bytes(self) -> Bytes: ... + @property + def type(self) -> TransactionType: ... + @property + def group_index(self) -> UInt64: ... + @property + def txn_id(self) -> Bytes: ... + @property + def rekey_to(self) -> Account: ... + +class PaymentTransaction(TransactionBase): + @property + def receiver(self) -> Account: ... + @property + def amount(self) -> UInt64: ... + @property + def close_remainder_to(self) -> Account: ... + +class KeyRegistrationTransaction(TransactionBase): + @property + def vote_key(self) -> Bytes: ... + @property + def selection_key(self) -> Bytes: ... + @property + def vote_first(self) -> UInt64: ... + @property + def vote_last(self) -> UInt64: ... + @property + def vote_key_dilution(self) -> UInt64: ... + @property + def non_participation(self) -> bool: ... + @property + def state_proof_key(self) -> Bytes: ... + +class AssetConfigTransaction(TransactionBase): + @property + def config_asset(self) -> UInt64: ... + @property + def total(self) -> UInt64: ... + @property + def decimals(self) -> UInt64: ... + @property + def default_frozen(self) -> bool: ... + @property + def unit_name(self) -> Bytes: ... + @property + def asset_name(self) -> Bytes: ... + @property + def url(self) -> Bytes: ... + @property + def metadata_hash(self) -> Bytes: ... + @property + def manager(self) -> Account: ... + @property + def reserve(self) -> Account: ... + @property + def freeze(self) -> Account: ... + @property + def clawback(self) -> Account: ... + +class AssetTransferTransaction(TransactionBase): + @property + def xfer_asset(self) -> Asset: ... + @property + def asset_amount(self) -> UInt64: ... + @property + def asset_sender(self) -> Account: ... + @property + def asset_receiver(self) -> Account: ... + @property + def asset_close_to(self) -> Account: ... + +class AssetFreezeTransaction(TransactionBase): + @property + def freeze_asset(self) -> Asset: ... + @property + def freeze_account(self) -> Account: ... + @property + def frozen(self) -> bool: ... + +class ApplicationCallTransaction(TransactionBase): + @property + def application_id(self) -> UInt64: + """ApplicationID from ApplicationCall transaction""" + @property + def on_completion(self) -> OnCompleteAction: + """ApplicationCall transaction on completion action""" + @property + def num_app_args(self) -> UInt64: + """Number of ApplicationArgs""" + @property + def num_accounts(self) -> UInt64: + """Number of ApplicationArgs""" + @property + def approval_program(self) -> Bytes: + """Approval program""" + @property + def clear_state_program(self) -> Bytes: + """Clear State program""" + @property + def num_assets(self) -> UInt64: + """Number of Assets""" + @property + def num_applications(self) -> UInt64: + """Number of Applications""" + @property + def global_num_uint(self) -> UInt64: + """Number of global state integers in ApplicationCall""" + @property + def global_num_byte_slice(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: + """Number of local state byteslices in ApplicationCall""" + @property + def extra_program_pages(self) -> UInt64: + """Number of additional pages for each of the application's approval and clear state programs. An ExtraProgramPages of 1 means 2048 more total bytes, or 1024 for each program.""" + @property + def last_log(self) -> Bytes: + """The last message emitted. Empty bytes if none were emitted. Application mode only""" + @property + def num_approval_program_pages(self) -> UInt64: + """Number of Approval Program pages""" + @property + def num_clear_state_program_pages(self) -> UInt64: + """Number of Clear State Program pages""" + # TODO: make the following sequences instead? + def application_args(self, index: UInt64 | int) -> Bytes: + """Arguments passed to the application in the ApplicationCall transaction""" + def accounts(self, index: UInt64 | int) -> Account: + """Accounts listed in the ApplicationCall transaction""" + def assets(self, index: UInt64 | int) -> Asset: + """Foreign Assets listed in the ApplicationCall transaction""" + def applications(self, index: UInt64 | int) -> Application: + """Foreign Apps listed in the ApplicationCall transaction""" + def approval_program_pages(self, index: UInt64 | int) -> Bytes: + """Approval Program as an array of pages""" + def clear_state_program_pages(self, index: UInt64 | int) -> Bytes: + """Clear State Program as an array of pages""" + +# TODO: inner transactions +# 58 Logs []byte v5 Log messages emitted by an application call (only with itxn in v5). Application mode only +# 59 NumLogs uint64 v5 Number of Logs (only with itxn in v5). Application mode only +# 60 CreatedAssetID uint64 v5 Asset ID allocated by the creation of an ASA (only with itxn in v5). Application mode only +# 61 CreatedApplicationID uint64 v5 ApplicationID allocated by the creation of an application (only with itxn in v5). Application mode only diff --git a/src/algopy-stubs/_util.pyi b/src/algopy-stubs/_util.pyi index 6361f05307..2e3faae77c 100644 --- a/src/algopy-stubs/_util.pyi +++ b/src/algopy-stubs/_util.pyi @@ -12,7 +12,9 @@ class OpUpFeeSource(Enum): #: First the excess will be used, remaining fees will be taken from the app account Any = 2 -def ensure_budget(required_budget: UInt64 | int, fee_source: OpUpFeeSource = ...) -> None: +def ensure_budget( + required_budget: UInt64 | int, fee_source: OpUpFeeSource = OpUpFeeSource.Any +) -> None: """ Ensure the available op code budget is greater than or equal to required_budget """ diff --git a/src/algopy-stubs/arc4.pyi b/src/algopy-stubs/arc4.pyi index d23cfce24b..79da6df39a 100644 --- a/src/algopy-stubs/arc4.pyi +++ b/src/algopy-stubs/arc4.pyi @@ -1,63 +1,101 @@ import typing -import typing as t +from collections.abc import Callable, Mapping, Sequence -from algopy import _primitives as stack -from algopy._contract import Contract +import algopy -_P = t.ParamSpec("_P") +_P = typing.ParamSpec("_P") -_R = t.TypeVar("_R") +_R = typing.TypeVar("_R") -OnCompleteActionName: t.TypeAlias = t.Literal[ - "no_op", - "opt_in", - "close_out", - # "clear_state", - "update_application", - "delete_application", +AllowedOnCompletes: typing.TypeAlias = Sequence[ + typing.Literal[ + "NoOp", + "OptIn", + "CloseOut", + # ClearState has its own program, so is not considered as part of ARC4 routing + "UpdateApplication", + "DeleteApplication", + ] ] -# if we use type aliasing here for Callable[_P, _R], mypy thinks it involves Any... wtf -@t.overload -def abimethod(fn: t.Callable[_P, _R], /) -> t.Callable[_P, _R]: ... -@t.overload +# TODO: better typing for ABI methods that can be used as an argument source +# TODO: support declaring state at the class level so it can be used as a default arg source +_TABIDefaultArgSource: typing.TypeAlias = object + +# if we use type aliasing here for Callable[_P, _R], mypy thinks it involves Any... +@typing.overload +def abimethod(fn: Callable[_P, _R], /) -> Callable[_P, _R]: ... +@typing.overload def abimethod( *, - allow_actions: t.Sequence[OnCompleteActionName] | None = None, - # todo: use typing to exclude allow_create and - # require_create being specified together - create: bool | t.Literal["allow"] = False, + allow_actions: AllowedOnCompletes | None = None, + create: bool | typing.Literal["allow"] = False, name: str | None = None, - read_only: bool = False, -) -> t.Callable[[t.Callable[_P, _R]], t.Callable[_P, _R],]: ... + readonly: bool = False, + default_args: Mapping[str, str | _TABIDefaultArgSource] | None = None, +) -> Callable[[Callable[_P, _R]], Callable[_P, _R],]: ... +@typing.overload +def baremethod(fn: Callable[_P, _R], /) -> Callable[_P, _R]: ... +@typing.overload +def baremethod( + *, + allow_actions: AllowedOnCompletes | None = None, + create: bool | typing.Literal["allow"] = False, +) -> Callable[[Callable[_P, _R]], Callable[_P, _R],]: ... -_T = t.TypeVar("_T") +_T = typing.TypeVar("_T") -class ABIEncoded(t.Protocol[_T]): - def decode(self) -> _T: - """Encode this ABI instance to wire format""" - @classmethod - def encode(cls, value: _T) -> t.Self: - """ "Decode wire format into an ABI instance""" +class _ABIBytesBacked(typing.Protocol): @property - def bytes(self) -> stack.Bytes: + def bytes(self) -> algopy.Bytes: """Get the underlying bytes[]""" @classmethod - def from_bytes(cls, value: stack.Bytes) -> t.Self: + def from_bytes(cls, value: algopy.Bytes) -> typing.Self: """Construct an instance from the underlying bytes[] (no validation)""" -class String(ABIEncoded[stack.Bytes]): - def __init__(self, value: stack.Bytes | t.LiteralString) -> None: ... +class ABIEncoded(_ABIBytesBacked, typing.Protocol[_T]): + def decode(self) -> _T: + """Decode this ABI instance from bytes to AVM stack value""" + @classmethod + def encode(cls, value: _T) -> typing.Self: + """Encode AVM stack value as an ABI bytes""" + +class String(ABIEncoded[algopy.Bytes]): + def __init__(self, value: typing.LiteralString) -> None: ... _TBitSize = typing.TypeVar("_TBitSize", bound=int) -class UIntN(typing.Generic[_TBitSize], ABIEncoded[stack.UInt64]): - def __init__(self, value: stack.UInt64 | int) -> None: ... +class UIntN(typing.Generic[_TBitSize], ABIEncoded[algopy.UInt64]): + def __init__(self, value: int | algopy.UInt64 | algopy.BigUInt) -> None: ... + +class BigUIntN(typing.Generic[_TBitSize], ABIEncoded[algopy.BigUInt]): + def __init__(self, value: int | algopy.UInt64 | algopy.BigUInt) -> None: ... + +_TDecimalPlaces = typing.TypeVar("_TDecimalPlaces", bound=int) + +class UFixedNxM(typing.Generic[_TBitSize, _TDecimalPlaces], ABIEncoded[algopy.UInt64]): + def __init__(self, value: typing.LiteralString): + """ + Construct an instance of UFixedNxM where value (v) is determined from the original + decimal value (d) by the formula v = round(d * (10^M)) + """ + +class BigUFixedNxM(typing.Generic[_TBitSize, _TDecimalPlaces], ABIEncoded[algopy.BigUInt]): + def __init__(self, value: typing.LiteralString): + """ + Construct an instance of UFixedNxM where value (v) is determined from the original + decimal value (d) by the formula v = round(d * (10^M)) + """ + +class Byte(UIntN[typing.Literal[8]]): ... UInt8: typing.TypeAlias = UIntN[typing.Literal[8]] UInt16: typing.TypeAlias = UIntN[typing.Literal[16]] UInt32: typing.TypeAlias = UIntN[typing.Literal[32]] UInt64: typing.TypeAlias = UIntN[typing.Literal[64]] +UInt128: typing.TypeAlias = BigUIntN[typing.Literal[128]] +UInt256: typing.TypeAlias = BigUIntN[typing.Literal[256]] +UInt512: typing.TypeAlias = BigUIntN[typing.Literal[512]] class Bool(ABIEncoded[bool]): def __init__(self, value: bool) -> None: ... @@ -65,51 +103,151 @@ class Bool(ABIEncoded[bool]): _TArrayItem = typing.TypeVar("_TArrayItem") _TArrayLength = typing.TypeVar("_TArrayLength", bound=int) -class StaticArray(typing.Generic[_TArrayItem, _TArrayLength]): +class StaticArray(_ABIBytesBacked, typing.Generic[_TArrayItem, _TArrayLength]): + @typing.overload + def __init__(self: StaticArray[_TArrayItem, typing.Literal[1]], item0: _TArrayItem): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[2]], item0: _TArrayItem, item1: _TArrayItem + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[3]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[4]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + item3: _TArrayItem, + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[5]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + item3: _TArrayItem, + item4: _TArrayItem, + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[6]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + item3: _TArrayItem, + item4: _TArrayItem, + item5: _TArrayItem, + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[7]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + item3: _TArrayItem, + item4: _TArrayItem, + item5: _TArrayItem, + item6: _TArrayItem, + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[8]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + item3: _TArrayItem, + item4: _TArrayItem, + item5: _TArrayItem, + item6: _TArrayItem, + item7: _TArrayItem, + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[9]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + item3: _TArrayItem, + item4: _TArrayItem, + item5: _TArrayItem, + item6: _TArrayItem, + item7: _TArrayItem, + item8: _TArrayItem, + ): ... + @typing.overload + def __init__( + self: StaticArray[_TArrayItem, typing.Literal[10]], + item0: _TArrayItem, + item1: _TArrayItem, + item2: _TArrayItem, + item3: _TArrayItem, + item4: _TArrayItem, + item5: _TArrayItem, + item6: _TArrayItem, + item7: _TArrayItem, + item8: _TArrayItem, + item9: _TArrayItem, + ): ... + @typing.overload def __init__(self, *items: _TArrayItem): ... - def __iter__(self) -> t.Iterator[_TArrayItem]: + def __iter__(self) -> typing.Iterator[_TArrayItem]: """Returns an iterator for the items in the array""" @property - def length(self) -> stack.UInt64: + def length(self) -> algopy.UInt64: """Returns the current length of the array""" - def __getitem__(self, index: stack.UInt64 | int | slice) -> _TArrayItem: ... + def __getitem__(self, index: algopy.UInt64 | int | slice) -> _TArrayItem: ... -class DynamicArray(typing.Generic[_TArrayItem]): +class DynamicArray(_ABIBytesBacked, typing.Generic[_TArrayItem]): def __init__(self, *items: _TArrayItem): ... - def __iter__(self) -> t.Iterator[_TArrayItem]: + def __iter__(self) -> typing.Iterator[_TArrayItem]: """Returns an iterator for the items in the array""" @property - def length(self) -> stack.UInt64: + def length(self) -> algopy.UInt64: """Returns the current length of the array""" - def __getitem__(self, index: stack.UInt64 | int | slice) -> _TArrayItem: ... + def __getitem__(self, index: algopy.UInt64 | int | slice) -> _TArrayItem: ... -class ARC4Contract(Contract): - @t.final - def approval_program(self) -> stack.UInt64 | bool: ... - def clear_state_program(self) -> stack.UInt64 | bool: ... +class Address(StaticArray[Byte, typing.Literal[32]]): ... -class Account: - @property - def address(self) -> stack.Address: ... +DynamicBytes: typing.TypeAlias = DynamicArray[Byte] -class Asset: - @property - def asset_id(self) -> stack.UInt64: ... +class ARC4Contract(algopy.Contract): + @typing.final + def approval_program(self) -> algopy.UInt64 | bool: ... + def clear_state_program(self) -> algopy.UInt64 | bool: ... -def arc4_signature(method_signature: t.LiteralString) -> stack.Bytes: ... +_TTuple = typing.TypeVarTuple("_TTuple") -class PaymentTransaction: - @property - def receiver(self) -> stack.Address: ... - @property - def amount(self) -> stack.UInt64: ... +class Tuple(typing.Generic[*_TTuple], ABIEncoded[tuple[*_TTuple]], tuple[*_TTuple]): + def __init__(self, items: tuple[*_TTuple]): ... + +T = typing.TypeVar("T") + +@typing.dataclass_transform( + eq_default=False, order_default=False, kw_only_default=False, field_specifiers=() +) +class _StructMeta(type): + def __new__( + mcs, + name: str, + bases: tuple[type, ...], + namespace: dict[str, object], + *, + kw_only: bool = False, + # **kwargs: t.Any, + ) -> _StructMeta: ... + +class Struct(metaclass=_StructMeta): + """Base class for ARC4 Struct types""" -class AssetTransferTransaction: - @property - def sender(self) -> stack.Address: ... - @property - def asset_receiver(self) -> stack.Address: ... - @property - def xfer_asset(self) -> stack.UInt64: ... @property - def asset_amount(self) -> stack.UInt64: ... + def bytes(self) -> algopy.Bytes: + """Get the underlying bytes[]""" + @classmethod + def from_bytes(cls, value: algopy.Bytes) -> typing.Self: + """Construct an instance from the underlying bytes[] (no validation)""" diff --git a/src/wyvern/ARCHITECTURE.md b/src/wyvern/ARCHITECTURE.md index a585ec000f..0895791a29 100644 --- a/src/wyvern/ARCHITECTURE.md +++ b/src/wyvern/ARCHITECTURE.md @@ -12,10 +12,11 @@ In top-down order: - wyvern/ - compile.py - codegen/ - - irbuild/ - ir/ + - awst/ + - metadata.py - parse.py - - errors.py + - errors.py - algopy/ Nothing should ever import from something higher in the list. diff --git a/src/wyvern/__main__.py b/src/wyvern/__main__.py index 362a9f0e48..bede913d3b 100644 --- a/src/wyvern/__main__.py +++ b/src/wyvern/__main__.py @@ -33,6 +33,12 @@ def main() -> None: default=True, help="Output TEAL", ) + parser.add_argument( + "--output-arc32", + action=argparse.BooleanOptionalAction, + default=True, + help="Output ARC32 application.json", + ) parser.add_argument( "--output-awst", action=argparse.BooleanOptionalAction, diff --git a/src/wyvern/algo_constants.py b/src/wyvern/algo_constants.py index 9ea4d28d3c..20dddcacc9 100644 --- a/src/wyvern/algo_constants.py +++ b/src/wyvern/algo_constants.py @@ -1,7 +1,7 @@ -import algosdk.constants - -ZERO_ADDRESS = algosdk.constants.ZERO_ADDRESS -ENCODED_ADDRESS_LENGTH = algosdk.constants.ADDRESS_LEN +ZERO_ADDRESS = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ" +ENCODED_ADDRESS_LENGTH = 58 +PUBLIC_KEY_HASH_LENGTH = 32 +ADDRESS_CHECKSUM_LENGTH = 4 MAX_BIGUINT_BITS = 512 MAX_BIGUINT_BYTES = MAX_BIGUINT_BITS // 8 MAX_BYTES_LENGTH = 4096 diff --git a/src/wyvern/arc32.py b/src/wyvern/arc32.py new file mode 100644 index 0000000000..8deb218385 --- /dev/null +++ b/src/wyvern/arc32.py @@ -0,0 +1,198 @@ +import base64 +import json +import typing +from collections.abc import Mapping, Sequence +from pathlib import Path + +from wyvern.avm_type import AVMType +from wyvern.codegen.emitprogram import CompiledContract +from wyvern.errors import InternalError +from wyvern.metadata import ARC4Method, ARC4MethodConfig, ContractState, OnCompletionAction +from wyvern.parse import SourceLocation + +OCA_ARC32_MAPPING = { + OnCompletionAction.NoOp: "no_op", + OnCompletionAction.OptIn: "opt_in", + OnCompletionAction.CloseOut: "close_out", + OnCompletionAction.ClearState: "clear_state", + OnCompletionAction.UpdateApplication: "update_application", + OnCompletionAction.DeleteApplication: "delete_application", +} + +JSONValue: typing.TypeAlias = "str | int | float | bool | None | Sequence[JSONValue] | JSONDict" +JSONDict: typing.TypeAlias = Mapping[str, "JSONValue"] + + +def _encode_source(teal_text: str) -> str: + return base64.b64encode(teal_text.encode()).decode("utf-8") + + +def _encode_state_schema(state: Sequence[ContractState]) -> JSONDict: + return { + "num_byte_slices": sum(1 for s in state if s.storage_type is AVMType.bytes), + "num_uints": sum(1 for s in state if s.storage_type is AVMType.uint64), + } + + +def _encode_schema_declaration(state: ContractState) -> JSONDict: + return { + "type": state.storage_type.name, + "key": state.key.decode("utf-8"), # TODO: support not utf8 keys? + "descr": state.description, + } + + +def _encode_schema(state: Sequence[ContractState]) -> JSONDict: + return { + "declared": { + s.name: _encode_schema_declaration(s) for s in sorted(state, key=lambda s: s.name) + }, + "reserved": {}, # TODO? + } + + +def _encode_call_config(config: ARC4MethodConfig) -> JSONDict: + if config.require_create: + call_config = "CREATE" + elif config.allow_create: + call_config = "ALL" + else: + call_config = "CALL" + return {OCA_ARC32_MAPPING[oca]: call_config for oca in config.allowed_completion_types} + + +def _encode_bare_method_configs(methods: list[ARC4Method]) -> JSONDict: + result: dict[str, JSONValue] = {} + for method in methods: + result.update(**_encode_call_config(method.config)) + return result + + +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: + for state in contract.metadata.global_state: + if state.name == source: + return { + "source": "global-state", + # TODO: handle non utf-8 bytes + "data": state.key.decode("utf-8"), + } + for state in contract.metadata.local_state: + if state.name == source: + return { + "source": "local-state", + "data": state.key.decode("utf-8"), + } + for method in contract.metadata.methods: + if method.name == source: + return { + "source": "abi-method", + "data": _encode_arc4_method(method), + } + # TODO: constants + raise InternalError(f"Cannot find source '{source}' on {contract.metadata.full_name}", loc) + + +def _encode_arc32_method_hint(contract: CompiledContract, method: ARC4Method) -> JSONDict: + return { + # deprecated by ARC-22 + "read_only": True if method.config.readonly else None, + "default_arguments": { + default_arg.parameter: _encode_default_arg( + contract, default_arg.source, method.config.source_location + ) + for default_arg in method.config.default_args + } + if method.config.default_args + else None, + "call_config": _encode_call_config(method.config), + "structs": _encode_arc32_method_structs(method), + } + + +def _encode_arc32_method_structs(method: ARC4Method) -> JSONDict | None: + if len(method.config.structs): + return { + struct_purpose: { + "name": struct_def.name, + "elements": struct_def.elements, + } + for struct_purpose, struct_def in method.config.structs + } + return None + + +def _encode_arc32_hints(contract: CompiledContract, methods: list[ARC4Method]) -> JSONDict: + return { + _get_signature(method): _encode_arc32_method_hint(contract, method) for method in methods + } + + +def _encode_arc4_method(method: ARC4Method) -> JSONDict: + return { + "name": method.config.name, + "args": [ + { + "type": arg.type_, + "name": arg.name, + "desc": arg.desc, + } + for arg in method.args + ], + # "readonly": method.config.readonly, # ARC-22 + "returns": { + "type": method.returns.type_, + "desc": method.returns.desc, + }, + "desc": method.desc, + } + + +def _encode_arc4_contract(name: str, desc: str | None, methods: Sequence[ARC4Method]) -> JSONDict: + return { + "name": name, + "desc": desc, + "methods": [_encode_arc4_method(m) for m in methods], + "networks": {}, + } + + +def _filter_none(value: JSONDict) -> JSONValue: + if isinstance(value, dict): + return {k: _filter_none(v) for k, v in value.items() if v is not None} + if isinstance(value, list): + return list(map(_filter_none, value)) + return value + + +def create_arc32_json(contract: CompiledContract) -> str: + metadata = contract.metadata + bare_methods = [m for m in metadata.methods if m.config.is_bare] + arc4_methods = [m for m in metadata.methods if not m.config.is_bare] + app_spec = { + "hints": _encode_arc32_hints(contract, arc4_methods), + "source": { + "approval": _encode_source("\n".join(contract.approval_program.src)), + "clear": _encode_source("\n".join(contract.clear_program.src)), + }, + "state": { + "global": _encode_state_schema(metadata.global_state), + "local": _encode_state_schema(metadata.local_state), + }, + "schema": { + "global": _encode_schema(metadata.global_state), + "local": _encode_schema(metadata.local_state), + }, + "contract": _encode_arc4_contract( + metadata.name_override or metadata.class_name, metadata.description, arc4_methods + ), + "bare_call_config": _encode_bare_method_configs(bare_methods), + } + return json.dumps(_filter_none(app_spec), indent=4) + + +def write_arc32(path: Path, contract: CompiledContract) -> None: + path.write_text(create_arc32_json(contract)) diff --git a/src/wyvern/avm_type.py b/src/wyvern/avm_type.py new file mode 100644 index 0000000000..9ad5affc3e --- /dev/null +++ b/src/wyvern/avm_type.py @@ -0,0 +1,8 @@ +import enum + + +@enum.unique +class AVMType(enum.Flag): + bytes = enum.auto() # noqa: A003 + uint64 = enum.auto() + any = bytes | uint64 # noqa: A003 diff --git a/src/wyvern/awst/function_traverser.py b/src/wyvern/awst/function_traverser.py index 215a2ed928..5b3f75f7ac 100644 --- a/src/wyvern/awst/function_traverser.py +++ b/src/wyvern/awst/function_traverser.py @@ -6,10 +6,6 @@ class FunctionTraverser( wyvern.awst.visitors.ExpressionVisitor[None], wyvern.awst.visitors.StatementVisitor[None], ): - def visit_is_substring(self, expr: awst_nodes.IsSubstring) -> None: - expr.item.accept(self) - expr.sequence.accept(self) - def visit_assignment_statement(self, statement: awst_nodes.AssignmentStatement) -> None: statement.target.accept(self) statement.value.accept(self) @@ -26,10 +22,10 @@ def visit_biguint_binary_operation(self, expr: awst_nodes.BigUIntBinaryOperation expr.left.accept(self) expr.right.accept(self) - def visit_uint64_constant(self, expr: awst_nodes.UInt64Constant) -> None: + def visit_integer_constant(self, expr: awst_nodes.IntegerConstant) -> None: pass - def visit_biguint_constant(self, expr: awst_nodes.BigUIntConstant) -> None: + def visit_decimal_constant(self, expr: awst_nodes.DecimalConstant) -> None: pass def visit_bool_constant(self, expr: awst_nodes.BoolConstant) -> None: @@ -38,18 +34,18 @@ def visit_bool_constant(self, expr: awst_nodes.BoolConstant) -> None: def visit_bytes_constant(self, expr: awst_nodes.BytesConstant) -> None: pass - def visit_abi_decode(self, expr: awst_nodes.AbiDecode) -> None: + def visit_arc4_decode(self, expr: awst_nodes.ARC4Decode) -> None: expr.value.accept(self) - def visit_abi_encode(self, expr: awst_nodes.AbiEncode) -> None: + def visit_arc4_encode(self, expr: awst_nodes.ARC4Encode) -> None: expr.value.accept(self) - def visit_abi_constant(self, expr: awst_nodes.AbiConstant) -> None: - pass + def visit_arc4_array_encode(self, expr: awst_nodes.ARC4ArrayEncode) -> None: + for value in expr.values: + value.accept(self) - def visit_new_abi_array(self, expr: awst_nodes.NewAbiArray) -> None: - for element in expr.elements: - element.accept(self) + def visit_method_constant(self, expr: awst_nodes.MethodConstant) -> None: + pass def visit_address_constant(self, expr: awst_nodes.AddressConstant) -> None: pass @@ -63,13 +59,13 @@ def visit_numeric_comparison_expression( def visit_var_expression(self, expr: awst_nodes.VarExpression) -> None: pass + def visit_checked_maybe(self, expr: awst_nodes.CheckedMaybe) -> None: + expr.expr.accept(self) + def visit_intrinsic_call(self, call: awst_nodes.IntrinsicCall) -> None: for arg in call.stack_args: arg.accept(self) - def visit_bytes_decode(self, expr: awst_nodes.BytesDecode) -> None: - pass - def visit_tuple_expression(self, expr: awst_nodes.TupleExpression) -> None: for item in expr.items: item.accept(self) @@ -152,6 +148,14 @@ def visit_if_else(self, statement: awst_nodes.IfElse) -> None: if statement.else_branch: statement.else_branch.accept(self) + def visit_switch(self, statement: awst_nodes.Switch) -> None: + statement.value.accept(self) + for case, block in statement.cases.items(): + case.accept(self) + block.accept(self) + if statement.default_case: + statement.default_case.accept(self) + def visit_while_loop(self, statement: awst_nodes.WhileLoop) -> None: statement.condition.accept(self) statement.loop_body.accept(self) diff --git a/src/wyvern/awst/nodes.py b/src/wyvern/awst/nodes.py index c5523bb0e8..c0f933b390 100644 --- a/src/wyvern/awst/nodes.py +++ b/src/wyvern/awst/nodes.py @@ -1,10 +1,12 @@ +import decimal import enum import typing as t from abc import ABC, abstractmethod -from collections.abc import Mapping, Sequence +from collections.abc import Iterator, Mapping, Sequence from functools import cached_property import attrs +from immutabledict import immutabledict from wyvern.awst import wtypes from wyvern.awst.visitors import ( @@ -14,6 +16,7 @@ ) from wyvern.awst.wtypes import WType from wyvern.errors import CodeError, InternalError +from wyvern.metadata import ARC4MethodConfig from wyvern.parse import SourceLocation T = t.TypeVar("T") @@ -55,7 +58,8 @@ def accept(self, visitor: StatementVisitor[T]) -> T: @attrs.frozen(repr=False) class _ExpressionHasWType: - one_of_these: tuple[WType, ...] + instances: tuple[WType, ...] + types: tuple[type[WType], ...] def __call__( self, @@ -66,21 +70,84 @@ def __call__( """ We use a callable class to be able to change the ``__repr__``. """ - if value.wtype not in self.one_of_these: - raise InternalError( - f"{type(inst).__name__}.{attr.name}: expression of WType {value.wtype} received," - f" expected {' or '.join(map(str, self.one_of_these))}" - ) + wtype = value.wtype + if wtype in self.instances: + return + for allowed_t in self.types: + if isinstance(wtype, allowed_t): + return + raise InternalError( + f"{type(inst).__name__}.{attr.name}: expression of WType {wtype} received," + f" expected {' or '.join(self._names)}" + ) def __repr__(self) -> str: - return ( - f"" + return f"" + + @property + def _names(self) -> Iterator[str]: + for inst in self.instances: + yield inst.name + for typ in self.types: + yield typ.__name__ + + +def expression_has_wtype(*one_of_these: WType | type[WType]) -> _ExpressionHasWType: + instances = [] + types = list[type[WType]]() + for item in one_of_these: + if isinstance(item, type): + types.append(item) + else: + instances.append(item) + return _ExpressionHasWType(instances=tuple(instances), types=tuple(types)) + + +@attrs.frozen(repr=False) +class _WTypeIsOneOf: + instances: tuple[WType, ...] + types: tuple[type[WType], ...] + + def __call__( + self, + inst: Node, + attr: attrs.Attribute, # type: ignore[type-arg] + value: WType, + ) -> None: + """ + We use a callable class to be able to change the ``__repr__``. + """ + wtype = value + if wtype in self.instances: + return + for allowed_t in self.types: + if isinstance(wtype, allowed_t): + return + raise InternalError( + f"{type(inst).__name__}.{attr.name}: set to {wtype}," + f" expected {' or '.join(self._names)}" ) + def __repr__(self) -> str: + return f"" -def expression_has_wtype(*one_of_these: WType) -> _ExpressionHasWType: - return _ExpressionHasWType(one_of_these) + @property + def _names(self) -> Iterator[str]: + for inst in self.instances: + yield inst.name + for typ in self.types: + yield typ.__name__ + + +def wtype_is_one_of(*one_of_these: WType | type[WType]) -> _WTypeIsOneOf: + instances = [] + types = list[type[WType]]() + for item in one_of_these: + if isinstance(item, type): + types.append(item) + else: + instances.append(item) + return _WTypeIsOneOf(instances=tuple(instances), types=tuple(types)) wtype_is_uint64 = expression_has_wtype(wtypes.uint64_wtype) @@ -131,6 +198,7 @@ class Literal(Node): @attrs.frozen class Block(Statement): body: Sequence[Statement] = attrs.field(converter=tuple[Statement, ...]) + description: str | None = attrs.field(default=None) def accept(self, visitor: StatementVisitor[T]) -> T: return visitor.visit_block(self) @@ -146,6 +214,16 @@ def accept(self, visitor: StatementVisitor[T]) -> T: return visitor.visit_if_else(self) +@attrs.frozen +class Switch(Statement): + value: Expression + cases: Mapping[Expression, Block] = attrs.field(converter=immutabledict) + default_case: Block | None + + def accept(self, visitor: StatementVisitor[T]) -> T: + return visitor.visit_switch(self) + + @attrs.frozen class WhileLoop(Statement): condition: Expression = attrs.field(validator=[wtype_is_bool]) @@ -184,35 +262,76 @@ def accept(self, visitor: StatementVisitor[T]) -> T: return visitor.visit_return_statement(self) +def _validate_literal(value: object, wtype: WType, source_location: SourceLocation) -> None: + if not wtype.is_valid_literal(value): + raise CodeError(f"Invalid {wtype} value: {value}", source_location) + + def literal_validator(wtype: WType) -> t.Callable[[Node, object, t.Any], None]: def validate(node: Node, _attribute: object, value: object) -> None: if not isinstance(node, Node): raise InternalError( f"literal_validator used on type {type(node).__name__}, expected Node" ) - if not wtype.is_valid_literal(value): - raise CodeError(f"Invalid {wtype} value: {value}", node.source_location) + _validate_literal(value, wtype, node.source_location) return validate -@attrs.frozen -class UInt64Constant(Expression): - wtype: WType = attrs.field(default=wtypes.uint64_wtype, init=False) - value: int = attrs.field(validator=[literal_validator(wtypes.uint64_wtype)]) +@attrs.frozen(kw_only=True) +class IntegerConstant(Expression): + wtype: WType = attrs.field( + validator=[ + wtype_is_one_of( + wtypes.uint64_wtype, + wtypes.biguint_wtype, + wtypes.ARC4UIntN, + ) + ] + ) + value: int = attrs.field() teal_alias: str | None = attrs.field(default=None) + @value.validator + def check(self, _attribute: object, value: int) -> None: + _validate_literal(value, self.wtype, self.source_location) + def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_uint64_constant(self) + return visitor.visit_integer_constant(self) @attrs.frozen -class BigUIntConstant(Expression): - wtype: WType = attrs.field(default=wtypes.biguint_wtype, init=False) - value: int = attrs.field(validator=[literal_validator(wtypes.biguint_wtype)]) +class DecimalConstant(Expression): + wtype: wtypes.ARC4UFixedNxM + value: decimal.Decimal = attrs.field() + + @value.validator + def check(self, _attribute: object, value: int) -> None: + _validate_literal(value, self.wtype, self.source_location) def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_biguint_constant(self) + return visitor.visit_decimal_constant(self) + + +def UInt64Constant( # noqa: N802 + *, source_location: SourceLocation, value: int, teal_alias: str | None = None +) -> IntegerConstant: + return IntegerConstant( + source_location=source_location, + value=value, + wtype=wtypes.uint64_wtype, + teal_alias=teal_alias, + ) + + +def BigUIntConstant( # noqa: N802 + *, source_location: SourceLocation, value: int +) -> IntegerConstant: + return IntegerConstant( + source_location=source_location, + value=value, + wtype=wtypes.biguint_wtype, + ) @attrs.frozen @@ -224,89 +343,75 @@ def accept(self, visitor: ExpressionVisitor[T]) -> T: return visitor.visit_bool_constant(self) +class BytesEncoding(enum.StrEnum): + base16 = enum.auto() + base32 = enum.auto() + base64 = enum.auto() + utf8 = enum.auto() + + @attrs.frozen class BytesConstant(Expression): wtype: WType = attrs.field(default=wtypes.bytes_wtype, init=False) value: bytes = attrs.field(validator=[literal_validator(wtypes.bytes_wtype)]) + encoding: BytesEncoding = attrs.field(default=BytesEncoding.utf8) def accept(self, visitor: ExpressionVisitor[T]) -> T: return visitor.visit_bytes_constant(self) @attrs.frozen -class AddressConstant(Expression): - wtype: WType = attrs.field(default=wtypes.address_wtype, init=False) - value: str = attrs.field(validator=[literal_validator(wtypes.address_wtype)]) - - def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_address_constant(self) - - -class BytesEncoding(enum.StrEnum): - base16 = enum.auto() - base32 = enum.auto() - base64 = enum.auto() - method = enum.auto() - utf8 = enum.auto() - - -@attrs.frozen -class BytesDecode(Expression): - value: str # TODO: validator - encoding: BytesEncoding +class MethodConstant(Expression): wtype: WType = attrs.field(default=wtypes.bytes_wtype, init=False) - # TODO: add evaluation to get bytes + value: str def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_bytes_decode(self) + return visitor.visit_method_constant(self) @attrs.frozen -class AbiEncode(Expression): - value: Expression - wtype: WType +class AddressConstant(Expression): + wtype: WType = attrs.field(default=wtypes.account_wtype, init=False) + value: str = attrs.field(validator=[literal_validator(wtypes.account_wtype)]) def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_abi_encode(self) + return visitor.visit_address_constant(self) @attrs.frozen -class AbiDecode(Expression): +class ARC4Encode(Expression): value: Expression wtype: WType def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_abi_decode(self) + return visitor.visit_arc4_encode(self) @attrs.frozen -class AbiConstant(Expression): - value: bytes - wtype: WType - bytes_encoding: BytesEncoding = attrs.field(default=BytesEncoding.base16) +class ARC4ArrayEncode(Expression): + values: Sequence[Expression] + wtype: wtypes.ARC4StaticArray | wtypes.ARC4DynamicArray = attrs.field() def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_abi_constant(self) + return visitor.visit_arc4_array_encode(self) @attrs.frozen -class NewAbiArray(Expression): - elements: tuple[Expression, ...] = attrs.field() - wtype: wtypes.AbiDynamicArray | wtypes.AbiStaticArray - - @elements.validator - def check(self, _attribute: object, value: tuple[Expression, ...]) -> None: - if any(expr.wtype != self.wtype.element_type for expr in value): - raise ValueError( - f"All array elements should have array type: {self.wtype.element_type}" - ) +class ARC4Decode(Expression): + value: Expression + wtype: WType def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_new_abi_array(self) + return visitor.visit_arc4_decode(self) CompileTimeConstantExpression: t.TypeAlias = ( - UInt64Constant | BigUIntConstant | BoolConstant | BytesConstant | AddressConstant | BytesDecode + IntegerConstant + | DecimalConstant + | BoolConstant + | BytesConstant + | AddressConstant + | MethodConstant ) @@ -331,6 +436,34 @@ def bytes_len(cls, expr: Expression, source_location: SourceLocation) -> t.Self: ) +@attrs.define(init=False) +class CheckedMaybe(Expression): + """Allows evaluating a maybe type i.e. tuple[_T, bool] as _T, but with the assertion that + the 2nd bool element is true""" + + expr: Expression = attrs.field() + comment: str | None + + def __init__(self, expr: Expression, comment: str | None = None) -> None: + match expr.wtype: + case wtypes.WTuple(types=(wtype, wtypes.bool_wtype)): + pass + case _: + raise InternalError( + f"{type(self).__name__}.expr: expression of WType {expr.wtype} received," + f" expected tuple[_T, bool]" + ) + self.__attrs_init__( + source_location=expr.source_location, + expr=expr, + comment=comment, + wtype=wtype, + ) + + def accept(self, visitor: ExpressionVisitor[T]) -> T: + return visitor.visit_checked_maybe(self) + + def lvalue_expr_validator(_instance: object, _attribute: object, value: Expression) -> None: if not value.wtype.lvalue: raise CodeError( @@ -344,6 +477,16 @@ class TupleExpression(Expression): items: Sequence[Expression] = attrs.field(converter=tuple[Expression, ...]) wtype: wtypes.WTuple + @classmethod + def from_items( + cls, items: Sequence[Expression], location: SourceLocation + ) -> "TupleExpression": + return cls( + items=items, + wtype=wtypes.WTuple.from_types(i.wtype for i in items), + source_location=location, + ) + def accept(self, visitor: ExpressionVisitor[T]) -> T: return visitor.visit_tuple_expression(self) @@ -433,7 +576,7 @@ class AppAccountStateExpression(Expression): key: bytes key_encoding: BytesEncoding account: Expression = attrs.field( - validator=[expression_has_wtype(wtypes.address_wtype, wtypes.uint64_wtype)] + validator=[expression_has_wtype(wtypes.account_wtype, wtypes.uint64_wtype)] ) def accept(self, visitor: ExpressionVisitor[T]) -> T: @@ -597,7 +740,11 @@ class NumericComparison(enum.StrEnum): numeric_comparable = expression_has_wtype( - wtypes.uint64_wtype, wtypes.biguint_wtype, wtypes.bool_wtype + wtypes.uint64_wtype, + wtypes.biguint_wtype, + wtypes.bool_wtype, + wtypes.asset_wtype, + wtypes.application_wtype, ) @@ -613,6 +760,7 @@ class NumericComparisonExpression(Expression): wtype: WType = attrs.field(default=wtypes.bool_wtype, init=False) + # TODO: make these names consistent with other expressions lhs: Expression = attrs.field(validator=[numeric_comparable]) operator: NumericComparison rhs: Expression = attrs.field(validator=[numeric_comparable]) @@ -629,7 +777,7 @@ def accept(self, visitor: ExpressionVisitor[T]) -> T: return visitor.visit_numeric_comparison_expression(self) -bytes_comparable = expression_has_wtype(wtypes.bytes_wtype, wtypes.address_wtype) +bytes_comparable = expression_has_wtype(wtypes.bytes_wtype, wtypes.account_wtype) @attrs.frozen @@ -640,6 +788,14 @@ class BytesComparisonExpression(Expression): operator: EqualityComparison rhs: Expression = attrs.field(validator=[bytes_comparable]) + def __attrs_post_init__(self) -> None: + if self.lhs.wtype != self.rhs.wtype: + raise InternalError( + "bytes comparison between different wtypes:" + f" {self.lhs.wtype} and {self.rhs.wtype}", + self.source_location, + ) + def accept(self, visitor: ExpressionVisitor[T]) -> T: return visitor.visit_bytes_comparison_expression(self) @@ -854,19 +1010,6 @@ def accept(self, visitor: ExpressionVisitor[T]) -> T: return visitor.visit_contains_expression(self) -wtype_is_bytes = expression_has_wtype(wtypes.bytes_wtype) - - -@attrs.frozen -class IsSubstring(Expression): - item: Expression = attrs.field(validator=[wtype_is_bytes]) - sequence: Expression = attrs.field(validator=[wtype_is_bytes]) - wtype: WType = attrs.field(default=wtypes.bool_wtype, init=False) - - def accept(self, visitor: ExpressionVisitor[T]) -> T: - return visitor.visit_is_substring(self) - - @attrs.frozen class UInt64AugmentedAssignment(Statement): target: Lvalue = attrs.field(validator=[wtype_is_uint64]) @@ -978,12 +1121,6 @@ class SubroutineArgument(Node): wtype: WType -@attrs.frozen -class ABIMethodConfig(Node): - name_override: str | None - # TODO: the rest - - @attrs.frozen class Function(ModuleStatement, ABC): module_name: str @@ -1011,7 +1148,7 @@ def accept(self, visitor: ModuleStatementVisitor[T]) -> T: @attrs.frozen class ContractMethod(Function): class_name: str - abimethod_config: ABIMethodConfig | None + abimethod_config: ARC4MethodConfig | None @property def full_name(self) -> str: diff --git a/src/wyvern/awst/to_code_visitor.py b/src/wyvern/awst/to_code_visitor.py index 51a8be64e3..1f97d5ac09 100644 --- a/src/wyvern/awst/to_code_visitor.py +++ b/src/wyvern/awst/to_code_visitor.py @@ -1,3 +1,4 @@ +import base64 import typing as t from wyvern.awst import nodes, wtypes @@ -28,19 +29,15 @@ def visit_module(self, module: nodes.Module) -> str: result.extend(lines) return "\n".join(result).strip() - def visit_abi_decode(self, expr: nodes.AbiDecode) -> str: - return f"abi_decode({expr.value.accept(self)}, {expr.wtype})" + def visit_arc4_decode(self, expr: nodes.ARC4Decode) -> str: + return f"arc4_decode({expr.value.accept(self)}, {expr.wtype})" - def visit_abi_encode(self, expr: nodes.AbiEncode) -> str: - return f"abi_encode({expr.value.accept(self)}, {expr.wtype})" + def visit_arc4_encode(self, expr: nodes.ARC4Encode) -> str: + return f"arc4_encode({expr.value.accept(self)}, {expr.wtype})" - def visit_abi_constant(self, expr: nodes.AbiConstant) -> str: - return f"abi_constant({bytes_str(expr.value)}, {expr.wtype})" - - def visit_new_abi_array(self, expr: nodes.NewAbiArray) -> str: - args = ", ".join(a.accept(self) for a in expr.elements) - array_size = expr.wtype.array_size if isinstance(expr.wtype, wtypes.AbiStaticArray) else "" - return f"new {expr.wtype.element_type}[{array_size}]({args})" + def visit_arc4_array_encode(self, expr: nodes.ARC4ArrayEncode) -> str: + items = ", ".join([value.accept(self) for value in expr.values]) + return f"arc4_array_encode([{items}], {expr.wtype})" def visit_contains_expression(self, expr: nodes.Contains) -> str: return f"{expr.item.accept(self)} IS IN {expr.sequence.accept(self)}" @@ -72,9 +69,6 @@ def visit_new_struct(self, expr: nodes.NewStruct) -> str: ) return f"new {expr.wtype}({args})" - def visit_is_substring(self, expr: nodes.IsSubstring) -> str: - return f"{expr.item.accept(self)} in {expr.sequence.accept(self)}" - def visit_enumeration(self, expr: nodes.Enumeration) -> str: sequence = ( self.visit_range(expr.expr) @@ -251,11 +245,8 @@ def visit_contract_method(self, statement: nodes.ContractMethod) -> list[str]: body = statement.body.accept(self) args = ", ".join([f"{a.name}: {a.wtype}" for a in statement.args]) if statement.abimethod_config is not None: - abi_spec_parts = [] - if (name_override := statement.abimethod_config.name_override) is not None: - abi_spec_parts.append(f"{name_override=}") - if abi_spec_parts: - deco = f"abimethod[{', '.join(abi_spec_parts)}]" + if statement.abimethod_config.name != statement.name: + deco = f"abimethod[name_override={statement.abimethod_config.name}]" else: deco = "abimethod" else: @@ -286,17 +277,49 @@ def visit_uint64_unary_operation(self, expr: nodes.UInt64UnaryOperation) -> str: def visit_bytes_unary_operation(self, expr: nodes.BytesUnaryOperation) -> str: return f"b{expr.op.value}({expr.expr.accept(self)})" - def visit_uint64_constant(self, expr: nodes.UInt64Constant) -> str: - return f"{expr.value}u" if not expr.teal_alias else expr.teal_alias + def visit_integer_constant(self, expr: nodes.IntegerConstant) -> str: + if expr.teal_alias: + return expr.teal_alias + match expr.wtype: + case wtypes.uint64_wtype: + suffix = "u" + case wtypes.biguint_wtype: + suffix = "n" + case wtypes.ARC4UIntN(n=n): + if n <= 64: + suffix = f"arc4u{n}" + else: + suffix = f"arc4n{n}" + case _: + raise InternalError( + f"Numeric type not implemented: {expr.wtype}", expr.source_location + ) + return f"{expr.value}{suffix}" - def visit_biguint_constant(self, expr: nodes.BigUIntConstant) -> str: - return f"{expr.value}n" + def visit_decimal_constant(self, expr: nodes.DecimalConstant) -> str: + d = str(expr.value) + if expr.wtype.n <= 64: + suffix = f"arc4u{expr.wtype.n}x{expr.wtype.m}" + else: + suffix = f"arc4n{expr.wtype.n}x{expr.wtype.m}" + return f"{d}{suffix}" def visit_bool_constant(self, expr: nodes.BoolConstant) -> str: return "true" if expr.value else "false" def visit_bytes_constant(self, expr: nodes.BytesConstant) -> str: - return bytes_str(expr.value) + match expr.encoding: + case nodes.BytesEncoding.base16: + return f'hex<"{expr.value.hex().upper()}">' + case nodes.BytesEncoding.base32: + return f'b32<"{base64.b32encode(expr.value).decode("ascii")}">' + case nodes.BytesEncoding.base64: + return f'b64<"{base64.b64encode(expr.value).decode("ascii")}">' + case _: + return bytes_str(expr.value) + + def visit_method_constant(self, expr: nodes.MethodConstant) -> str: + return f'Method("{expr.value}")' def visit_address_constant(self, expr: nodes.AddressConstant) -> str: return f'Address("{expr.value}")' @@ -305,7 +328,7 @@ def visit_conditional_expression(self, expr: nodes.ConditionalExpression) -> str condition = expr.condition.accept(self) true = expr.true_expr.accept(self) false = expr.false_expr.accept(self) - return f"{condition} ? {true} : {false}" + return f"({condition}) ? ({true}) : ({false})" def visit_numeric_comparison_expression(self, expr: nodes.NumericComparisonExpression) -> str: return f"{expr.lhs.accept(self)} {expr.operator.value} {expr.rhs.accept(self)}" @@ -313,6 +336,9 @@ def visit_numeric_comparison_expression(self, expr: nodes.NumericComparisonExpre def visit_var_expression(self, expr: nodes.VarExpression) -> str: return expr.name + def visit_checked_maybe(self, expr: nodes.CheckedMaybe) -> str: + return f"checked_maybe({expr.expr.accept(self)})" + def visit_intrinsic_call(self, expr: nodes.IntrinsicCall) -> str: result = expr.op_code if expr.immediates: @@ -323,9 +349,6 @@ def visit_intrinsic_call(self, expr: nodes.IntrinsicCall) -> str: result += ")" return result - def visit_bytes_decode(self, expr: nodes.BytesDecode) -> str: - return f'Bytes.from_{expr.encoding}("{expr.value}")' - def visit_tuple_expression(self, expr: nodes.TupleExpression) -> str: items = ", ".join([item.accept(self) for item in expr.items]) return f"({items})" @@ -363,6 +386,34 @@ def visit_if_else(self, statement: nodes.IfElse) -> list[str]: else_block = [] return [*if_block, *else_block, "}"] + def visit_switch(self, statement: nodes.Switch) -> list[str]: + match_block = [f"switch ({statement.value.accept(self)}) {{"] + for case_value, case_block in statement.cases.items(): + value = case_value.accept(self) + block = case_block.accept(self) + match_block.extend( + _indent( + [ + f"case {value}: {{", + *_indent(block), + "}", + ] + ) + ) + if statement.default_case: + default_block = statement.default_case.accept(self) + match_block.extend( + _indent( + [ + "case _: {", + *_indent(default_block), + "}", + ] + ) + ) + match_block.append("}") + return match_block + def visit_while_loop(self, statement: nodes.WhileLoop) -> list[str]: loop_body = statement.loop_body.accept(self) return [ diff --git a/src/wyvern/awst/visitors.py b/src/wyvern/awst/visitors.py index b28cf7b33a..04b019226f 100644 --- a/src/wyvern/awst/visitors.py +++ b/src/wyvern/awst/visitors.py @@ -18,6 +18,10 @@ def visit_block(self, statement: wyvern.awst.nodes.Block) -> T: def visit_if_else(self, statement: wyvern.awst.nodes.IfElse) -> T: ... + @abstractmethod + def visit_switch(self, statement: wyvern.awst.nodes.Switch) -> T: + ... + @abstractmethod def visit_while_loop(self, statement: wyvern.awst.nodes.WhileLoop) -> T: ... @@ -105,11 +109,11 @@ def visit_biguint_binary_operation(self, expr: wyvern.awst.nodes.BigUIntBinaryOp ... @abstractmethod - def visit_uint64_constant(self, expr: wyvern.awst.nodes.UInt64Constant) -> T: + def visit_integer_constant(self, expr: wyvern.awst.nodes.IntegerConstant) -> T: ... @abstractmethod - def visit_biguint_constant(self, expr: wyvern.awst.nodes.BigUIntConstant) -> T: + def visit_decimal_constant(self, expr: wyvern.awst.nodes.DecimalConstant) -> T: ... @abstractmethod @@ -139,19 +143,19 @@ def visit_intrinsic_call(self, call: wyvern.awst.nodes.IntrinsicCall) -> T: ... @abstractmethod - def visit_bytes_decode(self, expr: wyvern.awst.nodes.BytesDecode) -> T: + def visit_checked_maybe(self, call: wyvern.awst.nodes.CheckedMaybe) -> T: ... @abstractmethod - def visit_abi_decode(self, expr: wyvern.awst.nodes.AbiDecode) -> T: + def visit_arc4_decode(self, expr: wyvern.awst.nodes.ARC4Decode) -> T: ... @abstractmethod - def visit_abi_constant(self, expr: wyvern.awst.nodes.AbiConstant) -> T: + def visit_arc4_encode(self, expr: wyvern.awst.nodes.ARC4Encode) -> T: ... @abstractmethod - def visit_abi_encode(self, expr: wyvern.awst.nodes.AbiEncode) -> T: + def visit_arc4_array_encode(self, expr: wyvern.awst.nodes.ARC4ArrayEncode) -> T: ... @abstractmethod @@ -241,14 +245,10 @@ def visit_contains_expression(self, expr: wyvern.awst.nodes.Contains) -> T: def visit_reinterpret_cast(self, expr: wyvern.awst.nodes.ReinterpretCast) -> T: ... - @abstractmethod - def visit_is_substring(self, expr: wyvern.awst.nodes.IsSubstring) -> T: - ... - @abstractmethod def visit_enumeration(self, expr: wyvern.awst.nodes.Enumeration) -> T: ... @abstractmethod - def visit_new_abi_array(self, expr: wyvern.awst.nodes.NewAbiArray) -> T: + def visit_method_constant(self, expr: wyvern.awst.nodes.MethodConstant) -> T: ... diff --git a/src/wyvern/awst/wtypes.py b/src/wyvern/awst/wtypes.py index 88cbb59754..75fdb3e9c8 100644 --- a/src/wyvern/awst/wtypes.py +++ b/src/wyvern/awst/wtypes.py @@ -3,13 +3,17 @@ from collections.abc import Callable, Iterable, Mapping, Sequence import attrs +from immutabledict import immutabledict from wyvern.algo_constants import ( + ADDRESS_CHECKSUM_LENGTH, ENCODED_ADDRESS_LENGTH, MAX_BIGUINT_BITS, MAX_BYTES_LENGTH, + PUBLIC_KEY_HASH_LENGTH, ) from wyvern.awst_build import constants +from wyvern.utils import sha512_256_hash def _all_literals_invalid(_value: object) -> bool: @@ -19,7 +23,7 @@ def _all_literals_invalid(_value: object) -> bool: @attrs.frozen(str=False, kw_only=True) class WType: name: str - python_type: str + stub_name: str lvalue: bool = True immutable: bool = True is_valid_literal: Callable[[object], bool] = attrs.field( @@ -28,7 +32,7 @@ class WType: ) def __str__(self) -> str: - return self.python_type + return self.stub_name def is_valid_bool_literal(value: object) -> typing.TypeGuard[bool]: @@ -51,117 +55,119 @@ def is_valid_bytes_literal(value: object) -> typing.TypeGuard[bytes]: return isinstance(value, bytes) and len(value) <= MAX_BYTES_LENGTH -def is_valid_address_literal(value: object) -> typing.TypeGuard[str]: +def is_valid_account_literal(value: object) -> typing.TypeGuard[str]: return isinstance(value, str) and valid_address(value) +def is_valid_utf8_literal(value: object) -> typing.TypeGuard[str]: + return isinstance(value, str) and is_valid_bytes_literal(value.encode("utf8")) + + void_wtype: typing.Final = WType( name="void", - python_type="None", + stub_name="None", lvalue=False, ) bool_wtype: typing.Final = WType( name="bool", - python_type="bool", + stub_name="bool", is_valid_literal=is_valid_bool_literal, ) uint64_wtype: typing.Final = WType( name="uint64", - python_type=constants.CLS_UINT64_ALIAS, + stub_name=constants.CLS_UINT64_ALIAS, is_valid_literal=is_valid_uint64_literal, ) biguint_wtype: typing.Final = WType( name="biguint", - python_type=constants.CLS_BIGUINT_ALIAS, + stub_name=constants.CLS_BIGUINT_ALIAS, is_valid_literal=is_valid_biguint_literal, ) bytes_wtype: typing.Final = WType( name="bytes", - python_type=constants.CLS_BYTES_ALIAS, + stub_name=constants.CLS_BYTES_ALIAS, is_valid_literal=is_valid_bytes_literal, ) -address_wtype: typing.Final = WType( - name="address", - python_type=constants.CLS_ADDRESS_ALIAS, - is_valid_literal=is_valid_address_literal, -) -asset_wtype: typing.Final = WType(name="asset", python_type=constants.CLS_ASSET) +asset_wtype: typing.Final = WType( + name="asset", + stub_name=constants.CLS_ASSET_ALIAS, + is_valid_literal=is_valid_uint64_literal, +) +account_wtype: typing.Final = WType( + name="account", + stub_name=constants.CLS_ACCOUNT_ALIAS, + is_valid_literal=is_valid_account_literal, +) -abi_string_wtype: typing.Final = WType(name="abi_string", python_type=constants.CLS_ABI_STRING) +application_wtype: typing.Final = WType( + name="application", + stub_name=constants.CLS_APPLICATION_ALIAS, + is_valid_literal=is_valid_uint64_literal, +) @typing.final @attrs.frozen(str=False, kw_only=True) -class AbiUIntN(WType): - n: int +class WTransaction(WType): + transaction_type: constants.TransactionType | None + # TODO only allow int literals below max group size - @classmethod - def from_scale(cls, n: int) -> typing.Self: - name = f"uint{n}" - return cls( - n=n, - name=name, - immutable=False, - python_type=constants.CLS_ABI_UINTN, - ) +transaction_base_wtype: typing.Final = WTransaction( + transaction_type=None, + name="txn", + stub_name=constants.CLS_TRANSACTION_BASE_ALIAS, +) +payment_wtype: typing.Final = WTransaction( + transaction_type=constants.TransactionType.pay, + name="payment", + stub_name=constants.CLS_PAYMENT_TRANSACTION_ALIAS, +) -@typing.final -@attrs.frozen(str=False, kw_only=True) -class AbiDynamicArray(WType): - element_type: WType +key_registration_wtype: typing.Final = WTransaction( + transaction_type=constants.TransactionType.keyreg, + name="key_registration", + stub_name=constants.CLS_KEY_REGISTRATION_TRANSACTION_ALIAS, +) - @classmethod - def from_element_type(cls, element_type: WType) -> typing.Self: - if element_type == void_wtype: - raise ValueError("array element type cannot be void") - name = f"abi_dynamic_array<{element_type.name}>" - return cls( - name=name, - immutable=False, - element_type=element_type, - python_type=constants.CLS_ABI_DYNAMIC_ARRAY, - ) +asset_config_wtype: typing.Final = WTransaction( + transaction_type=constants.TransactionType.acfg, + name="asset_config", + stub_name=constants.CLS_ASSET_CONFIG_TRANSACTION_ALIAS, +) +asset_transfer_wtype: typing.Final = WTransaction( + transaction_type=constants.TransactionType.axfer, + name="asset_transfer", + stub_name=constants.CLS_ASSET_TRANSFER_TRANSACTION_ALIAS, +) -@typing.final -@attrs.frozen(str=False, kw_only=True) -class AbiStaticArray(WType): - element_type: WType - array_size: int +asset_freeze_wtype: typing.Final = WTransaction( + transaction_type=constants.TransactionType.afrz, + name="asset_freeze", + stub_name=constants.CLS_ASSET_FREEZE_TRANSACTION_ALIAS, +) - @classmethod - def from_element_type_and_size(cls, element_type: WType, array_size: int) -> typing.Self: - if element_type == void_wtype: - raise ValueError("array element type cannot be void") - name = f"abi_static_array<{element_type.name}, {array_size}>" - return cls( - array_size=array_size, - name=name, - immutable=False, - element_type=element_type, - python_type=constants.CLS_ABI_STATIC_ARRAY, - ) +application_call_wtype: typing.Final = WTransaction( + transaction_type=constants.TransactionType.appl, + name="application_call", + stub_name=constants.CLS_APPLICATION_CALL_TRANSACTION_ALIAS, +) @typing.final @attrs.frozen(str=False, kw_only=True) class WStructType(WType): - fields: Mapping[str, WType] = attrs.field(eq=False) - _data: Sequence[tuple[str, WType]] = attrs.field(init=False) - - @_data.default - def _data_factory(self) -> Sequence[tuple[str, WType]]: - return tuple(self.fields.items()) + fields: Mapping[str, WType] = attrs.field(converter=immutabledict) @classmethod - def from_name_and_fields(cls, python_name: str, fields: dict[str, WType]) -> typing.Self: + def from_name_and_fields(cls, python_name: str, fields: Mapping[str, WType]) -> typing.Self: if not fields: raise ValueError("struct needs fields") if void_wtype in fields.values(): @@ -175,7 +181,7 @@ def from_name_and_fields(cls, python_name: str, fields: dict[str, WType]) -> typ ) return cls( name=name, - python_type=python_name, + stub_name=python_name, immutable=False, fields=fields, ) @@ -193,7 +199,7 @@ def from_element_type(cls, element_type: WType) -> typing.Self: name = f"array<{element_type.name}>" return cls( name=name, - python_type=f"{constants.CLS_ARRAY_ALIAS}[{element_type}]", + stub_name=f"{constants.CLS_ARRAY_ALIAS}[{element_type}]", immutable=False, element_type=element_type, ) @@ -212,13 +218,187 @@ def from_types(cls, types: Iterable[WType]) -> typing.Self: if void_wtype in types: raise ValueError("tuple should not contain void types") name = f"tuple<{','.join([t.name for t in types])}>" + python_name = f"tuple[{', '.join(map(str, types))}]" + return cls(name=name, stub_name=python_name, types=types) + + +@attrs.frozen +class ARC4Type(WType): + alias: str | None = attrs.field(default=None) + + +@typing.final +@attrs.frozen(str=False, kw_only=True) +class ARC4UIntN(ARC4Type): + n: int + + @classmethod + def from_scale(cls, n: int, *, alias: str | None = None) -> typing.Self: + name = f"arc4.uint{n}" + base_cls = constants.CLS_ARC4_UINTN if n <= 64 else constants.CLS_ARC4_BIG_UINTN + + 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, - python_type=f"tuple[{', '.join(map(str, types))}]", - types=types, + stub_name=f"{base_cls}[typing.Literal[{n}]]", + alias=alias, + is_valid_literal=is_valid_literal, ) +@typing.final +@attrs.frozen(str=False, kw_only=True) +class ARC4Tuple(ARC4Type): + types: tuple[WType, ...] = attrs.field(validator=[attrs.validators.min_len(1)]) + + @classmethod + def from_types(cls, types: Iterable[WType]) -> typing.Self: + types = tuple(types) + if not types: + raise ValueError("arc4.Tuple needs types") + for typ in types: + if not is_arc4_encoded_type(typ): + raise ValueError(f"Invalid type for arc4.Tuple: {typ}") + name = f"arc4.tuple<{','.join([t.name for t in types])}>" + python_name = f"{constants.CLS_ARC4_TUPLE}[{', '.join(map(str, types))}]" + return cls(name=name, stub_name=python_name, types=types) + + +@typing.final +@attrs.frozen(str=False, kw_only=True) +class ARC4UFixedNxM(ARC4Type): + n: int + m: int + + @classmethod + def from_scale_and_precision(cls, n: int, m: 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" + assert 1 <= m <= 160, "precision must be between 1 and 160 inclusive" + + name = f"arc4.ufixed{n}x{m}" + base_cls = constants.CLS_ARC4_UFIXEDNXM if n <= 64 else constants.CLS_ARC4_BIG_UFIXEDNXM + + def is_valid_literal(value: object) -> bool: + import decimal + + if not isinstance(value, decimal.Decimal): + return False + if value < 0 or not value.is_finite(): + return False + decimal_str = str(value) + try: + whole, part = decimal_str.split(".") + except ValueError: + return False + # note: input is expected to be quantized correctly already + if len(part) != m: + return False + adjusted_int = int(decimal_str.replace(".", "")) + return adjusted_int.bit_length() <= n + + return cls( + n=n, + m=m, + name=name, + stub_name=f"{base_cls}[typing.Literal[{n}], typing.Literal[{m}]]", + is_valid_literal=is_valid_literal, + ) + + +@typing.final +@attrs.frozen(str=False, kw_only=True) +class ARC4DynamicArray(ARC4Type): + element_type: WType + + @classmethod + def from_element_type(cls, element_type: WType) -> typing.Self: + if not is_arc4_encoded_type(element_type): + raise ValueError(f"Invalid type for arc4.DynamicArray: {element_type}") + name = f"arc4.dynamic_array<{element_type.name}>" + return cls( + name=name, + immutable=False, + element_type=element_type, + stub_name=f"{constants.CLS_ARC4_DYNAMIC_ARRAY}[{element_type}]", + ) + + +@typing.final +@attrs.frozen(str=False, kw_only=True) +class ARC4StaticArray(ARC4Type): + element_type: WType + array_size: int + + @classmethod + def from_element_type_and_size( + cls, element_type: WType, array_size: int, alias: str | None = None + ) -> typing.Self: + if not is_arc4_encoded_type(element_type): + raise ValueError(f"Invalid type for arc4.StaticArray: {element_type}") + name = f"arc4.static_array<{element_type.name}, {array_size}>" + return cls( + array_size=array_size, + name=name, + immutable=False, + element_type=element_type, + stub_name=( + f"{constants.CLS_ARC4_STATIC_ARRAY}[" + f"{element_type}, typing.Literal[{array_size}]" + f"]" + ), + alias=alias, + ) + + +@typing.final +@attrs.frozen(str=False, kw_only=True) +class ARC4Struct(ARC4Type): + fields: Mapping[str, WType] = attrs.field( + converter=immutabledict, validator=[attrs.validators.min_len(1)] + ) + names: Sequence[str] = attrs.field(init=False, eq=False) + types: Sequence[WType] = attrs.field(init=False, eq=False) + + @names.default + def _names_factory(self) -> Sequence[str]: + return list(self.fields.keys()) + + @types.default + def _types_factory(self) -> Sequence[WType]: + return list(self.fields.values()) + + @classmethod + def from_name_and_fields(cls, *, python_name: str, fields: Mapping[str, WType]) -> typing.Self: + if not fields: + raise ValueError("arc4.Struct needs at least one element") + for t in fields.values(): + if not is_arc4_encoded_type(t): + raise ValueError(f"arc4.Struct should not contain non arc4 types: {t}") + name = ( + "arc4.struct<" + + ",".join( + f"{field_name}:{field_type.name}" for field_name, field_type in fields.items() + ) + + ">" + ) + return cls(name=name, stub_name=python_name, fields=fields) + + +arc4_string_wtype: typing.Final = ARC4Type( + name="arc4.string", + stub_name=constants.CLS_ARC4_STRING, + alias="string", + is_valid_literal=is_valid_utf8_literal, +) +arc4_bool_wtype: typing.Final = ARC4Type( + name="arc4.bool", stub_name=constants.CLS_ARC4_BOOL, alias="bool" +) + + # TODO: move these validation functions somewhere else def valid_base32(s: str) -> bool: """check if s is a valid base32 encoding string and fits into AVM bytes type""" @@ -252,5 +432,35 @@ def valid_base64(s: str) -> bool: def valid_address(address: str) -> bool: """check if address is a valid address with checksum""" - # TODO: additional validation?? - return len(address) == ENCODED_ADDRESS_LENGTH and valid_base32(address + (6 * "=")) + # Pad address so it's a valid b32 string + padded_address = address + (6 * "=") + if not (len(address) == ENCODED_ADDRESS_LENGTH and valid_base32(padded_address)): + return False + address_bytes = base64.b32decode(padded_address) + if len(address_bytes) != PUBLIC_KEY_HASH_LENGTH + ADDRESS_CHECKSUM_LENGTH: + return False + + public_key_hash = address_bytes[:PUBLIC_KEY_HASH_LENGTH] + check_sum = address_bytes[PUBLIC_KEY_HASH_LENGTH:] + verified_check_sum = sha512_256_hash(public_key_hash)[-ADDRESS_CHECKSUM_LENGTH:] + return check_sum == verified_check_sum + + +def is_transaction_type(wtype: WType) -> typing.TypeGuard[WTransaction]: + return isinstance(wtype, WTransaction) + + +def is_reference_type(wtype: WType) -> bool: + return wtype in (asset_wtype, account_wtype, application_wtype) + + +def is_arc4_encoded_type(wtype: WType) -> typing.TypeGuard[ARC4Type]: + return isinstance(wtype, ARC4Type) + + +def is_arc4_argument_type(wtype: WType) -> bool: + return ( + is_arc4_encoded_type(wtype) + or is_reference_type(wtype) + or (is_transaction_type(wtype) and wtype.transaction_type is not None) + ) diff --git a/src/wyvern/awst_build/constants.py b/src/wyvern/awst_build/constants.py index 6ae5867964..81e657978d 100644 --- a/src/wyvern/awst_build/constants.py +++ b/src/wyvern/awst_build/constants.py @@ -1,24 +1,50 @@ +import enum + +from wyvern.metadata import OnCompletionAction + ALGOPY_PREFIX = "algopy." -ARC4_CONTRACT_BASE = f"{ALGOPY_PREFIX}arc4.ARC4Contract" +ARC4_PREFIX = f"{ALGOPY_PREFIX}arc4." +ARC4_CONTRACT_BASE = f"{ARC4_PREFIX}ARC4Contract" +# special case for arc4 where algopy alias is present in algopy namespace ARC4_CONTRACT_BASE_ALIAS = f"{ALGOPY_PREFIX}ARC4Contract" +ARC4_SIGNATURE = f"{ARC4_PREFIX}arc4_signature" +ARC4_SIGNATURE_ALIAS = ARC4_SIGNATURE CONTRACT_BASE = f"{ALGOPY_PREFIX}_contract.Contract" CONTRACT_BASE_ALIAS = f"{ALGOPY_PREFIX}Contract" STRUCT_BASE = f"{ALGOPY_PREFIX}_struct.Struct" STRUCT_BASE_ALIAS = f"{ALGOPY_PREFIX}Struct" -CLS_ASSET = f"{ALGOPY_PREFIX}_primitives.Asset" +CLS_ACCOUNT = f"{ALGOPY_PREFIX}_reference.Account" +CLS_ACCOUNT_ALIAS = f"{ALGOPY_PREFIX}Account" +CLS_ASSET = f"{ALGOPY_PREFIX}_reference.Asset" CLS_ASSET_ALIAS = f"{ALGOPY_PREFIX}Asset" +CLS_APPLICATION = f"{ALGOPY_PREFIX}_reference.Application" +CLS_APPLICATION_ALIAS = f"{ALGOPY_PREFIX}Application" CLS_UINT64 = f"{ALGOPY_PREFIX}_primitives.UInt64" CLS_UINT64_ALIAS = f"{ALGOPY_PREFIX}UInt64" CLS_BYTES = f"{ALGOPY_PREFIX}_primitives.Bytes" CLS_BYTES_ALIAS = f"{ALGOPY_PREFIX}Bytes" CLS_BIGUINT = f"{ALGOPY_PREFIX}_primitives.BigUInt" CLS_BIGUINT_ALIAS = f"{ALGOPY_PREFIX}BigUInt" -CLS_ADDRESS = f"{ALGOPY_PREFIX}_primitives.Address" -CLS_ADDRESS_ALIAS = f"{ALGOPY_PREFIX}Address" +CLS_TRANSACTION_BASE = f"{ALGOPY_PREFIX}_transactions.TransactionBase" +CLS_TRANSACTION_BASE_ALIAS = f"{ALGOPY_PREFIX}TransactionBase" +CLS_PAYMENT_TRANSACTION = f"{ALGOPY_PREFIX}_transactions.PaymentTransaction" +CLS_PAYMENT_TRANSACTION_ALIAS = f"{ALGOPY_PREFIX}PaymentTransaction" +CLS_KEY_REGISTRATION_TRANSACTION = f"{ALGOPY_PREFIX}_transactions.KeyRegistrationTransaction" +CLS_KEY_REGISTRATION_TRANSACTION_ALIAS = f"{ALGOPY_PREFIX}KeyRegistrationTransaction" +CLS_ASSET_CONFIG_TRANSACTION = f"{ALGOPY_PREFIX}_transactions.AssetConfigTransaction" +CLS_ASSET_CONFIG_TRANSACTION_ALIAS = f"{ALGOPY_PREFIX}AssetConfigTransaction" +CLS_ASSET_TRANSFER_TRANSACTION = f"{ALGOPY_PREFIX}_transactions.AssetTransferTransaction" +CLS_ASSET_TRANSFER_TRANSACTION_ALIAS = f"{ALGOPY_PREFIX}AssetTransferTransaction" +CLS_ASSET_FREEZE_TRANSACTION = f"{ALGOPY_PREFIX}_transactions.AssetFreezeTransaction" +CLS_ASSET_FREEZE_TRANSACTION_ALIAS = f"{ALGOPY_PREFIX}AssetFreezeTransaction" +CLS_APPLICATION_CALL_TRANSACTION = f"{ALGOPY_PREFIX}_transactions.ApplicationCallTransaction" +CLS_APPLICATION_CALL_TRANSACTION_ALIAS = f"{ALGOPY_PREFIX}ApplicationCallTransaction" SUBROUTINE_HINT = f"{ALGOPY_PREFIX}_hints.subroutine" SUBROUTINE_HINT_ALIAS = f"{ALGOPY_PREFIX}subroutine" ABIMETHOD_DECORATOR = f"{ALGOPY_PREFIX}arc4.abimethod" ABIMETHOD_DECORATOR_ALIAS = ABIMETHOD_DECORATOR +BAREMETHOD_DECORATOR = f"{ALGOPY_PREFIX}arc4.baremethod" +BAREMETHOD_DECORATOR_ALIAS = BAREMETHOD_DECORATOR CLS_ARRAY = f"{ALGOPY_PREFIX}_array.Array" CLS_ARRAY_ALIAS = f"{ALGOPY_PREFIX}Array" APPROVAL_METHOD = "approval_program" @@ -30,11 +56,18 @@ ENSURE_BUDGET = f"{ALGOPY_PREFIX}_util.ensure_budget" OP_UP_FEE_SOURCE = f"{ALGOPY_PREFIX}_util.OpUpFeeSource" - -CLS_ABI_STRING = "algopy.arc4.String" -CLS_ABI_UINTN = "algopy.arc4.UIntN" -CLS_ABI_DYNAMIC_ARRAY = "algopy.arc4.DynamicArray" -CLS_ABI_STATIC_ARRAY = "algopy.arc4.StaticArray" +CLS_ARC4_STRING = "algopy.arc4.String" +CLS_ARC4_ADDRESS = "algopy.arc4.Address" +CLS_ARC4_BOOL = "algopy.arc4.Bool" +CLS_ARC4_BYTE = "algopy.arc4.Byte" +CLS_ARC4_UINTN = "algopy.arc4.UIntN" +CLS_ARC4_BIG_UINTN = "algopy.arc4.BigUIntN" +CLS_ARC4_UFIXEDNXM = "algopy.arc4.UFixedNxM" +CLS_ARC4_BIG_UFIXEDNXM = "algopy.arc4.BigUFixedNxM" +CLS_ARC4_DYNAMIC_ARRAY = "algopy.arc4.DynamicArray" +CLS_ARC4_STATIC_ARRAY = "algopy.arc4.StaticArray" +CLS_ARC4_TUPLE = "algopy.arc4.Tuple" +CLS_ARC4_STRUCT = "algopy.arc4.Struct" CONTRACT_STUB_TYPES = [ CONTRACT_BASE, @@ -49,25 +82,37 @@ KNOWN_METHOD_DECORATORS = [ SUBROUTINE_HINT, ABIMETHOD_DECORATOR, + BAREMETHOD_DECORATOR, ] + +# values and names are matched to AVM definitions +class TransactionType(enum.IntEnum): + pay = 1 + keyreg = 2 + acfg = 3 + axfer = 4 + afrz = 5 + appl = 6 + + ENUM_CLS_ON_COMPLETE_ACTION = f"{ALGOPY_PREFIX}_constants.OnCompleteAction" ENUM_CLS_TRANSACTION_TYPE = f"{ALGOPY_PREFIX}_constants.TransactionType" -NAMED_INT_CONST_ENUM_DATA = { +NAMED_INT_CONST_ENUM_DATA: dict[str, dict[str, enum.IntEnum]] = { ENUM_CLS_ON_COMPLETE_ACTION: { - "NoOp": (0, "NoOp"), - "OptIn": (1, "OptIn"), - "CloseOut": (2, "CloseOut"), - "ClearState": (3, "ClearState"), - "UpdateApplication": (4, "UpdateApplication"), - "DeleteApplication": (5, "DeleteApplication"), + "NoOp": OnCompletionAction.NoOp, + "OptIn": OnCompletionAction.OptIn, + "CloseOut": OnCompletionAction.CloseOut, + "ClearState": OnCompletionAction.ClearState, + "UpdateApplication": OnCompletionAction.UpdateApplication, + "DeleteApplication": OnCompletionAction.DeleteApplication, }, ENUM_CLS_TRANSACTION_TYPE: { - "Payment": (1, "pay"), - "KeyRegistration": (2, "keyreg"), - "AssetConfig": (3, "acfg"), - "AssetTransfer": (4, "axfer"), - "AssetFreeze": (5, "afrz"), - "ApplicationCall": (6, "appl"), + "Payment": TransactionType.pay, + "KeyRegistration": TransactionType.keyreg, + "AssetConfig": TransactionType.acfg, + "AssetTransfer": TransactionType.axfer, + "AssetFreeze": TransactionType.afrz, + "ApplicationCall": TransactionType.appl, }, } diff --git a/src/wyvern/awst_build/context.py b/src/wyvern/awst_build/context.py index 34b67d0aa8..112d69f8dd 100644 --- a/src/wyvern/awst_build/context.py +++ b/src/wyvern/awst_build/context.py @@ -1,5 +1,4 @@ import contextlib -import typing as t from collections.abc import Iterator, Mapping, Sequence import attrs @@ -7,10 +6,15 @@ import mypy.types from wyvern.awst import wtypes -from wyvern.awst.nodes import ConstantValue, Module -from wyvern.awst_build import constants as awst_constants +from wyvern.awst.nodes import ( + ConstantValue, + Literal as AWSTLiteral, + Module, +) +from wyvern.awst_build import constants +from wyvern.awst_build.eb.base import TypeClassExpressionBuilder from wyvern.context import CompileContext -from wyvern.errors import CodeError, InternalError, WyvernError, crash_report +from wyvern.errors import CodeError, InternalError, WyvernError, log_exceptions from wyvern.parse import SourceLocation from wyvern.utils import attrs_extend @@ -19,32 +23,6 @@ class ASTConversionContext(CompileContext): module_asts: Mapping[str, Module] constants: dict[str, ConstantValue] = attrs.field(factory=dict) - type_map: dict[str, wtypes.WType] = attrs.field( - # TODO: rm hax? - factory=lambda: { - awst_constants.CLS_UINT64: wtypes.uint64_wtype, - awst_constants.CLS_BIGUINT: wtypes.biguint_wtype, - awst_constants.CLS_ADDRESS: wtypes.address_wtype, - awst_constants.CLS_BYTES: wtypes.bytes_wtype, - awst_constants.CLS_ABI_STRING: wtypes.abi_string_wtype, - awst_constants.CLS_ASSET: wtypes.asset_wtype, - "builtins.bool": wtypes.bool_wtype, - } - ) - generics_type_map: dict[ - str, t.Callable[[Sequence[wtypes.WType | mypy.types.LiteralValue]], wtypes.WType] - ] = attrs.field( - factory=lambda: { - awst_constants.CLS_ARRAY: lambda args: wtypes.WArray.from_element_type(*args), - awst_constants.CLS_ABI_DYNAMIC_ARRAY: ( - lambda args: wtypes.AbiDynamicArray.from_element_type(*args) - ), - awst_constants.CLS_ABI_STATIC_ARRAY: ( - lambda args: wtypes.AbiStaticArray.from_element_type_and_size(*args) - ), - awst_constants.CLS_ABI_UINTN: (lambda args: wtypes.AbiUIntN.from_scale(*args)), - } - ) def for_module(self, current_module: mypy.nodes.MypyFile) -> "ASTConversionModuleContext": return attrs_extend(ASTConversionModuleContext, self, current_module=current_module) @@ -53,6 +31,7 @@ def for_module(self, current_module: mypy.nodes.MypyFile) -> "ASTConversionModul @attrs.frozen(kw_only=True) class ASTConversionModuleContext(ASTConversionContext): current_module: mypy.nodes.MypyFile + type_map: dict[str, wtypes.WStructType | wtypes.ARC4Struct] = attrs.field(factory=dict) @property def module_name(self) -> str: @@ -85,35 +64,40 @@ def warning(self, msg: str, location: mypy.nodes.Context | SourceLocation) -> No def log_exceptions( self, fallback_location: mypy.nodes.Context | SourceLocation ) -> Iterator[None]: - try: + with log_exceptions(self.errors, self._maybe_convert_location(fallback_location)): yield - except CodeError as ex: - self.error(str(ex), location=ex.location or fallback_location) - except InternalError as ex: - self.error(f"FATAL {ex!s}", location=ex.location or fallback_location) - crash_report(ex.location or self._maybe_convert_location(fallback_location)) - except Exception as ex: - self.error(f"UNEXPECTED {ex!s}", location=fallback_location) - crash_report(self._maybe_convert_location(fallback_location)) def type_to_wtype( self, typ: mypy.types.Type, *, source_location: SourceLocation | mypy.nodes.Context ) -> wtypes.WType: + return self._type_to_builder(typ, source_location=source_location).produces() + + def _type_to_builder( + self, typ: mypy.types.Type, *, source_location: SourceLocation | mypy.nodes.Context + ) -> TypeClassExpressionBuilder: + from wyvern.awst_build.eb.arc4.tuple import ARC4TupleClassExpressionBuilder + from wyvern.awst_build.eb.tuple import TupleTypeExpressionBuilder + from wyvern.awst_build.eb.void import VoidTypeExpressionBuilder + loc = self._maybe_convert_location(source_location) - match mypy.types.get_proper_type(typ): + proper_type = mypy.types.get_proper_type(typ) + match proper_type: case mypy.types.NoneType() | mypy.types.PartialType(type=None): - return wtypes.void_wtype + return VoidTypeExpressionBuilder(loc) case mypy.types.LiteralType(fallback=fallback): - return self.type_to_wtype(fallback, source_location=loc) - case mypy.types.TupleType(items=items): - types = [self.type_to_wtype(it, source_location=loc) for it in items] - if wtypes.void_wtype in types: - raise CodeError("Tuples cannot contain None values", loc) - return wtypes.WTuple.from_types(types) + return self._type_to_builder(fallback, source_location=loc) + case mypy.types.TupleType(items=items, partial_fallback=true_type): + types = [self._type_to_builder(it, source_location=loc) for it in items] + tuple_builder: TupleTypeExpressionBuilder | ARC4TupleClassExpressionBuilder + if true_type.type.fullname != constants.CLS_ARC4_TUPLE: + tuple_builder = TupleTypeExpressionBuilder(loc) + else: + tuple_builder = ARC4TupleClassExpressionBuilder(loc) + return tuple_builder.index_multiple(types, loc) case mypy.types.Instance(type=mypy.nodes.TypeInfo(is_enum=True, bases=bases)): for base in bases: try: - return self.type_to_wtype(base, source_location=loc) + return self._type_to_builder(base, source_location=loc) except WyvernError: pass raise CodeError("Cannot resolve enum type to an appropriate base type", loc) @@ -129,7 +113,7 @@ def type_to_wtype( if not items: raise CodeError("Cannot resolve empty type", loc) elif len(items) == 1: - return self.type_to_wtype(items[0], source_location=loc) + return self._type_to_builder(items[0], source_location=loc) else: raise CodeError("Type unions are unsupported at this location", loc) case mypy.types.AnyType(): @@ -142,29 +126,45 @@ def type_to_wtype( def resolve_type_from_name_and_args( self, type_fullname: str, inst_args: Sequence[mypy.types.Type] | None, loc: SourceLocation - ) -> wtypes.WType: + ) -> TypeClassExpressionBuilder: + from wyvern.awst_build.eb.arc4.struct import ARC4StructClassExpressionBuilder + from wyvern.awst_build.eb.struct import StructSubclassExpressionBuilder + from wyvern.awst_build.eb.type_registry import get_type_builder + + try: + mapped_wtype = self.type_map[type_fullname] + except KeyError: + pass + else: + if isinstance(mapped_wtype, wtypes.ARC4Struct): + return ARC4StructClassExpressionBuilder(mapped_wtype, loc) + else: + return StructSubclassExpressionBuilder(mapped_wtype, loc) + + cls_type_builder = get_type_builder(type_fullname, loc) if not inst_args: - try: - return self.type_map[type_fullname] - except KeyError as ex: - raise CodeError(f"Unsupported type: {type_fullname}", loc) from ex - wtype_callable = self.generics_type_map.get(type_fullname) - if wtype_callable is None: - raise CodeError(f"Unsupported generic type: {type_fullname}", loc) - type_args_resolved = [ - ta.value + if not isinstance(cls_type_builder, TypeClassExpressionBuilder): + raise CodeError(f"Missing generic type parameter(s) for {type_fullname}", loc) + return cls_type_builder + + if any(isinstance(a, mypy.types.AnyType) for a in inst_args): + raise CodeError(f"Unresolved generic type parameter for {type_fullname}", loc) + + type_args_resolved: list[TypeClassExpressionBuilder | AWSTLiteral] = [ + AWSTLiteral(value=ta.value, source_location=loc) # type: ignore[arg-type] if isinstance(ta, mypy.types.LiteralType) - else self.type_to_wtype(ta, source_location=loc) + else self._type_to_builder(ta, source_location=loc) for ta in inst_args ] - try: - return wtype_callable(type_args_resolved) - except Exception as ex: - raise CodeError( - f"Invalid parametrisation of generic type: {type_fullname}" - f" with {type_args_resolved}", - loc, - ) from ex + if len(type_args_resolved) == 1: + indexed_type = cls_type_builder.index(type_args_resolved[0], loc) + else: + indexed_type = cls_type_builder.index_multiple(type_args_resolved, loc) + if not isinstance(indexed_type, TypeClassExpressionBuilder): + raise InternalError( + f"Expected TypeClassExpressionBuilder got: {type(indexed_type).__name__}", loc + ) + return indexed_type def mypy_expr_node_type(self, expr: mypy.nodes.Expression) -> wtypes.WType: mypy_type = self.get_mypy_expr_type(expr) diff --git a/src/wyvern/awst_build/contract.py b/src/wyvern/awst_build/contract.py index 82e2354b3b..356f019a94 100644 --- a/src/wyvern/awst_build/contract.py +++ b/src/wyvern/awst_build/contract.py @@ -1,10 +1,14 @@ +import typing from collections.abc import Iterator, Mapping +from typing import Never import mypy.nodes import mypy.types +import mypy.visitor +import wyvern.metadata +from wyvern.awst import wtypes from wyvern.awst.nodes import ( - ABIMethodConfig, AppStateDefinition, AppStateKind, BytesEncoding, @@ -17,12 +21,16 @@ from wyvern.awst_build.context import ASTConversionModuleContext from wyvern.awst_build.subroutine import ContractMethodInfo, FunctionASTConverter from wyvern.awst_build.utils import ( + extract_bytes_literal_from_mypy, extract_docstring, get_decorators_by_fullname, iterate_user_bases, qualified_class_name, ) from wyvern.errors import CodeError, InternalError +from wyvern.ir.arc4_util import wtype_to_arc4 +from wyvern.metadata import ARC4DefaultArgument, ARC4MethodConfig, ARC32StructDef +from wyvern.parse import SourceLocation class ContractASTConverter(BaseMyPyStatementVisitor[None]): @@ -126,7 +134,7 @@ def visit_function( keep_going = False dec_by_fullname = get_decorators_by_fullname(self.context, decorator) if decorator else {} - # TODO: valid decorator ordering? + # TODO: validate decorator ordering? dec_by_fullname.pop("abc.abstractmethod", None) for unknown_dec_fullname in dec_by_fullname.keys() - frozenset( constants.KNOWN_METHOD_DECORATORS @@ -136,7 +144,7 @@ def visit_function( if not keep_going: pass # unrecoverable error in prior validation, - # TODO: handle difference of subroutine vs abimethod and overrrides??? + # TODO: handle difference of subroutine vs abimethod and overrides??? elif func_def.name == "__init__": sub = self._handle_method( func_def, extra_decorators=dec_by_fullname, abimethod_config=None @@ -171,33 +179,67 @@ def visit_function( else: subroutine_dec = dec_by_fullname.pop(constants.SUBROUTINE_HINT, None) abimethod_dec = dec_by_fullname.pop(constants.ABIMETHOD_DECORATOR, None) + baremethod_dec = dec_by_fullname.pop(constants.BAREMETHOD_DECORATOR, None) - abimethod_config: ABIMethodConfig | None = None - if abimethod_dec is not None: + if not (subroutine_dec or abimethod_dec or baremethod_dec): + self._error( + f"member functions (other than __init__ or approval / clear program methods)" + f" must be annotated with exactly one of @{constants.SUBROUTINE_HINT_ALIAS} or" + f" @{constants.ABIMETHOD_DECORATOR_ALIAS}", + func_loc, + ) + + arc4_method_config = None + arc4_decorator = abimethod_dec or baremethod_dec + if arc4_decorator is not None: + arc4_decorator_name = ( + constants.ABIMETHOD_DECORATOR_ALIAS + if abimethod_dec + else constants.BAREMETHOD_DECORATOR_ALIAS + ) + + arc4_decorator_loc = self._location(arc4_decorator) if not self._is_arc4: self._error( - f"abimethod decorator is only for subclasses" + f"{arc4_decorator_name} decorator is only for subclasses" f" of {constants.ARC4_CONTRACT_BASE_ALIAS}", - abimethod_dec, + arc4_decorator_loc, ) + if abimethod_dec and baremethod_dec: + self._error("cannot be both an abimethod and a baremethod", arc4_decorator_loc) if subroutine_dec is not None: - self._error("cannot be both a subroutine and an abimethod", subroutine_dec) - abimethod_config = ABIMethodConfig( - name_override=None, # TODO - source_location=self._location(abimethod_dec), + self._error( + f"cannot be both a subroutine and {arc4_decorator_name}", subroutine_dec + ) + *arg_wtypes, ret_wtype = get_func_types( + self.context, func_def, location=arc4_decorator_loc + ).values() + arc4_method_config = _get_arc4_method_config( + self.context, arc4_decorator, func_def ) - self.context.warning("TODO: @abimethod config handling", location=func_def) - # TODO: validate arg types are all ABI + if arc4_method_config.is_bare: + if arg_wtypes or (ret_wtype is not wtypes.void_wtype): + self._error( + "bare methods should have no arguments or return values", + arc4_decorator_loc, + ) + else: + for arg_wtype in arg_wtypes: + if not wtypes.is_arc4_argument_type(arg_wtype): + self._error( + f"Invalid argument type for an ARC4 method: {arg_wtype}", + arc4_decorator_loc, + ) + if not ( + ret_wtype is wtypes.void_wtype or wtypes.is_arc4_encoded_type(ret_wtype) + ): + self._error( + f"Invalid return type for an ARC4 method: {ret_wtype}", + arc4_decorator_loc, + ) # TODO: validate against super-class configs?? - elif subroutine_dec is None: - self._error( - f"member functions (other than __init__ or approval / clear program methods)" - f" must be annotated with exactly one of @{constants.SUBROUTINE_HINT_ALIAS} or" - f" @{constants.ABIMETHOD_DECORATOR_ALIAS}", - func_loc, - ) sub = self._handle_method( - func_def, extra_decorators=dec_by_fullname, abimethod_config=abimethod_config + func_def, extra_decorators=dec_by_fullname, abimethod_config=arc4_method_config ) if sub is not None: self._subroutines.append(sub) @@ -206,7 +248,7 @@ def _handle_method( self, func_def: mypy.nodes.FuncDef, extra_decorators: Mapping[str, mypy.nodes.Expression], - abimethod_config: ABIMethodConfig | None, + abimethod_config: ARC4MethodConfig | None, ) -> ContractMethod | None: func_loc = self._location(func_def) self._precondition( @@ -227,7 +269,7 @@ def _handle_method( func_def=func_def, contract_method_info=ContractMethodInfo( type_info=self.class_def.info, - abimethod_config=abimethod_config, + arc4_method_config=abimethod_config, app_state=self.app_state, cref=self.cref, ), @@ -264,6 +306,9 @@ def _unsupported(self, kind: str, stmt: mypy.nodes.Statement) -> None: self._error(f"{kind} statements are not supported in the class body", location=stmt) def visit_assignment_stmt(self, stmt: mypy.nodes.AssignmentStmt) -> None: + if isinstance(stmt.rvalue, mypy.nodes.TempNode): + # silently allow state declarations, these will be picked up by gather state + return self._unsupported("assignment", stmt) def visit_operator_assignment_stmt(self, stmt: mypy.nodes.OperatorAssignmentStmt) -> None: @@ -351,6 +396,191 @@ def _gather_app_state( ) +def get_func_types( + context: ASTConversionModuleContext, func_def: mypy.nodes.FuncDef, location: SourceLocation +) -> dict[str, wtypes.WType]: + skip_first = ( + 1 + if func_def.arguments + and (func_def.arguments[0].variable.is_self or func_def.arguments[0].variable.is_cls) + else 0 + ) + in_var_names = [arg.variable.name for arg in func_def.arguments[skip_first:]] + 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[skip_first:] + [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) + create = abi_hints.get("create", False) + readonly = abi_hints.get("readonly", False) + default_args = 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 = [ + (n, _wtype_to_struct_def(t)) + for n, t in get_func_types(context, func_def, dec_loc).items() + if isinstance(t, wtypes.ARC4Struct) + ] + + return ARC4MethodConfig( + source_location=dec_loc, + name=name, + allowed_completion_types=[ + wyvern.metadata.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=[ + ARC4DefaultArgument(parameter=p, source=s) for p, s in default_args.items() + ], + 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("wyvern."): + 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/wyvern/awst_build/eb/abi.py b/src/wyvern/awst_build/eb/abi.py deleted file mode 100644 index a3791813f6..0000000000 --- a/src/wyvern/awst_build/eb/abi.py +++ /dev/null @@ -1,502 +0,0 @@ -from __future__ import annotations - -from abc import ABC -from typing import TYPE_CHECKING - -import structlog - -from wyvern.awst import wtypes -from wyvern.awst.nodes import ( - AbiConstant, - AbiDecode, - AbiEncode, - BytesEncoding, - Expression, - IndexExpression, - IntrinsicCall, - Literal, - NewAbiArray, - ReinterpretCast, - UInt64Constant, -) -from wyvern.awst_build.eb.base import ( - ExpressionBuilder, - IntermediateExpressionBuilder, - Iteration, - TypeClassExpressionBuilder, - ValueExpressionBuilder, -) -from wyvern.awst_build.eb.bytes_backed import BytesBackedClassExpressionBuilder -from wyvern.awst_build.eb.var_factory import var_expression -from wyvern.awst_build.utils import expect_operand_wtype, require_expression_builder -from wyvern.errors import CodeError, InternalError - -if TYPE_CHECKING: - from collections.abc import Sequence - - import mypy.nodes - - from wyvern.parse import SourceLocation - -logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) - - -def abi_to_avm_wtype(abi_wtype: wtypes.WType) -> wtypes.WType: - match abi_wtype: - case wtypes.abi_string_wtype: - return wtypes.bytes_wtype - case wtypes.AbiUIntN(): - return wtypes.uint64_wtype - case _: - raise InternalError("Invalid abi_wtype") - - -class AbiClassExpressionBuilder(BytesBackedClassExpressionBuilder, ABC): - def __init__( - self, - location: SourceLocation, - ): - super().__init__(location) - - def member_access( - self, - name: str, - location: SourceLocation, - ) -> ExpressionBuilder: - """Handle self.name""" - match name: - case "encode": - return AbiEncodeBuilder(location, self.produces()) - case _: - return super().member_access(name, location) - - -class DynamicArrayClassExpressionBuilder(BytesBackedClassExpressionBuilder): - element_abi_type: wtypes.WType | None - abi_type: wtypes.AbiDynamicArray | None - - def __init__( - self, - location: SourceLocation, - ): - super().__init__(location) - self.element_abi_type = None - self.abi_type = None - - def index( - self, - index: ExpressionBuilder | Literal, - location: SourceLocation, - ) -> ExpressionBuilder: - match index: - case TypeClassExpressionBuilder() as eb: - self.element_abi_type = eb.produces() - self.abi_type = wtypes.AbiDynamicArray.from_element_type(self.element_abi_type) - case _: - raise CodeError("Invalid/unhandled arguments", location) - return self - - 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: - non_literal_args = [ - require_expression_builder(a, msg="Array arguments must be non literals").rvalue() - for a in args - ] - if self.element_abi_type is None: - if non_literal_args: - self.element_abi_type = non_literal_args[0].wtype - else: - raise CodeError( - "Empy arrays require a type annotation to be instantiated", location - ) - if self.abi_type is None: - self.abi_type = wtypes.AbiDynamicArray.from_element_type(self.element_abi_type) - for a in non_literal_args: - expect_operand_wtype(a, self.element_abi_type) - - array_expr = NewAbiArray( - source_location=location, elements=tuple(non_literal_args), wtype=self.abi_type - ) - return var_expression(array_expr) - - def produces(self) -> wtypes.WType: - if not self.abi_type: - raise InternalError( - "Cannot resolve wtype of generic EB until the index method is called with the " - "generic type parameter." - ) - return self.abi_type - - -class StaticArrayClassExpressionBuilder(BytesBackedClassExpressionBuilder): - element_abi_type: wtypes.WType | None - abi_type: wtypes.AbiStaticArray | None - array_size: int | None - - def __init__( - self, - location: SourceLocation, - ): - super().__init__(location) - self.element_abi_type = None - self.abi_type = None - - def index_multiple( - self, - index: Sequence[ExpressionBuilder | Literal], - location: SourceLocation, - ) -> ExpressionBuilder: - match index: - case [TypeClassExpressionBuilder() as item_type, array_size]: - match array_size: - case Literal(value=int(lit_value)): - self.array_size = lit_value - case ValueExpressionBuilder() as eb: - value = eb.rvalue() - if not isinstance(value, UInt64Constant): - raise CodeError("Array size must be compile time constant") - self.array_size = value.value - case _: - raise CodeError("Array size must be compile time constant") - - self.element_abi_type = item_type.produces() - self.abi_type = wtypes.AbiStaticArray.from_element_type_and_size( - array_size=self.array_size, - element_type=self.element_abi_type, - ) - - case _: - raise CodeError( - "Invalid type arguments for StaticArray. " - "Expected StaticArray[ItemType, typing.Literal[n]]", - location, - ) - return self - - 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: - non_literal_args = [ - require_expression_builder(a, msg="Array arguments must be non literals").rvalue() - for a in args - ] - if self.element_abi_type is None: - if non_literal_args: - self.element_abi_type = non_literal_args[0].wtype - else: - raise CodeError( - "Empty arrays require a type annotation to be instantiated", location - ) - if self.array_size is None: - self.array_size = len(non_literal_args) - elif self.array_size != len(non_literal_args): - raise CodeError( - f"StaticArray should be initialized with {self.array_size} values", location - ) - - if self.abi_type is None: - self.abi_type = wtypes.AbiStaticArray.from_element_type_and_size( - element_type=self.element_abi_type, array_size=self.array_size - ) - for a in non_literal_args: - expect_operand_wtype(a, self.element_abi_type) - - array_expr = NewAbiArray( - source_location=location, elements=tuple(non_literal_args), wtype=self.abi_type - ) - return var_expression(array_expr) - - def produces(self) -> wtypes.WType: - if not self.abi_type: - raise InternalError( - "Cannot resolve wtype of generic EB until the index method is called with the " - "generic type parameter." - ) - return self.abi_type - - -class UIntNClassExpressionBuilder(AbiClassExpressionBuilder): - def produces(self) -> wtypes.WType: - if not self.abi_type: - raise InternalError( - "Cannot resolve wtype of generic EB until the index method is called with the " - "generic type parameter." - ) - return self.abi_type - - 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=int(int_literal), source_location=loc)]: - const = AbiConstant( - value=int_literal.to_bytes(1, "big"), - source_location=loc, - wtype=self.abi_type, - ) - return var_expression(const) - case _: - raise CodeError("Invalid/unhandled arguments", location) - - def index( - self, - index: ExpressionBuilder | Literal, - location: SourceLocation, - ) -> ExpressionBuilder: - match index: - case Literal(value=int(lit_value)): - self.abi_type = wtypes.AbiUIntN.from_scale(lit_value) - case ValueExpressionBuilder() as eb: - value = eb.rvalue() - if not isinstance(value, UInt64Constant): - raise CodeError("Array size must be compile time constant") - self.abi_type = wtypes.AbiUIntN.from_scale(value.value) - case _: - raise CodeError("Array size must be compile time constant") - return self - - -class StringClassExpressionBuilder(AbiClassExpressionBuilder): - def produces(self) -> wtypes.WType: - return self.abi_type - - def __init__(self, location: SourceLocation): - super().__init__( - location, - ) - self.abi_type = wtypes.abi_string_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: - match args: - case [Literal(value=bytes(bytes_val), source_location=loc)]: - bytes_const = len(bytes_val).to_bytes(2, "big") + bytes_val - const = AbiConstant( - value=bytes_const, - source_location=loc, - wtype=wtypes.abi_string_wtype, - bytes_encoding=BytesEncoding.utf8, - ) - return var_expression(const) - case [Literal(value=str(str_val), source_location=loc)]: - # TODO: Confirm encoding - bytes_val = str_val.encode("utf8") - bytes_const = len(bytes_val).to_bytes(2, "big") + bytes_val - - const = AbiConstant( - value=bytes_const, - source_location=loc, - wtype=wtypes.abi_string_wtype, - bytes_encoding=BytesEncoding.utf8, - ) - return var_expression(const) - case _: - raise CodeError("Invalid/unhandled arguments", location) - - -class AbiEncodeBuilder(IntermediateExpressionBuilder): - def __init__(self, location: SourceLocation, abi_type: wtypes.WType): - super().__init__(location=location) - self.abi_type = abi_type - - 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 [ExpressionBuilder() as eb] if eb.rvalue().wtype == abi_to_avm_wtype( - self.abi_type - ): - value = eb.rvalue() - case _: - raise CodeError("Invalid/unhandled arguments", location) - - expr = AbiEncode( - source_location=location, - value=value, - wtype=self.abi_type, - ) - return var_expression(expr) - - -class AbiDecodeBuilder(IntermediateExpressionBuilder): - def __init__(self, expr: Expression, location: SourceLocation): - super().__init__(location=location) - match expr.wtype: - case wtypes.abi_string_wtype: - pass - case wtypes.AbiUIntN(): - pass - case _: - raise InternalError("Unsupported wtype") - self.expr = expr - - 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 []: - pass - case _: - raise CodeError("Invalid/unhandled arguments", location) - - expr = AbiDecode( - source_location=location, value=self.expr, wtype=abi_to_avm_wtype(self.expr.wtype) - ) - return var_expression(expr) - - -class AbiEncodedExpressionBuilder(ValueExpressionBuilder): - def member_access( - self, - name: str, - location: SourceLocation, - ) -> ExpressionBuilder: - match name: - case "decode": - return AbiDecodeBuilder(self.expr, location) - case "bytes": - return var_expression( - ReinterpretCast( - expr=self.expr, - wtype=wtypes.bytes_wtype, - source_location=location, - ) - ) - case _: - raise CodeError( - f"Unrecognised member of bytes: {name}", - location, - ) - - -class StringExpressionBuilder(AbiEncodedExpressionBuilder): - wtype = wtypes.abi_string_wtype - - def member_access( - self, - name: str, - location: SourceLocation, - ) -> ExpressionBuilder: - match name: - case _: - return super().member_access(name, location) - - -class UIntNExpressionBuilder(AbiEncodedExpressionBuilder): - def __init__(self, expr: Expression): - self.wtype = expr.wtype - super().__init__(expr) - - def member_access( - self, - name: str, - location: SourceLocation, - ) -> ExpressionBuilder: - match name: - case _: - return super().member_access(name, location) - - -class AbiArrayExpressionBuilder(ValueExpressionBuilder, ABC): - wtype: wtypes.AbiDynamicArray | wtypes.AbiStaticArray - - def iterate(self) -> Iteration: - return self.rvalue() - - def index( - self, index: ExpressionBuilder | Literal, location: SourceLocation - ) -> ExpressionBuilder: - index_expr = expect_operand_wtype(index, wtypes.uint64_wtype) - expr = IndexExpression( - source_location=location, - base=self.expr, - index=index_expr, - wtype=self.wtype.element_type, - ) - return var_expression(expr) - - def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: - match name: - case "bytes": - return var_expression( - ReinterpretCast( - expr=self.expr, - wtype=wtypes.bytes_wtype, - source_location=location, - ) - ) - case _: - return super().member_access(name, location) - - -class DynamicArrayExpressionBuilder(AbiArrayExpressionBuilder): - wtype: wtypes.AbiDynamicArray - - def __init__(self, expr: Expression): - assert isinstance(expr.wtype, wtypes.AbiDynamicArray) - self.wtype = expr.wtype - super().__init__(expr) - - def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: - match name: - case "length": - return var_expression( - IntrinsicCall( - op_code="extract_uint16", - stack_args=[self.expr, UInt64Constant(value=0, source_location=location)], - source_location=location, - wtype=wtypes.uint64_wtype, - ) - ) - case _: - return super().member_access(name, location) - - -class StaticArrayExpressionBuilder(ValueExpressionBuilder): - wtype: wtypes.AbiStaticArray - - def __init__(self, expr: Expression): - assert isinstance(expr.wtype, wtypes.AbiStaticArray) - self.wtype = expr.wtype - super().__init__(expr) - - def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: - match name: - case "length": - return var_expression( - UInt64Constant(value=self.wtype.array_size, source_location=location) - ) - case _: - return super().member_access(name, location) diff --git a/src/wyvern/awst_build/eb/arc4/__init__.py b/src/wyvern/awst_build/eb/arc4/__init__.py new file mode 100644 index 0000000000..0cca978f1a --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/__init__.py @@ -0,0 +1,7 @@ +# ruff: noqa: F403 +from wyvern.awst_build.eb.arc4.arrays import * +from wyvern.awst_build.eb.arc4.bool import * +from wyvern.awst_build.eb.arc4.numeric import * +from wyvern.awst_build.eb.arc4.string import * +from wyvern.awst_build.eb.arc4.struct import * +from wyvern.awst_build.eb.arc4.tuple import * diff --git a/src/wyvern/awst_build/eb/arc4/arrays.py b/src/wyvern/awst_build/eb/arc4/arrays.py new file mode 100644 index 0000000000..dafd7e5f0c --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/arrays.py @@ -0,0 +1,307 @@ +from __future__ import annotations + +from abc import ABC +from typing import TYPE_CHECKING + +import structlog + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + ARC4ArrayEncode, + Expression, + IndexExpression, + IntrinsicCall, + Literal, + UInt64BinaryOperation, + UInt64BinaryOperator, + UInt64Constant, +) +from wyvern.awst_build.eb.arc4.base import ( + get_bytes_expr_builder, + get_integer_literal_value, +) +from wyvern.awst_build.eb.base import ( + ExpressionBuilder, + GenericClassExpressionBuilder, + Iteration, + TypeClassExpressionBuilder, + ValueExpressionBuilder, +) +from wyvern.awst_build.eb.bytes_backed import BytesBackedClassExpressionBuilder +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import ( + expect_operand_wtype, + require_expression_builder, +) +from wyvern.errors import CodeError, InternalError + +if TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +class DynamicArrayGenericClassExpressionBuilder(GenericClassExpressionBuilder): + def index_multiple( + self, index: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> TypeClassExpressionBuilder: + match index: + case [TypeClassExpressionBuilder() as eb]: + element_wtype = eb.produces() + wtype = wtypes.ARC4DynamicArray.from_element_type(element_wtype) + case _: + raise CodeError("Invalid/unhandled arguments", location) + return DynamicArrayClassExpressionBuilder(location=location, wtype=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: + return dynamic_array_constructor(args=args, wtype=None, location=location) + + +def dynamic_array_constructor( + args: Sequence[ExpressionBuilder | Literal], + wtype: wtypes.ARC4DynamicArray | None, + location: SourceLocation, +) -> ExpressionBuilder: + non_literal_args = [ + require_expression_builder(a, msg="Array arguments must be non literals").rvalue() + for a in args + ] + if wtype is None: + if non_literal_args: + 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) + + for a in non_literal_args: + expect_operand_wtype(a, wtype.element_type) + + return var_expression( + ARC4ArrayEncode( + source_location=location, + values=tuple(non_literal_args), + wtype=wtype, + ) + ) + + +class DynamicArrayClassExpressionBuilder(BytesBackedClassExpressionBuilder): + def __init__(self, location: SourceLocation, wtype: wtypes.ARC4DynamicArray | None = None): + super().__init__(location) + self.wtype = 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: + return dynamic_array_constructor(args=args, wtype=self.wtype, location=location) + + def produces(self) -> wtypes.WType: + if not self.wtype: + raise InternalError( + "Cannot resolve wtype of generic EB until the index method is called with the " + "generic type parameter." + ) + return self.wtype + + +class StaticArrayGenericClassExpressionBuilder(GenericClassExpressionBuilder): + def index_multiple( + self, index: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> TypeClassExpressionBuilder: + match index: + case [TypeClassExpressionBuilder() as item_type, array_size]: + array_size_ = get_integer_literal_value(array_size, "Array size") + element_wtype = item_type.produces() + wtype = wtypes.ARC4StaticArray.from_element_type_and_size( + array_size=array_size_, + element_type=element_wtype, + ) + + case _: + raise CodeError( + "Invalid type arguments for StaticArray. " + "Expected StaticArray[ItemType, typing.Literal[n]]", + location, + ) + return StaticArrayClassExpressionBuilder(location=location, wtype=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: + return static_array_constructor(args=args, wtype=None, location=location) + + +def static_array_constructor( + args: Sequence[ExpressionBuilder | Literal], + wtype: wtypes.ARC4StaticArray | None, + location: SourceLocation, +) -> ExpressionBuilder: + non_literal_args = [ + require_expression_builder(a, msg="Array arguments must be non literals").rvalue() + for a in args + ] + if wtype is None: + if non_literal_args: + element_wtype = non_literal_args[0].wtype + array_size = len(non_literal_args) + wtype = wtypes.ARC4StaticArray.from_element_type_and_size( + array_size=array_size, + element_type=element_wtype, + ) + else: + raise CodeError("Empty arrays require a type annotation to be instantiated", location) + elif wtype.array_size != len(non_literal_args): + raise CodeError( + f"StaticArray should be initialized with {wtype.array_size} values", + location, + ) + + for a in non_literal_args: + expect_operand_wtype(a, wtype.element_type) + + return var_expression( + ARC4ArrayEncode( + source_location=location, + values=tuple(non_literal_args), + wtype=wtype, + ) + ) + + +class StaticArrayClassExpressionBuilder(BytesBackedClassExpressionBuilder): + def __init__(self, location: SourceLocation, wtype: wtypes.ARC4StaticArray | None = None): + super().__init__(location) + self.wtype = 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: + return static_array_constructor(args=args, wtype=self.wtype, location=location) + + def produces(self) -> wtypes.WType: + if not self.wtype: + raise InternalError( + "Cannot resolve wtype of generic EB until the index method is called with the " + "generic type parameter." + ) + return self.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" + ) + + def index_multiple( + self, index: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> ExpressionBuilder: + raise CodeError( + "Address does not support type arguments", + location, + ) + + +class ARC4ArrayExpressionBuilder(ValueExpressionBuilder, ABC): + wtype: wtypes.ARC4DynamicArray | wtypes.ARC4StaticArray + + def iterate(self) -> Iteration: + return self.rvalue() + + def index( + self, index: ExpressionBuilder | Literal, location: SourceLocation + ) -> ExpressionBuilder: + if isinstance(index, Literal) and isinstance(index.value, int) and index.value < 0: + index_expr: Expression = UInt64BinaryOperation( + left=expect_operand_wtype( + self.member_access("length", index.source_location), wtypes.uint64_wtype + ), + op=UInt64BinaryOperator.sub, + right=UInt64Constant( + value=abs(index.value), source_location=index.source_location + ), + source_location=index.source_location, + ) + else: + index_expr = expect_operand_wtype(index, wtypes.uint64_wtype) + return var_expression( + IndexExpression( + source_location=location, + base=self.expr, + index=index_expr, + wtype=self.wtype.element_type, + ) + ) + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + match name: + case "bytes": + return get_bytes_expr_builder(self.expr) + case _: + return super().member_access(name, location) + + +class DynamicArrayExpressionBuilder(ARC4ArrayExpressionBuilder): + def __init__(self, expr: Expression): + assert isinstance(expr.wtype, wtypes.ARC4DynamicArray) + self.wtype: wtypes.ARC4DynamicArray = expr.wtype + super().__init__(expr) + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + match name: + case "length": + return var_expression( + IntrinsicCall( + op_code="extract_uint16", + stack_args=[self.expr, UInt64Constant(value=0, source_location=location)], + source_location=location, + wtype=wtypes.uint64_wtype, + ) + ) + case _: + return super().member_access(name, location) + + +class StaticArrayExpressionBuilder(ARC4ArrayExpressionBuilder): + def __init__(self, expr: Expression): + assert isinstance(expr.wtype, wtypes.ARC4StaticArray) + self.wtype: wtypes.ARC4StaticArray = expr.wtype + super().__init__(expr) + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + match name: + case "length": + return var_expression( + UInt64Constant(value=self.wtype.array_size, source_location=location) + ) + case _: + return super().member_access(name, location) diff --git a/src/wyvern/awst_build/eb/arc4/base.py b/src/wyvern/awst_build/eb/arc4/base.py new file mode 100644 index 0000000000..3cb25d6964 --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/base.py @@ -0,0 +1,170 @@ +from __future__ import annotations + +from abc import ABC +from typing import TYPE_CHECKING + +import structlog + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + ARC4Decode, + ARC4Encode, + BytesComparisonExpression, + EqualityComparison, + Expression, + Literal, + ReinterpretCast, +) +from wyvern.awst_build.eb.base import ( + BuilderComparisonOp, + ExpressionBuilder, + IntermediateExpressionBuilder, + ValueExpressionBuilder, +) +from wyvern.awst_build.eb.bytes_backed import BytesBackedClassExpressionBuilder +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.errors import CodeError, InternalError + +if TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +def arc4_to_avm_wtype(arc4_wtype: wtypes.WType) -> wtypes.WType: + match arc4_wtype: + case wtypes.arc4_string_wtype: + return wtypes.bytes_wtype + case wtypes.arc4_bool_wtype: + return wtypes.bool_wtype + case wtypes.ARC4UIntN(n=n) | wtypes.ARC4UFixedNxM(n=n): + return wtypes.uint64_wtype if n <= 64 else wtypes.biguint_wtype + case wtypes.ARC4Tuple(types=types): + return wtypes.WTuple.from_types(types) + raise InternalError("Invalid arc4_wtype") + + +def get_bytes_expr(expr: Expression) -> ReinterpretCast: + return ReinterpretCast( + expr=expr, wtype=wtypes.bytes_wtype, source_location=expr.source_location + ) + + +def get_bytes_expr_builder(expr: Expression) -> ExpressionBuilder: + return var_expression(get_bytes_expr(expr)) + + +class ARC4ClassExpressionBuilder(BytesBackedClassExpressionBuilder, ABC): + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder: + match name: + case "encode": + return ARC4EncodeBuilder(location, self.produces()) + case _: + return super().member_access(name, location) + + +def get_integer_literal_value(eb_or_literal: ExpressionBuilder | Literal, purpose: str) -> int: + match eb_or_literal: + case Literal(value=int(lit_value)): + return lit_value + case _: + raise CodeError(f"{purpose} must be compile time constant") + + +class ARC4EncodeBuilder(IntermediateExpressionBuilder): + def __init__(self, location: SourceLocation, wtype: wtypes.WType): + super().__init__(location=location) + self.wtype = 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: + match args: + case [ExpressionBuilder() as eb] if eb.rvalue().wtype == arc4_to_avm_wtype(self.wtype): + value = eb.rvalue() + case _: + raise CodeError("Invalid/unhandled arguments", location) + + return var_expression( + ARC4Encode( + source_location=location, + value=value, + wtype=self.wtype, + ) + ) + + +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: + pass + case wtypes.ARC4Tuple(): + pass + case _: + raise InternalError("Unsupported wtype") + self.expr = expr + + 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 []: + pass + case _: + raise CodeError("Invalid/unhandled arguments", location) + + expr = ARC4Decode( + source_location=location, value=self.expr, wtype=arc4_to_avm_wtype(self.expr.wtype) + ) + return var_expression(expr) + + +class ARC4EncodedExpressionBuilder(ValueExpressionBuilder): + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder: + match name: + case "decode": + return ARC4DecodeBuilder(self.expr, location) + case "bytes": + return get_bytes_expr_builder(self.expr) + case _: + raise CodeError(f"Unrecognised member of bytes: {name}", location) + + def compare( + self, other: ExpressionBuilder | Literal, op: BuilderComparisonOp, location: SourceLocation + ) -> ExpressionBuilder: + if isinstance(other, Literal): + raise CodeError( + f"Cannot compare arc4 encoded value of {self.wtype} to a literal value", location + ) + other_expr = other.rvalue() + if other_expr.wtype != self.wtype: + return NotImplemented + cmp_expr = BytesComparisonExpression( + source_location=location, + lhs=get_bytes_expr(self.expr), + operator=EqualityComparison(op.value), + rhs=get_bytes_expr(other_expr), + ) + return var_expression(cmp_expr) diff --git a/src/wyvern/awst_build/eb/arc4/bool.py b/src/wyvern/awst_build/eb/arc4/bool.py new file mode 100644 index 0000000000..a235f7f55e --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/bool.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +import structlog + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + ARC4Encode, + BytesComparisonExpression, + BytesConstant, + BytesEncoding, + EqualityComparison, + Literal, +) +from wyvern.awst_build.eb.arc4.base import ( + ARC4ClassExpressionBuilder, + ARC4EncodedExpressionBuilder, + get_bytes_expr, +) +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import expect_operand_wtype +from wyvern.errors import CodeError + +if TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.awst_build.eb.base import ( + ExpressionBuilder, + ) + from wyvern.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +class ARC4BoolClassExpressionBuilder(ARC4ClassExpressionBuilder): + def produces(self) -> wtypes.WType: + return wtypes.arc4_bool_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: + match args: + case [val]: + return var_expression( + ARC4Encode( + value=expect_operand_wtype(val, wtypes.bool_wtype), + source_location=location, + wtype=self.produces(), + ) + ) + case _: + raise CodeError( + f"arc4.Bool expects exactly one parameter of type {wtypes.bool_wtype}" + ) + + +class ARC4BoolExpressionBuilder(ARC4EncodedExpressionBuilder): + wtype = wtypes.arc4_bool_wtype + + def bool_eval(self, location: SourceLocation, *, negate: bool = False) -> ExpressionBuilder: + return var_expression( + BytesComparisonExpression( + operator=EqualityComparison.eq if negate else EqualityComparison.ne, + lhs=get_bytes_expr(self.expr), + rhs=BytesConstant( + value=b"\x00", + source_location=location, + encoding=BytesEncoding.base16, + ), + source_location=location, + ) + ) diff --git a/src/wyvern/awst_build/eb/arc4/numeric.py b/src/wyvern/awst_build/eb/arc4/numeric.py new file mode 100644 index 0000000000..761d230e6d --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/numeric.py @@ -0,0 +1,178 @@ +from __future__ import annotations + +import decimal +from typing import TYPE_CHECKING + +import structlog + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + ARC4Encode, + DecimalConstant, + Expression, + IntegerConstant, + Literal, +) +from wyvern.awst_build.eb.arc4.base import ( + ARC4ClassExpressionBuilder, + ARC4EncodedExpressionBuilder, + get_integer_literal_value, +) +from wyvern.awst_build.eb.base import ValueExpressionBuilder +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.errors import CodeError, InternalError + +if TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.awst_build.eb.base import ExpressionBuilder + from wyvern.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +class NumericARC4ClassExpressionBuilder(ARC4ClassExpressionBuilder): + def __init__(self, location: SourceLocation): + super().__init__(location) + self.wtype: wtypes.ARC4UIntN | wtypes.ARC4UFixedNxM | None = None + + def produces(self) -> wtypes.WType: + if self.wtype is None: + raise InternalError( + "Cannot resolve wtype of generic EB until the index method is called with the " + "generic type parameter." + ) + 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: + if not self.wtype: + raise InternalError( + "Cannot resolve wtype of generic EB until the index method is called with" + " 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 [ValueExpressionBuilder() as eb]: + value = eb.rvalue() + if value.wtype not in ( + wtypes.bool_wtype, + wtypes.uint64_wtype, + wtypes.biguint_wtype, + ): + raise CodeError( + f"{self.wtype} constructor expects an int literal or a " + "uint64 expression or a biguint expression" + ) + return var_expression( + ARC4Encode(value=value, source_location=location, wtype=self.wtype) + ) + case _: + raise CodeError( + "Invalid/unhandled arguments", + location, + ) + + +class ByteClassExpressionBuilder(NumericARC4ClassExpressionBuilder): + def __init__(self, location: SourceLocation): + super().__init__(location) + self.wtype = wtypes.ARC4UIntN.from_scale(8, alias="byte") + + +class UIntNClassExpressionBuilder(NumericARC4ClassExpressionBuilder): + def index( + self, index: ExpressionBuilder | Literal, location: SourceLocation + ) -> ExpressionBuilder: + n = get_integer_literal_value(index, "UIntN scale") + if n % 8 or not (8 <= n <= 512): + raise CodeError( + "UIntN scale must be between 8 and 512 bits, and be a multiple of 8", + location, + ) + self.wtype = wtypes.ARC4UIntN.from_scale(n) + return self + + +class UFixedNxMClassExpressionBuilder(NumericARC4ClassExpressionBuilder): + def index_multiple( + self, index: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> ExpressionBuilder: + try: + scale_expr, precision_expr = index + except ValueError as ex: + raise CodeError(f"Expected two type arguments, got {len(index)}", location) from ex + n = get_integer_literal_value(scale_expr, "UFixedNxM scale") + m = get_integer_literal_value(precision_expr, "UFixedNxM precision") + + if n % 8 or not (8 <= n <= 512): + raise CodeError( + "UFixedNxM scale must be between 8 and 512 bits, and be a multiple of 8", + location, + ) + if not (1 <= m < 160): + raise CodeError("UFixedNxM precision must be between 1 and 160.") + self.wtype = wtypes.ARC4UFixedNxM.from_scale_and_precision(n=n, m=m) + return self + + +class UIntNExpressionBuilder(ARC4EncodedExpressionBuilder): + def __init__(self, expr: Expression): + self.wtype = expr.wtype + super().__init__(expr) + + +class UFixedNxMExpressionBuilder(ARC4EncodedExpressionBuilder): + def __init__(self, expr: Expression): + self.wtype = expr.wtype + super().__init__(expr) diff --git a/src/wyvern/awst_build/eb/arc4/string.py b/src/wyvern/awst_build/eb/arc4/string.py new file mode 100644 index 0000000000..3b26b09198 --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/string.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +import structlog + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + ARC4Encode, + BytesConstant, + BytesEncoding, + Literal, +) +from wyvern.awst_build.eb.arc4.base import ARC4ClassExpressionBuilder, ARC4EncodedExpressionBuilder +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.errors import CodeError + +if TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.awst_build.eb.base import ExpressionBuilder + from wyvern.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +class StringClassExpressionBuilder(ARC4ClassExpressionBuilder): + def produces(self) -> wtypes.WType: + return wtypes.arc4_string_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: + 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) + + +class StringExpressionBuilder(ARC4EncodedExpressionBuilder): + wtype = wtypes.arc4_string_wtype diff --git a/src/wyvern/awst_build/eb/arc4/struct.py b/src/wyvern/awst_build/eb/arc4/struct.py new file mode 100644 index 0000000000..07714bf022 --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/struct.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +import structlog + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + ARC4Encode, + Expression, + IndexExpression, + Literal, + TupleExpression, + UInt64Constant, +) +from wyvern.awst_build.eb.arc4.base import get_bytes_expr_builder +from wyvern.awst_build.eb.base import ValueExpressionBuilder +from wyvern.awst_build.eb.bytes_backed import BytesBackedClassExpressionBuilder +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import expect_operand_wtype, get_arg_mapping +from wyvern.errors import CodeError + +if TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.awst_build.eb.base import ( + ExpressionBuilder, + ) + from wyvern.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +class ARC4StructClassExpressionBuilder(BytesBackedClassExpressionBuilder): + def produces(self) -> wtypes.WType: + return self.wtype + + def __init__( + self, + wtype: wtypes.ARC4Struct, + location: SourceLocation, + ): + super().__init__(location) + self.wtype = 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: + ordered_field_names = self.wtype.names + field_mapping = get_arg_mapping( + positional_arg_names=ordered_field_names, + args=zip(arg_names, args, strict=True), + location=location, + ) + + args_positioned = list[Expression]() + for field_name, field_type in self.wtype.fields.items(): + 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)) + if field_mapping: + raise CodeError(f"Unexpected keyword arguments: {' '.join(field_mapping)}", location) + + tuple_expr = TupleExpression( + items=args_positioned, + source_location=location, + wtype=wtypes.WTuple.from_types(types=self.wtype.types), + ) + + return var_expression( + ARC4Encode(wtype=self.wtype, value=tuple_expr, source_location=location) + ) + + +class ARC4StructExpressionBuilder(ValueExpressionBuilder): + def __init__(self, expr: Expression): + assert isinstance(expr.wtype, wtypes.ARC4Struct) + self.wtype: wtypes.ARC4Struct = expr.wtype + super().__init__(expr) + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + match name: + case tuple_field if tuple_field in self.wtype.fields: + index = self.wtype.names.index(tuple_field) + return var_expression( + IndexExpression( + source_location=location, + base=self.expr, + index=UInt64Constant(value=index, source_location=location), + wtype=self.wtype.fields[tuple_field], + ) + ) + case "bytes": + return get_bytes_expr_builder(self.expr) + case _: + return super().member_access(name, location) diff --git a/src/wyvern/awst_build/eb/arc4/tuple.py b/src/wyvern/awst_build/eb/arc4/tuple.py new file mode 100644 index 0000000000..9200f0e0e9 --- /dev/null +++ b/src/wyvern/awst_build/eb/arc4/tuple.py @@ -0,0 +1,172 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +import structlog + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + ARC4Encode, + Expression, + IndexExpression, + Literal, + TupleExpression, + UInt64Constant, +) +from wyvern.awst_build.eb.arc4.base import ( + ARC4ClassExpressionBuilder, + ARC4EncodedExpressionBuilder, +) +from wyvern.awst_build.eb.base import ( + ExpressionBuilder, + GenericClassExpressionBuilder, + TypeClassExpressionBuilder, +) +from wyvern.awst_build.eb.tuple import TupleExpressionBuilder +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.errors import CodeError, InternalError + +if TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.parse import SourceLocation + +logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) + + +class ARC4TupleGenericClassExpressionBuilder(GenericClassExpressionBuilder): + def index_multiple( + self, indexes: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> TypeClassExpressionBuilder: + tuple_item_types = list[wtypes.WType]() + for index in indexes: + match index: + case TypeClassExpressionBuilder() as type_class: + wtype = type_class.produces() + if not wtypes.is_arc4_encoded_type(wtype): + raise CodeError( + "ARC4 Tuples can only contain ARC4 encoded values", location + ) + tuple_item_types.append(wtype) + case _: + raise CodeError("Invalid type parameter", index.source_location) + return ARC4TupleClassExpressionBuilder( + location, wtypes.ARC4Tuple.from_types(tuple_item_types) + ) + + 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: + return tuple_constructor(args, None, location) + + +def tuple_constructor( + args: Sequence[ExpressionBuilder | Literal], + wtype: wtypes.ARC4Tuple | None, + location: SourceLocation, +) -> ExpressionBuilder: + match args: + case [TupleExpressionBuilder() as teb]: + tuple_ex = teb.rvalue() + if not isinstance(tuple_ex, TupleExpression): + raise CodeError("arc4.Tuple must be instantiated with a tuple", location) + + if wtype is None: + wtype = wtypes.ARC4Tuple.from_types(tuple_ex.wtype.types) + else: + expected_type = wtypes.WTuple.from_types(wtype.types) + if tuple_ex.wtype != expected_type: + raise CodeError( + f"Invalid arg type: expected {expected_type}, got {tuple_ex.wtype}", + location, + ) + + return var_expression( + ARC4Encode(value=tuple_ex, wtype=wtype, source_location=location) + ) + + raise CodeError("Invalid/unhandled arguments", location) + + +class ARC4TupleClassExpressionBuilder(ARC4ClassExpressionBuilder): + def __init__(self, location: SourceLocation, wtype: wtypes.ARC4Tuple | None = None): + super().__init__(location) + self.wtype = wtype + + def produces(self) -> wtypes.WType: + if not self.wtype: + # TODO: make CodeError + raise InternalError( + "Cannot resolve wtype of generic EB until the index method is called with the " + "generic type parameter." + ) + return self.wtype + + def index( + self, index: ExpressionBuilder | Literal, location: SourceLocation + ) -> ExpressionBuilder: + return self.index_multiple((index,), location) + + def index_multiple( + self, + indexes: Sequence[ExpressionBuilder | Literal], + location: SourceLocation, + ) -> TypeClassExpressionBuilder: + tuple_item_types = list[wtypes.WType]() + for index in indexes: + match index: + case TypeClassExpressionBuilder() as type_class: + wtype = type_class.produces() + if not wtypes.is_arc4_encoded_type(wtype): + raise CodeError( + "ARC4 Tuples can only contain ARC4 encoded values", location + ) + tuple_item_types.append(wtype) + case _: + raise CodeError("Invalid type parameter", index.source_location) + self.wtype = wtypes.ARC4Tuple.from_types(tuple_item_types) + return self + + 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: + return tuple_constructor(args, self.wtype, location) + + +class ARC4TupleExpressionBuilder(ARC4EncodedExpressionBuilder): + def __init__(self, expr: Expression): + assert isinstance(expr.wtype, wtypes.ARC4Tuple) + self.wtype: wtypes.ARC4Tuple = expr.wtype + super().__init__(expr) + + def index( + self, index: ExpressionBuilder | Literal, location: SourceLocation + ) -> ExpressionBuilder: + match index: + case Literal(value=int(index_int), source_location=index_loc): + try: + item_wtype = self.wtype.types[index_int] + except IndexError as ex: + raise CodeError("Tuple index out of bounds", index_loc) from ex + return var_expression( + IndexExpression( + source_location=location, + base=self.expr, + index=UInt64Constant(value=index_int, source_location=index_loc), + wtype=item_wtype, + ) + ) + case _: + raise CodeError(f"{self.wtype.name} can only be indexed with literal values") diff --git a/src/wyvern/awst_build/eb/array.py b/src/wyvern/awst_build/eb/array.py index 1feb6197d7..8b8708c585 100644 --- a/src/wyvern/awst_build/eb/array.py +++ b/src/wyvern/awst_build/eb/array.py @@ -29,7 +29,7 @@ def __init__(self, location: SourceLocation): def produces(self) -> wtypes.WType: if self._storage is None: raise CodeError("A type parameter is required at this location", self.source_location) - return self._storage + return wtypes.WArray.from_element_type(self._storage) def index( self, index: ExpressionBuilder | Literal, location: SourceLocation diff --git a/src/wyvern/awst_build/eb/asset.py b/src/wyvern/awst_build/eb/asset.py deleted file mode 100644 index f4ac4bc74d..0000000000 --- a/src/wyvern/awst_build/eb/asset.py +++ /dev/null @@ -1,110 +0,0 @@ -from __future__ import annotations - -import typing - -from wyvern.awst import wtypes -from wyvern.awst.nodes import ( - Expression, - Literal, - Not, - NumericComparison, - NumericComparisonExpression, - ReinterpretCast, - UInt64Constant, -) -from wyvern.awst_build.eb.base import ( - BuilderComparisonOp, - ExpressionBuilder, - TypeClassExpressionBuilder, - ValueExpressionBuilder, -) -from wyvern.awst_build.eb.var_factory import var_expression -from wyvern.awst_build.utils import convert_literal_to_expr, expect_operand_wtype -from wyvern.errors import CodeError - -if typing.TYPE_CHECKING: - import mypy.nodes - - from wyvern.parse import SourceLocation - - -def as_wtype(expr: Expression, loc: SourceLocation, wtype: wtypes.WType) -> Expression: - if expr.wtype == wtype: - return expr - return ReinterpretCast(source_location=loc, wtype=wtype, expr=expr) - - -def as_uint64(expr: Expression, loc: SourceLocation) -> Expression: - return as_wtype(expr, loc, wtypes.uint64_wtype) - - -def as_asset(expr: Expression, loc: SourceLocation) -> Expression: - return as_wtype(expr, loc, wtypes.asset_wtype) - - -class AssetClassExpressionBuilder(TypeClassExpressionBuilder): - def produces(self) -> wtypes.WType: - return wtypes.asset_wtype - - def call( - self, - args: typing.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 [ExpressionBuilder() as eb]: - uint64_expr = expect_operand_wtype(eb, wtypes.uint64_wtype) - return AssetExpressionBuilder(uint64_expr) - case [Literal(value=int(int_value), source_location=loc)]: - const = UInt64Constant(value=int_value, source_location=loc) - return AssetExpressionBuilder(const) - case _: - raise CodeError("Invalid/unhandled arguments", location) - - -class AssetExpressionBuilder(ValueExpressionBuilder): - wtype = wtypes.asset_wtype - - def __init__(self, expr: Expression) -> None: - super().__init__(as_asset(expr, expr.source_location)) - - def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: - match name: - case "asset_id": - return var_expression(as_uint64(self.expr, location)) - case _: - return super().member_access(name, location) - - def bool_eval(self, location: SourceLocation, *, negate: bool = False) -> ExpressionBuilder: - as_bool = ReinterpretCast( - expr=self.expr, - wtype=wtypes.bool_wtype, - source_location=self.expr.source_location, - ) - if negate: - expr: Expression = Not(location, as_bool) - else: - expr = as_bool - return var_expression(expr) - - def compare( - self, other: ExpressionBuilder | Literal, op: BuilderComparisonOp, location: SourceLocation - ) -> ExpressionBuilder: - other_expr = convert_literal_to_expr(other, self.wtype) - if other_expr.wtype != self.wtype: # can only compare with other assets? - return NotImplemented - match op: - case BuilderComparisonOp.eq | BuilderComparisonOp.ne: - pass - case _: - return NotImplemented - cmp_expr = NumericComparisonExpression( - source_location=location, - lhs=as_uint64(self.expr, location), - operator=NumericComparison(op.value), - rhs=as_uint64(other_expr, location), - ) - return var_expression(cmp_expr) diff --git a/src/wyvern/awst_build/eb/base.py b/src/wyvern/awst_build/eb/base.py index 207c45a9be..58b672c7ba 100644 --- a/src/wyvern/awst_build/eb/base.py +++ b/src/wyvern/awst_build/eb/base.py @@ -33,6 +33,7 @@ "ExpressionBuilder", "IntermediateExpressionBuilder", "TypeClassExpressionBuilder", + "GenericClassExpressionBuilder", "ValueExpressionBuilder", ] @@ -235,6 +236,36 @@ def produces(self) -> wtypes.WType: ... +class GenericClassExpressionBuilder(IntermediateExpressionBuilder, abc.ABC): + def index( + self, index: ExpressionBuilder | Literal, location: SourceLocation + ) -> TypeClassExpressionBuilder: + return self.index_multiple([index], location) + + @abc.abstractmethod + def index_multiple( + self, index: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> TypeClassExpressionBuilder: + ... + + @abc.abstractmethod + 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: + ... + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + raise CodeError( + f"Cannot access member {name} without specifying class type parameters first", + location, + ) + + class ValueExpressionBuilder(ExpressionBuilder): wtype: wtypes.WType @@ -243,15 +274,10 @@ def __init__(self, expr: Expression): self.__expr = expr if expr.wtype != self.wtype: raise InternalError( - f"Invalid type of expression for {self.python_type}" - f" of {expr.wtype}, expected {self.wtype}", + f"Invalid type of expression for {self.wtype}: {expr.wtype}", expr.source_location, ) - @property - def python_type(self) -> str: - return self.wtype.python_type - @property def expr(self) -> Expression: return self.__expr @@ -268,12 +294,12 @@ def value_type(self) -> wtypes.WType: return self.wtype def delete(self, location: SourceLocation) -> Statement: - raise CodeError(f"{self.python_type} is not valid as del target", location) + raise CodeError(f"{self.wtype} is not valid as del target", location) def index( self, index: ExpressionBuilder | Literal, location: SourceLocation ) -> ExpressionBuilder: - raise CodeError(f"{self.python_type} does not support indexing", location) + raise CodeError(f"{self.wtype} does not support indexing", location) def call( self, @@ -283,43 +309,43 @@ def call( location: SourceLocation, original_expr: mypy.nodes.CallExpr, ) -> ExpressionBuilder: - raise CodeError(f"{self.python_type} does not support calling", location) + raise CodeError(f"{self.wtype} does not support calling", location) def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: - raise CodeError(f"Unrecognised member of {self.python_type}: {name}", location) + raise CodeError(f"Unrecognised member of {self.wtype}: {name}", location) def iterate(self) -> Iteration: """Produce target of ForInLoop""" raise CodeError(f"{type(self).__name__} does not support iteration", self.source_location) def bool_eval(self, location: SourceLocation, *, negate: bool = False) -> ExpressionBuilder: - raise CodeError(f"{self.python_type} does not support boolean evaluation", location) + raise CodeError(f"{self.wtype} does not support boolean evaluation", location) def unary_plus(self, location: SourceLocation) -> ExpressionBuilder: - raise CodeError(f"{self.python_type} does not support unary plus operator", location) + raise CodeError(f"{self.wtype} does not support unary plus operator", location) def unary_minus(self, location: SourceLocation) -> ExpressionBuilder: - raise CodeError(f"{self.python_type} does not support unary minus operator", location) + raise CodeError(f"{self.wtype} does not support unary minus operator", location) def bitwise_invert(self, location: SourceLocation) -> ExpressionBuilder: - raise CodeError(f"{self.python_type} does not support bitwise inversion", location) + raise CodeError(f"{self.wtype} does not support bitwise inversion", location) def contains( self, item: ExpressionBuilder | Literal, location: SourceLocation ) -> ExpressionBuilder: - raise CodeError(f"{self.python_type} does not support in/not in checks", location) + raise CodeError(f"{self.wtype} does not support in/not in checks", location) def _validate_lvalue(resolved: Expression) -> Lvalue: if not (isinstance(resolved, Lvalue) and resolved.wtype.lvalue): # type: ignore[arg-type,misc] raise CodeError( - f"{resolved.wtype.python_type} expression is not valid as assignment target", + f"{resolved.wtype.stub_name} expression is not valid as assignment target", resolved.source_location, ) if isinstance(resolved, IndexExpression | FieldExpression) and resolved.base.wtype.immutable: raise CodeError( "expression is not valid as assignment target" - f" ({resolved.base.wtype.python_type} is immutable)", + f" ({resolved.base.wtype.stub_name} is immutable)", resolved.source_location, ) elif isinstance(resolved, ReinterpretCast): diff --git a/src/wyvern/awst_build/eb/bytes.py b/src/wyvern/awst_build/eb/bytes.py index 2c482b3954..30393b5000 100644 --- a/src/wyvern/awst_build/eb/bytes.py +++ b/src/wyvern/awst_build/eb/bytes.py @@ -1,5 +1,6 @@ from __future__ import annotations +import base64 from typing import TYPE_CHECKING import mypy.nodes @@ -12,18 +13,24 @@ BytesBinaryOperator, BytesComparisonExpression, BytesConstant, - BytesDecode, BytesEncoding, BytesUnaryOperation, BytesUnaryOperator, + CallArg, + ConditionalExpression, EqualityComparison, Expression, + FreeSubroutineTarget, IndexExpression, IntrinsicCall, - IsSubstring, Literal, + NumericComparison, + NumericComparisonExpression, SliceExpression, Statement, + SubroutineCallExpression, + UInt64BinaryOperation, + UInt64BinaryOperator, UInt64Constant, ) from wyvern.awst_build.constants import CLS_BYTES_ALIAS @@ -37,7 +44,11 @@ ValueExpressionBuilder, ) from wyvern.awst_build.eb.var_factory import var_expression -from wyvern.awst_build.utils import convert_literal_to_expr, expect_operand_wtype +from wyvern.awst_build.utils import ( + convert_literal_to_expr, + create_temporary_assignment, + expect_operand_wtype, +) from wyvern.errors import CodeError, InternalError if TYPE_CHECKING: @@ -63,6 +74,9 @@ def call( original_expr: mypy.nodes.CallExpr, ) -> ExpressionBuilder: match args: + case []: + const = BytesConstant(value=b"", source_location=location) + return var_expression(const) case [Literal(value=bytes(bytes_val), source_location=loc)]: # TODO: replace loc with location const = BytesConstant(value=bytes_val, source_location=loc) @@ -107,21 +121,24 @@ def call( case BytesEncoding.base64: if not wtypes.valid_base64(encoded_value): raise CodeError("Invalid base64 value", location) + bytes_value = base64.b64decode(encoded_value) case BytesEncoding.base32: if not wtypes.valid_base32(encoded_value): raise CodeError("Invalid base32 value", location) + bytes_value = base64.b32decode(encoded_value) case BytesEncoding.base16: encoded_value = encoded_value.upper() if not wtypes.valid_base16(encoded_value): raise CodeError("Invalid base16 value", location) + bytes_value = base64.b16decode(encoded_value) case _: raise InternalError( f"Unhandled bytes encoding for constant construction: {self.encoding}", location, ) - expr = BytesDecode( + expr = BytesConstant( source_location=location, - value=encoded_value, + value=bytes_value, encoding=self.encoding, ) return var_expression(expr) @@ -159,30 +176,95 @@ def slice_index( if stride is not None: raise CodeError("Stride is not supported", location=stride.source_location) + base = self.expr + fixed_length = len(base.value) if isinstance(base, BytesConstant) else None + len_expr = ( + UInt64Constant(value=fixed_length, source_location=location) + if fixed_length + else IntrinsicCall.bytes_len(self.expr, source_location=location) + ) + def eval_slice_component( val: ExpressionBuilder | Literal | None, ) -> Expression | None: match val: case Literal(value=int(int_lit)): if int_lit >= 0: - return UInt64Constant( - value=int_lit, - source_location=val.source_location, - ) + if fixed_length: + return UInt64Constant( + value=min(int_lit, fixed_length), + source_location=val.source_location, + ) + else: + temp_len = create_temporary_assignment(len_expr, location) + return ConditionalExpression( + condition=NumericComparisonExpression( + lhs=UInt64Constant( + value=int_lit, + source_location=val.source_location, + ), + rhs=temp_len.define, + operator=NumericComparison.lt, + source_location=location, + ), + true_expr=UInt64Constant( + value=int_lit, + source_location=val.source_location, + ), + false_expr=temp_len.read, + wtype=wtypes.uint64_wtype, + source_location=location, + ) else: - return IntrinsicCall( - wtype=wtypes.uint64_wtype, - op_code="-", - stack_args=[ - IntrinsicCall.bytes_len(self.expr, val.source_location), - UInt64Constant( - value=abs(int_lit), source_location=val.source_location + if fixed_length: + return UInt64Constant( + value=max(fixed_length - abs(int_lit), 0), + source_location=val.source_location, + ) + temp_len = create_temporary_assignment(len_expr, location) + + return ConditionalExpression( + condition=NumericComparisonExpression( + lhs=UInt64Constant( + value=abs(int_lit), + source_location=val.source_location, ), - ], - source_location=val.source_location, + rhs=temp_len.define, + operator=NumericComparison.lt, + source_location=val.source_location, + ), + true_expr=UInt64BinaryOperation( + op=UInt64BinaryOperator.sub, + left=temp_len.read, + right=UInt64Constant( + value=abs(int_lit), + source_location=val.source_location, + ), + source_location=val.source_location, + ), + false_expr=UInt64Constant( + value=0, source_location=val.source_location + ), + wtype=wtypes.uint64_wtype, + source_location=location, ) case ExpressionBuilder() as eb: - return eb.rvalue() + temp_len = create_temporary_assignment(len_expr, location) + temp_index = create_temporary_assignment( + expect_operand_wtype(eb, wtypes.uint64_wtype) + ) + return ConditionalExpression( + condition=NumericComparisonExpression( + lhs=temp_index.define, + rhs=temp_len.define, + operator=NumericComparison.lt, + source_location=location, + ), + true_expr=temp_index.read, + false_expr=temp_len.read, + wtype=wtypes.uint64_wtype, + source_location=location, + ) case None: return None case _: @@ -219,8 +301,11 @@ def contains( self, item: ExpressionBuilder | Literal, location: SourceLocation ) -> ExpressionBuilder: item_expr = expect_operand_wtype(item, wtypes.bytes_wtype) - is_substring_expr = IsSubstring( - source_location=location, item=item_expr, sequence=self.expr + is_substring_expr = SubroutineCallExpression( + target=FreeSubroutineTarget(module_name="algopy", name="is_substring"), + args=[CallArg(value=item_expr, name=None), CallArg(value=self.expr, name=None)], + wtype=wtypes.bool_wtype, + source_location=location, ) return var_expression(is_substring_expr) @@ -228,6 +313,8 @@ def compare( self, other: ExpressionBuilder | Literal, op: BuilderComparisonOp, location: SourceLocation ) -> ExpressionBuilder: other_expr = convert_literal_to_expr(other, self.wtype) + if other_expr.wtype != self.wtype: + return NotImplemented cmp_expr = BytesComparisonExpression( source_location=location, lhs=self.expr, diff --git a/src/wyvern/awst_build/eb/contracts.py b/src/wyvern/awst_build/eb/contracts.py index 42524b44e4..29364b5af1 100644 --- a/src/wyvern/awst_build/eb/contracts.py +++ b/src/wyvern/awst_build/eb/contracts.py @@ -9,16 +9,15 @@ AppStateDefinition, AppStateExpression, AppStateKind, - AssignmentExpression, BytesConstant, ConditionalExpression, Expression, ExpressionStatement, InstanceSubroutineTarget, + IntegerConstant, IntrinsicCall, Literal, Statement, - TemporaryVariable, TupleItemExpression, UInt64Constant, ) @@ -34,7 +33,7 @@ ) from wyvern.awst_build.eb.subroutine import SubroutineInvokerExpressionBuilder from wyvern.awst_build.eb.var_factory import var_expression -from wyvern.awst_build.utils import expect_operand_wtype +from wyvern.awst_build.utils import create_temporary_assignment, expect_operand_wtype from wyvern.errors import CodeError, InternalError from wyvern.parse import SourceLocation @@ -125,16 +124,18 @@ def call( else: item, default_arg = args default_expr = expect_operand_wtype(default_arg, target_wtype=self.state_def.storage_wtype) - inner_tmp = _build_app_local_get_ex(self.state_def, item, location) - tmp = TemporaryVariable(inner_tmp) - app_local_get_ex = AssignmentExpression( - value=inner_tmp, target=tmp, source_location=location + app_local_get_ex = create_temporary_assignment( + _build_app_local_get_ex(self.state_def, item, location), location ) conditional_expr = ConditionalExpression( location, wtype=self.state_def.storage_wtype, - condition=TupleItemExpression(app_local_get_ex, index=1, source_location=location), - true_expr=TupleItemExpression(tmp, index=0, source_location=location), + condition=TupleItemExpression( + app_local_get_ex.define, index=1, source_location=location + ), + true_expr=TupleItemExpression( + app_local_get_ex.read, index=0, source_location=location + ), false_expr=default_expr, ) return var_expression(conditional_expr) @@ -193,9 +194,9 @@ def _validated_index_expr(index: ExpressionBuilder | Literal) -> Expression: ) case Literal(): raise CodeError("Invalid literal, expected an int", index.source_location) - case UInt64Constant(value=account_offset) as index_expr: + case IntegerConstant(value=account_offset) as index_expr: valid_account_offset(account_offset, index.source_location) - case Expression(wtype=(wtypes.uint64_wtype | wtypes.address_wtype)) as index_expr: + case Expression(wtype=(wtypes.uint64_wtype | wtypes.account_wtype)) as index_expr: pass case _: raise CodeError( diff --git a/src/wyvern/awst_build/eb/ensure_budget.py b/src/wyvern/awst_build/eb/ensure_budget.py index 661342aeb2..4a8b971296 100644 --- a/src/wyvern/awst_build/eb/ensure_budget.py +++ b/src/wyvern/awst_build/eb/ensure_budget.py @@ -10,6 +10,7 @@ FreeSubroutineTarget, Literal, SubroutineCallExpression, + UInt64Constant, ) from wyvern.awst_build.eb.base import ( ExpressionBuilder, @@ -17,6 +18,7 @@ TypeClassExpressionBuilder, ) from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import expect_operand_wtype, get_arg_mapping from wyvern.errors import CodeError if TYPE_CHECKING: @@ -36,15 +38,46 @@ def call( location: SourceLocation, original_expr: mypy.nodes.CallExpr, ) -> ExpressionBuilder: - call_args: Sequence[CallArg] - match args: - case [_required_budget, _fee_source]: - call_args = [] - case [_required_budget]: - call_args = [] - case _: - raise CodeError("Incorrect args", location) + required_budget_arg_name = "required_budget" + fee_source_arg_name = "fee_source" + arg_mapping = get_arg_mapping( + positional_arg_names=[required_budget_arg_name, fee_source_arg_name], + args=zip(arg_names, args, strict=True), + location=location, + ) + try: + required_budget = arg_mapping.pop(required_budget_arg_name) + except KeyError: + raise CodeError( + f"Missing required argument '{required_budget_arg_name}'", location + ) from None + + call_args = [ + CallArg( + name=required_budget_arg_name, + value=expect_operand_wtype(required_budget, wtypes.uint64_wtype), + ) + ] + match arg_mapping.pop(fee_source_arg_name, None): + case Literal( + value=int(fee_source_value), source_location=fee_source_loc + ) if 0 <= fee_source_value <= 2: + fee_source_expr = UInt64Constant( + value=fee_source_value, source_location=fee_source_loc + ) + case None: + fee_source_expr = UInt64Constant(value=2, source_location=location) + case _: + raise CodeError(f"Invalid argument value for {fee_source_arg_name}", location) + call_args.append( + CallArg( + name=fee_source_arg_name, + value=fee_source_expr, + ) + ) + if arg_mapping: + raise CodeError(f"Unexpected arguments: {', '.join(arg_mapping)}", location) call_expr = SubroutineCallExpression( source_location=location, target=FreeSubroutineTarget(module_name="algopy", name="ensure_budget"), diff --git a/src/wyvern/awst_build/eb/intrinsics.py b/src/wyvern/awst_build/eb/intrinsics.py index e47b532439..e98a37a3b3 100644 --- a/src/wyvern/awst_build/eb/intrinsics.py +++ b/src/wyvern/awst_build/eb/intrinsics.py @@ -1,6 +1,5 @@ from __future__ import annotations -import typing from typing import TYPE_CHECKING, Never import mypy.nodes @@ -14,9 +13,11 @@ Expression, IntrinsicCall, Literal, + MethodConstant, Node, UInt64Constant, ) +from wyvern.awst_build.constants import ARC4_SIGNATURE_ALIAS from wyvern.awst_build.eb.base import ( ExpressionBuilder, IntermediateExpressionBuilder, @@ -24,8 +25,8 @@ from wyvern.awst_build.eb.var_factory import var_expression from wyvern.awst_build.intrinsic_data import ENUM_CLASSES, STUB_TO_AST_MAPPER from wyvern.awst_build.intrinsic_models import ArgMapping, FunctionOpMapping -from wyvern.awst_build.utils import require_expression_builder -from wyvern.errors import CodeError, InternalError, TodoError +from wyvern.awst_build.utils import get_arg_mapping, require_expression_builder +from wyvern.errors import CodeError, InternalError if TYPE_CHECKING: from collections.abc import Sequence @@ -35,6 +36,27 @@ logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) +class Arc4SignatureBuilder(IntermediateExpressionBuilder): + 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=str(str_value))]: + return var_expression( + MethodConstant( + value=str_value, + source_location=location, + ) + ) + case _: + raise CodeError(f"Unexpected args for {ARC4_SIGNATURE_ALIAS}", location) + + class IntrinsicEnumClassExpressionBuilder(IntermediateExpressionBuilder): def __init__(self, enum_class_fullname: str, location: SourceLocation) -> None: self.enum_class = enum_class_fullname @@ -92,9 +114,7 @@ def call( ] arg_mapping = get_arg_mapping_funcdef(self.func_def, resolved_args, location, arg_names) intrinsic_expr = map_call( - callee=self.func_def.fullname, - node_location=location, - args={name: arg for name, (_, arg) in arg_mapping.items()}, + callee=self.func_def.fullname, node_location=location, args=arg_mapping ) if intrinsic_expr is None: raise CodeError(f"Unknown algopy function {self.func_def.fullname}") @@ -143,73 +163,21 @@ def unwrap_func_def( raise InternalError("Call symbol resolved to non-callable", location) -def get_func_symbol_node( - location: SourceLocation, call: mypy.nodes.CallExpr -) -> mypy.nodes.SymbolNode | None: - match call.callee: - case mypy.nodes.NameExpr(node=target): - if isinstance(target, mypy.nodes.TypeInfo): # target is a class, so find init - return target["__init__"].node - return target - case mypy.nodes.MemberExpr( - expr=mypy.nodes.NameExpr(node=mypy.nodes.TypeInfo() as typ), - name=name, - ): - # reference to a function via a class (ie staticmethod or classmethod) - return typ[name].node - case mypy.nodes.MemberExpr(node=mypy.nodes.FuncDef() as func): - # reference to a function - return func - case _: - raise TodoError(location) - - -T = typing.TypeVar("T") - - -def get_arg_mapping( - call: mypy.nodes.CallExpr, - args: Sequence[T], - location: SourceLocation, -) -> dict[str, tuple[int, T]]: - func_sym = get_func_symbol_node(location, call) - if func_sym is None: - raise InternalError("Unable to resolve call symbol", location) - func_def = unwrap_func_def( - location, func_sym, call.arg_kinds.count(mypy.nodes.ArgKind.ARG_POS) - ) - return get_arg_mapping_funcdef(func_def, args, location, call.arg_names) - - def get_arg_mapping_funcdef( func_def: mypy.nodes.FuncDef, - args: Sequence[T], + args: Sequence[Expression | Literal], location: SourceLocation, arg_names: Sequence[str | None], -) -> dict[str, tuple[int, T]]: +) -> dict[str, Expression | Literal]: func_pos_args = [ arg.variable.name for arg, kind in zip(func_def.arguments, func_def.arg_kinds, strict=True) if kind in (mypy.nodes.ArgKind.ARG_POS, mypy.nodes.ArgKind.ARG_OPT) and not (arg.variable.is_cls or arg.variable.is_self) ] - func_name_pos_args = { - arg.variable.name: idx - for idx, arg in enumerate( - a for a in func_def.arguments if not (a.variable.is_cls or a.variable.is_self) - ) - } - - arg_mapping = dict[str, tuple[int, T]]() - for arg_idx, (arg_name, arg) in enumerate(zip(arg_names, args, strict=True)): - if arg_name is None: - if arg_idx < len(func_pos_args): - arg_name = func_pos_args[arg_idx] - assert arg_idx == func_name_pos_args[arg_name], "bad ju ju" - else: - raise InternalError("Unexpected callable", location) - arg_mapping[arg_name] = (func_name_pos_args[arg_name], arg) - return arg_mapping + return get_arg_mapping( + func_pos_args, args=zip(arg_names, args, strict=True), location=location + ) def _all_immediates_are_constant( diff --git a/src/wyvern/awst_build/eb/named_int_constants.py b/src/wyvern/awst_build/eb/named_int_constants.py index dccdb0ced0..923892aa5d 100644 --- a/src/wyvern/awst_build/eb/named_int_constants.py +++ b/src/wyvern/awst_build/eb/named_int_constants.py @@ -1,3 +1,5 @@ +import enum + from wyvern.awst import wtypes from wyvern.awst.nodes import UInt64Constant from wyvern.awst_build.eb.base import ExpressionBuilder, TypeClassExpressionBuilder @@ -7,7 +9,7 @@ class NamedIntegerConstsTypeBuilder(TypeClassExpressionBuilder): - def __init__(self, enum_name: str, data: dict[str, tuple[int, str]], location: SourceLocation): + def __init__(self, enum_name: str, data: dict[str, enum.IntEnum], location: SourceLocation): super().__init__(location=location) self.enum_name = enum_name self.data = data @@ -17,11 +19,13 @@ def produces(self) -> wtypes.WType: def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder: try: - int_value, teal_alias = self.data[name] + int_enum = self.data[name] except KeyError as ex: raise CodeError( f"Unable to resolve constant value for {self.enum_name}.{name}", location ) from ex return var_expression( - UInt64Constant(value=int_value, source_location=location, teal_alias=teal_alias) + UInt64Constant( + value=int_enum.value, source_location=location, teal_alias=int_enum.name + ) ) diff --git a/src/wyvern/awst_build/eb/reference_types/__init__.py b/src/wyvern/awst_build/eb/reference_types/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/wyvern/awst_build/eb/address.py b/src/wyvern/awst_build/eb/reference_types/account.py similarity index 53% rename from src/wyvern/awst_build/eb/address.py rename to src/wyvern/awst_build/eb/reference_types/account.py index 7bdcc3fa7e..7e9db39173 100644 --- a/src/wyvern/awst_build/eb/address.py +++ b/src/wyvern/awst_build/eb/reference_types/account.py @@ -1,9 +1,8 @@ from __future__ import annotations -from typing import TYPE_CHECKING +import typing -import mypy.nodes -import structlog +from immutabledict import immutabledict from wyvern.algo_constants import ENCODED_ADDRESS_LENGTH from wyvern.awst import wtypes @@ -13,35 +12,27 @@ EqualityComparison, IntrinsicCall, Literal, - ReinterpretCast, -) -from wyvern.awst_build.eb.base import ( - BuilderComparisonOp, - ExpressionBuilder, - ValueExpressionBuilder, ) +from wyvern.awst_build.eb.base import BuilderComparisonOp, ExpressionBuilder from wyvern.awst_build.eb.bytes_backed import BytesBackedClassExpressionBuilder +from wyvern.awst_build.eb.reference_types.base import ReferenceValueExpressionBuilder from wyvern.awst_build.eb.var_factory import var_expression -from wyvern.awst_build.utils import convert_literal_to_expr +from wyvern.awst_build.utils import convert_literal_to_expr, expect_operand_wtype from wyvern.errors import CodeError -if TYPE_CHECKING: - from collections.abc import Sequence - - import mypy.types +if typing.TYPE_CHECKING: + import mypy.nodes from wyvern.parse import SourceLocation -logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) - -class AddressClassExpressionBuilder(BytesBackedClassExpressionBuilder): +class AccountClassExpressionBuilder(BytesBackedClassExpressionBuilder): def produces(self) -> wtypes.WType: - return wtypes.address_wtype + return wtypes.account_wtype def call( self, - args: Sequence[ExpressionBuilder | Literal], + args: typing.Sequence[ExpressionBuilder | Literal], arg_kinds: list[mypy.nodes.ArgKind], arg_names: list[str | None], location: SourceLocation, @@ -59,22 +50,35 @@ def call( # TODO: replace loc with location const = AddressConstant(value=addr_value, source_location=loc) return var_expression(const) + case [ExpressionBuilder() as eb]: + account_expr = expect_operand_wtype(eb, wtypes.account_wtype) + return AccountExpressionBuilder(account_expr) case _: raise CodeError("Invalid/unhandled arguments", location) -class AddressExpressionBuilder(ValueExpressionBuilder): - wtype = wtypes.address_wtype - - def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: - match name: - case "bytes": - return var_expression( - ReinterpretCast( - source_location=location, wtype=wtypes.bytes_wtype, expr=self.expr - ) - ) - return super().member_access(name, location) +class AccountExpressionBuilder(ReferenceValueExpressionBuilder): + wtype = wtypes.account_wtype + native_wtype = wtypes.bytes_wtype + native_access_member = "bytes" + field_mapping = immutabledict( + { + "balance": ("AcctBalance", wtypes.uint64_wtype), + "min_balance": ("AcctMinBalance", wtypes.uint64_wtype), + "auth_address": ("AcctAuthAddr", wtypes.account_wtype), + "total_num_uint": ("AcctTotalNumUint", wtypes.uint64_wtype), + "total_num_byte_slice": ("AcctTotalNumByteSlice", wtypes.uint64_wtype), + "total_extra_app_pages": ("AcctTotalExtraAppPages", wtypes.uint64_wtype), + "total_apps_created": ("AcctTotalAppsCreated", wtypes.uint64_wtype), + "total_apps_opted_in": ("AcctTotalAppsOptedIn", wtypes.uint64_wtype), + "total_assets_created": ("AcctTotalAssetsCreated", wtypes.uint64_wtype), + "total_assets": ("AcctTotalAssets", wtypes.uint64_wtype), + "total_boxes": ("AcctTotalBoxes", wtypes.uint64_wtype), + "total_box_bytes": ("AcctTotalBoxBytes", wtypes.uint64_wtype), + } + ) + field_op_code = "acct_params_get" + field_bool_comment = "account funded" def bool_eval(self, location: SourceLocation, *, negate: bool = False) -> ExpressionBuilder: cmp_with_zero_expr = BytesComparisonExpression( @@ -83,17 +87,23 @@ def bool_eval(self, location: SourceLocation, *, negate: bool = False) -> Expres operator=EqualityComparison.eq if negate else EqualityComparison.ne, rhs=IntrinsicCall( source_location=location, - wtype=wtypes.address_wtype, + wtype=self.wtype, op_code="global", immediates=["ZeroAddress"], ), ) + return var_expression(cmp_with_zero_expr) def compare( self, other: ExpressionBuilder | Literal, op: BuilderComparisonOp, location: SourceLocation ) -> ExpressionBuilder: other_expr = convert_literal_to_expr(other, self.wtype) + if not ( + other_expr.wtype == self.wtype # can only compare with other Accounts? + and op in (BuilderComparisonOp.eq, BuilderComparisonOp.ne) + ): + return NotImplemented cmp_expr = BytesComparisonExpression( source_location=location, lhs=self.expr, diff --git a/src/wyvern/awst_build/eb/reference_types/application.py b/src/wyvern/awst_build/eb/reference_types/application.py new file mode 100644 index 0000000000..b270b26604 --- /dev/null +++ b/src/wyvern/awst_build/eb/reference_types/application.py @@ -0,0 +1,62 @@ +from __future__ import annotations + +import typing + +from immutabledict import immutabledict + +from wyvern.awst import wtypes +from wyvern.awst.nodes import Literal, UInt64Constant +from wyvern.awst_build.eb.base import ExpressionBuilder, TypeClassExpressionBuilder +from wyvern.awst_build.eb.reference_types.base import ( + UInt64BackedReferenceValueExpressionBuilder, +) +from wyvern.awst_build.utils import expect_operand_wtype +from wyvern.errors import CodeError + +if typing.TYPE_CHECKING: + import mypy.nodes + + from wyvern.parse import SourceLocation + + +class ApplicationClassExpressionBuilder(TypeClassExpressionBuilder): + def produces(self) -> wtypes.WType: + return wtypes.application_wtype + + def call( + self, + args: typing.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 [ExpressionBuilder() as eb]: + uint64_expr = expect_operand_wtype(eb, wtypes.uint64_wtype) + return ApplicationExpressionBuilder(uint64_expr) + case [Literal(value=int(int_value), source_location=loc)]: + const = UInt64Constant(value=int_value, source_location=loc) + return ApplicationExpressionBuilder(const) + case _: + raise CodeError("Invalid/unhandled arguments", location) + + +class ApplicationExpressionBuilder(UInt64BackedReferenceValueExpressionBuilder): + wtype = wtypes.application_wtype + native_access_member = "application_id" + field_mapping = immutabledict( + { + "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), + "local_num_uint": ("AppLocalNumUint", wtypes.uint64_wtype), + "local_num_byte_slice": ("AppLocalNumByteSlice", wtypes.uint64_wtype), + "extra_program_pages": ("AppExtraProgramPages", wtypes.uint64_wtype), + "creator": ("AppCreator", wtypes.account_wtype), + "address": ("AppAddress", wtypes.account_wtype), + } + ) + field_op_code = "app_params_get" + field_bool_comment = "application exists" diff --git a/src/wyvern/awst_build/eb/reference_types/asset.py b/src/wyvern/awst_build/eb/reference_types/asset.py new file mode 100644 index 0000000000..85b5dce9d8 --- /dev/null +++ b/src/wyvern/awst_build/eb/reference_types/asset.py @@ -0,0 +1,118 @@ +from __future__ import annotations + +import typing +from typing import Sequence + +from immutabledict import immutabledict + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + CheckedMaybe, + Expression, + IntrinsicCall, + Literal, + UInt64Constant, +) +from wyvern.awst_build.eb.base import ( + ExpressionBuilder, + IntermediateExpressionBuilder, + TypeClassExpressionBuilder, +) +from wyvern.awst_build.eb.reference_types.base import UInt64BackedReferenceValueExpressionBuilder +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import expect_operand_wtype +from wyvern.errors import CodeError + +if typing.TYPE_CHECKING: + import mypy.nodes + + from wyvern.parse import SourceLocation + + +class AssetClassExpressionBuilder(TypeClassExpressionBuilder): + def produces(self) -> wtypes.WType: + return wtypes.asset_wtype + + def call( + self, + args: typing.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 [ExpressionBuilder() as eb]: + uint64_expr = expect_operand_wtype(eb, wtypes.uint64_wtype) + return AssetExpressionBuilder(uint64_expr) + case [Literal(value=int(int_value), source_location=loc)]: + const = UInt64Constant(value=int_value, source_location=loc) + return AssetExpressionBuilder(const) + case _: + raise CodeError("Invalid/unhandled arguments", location) + + +ASSET_HOLDING_FIELD_MAPPING: typing.Final = { + "balance": ("AssetBalance", wtypes.uint64_wtype), + "frozen": ("AssetFrozen", wtypes.bool_wtype), +} + + +class AssetHoldingExpressionBuilder(IntermediateExpressionBuilder): + def __init__(self, asset: Expression, holding_field: str, location: SourceLocation): + self.asset = asset + self.holding_field = holding_field + super().__init__(location) + + 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 [ExpressionBuilder() as eb]: + account_expr = expect_operand_wtype(eb, wtypes.account_wtype) + immediate, wtype = ASSET_HOLDING_FIELD_MAPPING[self.holding_field] + asset_params_get = IntrinsicCall( + source_location=location, + wtype=wtypes.WTuple.from_types((wtype, wtypes.bool_wtype)), + op_code="asset_holding_get", + immediates=[immediate], + stack_args=[account_expr, self.asset], + ) + return var_expression( + CheckedMaybe(asset_params_get, comment="account opted into asset") + ) + case _: + raise CodeError("Invalid/unhandled arguments", location) + + +class AssetExpressionBuilder(UInt64BackedReferenceValueExpressionBuilder): + wtype = wtypes.asset_wtype + native_access_member = "asset_id" + field_mapping = immutabledict( + { + "total": ("AssetTotal", wtypes.uint64_wtype), + "decimals": ("AssetDecimals", wtypes.uint64_wtype), + "default_frozen": ("AssetDefaultFrozen", wtypes.bool_wtype), + "unit_name": ("AssetUnitName", wtypes.bytes_wtype), + "name": ("AssetName", wtypes.bytes_wtype), + "url": ("AssetURL", wtypes.bytes_wtype), + "metadata_hash": ("AssetMetadataHash", wtypes.bytes_wtype), + "manager": ("AssetManager", wtypes.account_wtype), + "reserve": ("AssetReserve", wtypes.account_wtype), + "freeze": ("AssetFreeze", wtypes.account_wtype), + "clawback": ("AssetClawback", wtypes.account_wtype), + "creator": ("AssetCreator", wtypes.account_wtype), + } + ) + field_op_code = "asset_params_get" + field_bool_comment = "asset exists" + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + if name in ASSET_HOLDING_FIELD_MAPPING: + return AssetHoldingExpressionBuilder(self.expr, name, location) + return super().member_access(name, location) diff --git a/src/wyvern/awst_build/eb/reference_types/base.py b/src/wyvern/awst_build/eb/reference_types/base.py new file mode 100644 index 0000000000..1582d633fc --- /dev/null +++ b/src/wyvern/awst_build/eb/reference_types/base.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +from typing import TYPE_CHECKING + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + CheckedMaybe, + Expression, + IntrinsicCall, + Literal, + Not, + NumericComparison, + NumericComparisonExpression, + ReinterpretCast, +) +from wyvern.awst_build.eb.base import ( + BuilderComparisonOp, + ExpressionBuilder, + ValueExpressionBuilder, +) +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import convert_literal_to_expr + +if TYPE_CHECKING: + from immutabledict import immutabledict + + from wyvern.parse import SourceLocation + + +class ReferenceValueExpressionBuilder(ValueExpressionBuilder): + native_wtype: wtypes.WType + native_access_member: str + field_mapping: immutabledict[str, tuple[str, wtypes.WType]] + field_op_code: str + field_bool_comment: str + + def __init__(self, expr: Expression) -> None: + if expr.wtype == self.native_wtype: + expr = ReinterpretCast( + source_location=expr.source_location, wtype=self.wtype, expr=expr + ) + super().__init__(expr) + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + if name == self.native_access_member: + native_cast = ReinterpretCast( + source_location=location, wtype=self.native_wtype, expr=self.expr + ) + return var_expression(native_cast) + if name in self.field_mapping: + immediate, wtype = self.field_mapping[name] + acct_params_get = IntrinsicCall( + source_location=location, + wtype=wtypes.WTuple.from_types((wtype, wtypes.bool_wtype)), + op_code=self.field_op_code, + immediates=[immediate], + stack_args=[self.expr], + ) + checked_maybe = CheckedMaybe(acct_params_get, comment=self.field_bool_comment) + return var_expression(checked_maybe) + return super().member_access(name, location) + + +class UInt64BackedReferenceValueExpressionBuilder(ReferenceValueExpressionBuilder): + native_wtype = wtypes.uint64_wtype + + def bool_eval(self, location: SourceLocation, *, negate: bool = False) -> ExpressionBuilder: + as_bool = ReinterpretCast( + expr=self.expr, + wtype=wtypes.bool_wtype, + source_location=self.expr.source_location, + ) + if negate: + expr: Expression = Not(location, as_bool) + else: + expr = as_bool + return var_expression(expr) + + def compare( + self, other: ExpressionBuilder | Literal, op: BuilderComparisonOp, location: SourceLocation + ) -> ExpressionBuilder: + other_expr = convert_literal_to_expr(other, self.wtype) + if not ( + other_expr.wtype == self.wtype # can only compare with other of same type? + and op in (BuilderComparisonOp.eq, BuilderComparisonOp.ne) + ): + return NotImplemented + cmp_expr = NumericComparisonExpression( + source_location=location, + lhs=self.expr, + operator=NumericComparison(op.value), + rhs=other_expr, + ) + return var_expression(cmp_expr) diff --git a/src/wyvern/awst_build/eb/temporary_assignment.py b/src/wyvern/awst_build/eb/temporary_assignment.py index 5084a08888..e07f1a43cb 100644 --- a/src/wyvern/awst_build/eb/temporary_assignment.py +++ b/src/wyvern/awst_build/eb/temporary_assignment.py @@ -1,13 +1,12 @@ from wyvern.awst.nodes import ( - AssignmentExpression, Expression, Literal, Lvalue, Statement, - TemporaryVariable, ) from wyvern.awst_build.eb.base import BuilderComparisonOp, ExpressionBuilder from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import create_temporary_assignment from wyvern.errors import InternalError from wyvern.parse import SourceLocation @@ -15,12 +14,9 @@ class TemporaryAssignmentExpressionBuilder(ExpressionBuilder): def __init__(self, expr: Expression): super().__init__(expr.source_location) - self.target = TemporaryVariable(expr) - self.assignment = AssignmentExpression( - source_location=expr.source_location, - value=expr, - target=self.target, - ) + assign_expr = create_temporary_assignment(expr) + self.target = assign_expr.read + self.assignment = assign_expr.define self.is_first_access = True def lvalue(self) -> Lvalue: diff --git a/src/wyvern/awst_build/eb/transaction.py b/src/wyvern/awst_build/eb/transaction.py new file mode 100644 index 0000000000..3f0f73e71e --- /dev/null +++ b/src/wyvern/awst_build/eb/transaction.py @@ -0,0 +1,337 @@ +from __future__ import annotations + +import abc +import typing + +from wyvern.awst import wtypes +from wyvern.awst.nodes import ( + CheckedMaybe, + Expression, + IntrinsicCall, + Literal, + NumericComparison, + NumericComparisonExpression, + ReinterpretCast, + TupleExpression, + UInt64Constant, +) +from wyvern.awst_build.eb.base import ( + ExpressionBuilder, + IntermediateExpressionBuilder, + TypeClassExpressionBuilder, + ValueExpressionBuilder, +) +from wyvern.awst_build.eb.var_factory import var_expression +from wyvern.awst_build.utils import create_temporary_assignment, expect_operand_wtype +from wyvern.errors import CodeError + +if typing.TYPE_CHECKING: + from collections.abc import Sequence + + import mypy.nodes + + from wyvern.parse import SourceLocation + +MemberTypeMap = dict[str, tuple[str, wtypes.WType]] + +COMMON_TRANSACTION_FIELDS: MemberTypeMap = { + "sender": ("Sender", wtypes.account_wtype), + "fee": ("Fee", wtypes.uint64_wtype), + "first_valid": ("FirstValid", wtypes.uint64_wtype), + "first_valid_time": ("FirstValidTime", wtypes.uint64_wtype), + "last_valid": ("LastValid", wtypes.uint64_wtype), + "note": ("Note", wtypes.bytes_wtype), + "lease": ("Lease", wtypes.bytes_wtype), + "type_bytes": ("Type", wtypes.bytes_wtype), + "type": ("TypeEnum", wtypes.uint64_wtype), + "group_index": ("GroupIndex", wtypes.uint64_wtype), + "txn_id": ("TxID", wtypes.bytes_wtype), + "rekey_to": ("RekeyTo", wtypes.account_wtype), +} + + +class _TransactionExpressionBuilder(ValueExpressionBuilder, abc.ABC): + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + try: + immediate, wtype = self.transaction_fields_mapping[name] + except KeyError: + pass + else: + return self.gtxns(immediate, wtype, location) + return super().member_access(name, location) + + def gtxns( + self, immediate: str, wtype: wtypes.WType, location: SourceLocation + ) -> ExpressionBuilder: + return var_expression( + IntrinsicCall( + source_location=location, + wtype=wtype, + op_code="gtxns", + immediates=[immediate], + stack_args=[self.expr], + ) + ) + + +def check_transaction_type( + transaction_index: Expression, + expected_transaction_type: wtypes.WTransaction, + location: SourceLocation, +) -> Expression: + if expected_transaction_type.transaction_type is None: + return transaction_index + transaction_index_tmp = create_temporary_assignment( + transaction_index, + location, + ) + return ReinterpretCast( + source_location=location, + wtype=expected_transaction_type, + expr=CheckedMaybe( + TupleExpression.from_items( + ( + transaction_index_tmp.define, + NumericComparisonExpression( + lhs=IntrinsicCall( + op_code="gtxns", + immediates=["TypeEnum"], + stack_args=[transaction_index_tmp.read], + wtype=wtypes.uint64_wtype, + source_location=location, + ), + operator=NumericComparison.eq, + rhs=UInt64Constant( + value=expected_transaction_type.transaction_type.value, + teal_alias=expected_transaction_type.transaction_type.name, + source_location=location, + ), + source_location=location, + ), + ), + location, + ), + comment=f"transaction type is {expected_transaction_type.transaction_type.name}", + ), + ) + + +class _TransactionClassExpressionBuilder(TypeClassExpressionBuilder, abc.ABC): + expression_builder_type: type[_TransactionExpressionBuilder] + + @property + def wtype(self) -> wtypes.WType: + return self.expression_builder_type.wtype + + def produces(self) -> wtypes.WType: + return self.wtype + + def call( + self, + args: typing.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 [ExpressionBuilder() as eb]: + group_index = expect_operand_wtype(eb, wtypes.uint64_wtype) + case [Literal(value=int(int_value), source_location=loc)]: + group_index = UInt64Constant(value=int_value, source_location=loc) + case _: + raise CodeError("Invalid/unhandled arguments", location) + wtype = self.wtype + txn = ( + check_transaction_type(group_index, wtype, location) + if isinstance(wtype, wtypes.WTransaction) + else group_index + ) + return self.expression_builder_type(txn) + + +class _TypedTransactionExpressionBuilder(_TransactionExpressionBuilder, abc.ABC): + wtype: wtypes.WTransaction + + +class _TypedTransactionClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type: type[_TypedTransactionExpressionBuilder] + + +class TransactionBaseExpressionBuilder(_TransactionExpressionBuilder): + wtype: wtypes.WType = wtypes.transaction_base_wtype + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] = COMMON_TRANSACTION_FIELDS + + +class TransactionBaseClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type = TransactionBaseExpressionBuilder + + +class PaymentTransactionExpressionBuilder(_TypedTransactionExpressionBuilder): + wtype = wtypes.payment_wtype + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] = { + **COMMON_TRANSACTION_FIELDS, + "receiver": ("Receiver", wtypes.account_wtype), + "amount": ("Amount", wtypes.uint64_wtype), + "close_remainder_to": ("CloseRemainderTo", wtypes.account_wtype), + } + + +class PaymentTransactionClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type = PaymentTransactionExpressionBuilder + + +class KeyRegistrationTransactionExpressionBuilder(_TypedTransactionExpressionBuilder): + wtype = wtypes.key_registration_wtype + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] = { + **COMMON_TRANSACTION_FIELDS, + "vote_key": ("VotePK", wtypes.account_wtype), + "selection_key": ("SelectionPK", wtypes.account_wtype), + "vote_first": ("VoteFirst", wtypes.uint64_wtype), + "vote_last": ("VoteLast", wtypes.uint64_wtype), + "vote_key_dilution": ("VoteKeyDilution", wtypes.uint64_wtype), + "non_participation": ("Nonparticipation", wtypes.bool_wtype), + "state_proof_key": ("StateProofPK", wtypes.bytes_wtype), + } + + +class KeyRegistrationTransactionClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type = KeyRegistrationTransactionExpressionBuilder + + +class AssetConfigTransactionExpressionBuilder(_TypedTransactionExpressionBuilder): + wtype = wtypes.asset_config_wtype + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] = { + **COMMON_TRANSACTION_FIELDS, + "config_asset": ("ConfigAsset", wtypes.uint64_wtype), + "total": ("ConfigAssetTotal", wtypes.uint64_wtype), + "decimals": ("ConfigAssetDecimals", wtypes.uint64_wtype), + "default_frozen": ("ConfigAssetDefaultFrozen", wtypes.bool_wtype), + "unit_name": ("ConfigAssetUnitName", wtypes.bytes_wtype), + "asset_name": ("ConfigAssetName", wtypes.bytes_wtype), + "url": ("ConfigAssetURL", wtypes.bytes_wtype), + "metadata_hash": ("ConfigAssetMetadataHash", wtypes.bytes_wtype), + "manager": ("ConfigAssetManager", wtypes.account_wtype), + "reserve": ("ConfigAssetReserve", wtypes.account_wtype), + "freeze": ("ConfigAssetFreeze", wtypes.account_wtype), + "clawback": ("ConfigAssetClawback", wtypes.account_wtype), + } + + +class AssetConfigTransactionClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type = AssetConfigTransactionExpressionBuilder + + +class AssetTransferTransactionExpressionBuilder(_TypedTransactionExpressionBuilder): + wtype = wtypes.asset_transfer_wtype + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] = { + **COMMON_TRANSACTION_FIELDS, + "xfer_asset": ("XferAsset", wtypes.asset_wtype), + "asset_amount": ("AssetAmount", wtypes.uint64_wtype), + "asset_sender": ("AssetSender", wtypes.account_wtype), + "asset_receiver": ("AssetReceiver", wtypes.account_wtype), + "asset_close_to": ("AssetCloseTo", wtypes.account_wtype), + } + + +class AssetTransferTransactionClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type = AssetTransferTransactionExpressionBuilder + + +class AssetFreezeTransactionExpressionBuilder(_TypedTransactionExpressionBuilder): + wtype = wtypes.asset_freeze_wtype + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] = { + **COMMON_TRANSACTION_FIELDS, + "freeze_asset": ("FreezeAsset", wtypes.uint64_wtype), + "freeze_account": ("FreezeAssetAccount", wtypes.account_wtype), + "frozen": ("FreezeAssetFrozen", wtypes.bool_wtype), + } + + +class AssetFreezeTransactionClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type = AssetFreezeTransactionExpressionBuilder + + +class ApplicationCallTransactionArrayExpressionBuilder(IntermediateExpressionBuilder): + def __init__( + self, + transaction: Expression, + immediate: str, + wtype: wtypes.WType, + location: SourceLocation, + ): + super().__init__(location) + self.transaction = transaction + self.immediate = immediate + self.wtype = 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: + match args: + case [(ExpressionBuilder() | Literal(value=int())) as eb]: + index_expr = expect_operand_wtype(eb, wtypes.uint64_wtype) + return var_expression( + IntrinsicCall( + source_location=location, + wtype=self.wtype, + op_code="gtxnsas", + immediates=[self.immediate], + stack_args=[self.transaction, index_expr], + ) + ) + case _: + raise CodeError("Invalid/unhandled arguments", location) + + +class ApplicationCallTransactionExpressionBuilder(_TypedTransactionExpressionBuilder): + wtype = wtypes.application_call_wtype + transaction_fields_mapping: typing.ClassVar[MemberTypeMap] = { + **COMMON_TRANSACTION_FIELDS, + "application_id": ("ApplicationID", wtypes.uint64_wtype), + "on_completion": ("OnCompletion", wtypes.uint64_wtype), + "num_app_args": ("NumAppArgs", wtypes.uint64_wtype), + "num_accounts": ("NumAccounts", wtypes.uint64_wtype), + "approval_program": ("ApprovalProgram", wtypes.bytes_wtype), + "clear_state_program": ("ClearStateProgram", wtypes.bytes_wtype), + "num_assets": ("NumAssets", wtypes.uint64_wtype), + "num_applications": ("NumApplications", wtypes.uint64_wtype), + "global_num_uint": ("GlobalNumUint", wtypes.uint64_wtype), + "global_num_byte_slice": ("GlobalNumByteSlice", wtypes.uint64_wtype), + "local_num_uint": ("LocalNumUint", wtypes.uint64_wtype), + "local_num_byte_slice": ("LocalNumByteSlice", wtypes.uint64_wtype), + "extra_program_pages": ("ExtraProgramPages", wtypes.uint64_wtype), + "last_log": ("LastLog", wtypes.bytes_wtype), + "num_approval_program_pages": ("NumApprovalProgramPages", wtypes.uint64_wtype), + "num_clear_state_program_pages": ("NumClearStateProgramPages", wtypes.uint64_wtype), + } + transaction_array_method_mapping: typing.ClassVar[MemberTypeMap] = { + "application_args": ("ApplicationArgs", wtypes.bytes_wtype), + "accounts": ("Accounts", wtypes.account_wtype), + "assets": ("Assets", wtypes.asset_wtype), + "applications": ("Applications", wtypes.application_wtype), + "approval_program_pages": ("ApprovalProgramPages", wtypes.bytes_wtype), + "clear_state_program_pages": ("ClearStateProgramPages", wtypes.bytes_wtype), + } + + def member_access(self, name: str, location: SourceLocation) -> ExpressionBuilder | Literal: + try: + immediate, wtype = self.transaction_array_method_mapping[name] + except KeyError: + pass + else: + return ApplicationCallTransactionArrayExpressionBuilder( + self.expr, immediate, wtype, location + ) + return super().member_access(name, location) + + +class ApplicationCallTransactionClassExpressionBuilder(_TransactionClassExpressionBuilder): + expression_builder_type = ApplicationCallTransactionExpressionBuilder diff --git a/src/wyvern/awst_build/eb/tuple.py b/src/wyvern/awst_build/eb/tuple.py index ad73052e36..9e24774fb3 100644 --- a/src/wyvern/awst_build/eb/tuple.py +++ b/src/wyvern/awst_build/eb/tuple.py @@ -1,20 +1,64 @@ +from collections.abc import Sequence + import structlog from wyvern.awst import wtypes -from wyvern.awst.nodes import BoolConstant, Contains, Expression, Literal, TupleItemExpression +from wyvern.awst.nodes import ( + BoolConstant, + Contains, + Expression, + IntegerConstant, + Literal, + SliceExpression, + TupleItemExpression, + UInt64Constant, +) from wyvern.awst_build.eb.base import ( BuilderComparisonOp, ExpressionBuilder, Iteration, + TypeClassExpressionBuilder, ValueExpressionBuilder, ) from wyvern.awst_build.eb.var_factory import var_expression from wyvern.errors import CodeError, TodoError from wyvern.parse import SourceLocation +from wyvern.utils import clamp logger: structlog.types.FilteringBoundLogger = structlog.get_logger(__name__) +class TupleTypeExpressionBuilder(TypeClassExpressionBuilder): + def produces(self) -> wtypes.WType: + try: + return self.wtype + except AttributeError as ex: + raise CodeError( + "Unparameterized tuple class cannot be used as a type", self.source_location + ) from ex + + def index( + self, index: ExpressionBuilder | Literal, location: SourceLocation + ) -> ExpressionBuilder: + return self.index_multiple((index,), location) + + def index_multiple( + self, indexes: Sequence[ExpressionBuilder | Literal], location: SourceLocation + ) -> TypeClassExpressionBuilder: + tuple_item_types = list[wtypes.WType]() + for index in indexes: + match index: + case TypeClassExpressionBuilder() as type_class: + wtype = type_class.produces() + if wtype is wtypes.void_wtype: + raise CodeError("Tuples cannot contain None values", location) + tuple_item_types.append(wtype) + case _: + raise CodeError("Expected a type", index.source_location) + self.wtype = wtypes.WTuple.from_types(tuple_item_types) + return self + + class TupleExpressionBuilder(ValueExpressionBuilder): def __init__(self, expr: Expression): assert isinstance(expr.wtype, wtypes.WTuple) @@ -55,7 +99,42 @@ def slice_index( stride: ExpressionBuilder | Literal | None, location: SourceLocation, ) -> ExpressionBuilder: - raise TodoError(location, "TODO: slicing tuple") + if stride is not None: + raise CodeError("Stride is not supported", location=stride.source_location) + + start_expr, start_idx = self._convert_index(begin_index) + end_expr, end_idx = self._convert_index(end_index) + slice_types = self.wtype.types[start_idx:end_idx] + if not slice_types: + raise CodeError("Empty slices are not supported", location) + + updated_wtype = wtypes.WTuple.from_types(slice_types) + return var_expression( + SliceExpression( + source_location=location, + base=self.expr, + begin_index=start_expr, + end_index=end_expr, + wtype=updated_wtype, + ) + ) + + def _convert_index( + self, index: ExpressionBuilder | Literal | None + ) -> tuple[IntegerConstant | None, int | None]: + match index: + case None: + expr = None + idx = None + case Literal(value=int(idx), source_location=start_loc): + positive_idx = idx if idx >= 0 else len(self.wtype.types) + idx + positive_idx_clamped = clamp(positive_idx, low=0, high=len(self.wtype.types) - 1) + expr = UInt64Constant(value=positive_idx_clamped, source_location=start_loc) + case _: + raise CodeError( + "Tuples can only be indexed with literal values", index.source_location + ) + return expr, idx def iterate(self) -> Iteration: return self.rvalue() diff --git a/src/wyvern/awst_build/eb/type_registry.py b/src/wyvern/awst_build/eb/type_registry.py new file mode 100644 index 0000000000..ed7fe3192d --- /dev/null +++ b/src/wyvern/awst_build/eb/type_registry.py @@ -0,0 +1,117 @@ +from wyvern.awst import ( + wtypes, +) +from wyvern.awst.nodes import Expression +from wyvern.awst_build import constants +from wyvern.awst_build.eb import ( + arc4, + array, + biguint, + bool as bool_, + bytes as bytes_, + struct, + transaction, + tuple as tuple_, + uint64, + void, +) +from wyvern.awst_build.eb.base import ( + ExpressionBuilder, + GenericClassExpressionBuilder, + TypeClassExpressionBuilder, +) +from wyvern.awst_build.eb.reference_types import account, application, asset +from wyvern.errors import CodeError +from wyvern.parse import SourceLocation + +TYPE_NAME_CLS_MAPPING: dict[ + str, type[TypeClassExpressionBuilder | GenericClassExpressionBuilder] +] = { + "builtins.None": void.VoidTypeExpressionBuilder, + "builtins.bool": bool_.BoolClassExpressionBuilder, + "builtins.tuple": tuple_.TupleTypeExpressionBuilder, + constants.CLS_ARC4_ADDRESS: arc4.AddressClassExpressionBuilder, + constants.CLS_ARC4_BIG_UFIXEDNXM: arc4.UFixedNxMClassExpressionBuilder, + constants.CLS_ARC4_BIG_UINTN: arc4.UIntNClassExpressionBuilder, + constants.CLS_ARC4_BOOL: arc4.ARC4BoolClassExpressionBuilder, + constants.CLS_ARC4_BYTE: arc4.ByteClassExpressionBuilder, + constants.CLS_ARC4_DYNAMIC_ARRAY: arc4.DynamicArrayGenericClassExpressionBuilder, + constants.CLS_ARC4_STATIC_ARRAY: arc4.StaticArrayGenericClassExpressionBuilder, + constants.CLS_ARC4_STRING: arc4.StringClassExpressionBuilder, + constants.CLS_ARC4_TUPLE: arc4.ARC4TupleGenericClassExpressionBuilder, + constants.CLS_ARC4_UFIXEDNXM: arc4.UFixedNxMClassExpressionBuilder, + constants.CLS_ARC4_UINTN: arc4.UIntNClassExpressionBuilder, + constants.CLS_ACCOUNT: account.AccountClassExpressionBuilder, + constants.CLS_ARRAY: array.ArrayGenericClassExpressionBuilder, + constants.CLS_APPLICATION: application.ApplicationClassExpressionBuilder, + constants.CLS_TRANSACTION_BASE: transaction.TransactionBaseClassExpressionBuilder, + constants.CLS_APPLICATION_CALL_TRANSACTION: ( + transaction.ApplicationCallTransactionClassExpressionBuilder + ), + constants.CLS_ASSET: asset.AssetClassExpressionBuilder, + constants.CLS_ASSET_CONFIG_TRANSACTION: ( + transaction.AssetConfigTransactionClassExpressionBuilder + ), + constants.CLS_ASSET_TRANSFER_TRANSACTION: ( + transaction.AssetTransferTransactionClassExpressionBuilder + ), + constants.CLS_ASSET_FREEZE_TRANSACTION: ( + transaction.AssetFreezeTransactionClassExpressionBuilder + ), + constants.CLS_BIGUINT: biguint.BigUIntClassExpressionBuilder, + constants.CLS_BYTES: bytes_.BytesClassExpressionBuilder, + constants.CLS_KEY_REGISTRATION_TRANSACTION: ( + transaction.KeyRegistrationTransactionClassExpressionBuilder + ), + constants.CLS_PAYMENT_TRANSACTION: transaction.PaymentTransactionClassExpressionBuilder, + constants.CLS_UINT64: uint64.UInt64ClassExpressionBuilder, +} + +WTYPE_BUILDER_MAPPING = { + wtypes.ARC4DynamicArray: arc4.DynamicArrayExpressionBuilder, + wtypes.ARC4Struct: arc4.ARC4StructExpressionBuilder, + wtypes.ARC4StaticArray: arc4.StaticArrayExpressionBuilder, + wtypes.ARC4Tuple: arc4.ARC4TupleExpressionBuilder, + wtypes.ARC4UFixedNxM: arc4.UFixedNxMExpressionBuilder, + wtypes.ARC4UIntN: arc4.UIntNExpressionBuilder, + wtypes.WArray: array.ArrayExpressionBuilder, + wtypes.WStructType: struct.StructExpressionBuilder, + wtypes.WTuple: tuple_.TupleExpressionBuilder, + wtypes.arc4_bool_wtype: arc4.ARC4BoolExpressionBuilder, + wtypes.arc4_string_wtype: arc4.StringExpressionBuilder, + wtypes.account_wtype: account.AccountExpressionBuilder, + wtypes.application_wtype: application.ApplicationExpressionBuilder, + wtypes.application_call_wtype: transaction.ApplicationCallTransactionExpressionBuilder, + wtypes.asset_config_wtype: transaction.AssetConfigTransactionExpressionBuilder, + wtypes.asset_transfer_wtype: transaction.AssetTransferTransactionExpressionBuilder, + wtypes.asset_freeze_wtype: transaction.AssetFreezeTransactionExpressionBuilder, + wtypes.transaction_base_wtype: transaction.TransactionBaseExpressionBuilder, + wtypes.asset_wtype: asset.AssetExpressionBuilder, + wtypes.biguint_wtype: biguint.BigUIntExpressionBuilder, + wtypes.bool_wtype: bool_.BoolExpressionBuilder, + wtypes.bytes_wtype: bytes_.BytesExpressionBuilder, + wtypes.key_registration_wtype: transaction.KeyRegistrationTransactionExpressionBuilder, + wtypes.payment_wtype: transaction.PaymentTransactionExpressionBuilder, + wtypes.uint64_wtype: uint64.UInt64ExpressionBuilder, + wtypes.void_wtype: void.VoidExpressionBuilder, +} + + +def get_type_builder( + python_type: str, source_location: SourceLocation +) -> TypeClassExpressionBuilder | GenericClassExpressionBuilder: + try: + type_class = TYPE_NAME_CLS_MAPPING[python_type] + except KeyError as ex: + # TODO: make an InternalError before alpha + raise CodeError(f"Unhandled algopy name: {python_type}", source_location) from ex + else: + return type_class(source_location) + + +def var_expression(expr: Expression) -> ExpressionBuilder: + try: + builder = WTYPE_BUILDER_MAPPING[expr.wtype] + except KeyError: + builder = WTYPE_BUILDER_MAPPING[type(expr.wtype)] + return builder(expr) diff --git a/src/wyvern/awst_build/eb/typing_literal.py b/src/wyvern/awst_build/eb/typing_literal.py deleted file mode 100644 index 84371d24a4..0000000000 --- a/src/wyvern/awst_build/eb/typing_literal.py +++ /dev/null @@ -1,36 +0,0 @@ -from wyvern.awst import wtypes -from wyvern.awst.nodes import Literal, UInt64Constant -from wyvern.awst_build.eb.base import ( - ExpressionBuilder, - TypeClassExpressionBuilder, -) -from wyvern.awst_build.eb.var_factory import var_expression -from wyvern.errors import CodeError, InternalError -from wyvern.parse import SourceLocation - - -class TypingLiteralClassExpressionBuilder(TypeClassExpressionBuilder): - wtype: wtypes.WType | None - - def produces(self) -> wtypes.WType: - if self.wtype: - return self.wtype - raise InternalError("Cannot determine wtype of TypingLiteral until index is called ") - - def index( - self, index: ExpressionBuilder | Literal, location: SourceLocation - ) -> ExpressionBuilder: - assert isinstance( - index, Literal - ), "Index item must be a literal value to be indexed with typing.Literal[...]" - - match index.value: - case int(int_value): - self.wtype = wtypes.uint64_wtype - return var_expression(UInt64Constant(value=int_value, source_location=location)) - # case bool(): - # wtype = wtypes.bool_wtype - # case str(): - # wtype = wtypes.bytes_wtype - case _: - raise CodeError("Unsupported value for a literal type") diff --git a/src/wyvern/awst_build/eb/var_factory.py b/src/wyvern/awst_build/eb/var_factory.py index be87e015cc..2a060aa358 100644 --- a/src/wyvern/awst_build/eb/var_factory.py +++ b/src/wyvern/awst_build/eb/var_factory.py @@ -1,58 +1,8 @@ -from wyvern.awst import wtypes from wyvern.awst.nodes import Expression from wyvern.awst_build.eb.base import ExpressionBuilder -from wyvern.errors import TodoError def var_expression(expr: Expression) -> ExpressionBuilder: - # To avoid circular imports - from wyvern.awst_build.eb.abi import ( - DynamicArrayExpressionBuilder, - StaticArrayExpressionBuilder, - StringExpressionBuilder, - UIntNExpressionBuilder, - ) - from wyvern.awst_build.eb.address import AddressExpressionBuilder - from wyvern.awst_build.eb.array import ArrayExpressionBuilder - from wyvern.awst_build.eb.asset import AssetExpressionBuilder - from wyvern.awst_build.eb.biguint import BigUIntExpressionBuilder - from wyvern.awst_build.eb.bool import BoolExpressionBuilder - from wyvern.awst_build.eb.bytes import BytesExpressionBuilder - from wyvern.awst_build.eb.struct import StructExpressionBuilder - from wyvern.awst_build.eb.tuple import TupleExpressionBuilder - from wyvern.awst_build.eb.uint64 import UInt64ExpressionBuilder - from wyvern.awst_build.eb.void import VoidExpressionBuilder + from wyvern.awst_build.eb import type_registry - match expr.wtype: - case wtypes.address_wtype: - return AddressExpressionBuilder(expr) - case wtypes.asset_wtype: - return AssetExpressionBuilder(expr) - case wtypes.biguint_wtype: - return BigUIntExpressionBuilder(expr) - case wtypes.bytes_wtype: - return BytesExpressionBuilder(expr) - case wtypes.uint64_wtype: - return UInt64ExpressionBuilder(expr) - case wtypes.bool_wtype: - return BoolExpressionBuilder(expr) - case wtypes.void_wtype: - return VoidExpressionBuilder(expr) - case wtypes.WArray(): - return ArrayExpressionBuilder(expr) - case wtypes.WStructType(): - return StructExpressionBuilder(expr) - case wtypes.WTuple(): - return TupleExpressionBuilder(expr) - case wtypes.abi_string_wtype: - return StringExpressionBuilder(expr) - case wtypes.AbiUIntN(): - return UIntNExpressionBuilder(expr) - case wtypes.AbiDynamicArray(): - return DynamicArrayExpressionBuilder(expr) - case wtypes.AbiStaticArray(): - return StaticArrayExpressionBuilder(expr) - case _: - raise TodoError( - expr.source_location, f"need to add var builder for wtype {expr.wtype}" - ) + return type_registry.var_expression(expr) diff --git a/src/wyvern/awst_build/eb/void.py b/src/wyvern/awst_build/eb/void.py index 3f5e7e3d8f..f9577aa21a 100644 --- a/src/wyvern/awst_build/eb/void.py +++ b/src/wyvern/awst_build/eb/void.py @@ -1,9 +1,14 @@ from wyvern.awst import wtypes from wyvern.awst.nodes import Expression -from wyvern.awst_build.eb.base import ValueExpressionBuilder +from wyvern.awst_build.eb.base import TypeClassExpressionBuilder, ValueExpressionBuilder from wyvern.errors import CodeError +class VoidTypeExpressionBuilder(TypeClassExpressionBuilder): + def produces(self) -> wtypes.WType: + return wtypes.void_wtype + + class VoidExpressionBuilder(ValueExpressionBuilder): wtype = wtypes.void_wtype diff --git a/src/wyvern/awst_build/intrinsic_data.py b/src/wyvern/awst_build/intrinsic_data.py index d5469e8f15..8e75020559 100644 --- a/src/wyvern/awst_build/intrinsic_data.py +++ b/src/wyvern/awst_build/intrinsic_data.py @@ -50,7 +50,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -141,7 +141,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1005,7 +1005,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -1033,7 +1033,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1242,7 +1242,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -1278,7 +1278,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -1461,7 +1461,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1483,7 +1483,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1505,14 +1505,14 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -1527,7 +1527,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1549,7 +1549,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1571,7 +1571,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1593,7 +1593,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1615,7 +1615,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1637,7 +1637,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1659,7 +1659,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1681,7 +1681,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1703,7 +1703,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1852,7 +1852,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1878,7 +1878,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1904,7 +1904,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1938,7 +1938,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1972,7 +1972,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -1996,7 +1996,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -2184,7 +2184,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2205,7 +2205,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2220,7 +2220,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -2249,7 +2249,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.uint64_wtype, int, ], @@ -2410,7 +2410,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2431,7 +2431,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2452,7 +2452,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2473,7 +2473,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2494,7 +2494,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2515,7 +2515,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, wtypes.bool_wtype, ], ), @@ -2760,7 +2760,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -2813,7 +2813,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -2848,7 +2848,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -2867,7 +2867,7 @@ allowed_types=[ wtypes.bytes_wtype, bytes, - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -2886,7 +2886,7 @@ allowed_types=[ wtypes.bytes_wtype, bytes, - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3029,7 +3029,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3046,7 +3046,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3063,7 +3063,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3134,7 +3134,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3187,7 +3187,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3333,7 +3333,7 @@ allowed_types=[ wtypes.bytes_wtype, bytes, - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3350,7 +3350,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3367,7 +3367,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3384,7 +3384,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3401,7 +3401,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3436,7 +3436,7 @@ ArgMapping( arg_name="a", allowed_types=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3705,7 +3705,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3777,7 +3777,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3789,7 +3789,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3801,7 +3801,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -3837,7 +3837,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3849,7 +3849,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3921,7 +3921,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -3933,7 +3933,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3957,7 +3957,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -3969,7 +3969,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -3981,7 +3981,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -4077,7 +4077,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4089,7 +4089,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4101,7 +4101,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4125,7 +4125,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -4217,7 +4217,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -4233,7 +4233,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4281,7 +4281,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4377,7 +4377,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -4389,7 +4389,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4401,7 +4401,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4413,7 +4413,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4425,7 +4425,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4449,7 +4449,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4839,7 +4839,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -4947,7 +4947,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -4965,7 +4965,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5001,7 +5001,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5019,7 +5019,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -5037,7 +5037,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -5181,7 +5181,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5199,7 +5199,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5217,7 +5217,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5253,7 +5253,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -5381,7 +5381,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -5403,7 +5403,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5475,7 +5475,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5619,7 +5619,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -5637,7 +5637,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5655,7 +5655,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5673,7 +5673,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5691,7 +5691,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -5727,7 +5727,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6348,7 +6348,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6420,7 +6420,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -6432,7 +6432,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6456,7 +6456,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6468,7 +6468,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -6480,7 +6480,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -6576,7 +6576,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6588,7 +6588,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6600,7 +6600,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6624,7 +6624,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -6716,7 +6716,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -6732,7 +6732,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6780,7 +6780,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6876,7 +6876,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -6888,7 +6888,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6900,7 +6900,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6912,7 +6912,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6924,7 +6924,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -6948,7 +6948,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -7340,7 +7340,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -7356,7 +7356,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -7556,7 +7556,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -7572,7 +7572,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -7592,7 +7592,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -7608,7 +7608,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -7664,7 +7664,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -7680,7 +7680,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -7700,7 +7700,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -7716,7 +7716,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -7736,7 +7736,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -7752,7 +7752,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -8024,7 +8024,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8040,7 +8040,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -8060,7 +8060,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8076,7 +8076,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -8096,7 +8096,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8112,7 +8112,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -8168,7 +8168,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8184,7 +8184,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -8416,7 +8416,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8440,7 +8440,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8462,7 +8462,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8486,7 +8486,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -8614,7 +8614,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8630,7 +8630,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -8902,7 +8902,7 @@ ), ], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8918,7 +8918,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.bytes_wtype, + wtypes.account_wtype, ], ), ], @@ -8938,7 +8938,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8954,7 +8954,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -8974,7 +8974,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -8990,7 +8990,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -9010,7 +9010,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -9026,7 +9026,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -9046,7 +9046,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -9062,7 +9062,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], @@ -9118,7 +9118,7 @@ ), ], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), FunctionOpMapping( @@ -9134,7 +9134,7 @@ ], stack_inputs=[], stack_outputs=[ - wtypes.address_wtype, + wtypes.account_wtype, ], ), ], diff --git a/src/wyvern/awst_build/main.py b/src/wyvern/awst_build/main.py index 91da9f1a46..bd5b39e21d 100644 --- a/src/wyvern/awst_build/main.py +++ b/src/wyvern/awst_build/main.py @@ -35,10 +35,12 @@ def transform_ast( for module_name in scc_module_names: module = ctx.parse_result.manager.modules.get(module_name) if module is None: - raise InternalError("wtf mypy") + raise InternalError(f"mypy failed to parse: {module_name}") module_rel_path = make_path_relative_to_cwd(module.path) if module_name != module.fullname: - raise InternalError("the world is broken") + raise InternalError( + f"mypy parsed wrong module, expected '{module_name}': {module.fullname}" + ) if module_name in ("abc", "typing", "collections.abc"): logger.debug(f"Skipping stdlib stub {module_rel_path}") elif module_name.startswith("algopy"): @@ -47,8 +49,13 @@ def transform_ast( logger.debug(f"Skipping typeshed stub {module_rel_path}") elif module.is_stub: logger.warning(f"Skipping stub: {module_rel_path}") + elif module_name == "_algopy_": + logger.debug(f"Building AWST for embedded algopy lib at {module_rel_path}") + module._fullname = "algopy" # noqa: SLF001 + module_awst = ModuleASTConverter.convert(ctx, module) + result[module.name] = module_awst else: - logger.info(f"Building AWST for {module_rel_path}") + logger.debug(f"Building AWST for {module_rel_path}") module_awst = ModuleASTConverter.convert(ctx, module) if ctx.options.output_awst: _output_awst(module_awst, ctx.options) diff --git a/src/wyvern/awst_build/module.py b/src/wyvern/awst_build/module.py index 183a629aed..7cbcfd6b99 100644 --- a/src/wyvern/awst_build/module.py +++ b/src/wyvern/awst_build/module.py @@ -5,6 +5,7 @@ import mypy.visitor import structlog +from wyvern.awst import wtypes from wyvern.awst.nodes import ( ConstantDeclaration, ConstantValue, @@ -13,7 +14,6 @@ StructureDefinition, StructureField, ) -from wyvern.awst.wtypes import WStructType, WType from wyvern.awst_build import constants from wyvern.awst_build.base_mypy_visitor import BaseMyPyVisitor from wyvern.awst_build.context import ASTConversionContext @@ -120,6 +120,16 @@ def visit_class_def(self, cdef: mypy.nodes.ClassDef) -> None: ) if cdef.info.bad_mro: self._error("Bad MRO", location=cdef) + elif cdef.info.has_base(constants.CLS_ARC4_STRUCT): + if [ti.fullname for ti in cdef.info.direct_base_classes()] != [ + constants.CLS_ARC4_STRUCT + ]: + # TODO: allow inheritance of arc4.Struct? + self._error( + "arc4.Struct classes must only inherit directly from arc4.Struct", cdef + ) + else: + self._process_arc4_struct(cdef) elif cdef.info.has_base(constants.STRUCT_BASE): if [ti.fullname for ti in cdef.info.direct_base_classes()] != [constants.STRUCT_BASE]: # TODO: allow inheritance of Structs? @@ -162,8 +172,55 @@ def visit_class_def(self, cdef: mypy.nodes.ClassDef) -> None: location=cdef, ) + def _process_arc4_struct(self, cdef: mypy.nodes.ClassDef) -> None: + field_types = dict[str, wtypes.WType]() + field_decls = list[StructureField]() + docstring = extract_docstring(cdef) + + for stmt in cdef.defs.body: + match stmt: + case mypy.nodes.AssignmentStmt( + lvalues=[mypy.nodes.NameExpr(name=field_name)], + rvalue=mypy.nodes.TempNode(), + type=mypy.types.Type() as mypy_type, + ): + wtype = self.context.type_to_wtype(mypy_type, source_location=stmt) + if not wtypes.is_arc4_encoded_type(wtype): + raise CodeError( + f"Invalid field type for arc4.Struct: {wtype}", self._location(stmt) + ) + field_types[field_name] = wtype + field_decls.append( + StructureField( + source_location=self._location(stmt), + name=field_name, + wtype=wtype, + ) + ) + case mypy.nodes.SymbolNode(name=symbol_name) if ( + cdef.info.names[symbol_name].plugin_generated + ): + pass + case _: + self._error("Unsupported Struct declaration", stmt) + if not field_types: + raise CodeError("arc4.Struct requires at least one field", self._location(cdef)) + tuple_wtype = wtypes.ARC4Struct.from_name_and_fields( + python_name=cdef.fullname, fields=field_types + ) + self._statements.append( + StructureDefinition( + name=cdef.name, + source_location=self._location(cdef), + fields=field_decls, + wtype=tuple_wtype, + docstring=docstring, + ) + ) + self.context.type_map[cdef.info.fullname] = tuple_wtype + def _process_struct(self, cdef: mypy.nodes.ClassDef) -> None: - field_types = dict[str, WType]() + field_types = dict[str, wtypes.WType]() field_decls = list[StructureField]() docstring = extract_docstring(cdef) for stmt in cdef.defs.body: @@ -174,36 +231,31 @@ def _process_struct(self, cdef: mypy.nodes.ClassDef) -> None: type=mypy.types.Type() as mypy_type, ): wtype = self.context.type_to_wtype(mypy_type, source_location=stmt) - # TODO: remove None check since type_to_wtype now raises a CodeError - # if a valid type can't be found? - if wtype is None: - self._error("unsupported type", stmt) - else: - field_decls.append( - StructureField( - source_location=self._location(stmt), - name=field_name, - wtype=wtype, - ) + field_decls.append( + StructureField( + source_location=self._location(stmt), + name=field_name, + wtype=wtype, ) - field_types[field_name] = wtype + ) + field_types[field_name] = wtype case mypy.nodes.SymbolNode(name=symbol_name) if ( cdef.info.names[symbol_name].plugin_generated ): pass case _: self._error("Unsupported Struct declaration", stmt) - struct_rtype = WStructType.from_name_and_fields(cdef.fullname, field_types) + struct_wtype = wtypes.WStructType.from_name_and_fields(cdef.fullname, field_types) self._statements.append( StructureDefinition( name=cdef.name, source_location=self._location(cdef), fields=field_decls, - wtype=struct_rtype, + wtype=struct_wtype, docstring=docstring, ) ) - self.context.type_map[cdef.info.fullname] = struct_rtype + self.context.type_map[cdef.info.fullname] = struct_wtype def visit_operator_assignment_stmt(self, stmt: mypy.nodes.OperatorAssignmentStmt) -> None: match stmt.lvalue: diff --git a/src/wyvern/awst_build/subroutine.py b/src/wyvern/awst_build/subroutine.py index ec8b85cf39..c3944ada57 100644 --- a/src/wyvern/awst_build/subroutine.py +++ b/src/wyvern/awst_build/subroutine.py @@ -5,12 +5,12 @@ import attrs import mypy.nodes +import mypy.patterns import mypy.types import structlog from wyvern.awst import wtypes from wyvern.awst.nodes import ( - ABIMethodConfig, AppStateDefinition, AssertStatement, AssignmentExpression, @@ -38,6 +38,7 @@ Statement, Subroutine, SubroutineArgument, + Switch, TupleExpression, VarExpression, WhileLoop, @@ -46,30 +47,21 @@ from wyvern.awst_build import constants from wyvern.awst_build.base_mypy_visitor import BaseMyPyVisitor from wyvern.awst_build.context import ASTConversionModuleContext -from wyvern.awst_build.eb.abi import ( - DynamicArrayClassExpressionBuilder, - StaticArrayClassExpressionBuilder, - StringClassExpressionBuilder, - UIntNClassExpressionBuilder, -) -from wyvern.awst_build.eb.address import AddressClassExpressionBuilder -from wyvern.awst_build.eb.array import ArrayGenericClassExpressionBuilder -from wyvern.awst_build.eb.asset import AssetClassExpressionBuilder +from wyvern.awst_build.eb.arc4 import ARC4StructClassExpressionBuilder from wyvern.awst_build.eb.base import ( BuilderBinaryOp, BuilderComparisonOp, ExpressionBuilder, TypeClassExpressionBuilder, ) -from wyvern.awst_build.eb.biguint import BigUIntClassExpressionBuilder from wyvern.awst_build.eb.bool import BoolClassExpressionBuilder -from wyvern.awst_build.eb.bytes import BytesClassExpressionBuilder from wyvern.awst_build.eb.contracts import ( ContractSelfExpressionBuilder, LocalStorageClassExpressionBuilder, ) from wyvern.awst_build.eb.ensure_budget import EnsureBudgetBuilder, OpUpFeeSourceClassBuilder from wyvern.awst_build.eb.intrinsics import ( + Arc4SignatureBuilder, IntrinsicEnumClassExpressionBuilder, IntrinsicFunctionExpressionBuilder, IntrinsicNamespaceClassExpressionBuilder, @@ -78,8 +70,8 @@ from wyvern.awst_build.eb.struct import StructSubclassExpressionBuilder from wyvern.awst_build.eb.subroutine import SubroutineInvokerExpressionBuilder from wyvern.awst_build.eb.temporary_assignment import TemporaryAssignmentExpressionBuilder -from wyvern.awst_build.eb.typing_literal import TypingLiteralClassExpressionBuilder -from wyvern.awst_build.eb.uint64 import UInt64ClassExpressionBuilder +from wyvern.awst_build.eb.tuple import TupleTypeExpressionBuilder +from wyvern.awst_build.eb.type_registry import get_type_builder from wyvern.awst_build.eb.unsigned_builtins import UnsignedEnumerateBuilder, UnsignedRangeBuilder from wyvern.awst_build.eb.var_factory import var_expression from wyvern.awst_build.exceptions import UnsupportedASTError @@ -90,12 +82,14 @@ extract_docstring, fold_binary_expr, fold_unary_expr, + get_aliased_instance, get_unaliased_fullname, iterate_user_bases, qualified_class_name, require_expression_builder, ) from wyvern.errors import CodeError, InternalError, WyvernError +from wyvern.metadata import ARC4MethodConfig from wyvern.parse import SourceLocation from wyvern.utils import invert_ordered_binary_op, lazy_setdefault @@ -107,7 +101,7 @@ class ContractMethodInfo: type_info: mypy.nodes.TypeInfo cref: ContractReference app_state: dict[str, AppStateDefinition] - abimethod_config: ABIMethodConfig | None + arc4_method_config: ARC4MethodConfig | None class FunctionASTConverter( @@ -151,7 +145,7 @@ def __init__( if func_def.info is not mypy.nodes.FUNC_NO_INFO: # why god why # function is a method self._precondition( - mypy_args[0].variable.is_self, + bool(mypy_args) and mypy_args[0].variable.is_self, "if function is a method, first variable should be self-like", func_loc, ) @@ -203,7 +197,7 @@ def __init__( return_type=self._return_type, body=translated_body, docstring=docstring, - abimethod_config=self.contract_method_info.abimethod_config, + abimethod_config=self.contract_method_info.arc4_method_config, ) @classmethod @@ -452,10 +446,37 @@ def visit_return_stmt(self, stmt: mypy.nodes.ReturnStmt) -> ReturnStatement | No self._error("invalid return type", loc) return ReturnStatement(source_location=loc, value=returning) - # Unsupported statements + def visit_match_stmt(self, stmt: mypy.nodes.MatchStmt) -> Switch | None: + loc = self._location(stmt) + subject = require_expression_builder( + temporary_assignment_if_required(stmt.subject.accept(self)) + ).rvalue() + case_block_map = dict[Expression, Block]() + default_block: Block | None = None + for pattern, guard, block in zip(stmt.patterns, stmt.guards, stmt.bodies, strict=True): + match pattern, guard: + case mypy.patterns.ValuePattern(expr=case_expr), None: + case_value_builder_or_literal = case_expr.accept(self) + case_value = expect_operand_wtype(case_value_builder_or_literal, subject.wtype) + case_block = self.visit_block(block) + case_block_map[case_value] = case_block + case mypy.patterns.AsPattern(name=None, pattern=None), None: + default_block = self.visit_block(block) + case _: + self._error( + "match statements only support value patterns without guards", stmt + ) + break + else: + return Switch( + source_location=loc, + value=subject, + cases=case_block_map, + default_case=default_block, + ) + return None - def visit_match_stmt(self, stmt: mypy.nodes.MatchStmt) -> None: - self._error("match statements are not supported yet", stmt) + # Unsupported statements def visit_function(self, fdef: mypy.nodes.FuncDef, _: mypy.nodes.Decorator | None) -> None: self._error("nested functions are not supported", fdef) @@ -467,24 +488,26 @@ def visit_class_def(self, cdef: mypy.nodes.ClassDef) -> None: self._error("classes nested inside functions are not supported", cdef) # Expressions - def _visit_instance_of_type( - self, instance: mypy.types.Instance, expr_loc: SourceLocation - ) -> ExpressionBuilder | Literal: - if isinstance(instance, mypy.types.LiteralType): - return Literal(value=instance.value, source_location=expr_loc) - fullname = instance.type.fullname - if fullname.startswith("builtins."): - return self._visit_ref_expr_of_builtins(fullname, expr_loc) - if fullname.startswith(constants.ALGOPY_PREFIX): - return self._visit_ref_expr_of_algopy(fullname, expr_loc, None) - if fullname == "typing.Literal": - return TypingLiteralClassExpressionBuilder(expr_loc) - raise InternalError("Cannot handle instance of this type: " + fullname) - def _visit_ref_expr( self, expr: mypy.nodes.MemberExpr | mypy.nodes.NameExpr ) -> ExpressionBuilder | Literal: expr_loc = self._location(expr) + builder_or_literal = self._visit_ref_expr_maybe_aliased(expr, expr_loc) + # as an extra step, in case the resolved item was a type through a TypeAlias, + # we need to apply the specified arguments to the type + if aliased_type := get_aliased_instance(expr): + if not isinstance(builder_or_literal, ExpressionBuilder): + raise InternalError( + "Encountered an aliased instance that generated a Literal", + expr_loc, + ) + alias_type_args = [self._visit_type_arg(a, expr_loc) for a in aliased_type.args] + return _maybe_index(builder_or_literal, alias_type_args, expr_loc) + return builder_or_literal + + def _visit_ref_expr_maybe_aliased( + self, expr: mypy.nodes.MemberExpr | mypy.nodes.NameExpr, expr_loc: SourceLocation + ) -> ExpressionBuilder | Literal: if expr.name == "__all__": # special case here, we allow __all__ at the module level for it's "public vs private" # control implications w.r.t linting etc, but we do so by ignoring it. @@ -497,15 +520,22 @@ def _visit_ref_expr( return self._visit_ref_expr_of_builtins(fullname, expr_loc) if fullname.startswith(constants.ALGOPY_PREFIX): return self._visit_ref_expr_of_algopy(fullname, expr_loc, expr.node) - if fullname == "typing.Literal": - return TypingLiteralClassExpressionBuilder(expr_loc) match expr: - case mypy.nodes.RefExpr(node=mypy.nodes.TypeInfo() as typ) if typ.has_base( - constants.STRUCT_BASE + 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) ): - struct_wtype = self.context.type_map[fullname] - assert isinstance(struct_wtype, wtypes.WStructType) - return StructSubclassExpressionBuilder(struct_wtype, expr_loc) + try: + wtype = self.context.type_map[fullname] + except KeyError: + raise CodeError( + f"Unknown struct subclass {fullname}" + " (declaration must currently precede usage)", + expr_loc, + ) from None + if isinstance(wtype, wtypes.WStructType): + return StructSubclassExpressionBuilder(wtype, expr_loc) + else: + return ARC4StructClassExpressionBuilder(wtype, expr_loc) case mypy.nodes.NameExpr(node=mypy.nodes.Var(is_self=True) as self_var): if self.contract_method_info is None: raise InternalError( @@ -658,30 +688,12 @@ def _visit_ref_expr_of_algopy( case _: raise InternalError(f"Unhandled algopy name: {fullname}", location) match fullname: - case constants.CLS_BYTES: - return BytesClassExpressionBuilder(location=location) - case constants.CLS_UINT64: - return UInt64ClassExpressionBuilder(location=location) - case constants.CLS_BIGUINT: - return BigUIntClassExpressionBuilder(location=location) - case constants.CLS_ADDRESS: - return AddressClassExpressionBuilder(location=location) - case constants.CLS_ARRAY: - return ArrayGenericClassExpressionBuilder(location=location) - case constants.CLS_ASSET: - return AssetClassExpressionBuilder(location=location) - case constants.CLS_ABI_STRING: - return StringClassExpressionBuilder(location=location) - case constants.CLS_ABI_UINTN: - return UIntNClassExpressionBuilder(location=location) - case constants.CLS_ABI_DYNAMIC_ARRAY: - return DynamicArrayClassExpressionBuilder(location=location) - case constants.CLS_ABI_STATIC_ARRAY: - return StaticArrayClassExpressionBuilder(location=location) case constants.URANGE: return UnsignedRangeBuilder(location=location) case constants.UENUMERATE: return UnsignedEnumerateBuilder(location=location) + case constants.ARC4_SIGNATURE: + return Arc4SignatureBuilder(location=location) case constants.ENSURE_BUDGET: return EnsureBudgetBuilder(location=location) case constants.OP_UP_FEE_SOURCE: @@ -699,51 +711,38 @@ def _visit_ref_expr_of_algopy( data=constants.NAMED_INT_CONST_ENUM_DATA[enum_name], location=location, ) - raise InternalError(f"Unhandled algopy name: {fullname}", location) + return get_type_builder(fullname, location) def visit_name_expr(self, expr: mypy.nodes.NameExpr) -> ExpressionBuilder | Literal: - eb_or_lit = self._visit_ref_expr(expr) - - # This is yuck, but without it generic arguments do not get passed to generic types - # which have been aliased. - if ( - isinstance(expr.node, mypy.nodes.TypeAlias) - and isinstance(expr.node.target, mypy.types.Instance) - and expr.node.target.args - and isinstance(eb_or_lit, ExpressionBuilder) - ): - location = self._location(expr) - args = [self._visit_type(a, location) for a in expr.node.target.args] - if len(args) == 1: - eb_or_lit.index(args[0], location) - else: - eb_or_lit.index_multiple(args, location) + return self._visit_ref_expr(expr) - return eb_or_lit - - def _visit_type( + def _visit_type_arg( self, mypy_type: mypy.types.Type, location: SourceLocation ) -> ExpressionBuilder | Literal: match mypy_type: case mypy.types.Instance() as instance: - return self._visit_instance_of_type(instance, location) - case mypy.types.LiteralType(value=literal_value) if not isinstance( - literal_value, float - ): + fullname = instance.type.fullname + if fullname.startswith("builtins."): + return self._visit_ref_expr_of_builtins(fullname, location) + if fullname.startswith(constants.ALGOPY_PREFIX): + return self._visit_ref_expr_of_algopy(fullname, location, None) + raise InternalError("Cannot handle instance of this type: " + fullname) + case mypy.types.LiteralType(value=literal_value): + if isinstance(literal_value, float): + raise CodeError("Float literals are not supported", location) return Literal(value=literal_value, source_location=location) - case mypy.types.TypeAliasType(alias=alias) if alias: - target = self._visit_type(alias.target, location) - if ( - isinstance(target, ExpressionBuilder) - and isinstance(alias.target, mypy.types.Instance) - and alias.target.args - ): - args = [self._visit_type(arg, location) for arg in alias.target.args] - if len(args) == 1: - target.index(args[0], location) - else: - target.index_multiple(args, location) + case mypy.types.TypeAliasType() as ta: + typ = mypy.types.get_proper_type(ta) + target = self._visit_type_arg(typ, location) + if isinstance(target, ExpressionBuilder) and isinstance(typ, mypy.types.Instance): + args = [self._visit_type_arg(arg, location) for arg in typ.args] + return _maybe_index(target, args, location) return target + case mypy.types.TupleType(items=items): + tuple_eb = TupleTypeExpressionBuilder(location) + return tuple_eb.index_multiple( + [self._visit_type_arg(item, location) for item in items], location + ) raise InternalError("Unsupported mypy_type argument") def visit_member_expr(self, expr: mypy.nodes.MemberExpr) -> ExpressionBuilder | Literal: @@ -937,6 +936,13 @@ def _visit_bool_op_expr( ) def visit_index_expr(self, expr: mypy.nodes.IndexExpr) -> ExpressionBuilder | Literal: + # short-circuit in case of application of typing.Literal to just evaluate the args + if ( + isinstance(expr.base, mypy.nodes.RefExpr) + and get_unaliased_fullname(expr.base) == "typing.Literal" + ): + return expr.index.accept(self) + base_expr = expr.base.accept(self) if isinstance(base_expr, Literal): raise CodeError( @@ -1190,3 +1196,14 @@ def temporary_assignment_if_required( return var_expression(operand) else: return operand + + +def _maybe_index( + eb: ExpressionBuilder, indexes: Sequence[ExpressionBuilder | Literal], location: SourceLocation +) -> ExpressionBuilder | Literal: + if indexes: + if len(indexes) == 1: + return eb.index(indexes[0], location) + else: + return eb.index_multiple(indexes, location) + return eb diff --git a/src/wyvern/awst_build/utils.py b/src/wyvern/awst_build/utils.py index 0dbe70a905..df3518d47c 100644 --- a/src/wyvern/awst_build/utils.py +++ b/src/wyvern/awst_build/utils.py @@ -1,6 +1,8 @@ import typing +from collections.abc import Iterable, Sequence from typing import Iterator +import attrs import mypy.build import mypy.nodes import structlog @@ -9,6 +11,7 @@ from wyvern.awst import wtypes from wyvern.awst.nodes import ( AddressConstant, + AssignmentExpression, BigUIntConstant, BoolConstant, BytesConstant, @@ -16,6 +19,7 @@ ContractReference, Expression, Literal, + TemporaryVariable, UInt64Constant, ) from wyvern.awst_build import constants @@ -63,11 +67,23 @@ def refers_to_fullname(ref_expr: mypy.nodes.RefExpr, *fullnames: str) -> bool: def get_unaliased_fullname(ref_expr: mypy.nodes.RefExpr) -> str: + alias = get_aliased_instance(ref_expr) + if alias: + return alias.type.fullname + return ref_expr.fullname + + +def get_aliased_instance(ref_expr: mypy.nodes.RefExpr) -> mypy.types.Instance | None: if isinstance(ref_expr.node, mypy.nodes.TypeAlias): t = get_proper_type(ref_expr.node.target) if isinstance(t, mypy.types.Instance): - return t.type.fullname - return ref_expr.fullname + return t + if ( + isinstance(t, mypy.types.TupleType) + and t.partial_fallback.type.fullname != "builtins.tuple" + ): + return t.partial_fallback + return None def get_decorators_by_fullname( @@ -204,7 +220,7 @@ def convert_literal( return BigUIntConstant(value=literal_value, source_location=loc) case wtypes.bytes_wtype: return BytesConstant(value=literal_value, source_location=loc) - case wtypes.address_wtype: + case wtypes.account_wtype: return AddressConstant(value=literal_value, source_location=loc) case _: raise CodeError( @@ -264,3 +280,42 @@ def extract_bytes_literal_from_mypy(expr: mypy.nodes.BytesExpr) -> bytes: bytes_literal = 'b"' + bytes_str + '"' bytes_const: bytes = ast.literal_eval(bytes_literal) return bytes_const + + +@attrs.define(kw_only=True) +class TemporaryAssignmentExpr: + define: AssignmentExpression + read: TemporaryVariable + + +def create_temporary_assignment( + value: Expression, location: SourceLocation | None = None +) -> TemporaryAssignmentExpr: + read_expr = TemporaryVariable(value) + define_expr = AssignmentExpression( + target=read_expr, + value=value, + source_location=location or value.source_location, + ) + return TemporaryAssignmentExpr(define=define_expr, read=read_expr) + + +T = typing.TypeVar("T") + + +def get_arg_mapping( + positional_arg_names: Sequence[str], + args: Iterable[tuple[str | None, T]], + location: SourceLocation, +) -> dict[str, T]: + arg_mapping = dict[str, T]() + for arg_idx, (supplied_arg_name, arg) in enumerate(args): + if supplied_arg_name is not None: + arg_name = supplied_arg_name + else: + try: + arg_name = positional_arg_names[arg_idx] + except IndexError as ex: + raise CodeError("Too many positional arguments", location) from ex + arg_mapping[arg_name] = arg + return arg_mapping diff --git a/src/wyvern/codegen/builder.py b/src/wyvern/codegen/builder.py index b29a4022f0..70b793a080 100644 --- a/src/wyvern/codegen/builder.py +++ b/src/wyvern/codegen/builder.py @@ -30,7 +30,6 @@ class MemoryIrBuilder(IRVisitor[None]): current_subroutine: models.Subroutine is_main: bool current_ops: list[ops.BaseOp] = attrs.field(factory=list) - scratch_allocations: dict[str, int] = attrs.field(factory=dict) active_op: models.Op | models.ControlOp | None = None next_block: models.BasicBlock | None = None @@ -59,7 +58,7 @@ def visit_assignment(self, ass: models.Assignment) -> None: param_idx = self.current_subroutine.parameters.index(target) except ValueError: self._add_op( - ops.StoreScratch( + ops.StoreVirtual( local_id=target.local_id, source_location=target.source_location, atype=target.atype, @@ -81,7 +80,7 @@ def visit_register(self, reg: models.Register) -> None: param_idx = self.current_subroutine.parameters.index(reg) except ValueError: self._add_op( - ops.LoadScratch( + ops.LoadVirtual( local_id=reg.local_id, source_location=reg.source_location, atype=reg.atype, @@ -137,6 +136,14 @@ def visit_address_constant(self, const: models.AddressConstant) -> None: ) ) + def visit_method_constant(self, const: models.MethodConstant) -> None: + self._add_op( + ops.PushMethod( + const.value, + source_location=const.source_location, + ) + ) + def visit_phi(self, phi: models.Phi) -> None: raise NotImplementedError @@ -153,6 +160,7 @@ def visit_intrinsic_op(self, intrinsic: models.Intrinsic) -> None: source_location=intrinsic.source_location, consumes=len(intrinsic.op_signature.args), produces=len(intrinsic.op_signature.returns), + comment=intrinsic.comment, ) ) @@ -160,18 +168,10 @@ def visit_invoke_subroutine(self, callsub: models.InvokeSubroutine) -> None: discard_results = callsub is self.active_op target = callsub.target - # determine if scratch vars need to be saved. - # this amounts to checking if there is a path in the call-graph - # that returns from the target to the current subroutine - save_restore_scratch = self.context.call_graph.has_path( - from_=target, to=self.current_subroutine - ) - callsub_op = ops.CallSub( target=self._get_subroutine_entry_block_name(target), parameters=len(target.parameters), returns=len(target.returns), - save_restore_scratch=save_restore_scratch, source_location=callsub.source_location, ) @@ -433,11 +433,7 @@ def compile_program_to_teal( def compile_ir_to_teal(context: CompileContext, ir: models.Contract) -> CompiledContract: return CompiledContract( - name=ir.full_name, approval_program=compile_program_to_teal(context, ir, ir.approval_program), clear_program=compile_program_to_teal(context, ir, ir.clear_program), - description=ir.description, - name_override=ir.name_override, - global_state=list(ir.global_state), - local_state=list(ir.local_state), + metadata=ir.metadata, ) diff --git a/src/wyvern/codegen/emitprogram.py b/src/wyvern/codegen/emitprogram.py index 473a0ae84f..197e9e679b 100644 --- a/src/wyvern/codegen/emitprogram.py +++ b/src/wyvern/codegen/emitprogram.py @@ -1,9 +1,7 @@ -from collections.abc import Sequence - import attrs import structlog -from wyvern.ir import models +from wyvern.metadata import ContractMetaData logger = structlog.get_logger(__file__) @@ -16,15 +14,8 @@ class CompiledProgram: @attrs.define(kw_only=True) class CompiledContract: - name: str approval_program: CompiledProgram """lines of the TEAL approval program for the contract""" clear_program: CompiledProgram """lines of the TEAL clear program for the contract""" - - # metadata fields below - description: str | None - name_override: str | None - # TODO: either put ContractState type somewhere common or copy to here - global_state: Sequence[models.ContractState] - local_state: Sequence[models.ContractState] + metadata: ContractMetaData diff --git a/src/wyvern/codegen/ops.py b/src/wyvern/codegen/ops.py index a71ed8fd66..85ffe14f45 100644 --- a/src/wyvern/codegen/ops.py +++ b/src/wyvern/codegen/ops.py @@ -11,9 +11,10 @@ if t.TYPE_CHECKING: from collections.abc import Iterable, Mapping, Sequence + from wyvern.avm_type import AVMType from wyvern.codegen.teal import TealOp from wyvern.codegen.visitor import MIRVisitor - from wyvern.ir.types_ import AVMBytesEncoding, AVMType + from wyvern.ir.types_ import AVMBytesEncoding from wyvern.parse import SourceLocation _T = t.TypeVar("_T") @@ -59,7 +60,18 @@ def accept(self, visitor: MIRVisitor[_T]) -> _T: return visitor.visit_push_address(self) def __str__(self) -> str: - return f"addr {self.value}" + return f'addr "{self.value}"' + + +@attrs.frozen(eq=False) +class PushMethod(BaseOp): + value: str + + def accept(self, visitor: MIRVisitor[_T]) -> _T: + return visitor.visit_push_method(self) + + def __str__(self) -> str: + return f"method {self.value}" @attrs.frozen(eq=False) @@ -75,7 +87,7 @@ def __str__(self) -> str: @attrs.frozen(kw_only=True, eq=False) class MemoryOp(BaseOp, abc.ABC): - """An op that is concerned with manipulating memory (scratch or stack)""" + """An op that is concerned with manipulating memory""" @attrs.frozen(kw_only=True, eq=False) @@ -95,21 +107,21 @@ class LoadOp(MemoryOp, abc.ABC): @attrs.frozen(eq=False) -class StoreScratch(StoreOp): +class StoreVirtual(StoreOp): def accept(self, visitor: MIRVisitor[_T]) -> _T: - return visitor.visit_store_scratch(self) + return visitor.visit_store_virtual(self) def __str__(self) -> str: - return f"store {self.local_id} to scratch" + return f"store {self.local_id}" @attrs.frozen(eq=False) -class LoadScratch(LoadOp): +class LoadVirtual(LoadOp): def accept(self, visitor: MIRVisitor[_T]) -> _T: - return visitor.visit_load_scratch(self) + return visitor.visit_load_virtual(self) def __str__(self) -> str: - return f"load {self.local_id} from scratch" + return f"load {self.local_id}" @attrs.frozen(eq=False, kw_only=True) @@ -292,7 +304,6 @@ class CallSub(BaseOp): target: str parameters: int returns: int - save_restore_scratch: bool def accept(self, visitor: MIRVisitor[_T]) -> _T: return visitor.visit_callsub(self) @@ -367,7 +378,7 @@ class Signature: def __str__(self) -> str: params = ", ".join(f"{p.local_id}: {p.atype.name}" for p in self.parameters) returns = ", ".join(str(r.name) for r in self.returns) - return f"{self.name}({params}) -> {returns}:" + return f"{self.name}({params}) -> {returns or 'void'}:" @attrs.define(slots=False) diff --git a/src/wyvern/codegen/stack.py b/src/wyvern/codegen/stack.py index 0656fb1887..c5f8b2c643 100644 --- a/src/wyvern/codegen/stack.py +++ b/src/wyvern/codegen/stack.py @@ -1,3 +1,4 @@ +import contextlib import typing from collections.abc import Iterable, Iterator from copy import deepcopy @@ -21,12 +22,6 @@ class _StackState: """x-stack holds variable that are carried between blocks""" l_stack: list[str] = attrs.field(factory=list) """l-stack holds variables that are used within a block""" - slots: dict[str, int] = attrs.field(factory=dict) - slot_counter: Iterator[int] = attrs.field() - - @slot_counter.default - def _new_slot_counter(self) -> Iterator[int]: - return iter(range(256)) @property def full_stack(self) -> Iterable[str]: @@ -37,7 +32,7 @@ def full_stack(self) -> Iterable[str]: @attrs.define class Stack(MIRVisitor[list[teal.TealOp]]): - save_restore_scratch: bool = attrs.field(default=False) + allow_virtual: bool = attrs.field(default=True) _current_subroutine: ops.MemorySubroutine | None = attrs.field(default=None) _use_frame: bool = attrs.field(default=False) _vla: VariableLifetimeAnalysis | None = attrs.field(default=None) @@ -79,10 +74,6 @@ def _x_stack(self) -> list[str]: def _l_stack(self) -> list[str]: return self.state.l_stack - @property - def num_slots(self) -> int: - return len(self.state.slots) - @property def vla(self) -> VariableLifetimeAnalysis: if self._vla is None: @@ -142,16 +133,6 @@ def get_l_stack_cover_n(self) -> int: """Return n value for a (un)cover operation with the l stack""" return self.l_stack_height - 1 - def _slot_lookup(self, local_id: str) -> int: - # TODO: assign slots based on liveness - assert self._current_subroutine - global_id = f"{self._current_subroutine.signature.name}.{local_id}" - try: - slot = self.state.slots[global_id] - except KeyError: - self.state.slots[global_id] = slot = next(self.state.slot_counter) - return slot - def visit_push_int(self, push: ops.PushInt) -> list[teal.TealOp]: self._l_stack.append(str(push.value)) return [teal.PushInt(push.value)] @@ -164,18 +145,30 @@ def visit_push_address(self, addr: ops.PushAddress) -> list[teal.TealOp]: self._l_stack.append(addr.value) return [teal.PushAddress(addr.value)] + def visit_push_method(self, method: ops.PushMethod) -> list[teal.TealOp]: + self._l_stack.append(f'method<"{method.value}">') + return [teal.PushMethod(method.value)] + def visit_comment(self, _comment: ops.Comment) -> list[teal.TealOp]: return [] - def visit_store_scratch(self, store: ops.StoreScratch) -> list[teal.TealOp]: + def visit_store_virtual(self, store: ops.StoreVirtual) -> list[teal.TealOp]: + if not self.allow_virtual: + raise InternalError( + "StoreVirtual op encountered during TEAL generation", store.source_location + ) if not self._l_stack: - self._stack_error(f"l-stack too small to store scratch {store.local_id}") + self._stack_error(f"l-stack too small to store {store.local_id}") self._l_stack.pop() - return [teal.Store(n=self._slot_lookup(store.local_id))] + return [] - def visit_load_scratch(self, load: ops.LoadScratch) -> list[teal.TealOp]: + def visit_load_virtual(self, load: ops.LoadVirtual) -> list[teal.TealOp]: + if not self.allow_virtual: + raise InternalError( + "LoadVirtual op encountered during TEAL generation", load.source_location + ) self._l_stack.append(load.local_id) - return [teal.Load(n=self._slot_lookup(load.local_id))] + return [] def _store_f_stack(self, value: str) -> teal.Cover | teal.FrameBury | teal.Bury: """Updates the stack, and if insert returns the cover value, else the bury value""" @@ -343,20 +336,7 @@ def visit_callsub(self, callsub: ops.CallSub) -> list[teal.TealOp]: self._l_stack.pop() self._l_stack.extend(produces) - if not callsub.save_restore_scratch or not self.save_restore_scratch: - # no need for reentrancy handling, emit op and return - return [teal.CallSub(target=callsub.target)] - - save_restore = { - save_local_id: self._slot_lookup(save_local_id) - for save_local_id in self.vla.get_live_out_variables(callsub) - } - teal_ops = [ - *get_scratch_saves(callsub, save_restore), - teal.CallSub(target=callsub.target), - *get_scratch_restores(callsub, save_restore), - ] - return teal_ops + return [teal.CallSub(target=callsub.target)] def visit_retsub(self, retsub: ops.RetSub) -> list[teal.TealOp]: if self.l_stack_height != retsub.returns: @@ -410,9 +390,19 @@ def visit_intrinsic(self, intrinsic: ops.IntrinsicOp) -> list[teal.TealOp]: ) ] + @contextlib.contextmanager + def _enter_virtual_stack(self) -> Iterator[None]: + original_allow_virtual = self.allow_virtual + try: + self.allow_virtual = True + yield + finally: + self.allow_virtual = original_allow_virtual + def visit_virtual_stack(self, virtual: ops.VirtualStackOp) -> list[teal.TealOp]: - for original in virtual.original: - original.accept(self) + with self._enter_virtual_stack(): + for original in virtual.original: + original.accept(self) return [*(virtual.replacement or ())] def clone(self) -> "Stack": @@ -423,22 +413,3 @@ def clone(self) -> "Stack": def __str__(self) -> str: return self.full_stack_desc - - -def get_scratch_saves(callsub: ops.CallSub, save_restore: dict[str, int]) -> Iterable[teal.TealOp]: - for _save_local_id, save_slot_id in save_restore.items(): - yield teal.Load(save_slot_id) - if callsub.parameters: - yield teal.Cover(callsub.parameters) - # teal += f" // save {save_local_id}" - - -def get_scratch_restores( - callsub: ops.CallSub, save_restore: dict[str, int] -) -> Iterable[teal.TealOp]: - # emit teal to restore scratch from stack - for _restore_local_id, restore_slot_id in reversed(save_restore.items()): - if callsub.returns: - yield teal.Uncover(callsub.returns) - yield teal.Store(restore_slot_id) - # teal += f" // restore {restore_local_id}" diff --git a/src/wyvern/codegen/stack_baileys.py b/src/wyvern/codegen/stack_baileys.py index bebbb35d75..7928f2b93f 100644 --- a/src/wyvern/codegen/stack_baileys.py +++ b/src/wyvern/codegen/stack_baileys.py @@ -16,7 +16,7 @@ @attrs.define(eq=False, repr=False) class BlockRecord: block: ops.MemoryBasicBlock - local_references: list[ops.StoreScratch | ops.LoadScratch] + local_references: list[ops.StoreVirtual | ops.LoadVirtual] live_in: Set[str] live_out: Set[str] children: "list[BlockRecord]" = attrs.field(factory=list) @@ -49,10 +49,10 @@ def sort_by_appearance( appearance = list[str]() block_ops = block.ops if load else reversed(block.ops) if load: - scratch_ops = (o.local_id for o in block_ops if isinstance(o, ops.LoadScratch)) + virtual_ops = (o.local_id for o in block_ops if isinstance(o, ops.LoadVirtual)) else: - scratch_ops = (o.local_id for o in block_ops if isinstance(o, ops.StoreScratch)) - for local_id in scratch_ops: + virtual_ops = (o.local_id for o in block_ops if isinstance(o, ops.StoreVirtual)) + for local_id in virtual_ops: if local_id in variables and local_id not in appearance: appearance.append(local_id) # don't keep searching once we are done @@ -90,14 +90,14 @@ def lcs(s1: tuple[str, ...], s2: tuple[str, ...]) -> tuple[str, ...]: return shared -def get_x_stack_load_ops(record: BlockRecord) -> set[ops.LoadScratch]: +def get_x_stack_load_ops(record: BlockRecord) -> set[ops.LoadVirtual]: block = record.block assert block.x_stack_in is not None remaining = set(block.x_stack_in) load_ops = [] for ref in record.local_references: - if isinstance(ref, ops.LoadScratch) and ref.local_id in remaining: + if isinstance(ref, ops.LoadVirtual) and ref.local_id in remaining: remaining.remove(ref.local_id) load_ops.append(ref) @@ -110,14 +110,14 @@ def get_x_stack_load_ops(record: BlockRecord) -> set[ops.LoadScratch]: return set(load_ops) -def get_x_stack_store_ops(record: BlockRecord) -> set[ops.StoreScratch]: +def get_x_stack_store_ops(record: BlockRecord) -> set[ops.StoreVirtual]: block = record.block assert block.x_stack_out is not None remaining = set(block.x_stack_out) store_ops = [] for ref in reversed(record.local_references): - if isinstance(ref, ops.StoreScratch) and ref.local_id in remaining: + if isinstance(ref, ops.StoreVirtual) and ref.local_id in remaining: remaining.remove(ref.local_id) store_ops.append(ref) @@ -138,7 +138,7 @@ def add_x_stack_ops(record: BlockRecord) -> None: for op in block.ops[:]: # using a copy as the list will have insertions if op in store_ops: - assert isinstance(op, ops.StoreScratch) + assert isinstance(op, ops.StoreVirtual) index = block.ops.index(op) # recalculate index due to inserts new_op = ops.StoreXStack( local_id=op.local_id, @@ -147,7 +147,7 @@ def add_x_stack_ops(record: BlockRecord) -> None: ) block.ops.insert(index, new_op) elif op in load_ops: - assert isinstance(op, ops.LoadScratch) + assert isinstance(op, ops.LoadVirtual) index = block.ops.index(op) block.ops[index] = ops.LoadXStack( local_id=op.local_id, @@ -194,7 +194,7 @@ def get_edge_sets(subroutine: ops.MemorySubroutine) -> Sequence[EdgeSet]: block: BlockRecord( block=block, local_references=[ - op for op in block.ops if isinstance(op, ops.StoreScratch | ops.LoadScratch) + op for op in block.ops if isinstance(op, ops.StoreVirtual | ops.LoadVirtual) ], live_in=vla.get_live_in_variables(block.ops[0]), live_out=vla.get_live_out_variables(block.ops[-1]), @@ -315,8 +315,8 @@ def schedule_sets(edge_sets: Sequence[EdgeSet], vla: VariableLifetimeAnalysis) - if variables_successfully_scheduled: logger.debug( - f"Eliminated scratch slots for {len(variables_successfully_scheduled)} " - f"variable/s: {', '.join(variables_successfully_scheduled)}" + f"Allocated {len(variables_successfully_scheduled)} " + f"variable/s to x-stack: {', '.join(variables_successfully_scheduled)}" ) @@ -332,7 +332,7 @@ def validate_pair(parent: BlockRecord, child: BlockRecord) -> bool: ) return False if parent_x: - logger.info(f"shared x-stack for {parent.block} -> {child.block}: {', '.join(parent_x)}") + logger.debug(f"shared x-stack for {parent.block} -> {child.block}: {', '.join(parent_x)}") return True diff --git a/src/wyvern/codegen/stack_frame_allocation.py b/src/wyvern/codegen/stack_frame_allocation.py index 4417d44812..bc3d294f6b 100644 --- a/src/wyvern/codegen/stack_frame_allocation.py +++ b/src/wyvern/codegen/stack_frame_allocation.py @@ -3,17 +3,17 @@ import attrs import structlog +from wyvern.avm_type import AVMType from wyvern.codegen import ops from wyvern.codegen.context import ProgramCodeGenContext from wyvern.codegen.stack_koopmans import peephole_optimization from wyvern.codegen.vla import VariableLifetimeAnalysis -from wyvern.ir.types_ import AVMType logger = structlog.get_logger(__name__) -def get_lazy_fstack(subroutine: ops.MemorySubroutine) -> list[ops.StoreScratch]: - result = list[ops.StoreScratch]() +def get_lazy_fstack(subroutine: ops.MemorySubroutine) -> list[ops.StoreVirtual]: + result = list[ops.StoreVirtual]() seen_local_ids = set[str]() # TODO: consider more than the entry block entry = subroutine.body[0] @@ -21,7 +21,7 @@ def get_lazy_fstack(subroutine: ops.MemorySubroutine) -> list[ops.StoreScratch]: if entry.predecessors: return result for op in entry.ops: - if isinstance(op, ops.StoreScratch) and op.local_id not in seen_local_ids: + if isinstance(op, ops.StoreVirtual) and op.local_id not in seen_local_ids: seen_local_ids.add(op.local_id) result.append(op) return result @@ -31,7 +31,7 @@ def get_local_id_types(subroutine: ops.MemorySubroutine) -> dict[str, AVMType]: variable_mapping = dict[str, AVMType]() for block in subroutine.all_blocks: for op in block.ops: - if isinstance(op, ops.StoreScratch): + if isinstance(op, ops.StoreVirtual): try: existing_type = variable_mapping[op.local_id] except KeyError: @@ -98,7 +98,7 @@ def allocate_locals_on_stack( for block in subroutine.body: for index, op in enumerate(block.ops): match op: - case ops.StoreScratch( + case ops.StoreVirtual( local_id=local_id, source_location=src_location, atype=atype ): block.ops[index] = ops.StoreFStack( @@ -107,7 +107,7 @@ def allocate_locals_on_stack( insert=op in first_store_ops, atype=atype, ) - case ops.LoadScratch( + case ops.LoadVirtual( local_id=local_id, source_location=src_location, atype=atype, diff --git a/src/wyvern/codegen/stack_koopmans.py b/src/wyvern/codegen/stack_koopmans.py index d8eb2787ab..c140040053 100644 --- a/src/wyvern/codegen/stack_koopmans.py +++ b/src/wyvern/codegen/stack_koopmans.py @@ -19,8 +19,8 @@ @attrs.define class UsagePair: - a: ops.LoadScratch | ops.StoreScratch - b: ops.LoadScratch + a: ops.LoadVirtual | ops.StoreVirtual + b: ops.LoadVirtual a_index: int b_index: int @@ -34,16 +34,16 @@ def find_usage_pairs(block: ops.MemoryBasicBlock) -> list[UsagePair]: # the first element of the pair is an op that defines or uses a variable # the second element of the pair is an op that uses the variable # return pairs in ascending order, based on the number of instruction between each pair - variables = dict[str, list[tuple[int, ops.StoreScratch | ops.LoadScratch]]]() + variables = dict[str, list[tuple[int, ops.StoreVirtual | ops.LoadVirtual]]]() for index, op in enumerate(block.ops): match op: - case ops.StoreScratch(local_id=local_id) | ops.LoadScratch(local_id=local_id): + case ops.StoreVirtual(local_id=local_id) | ops.LoadVirtual(local_id=local_id): variables.setdefault(local_id, []).append((index, op)) pairs = list[UsagePair]() for uses in variables.values(): for (a_index, a), (b_index, b) in itertools.pairwise(uses): - if isinstance(b, ops.StoreScratch): + if isinstance(b, ops.StoreVirtual): continue # skip redefines, if they are used they will be picked up in next pair pairs.append(UsagePair(a=a, b=b, a_index=a_index, b_index=b_index)) @@ -87,7 +87,7 @@ def copy_usage_pairs( a_index = block.ops.index(a) # insert replacement before store, or after load - insert_index = a_index if isinstance(a, ops.StoreScratch) else a_index + 1 + insert_index = a_index if isinstance(a, ops.StoreVirtual) else a_index + 1 # determine stack height at point of insertion insert_stack_in = _get_stack_after_op(subroutine, block, insert_index - 1) @@ -192,7 +192,7 @@ def optimize_pair( """Given a pair of ops, returns which ops should be kept including replacements""" match a, b: - case ops.StoreLStack(copy=True) | ops.StoreXStack(copy=True) as cover, ops.StoreScratch( + case ops.StoreLStack(copy=True) | ops.StoreXStack(copy=True) as cover, ops.StoreVirtual( local_id=local_id ) if local_id not in vla.get_live_out_variables( b @@ -203,7 +203,7 @@ def optimize_pair( # If it is a dead store, then the 1st scenario is no longer needed # and instead just need to ensure the value is copied to the bottom of the stack return (attrs.evolve(cover, copy=False),) - case _, ops.StoreScratch(local_id=local_id) if local_id not in vla.get_live_out_variables( + case _, ops.StoreVirtual(local_id=local_id) if local_id not in vla.get_live_out_variables( b ): # aka dead store removal return a, ops.Pop(n=1, source_location=b.source_location) @@ -254,8 +254,8 @@ def optimize_pair( return (new_b,) return ops.VirtualStackOp(a_mem), new_b case ( - ops.LoadScratch() as load, - ops.StoreScratch() as store, + ops.LoadVirtual() as load, + ops.StoreVirtual() as store, ) if load.local_id == store.local_id: return () case ( diff --git a/src/wyvern/codegen/stack_simplify_teal.py b/src/wyvern/codegen/stack_simplify_teal.py index ae21330bb4..0fbbe7676c 100644 --- a/src/wyvern/codegen/stack_simplify_teal.py +++ b/src/wyvern/codegen/stack_simplify_teal.py @@ -270,7 +270,7 @@ def simplify_rotation_ops( n = max(rot_op_ns) possible_rotation_ops = get_possible_rotation_ops(n) - # TODO: improve this as it is stupidly slow + # TODO: use a non-bruteforce approach and/or capture common simplifications as data for num_rotation_ops in range(len(rot_op_ns)): num_possible_ops = num_rotation_ops + len(fixed_ops) for maybe_rotation_ops in itertools.permutations(possible_rotation_ops, num_rotation_ops): diff --git a/src/wyvern/codegen/teal.py b/src/wyvern/codegen/teal.py index 0b28dbdc45..8e75d7c5cb 100644 --- a/src/wyvern/codegen/teal.py +++ b/src/wyvern/codegen/teal.py @@ -18,7 +18,10 @@ def immediates(self) -> Sequence[int | str]: return () def __str__(self) -> str: - teal_args = [self.op_code, *map(str, self.immediates)] + return self.teal_str(self.op_code, *self.immediates) + + def teal_str(self, op_code: str, *immediates: int | str) -> str: + teal_args = [op_code, *map(str, immediates)] if self.comment: teal_args.append(f"// {self.comment}") return " ".join(teal_args) @@ -52,11 +55,23 @@ def immediates(self) -> Sequence[int | str]: class Cover(TealOpN): op_code: str = "cover" + def __str__(self) -> str: + if self.n == 1: + return self.teal_str("swap") + else: + return super().__str__() + @attrs.frozen class Uncover(TealOpN): op_code: str = "uncover" + def __str__(self) -> str: + if self.n == 1: + return self.teal_str("swap") + else: + return super().__str__() + @attrs.frozen class Dig(TealOpN): @@ -78,16 +93,6 @@ class FrameBury(TealOpN): op_code: str = "frame_bury" -@attrs.frozen -class Store(TealOpN): - op_code: str = "store" - - -@attrs.frozen -class Load(TealOpN): - op_code: str = "load" - - @attrs.frozen class PushInt(TealOp): n: int | str @@ -147,6 +152,16 @@ def immediates(self) -> Sequence[int | str]: return (self.a,) +@attrs.frozen +class PushMethod(TealOp): + a: str + op_code: str = "method" + + @property + def immediates(self) -> Sequence[int | str]: + return (f'"{self.a}"',) + + @attrs.frozen class Intrinsic(TealOp): immediates: Sequence[int | str] diff --git a/src/wyvern/codegen/teal_annotaters.py b/src/wyvern/codegen/teal_annotaters.py index 16826ff1d6..e05d8f95ab 100644 --- a/src/wyvern/codegen/teal_annotaters.py +++ b/src/wyvern/codegen/teal_annotaters.py @@ -9,7 +9,6 @@ from wyvern.codegen.context import ProgramCodeGenContext from wyvern.codegen.source_meta_retriever import SourceMetaRetriever from wyvern.codegen.stack import Stack -from wyvern.codegen.stack_koopmans import find_usage_pairs from wyvern.codegen.vla import VariableLifetimeAnalysis from wyvern.errors import InternalError @@ -127,7 +126,7 @@ class EmitProgramContext(ProgramCodeGenContext): @stack.default def _stack_factory(self) -> Stack: - return Stack(save_restore_scratch=True) + return Stack(allow_virtual=False) @attrs.frozen(kw_only=True) @@ -187,37 +186,6 @@ def annotate(self, writer: AlignedWriter, op: ops.BaseOp) -> None: return Annotater() -class ScratchAnnotation(TealAnnotater): - def header(self, writer: AlignedWriter) -> None: - writer.add_header("Scr", 0) - writer.add_header("atch") # hmmmm - writer.add_header("") - - def create_op_annotater(self, context: EmitSubroutineContext) -> OpAnnotater: - def annotater(writer: AlignedWriter, op: ops.BaseOp) -> None: - before = after = scratch = "" - match op: - case ops.StoreScratch(local_id=local_id) | ops.LoadScratch(local_id=local_id): - is_live = local_id in context.vla.get_live_out_variables(op) - - local_id_desc = local_id if is_live else f"{local_id} (DEAD)" - - if isinstance(op, ops.StoreScratch): - if is_live: - after = "->" - op_code = "store" - else: - before = "<- " - op_code = "load" - scratch = f"{op_code} {local_id_desc}" - - writer.append(before) - writer.append(scratch) - writer.append(after) - - return SimpleOpAnnotater(annotater) - - class VLAAnnotation(TealAnnotater): def header(self, writer: AlignedWriter) -> None: writer.add_header("Live (out)", 4) @@ -257,29 +225,6 @@ def annotater(writer: AlignedWriter, op: ops.BaseOp) -> None: return SimpleOpAnnotater(annotater) -class ScratchPairsAnnotation(TealAnnotater): - def header(self, writer: AlignedWriter) -> None: - writer.add_header("Pairs") - - def create_op_annotater(self, context: EmitSubroutineContext) -> OpAnnotater: - pair_labels = dict[ops.BaseOp, dict[int, str]]() - - for block in context.subroutine.body: - usage_pairs = find_usage_pairs(block) - for pair_num, pair in enumerate(usage_pairs): - pair_labels.setdefault(pair.a, {})[pair_num] = f"ꜜ{pair_num + 1}a" - pair_labels.setdefault(pair.b, {})[pair_num] = f"ꜛ{pair_num + 1}b" - - def annotater(writer: "AlignedWriter", op: ops.BaseOp) -> None: - labels = pair_labels.get(op, {}) - max_pair = max((-1, *labels)) - - pairs_desc = "-".join(labels.get(p, "---") for p in range(max_pair + 1)) - writer.append(pairs_desc) - - return SimpleOpAnnotater(annotater) - - class XStack(TealAnnotater): def header(self, writer: AlignedWriter) -> None: writer.add_header("X stack") @@ -310,9 +255,7 @@ def annotate(self, writer: "AlignedWriter", op: ops.BaseOp) -> None: debug_annotations = [ OpDescriptionAnnotation(), StackAnnotation(), - ScratchAnnotation(), VLAAnnotation(), XStack(), - # ScratchPairsAnnotation(), # only useful if usage pairs are not being replaced SourceAnnotation(), ] diff --git a/src/wyvern/codegen/visitor.py b/src/wyvern/codegen/visitor.py index 4b6179d017..e7b1d9b264 100644 --- a/src/wyvern/codegen/visitor.py +++ b/src/wyvern/codegen/visitor.py @@ -55,11 +55,11 @@ def visit_store_param(self, load: ops.StoreParam) -> _T: ... @abc.abstractmethod - def visit_store_scratch(self, store: ops.StoreScratch) -> _T: + def visit_store_virtual(self, store: ops.StoreVirtual) -> _T: ... @abc.abstractmethod - def visit_load_scratch(self, load: ops.LoadScratch) -> _T: + def visit_load_virtual(self, load: ops.LoadVirtual) -> _T: ... @abc.abstractmethod @@ -93,3 +93,7 @@ def visit_virtual_stack(self, nop: ops.VirtualStackOp) -> _T: @abc.abstractmethod def visit_push_address(self, addr: ops.PushAddress) -> _T: ... + + @abc.abstractmethod + def visit_push_method(self, addr: ops.PushMethod) -> _T: + ... diff --git a/src/wyvern/codegen/vla.py b/src/wyvern/codegen/vla.py index e481ff3dd1..c5972a8190 100644 --- a/src/wyvern/codegen/vla.py +++ b/src/wyvern/codegen/vla.py @@ -42,9 +42,9 @@ def _op_lifetimes_factory(self) -> dict[ops.BaseOp, _OpLifetime]: for op, next_op in itertools.zip_longest(block.ops, block.ops[1:]): used = StableSet[str]() defined = StableSet[str]() - if isinstance(op, ops.StoreScratch): + if isinstance(op, ops.StoreVirtual): defined.add(op.local_id) - elif isinstance(op, ops.LoadScratch): + elif isinstance(op, ops.LoadVirtual): used.add(op.local_id) if next_op is None: # for last op, add first op of each successor block diff --git a/src/wyvern/compile.py b/src/wyvern/compile.py index 7c8dd63529..3075f044f2 100644 --- a/src/wyvern/compile.py +++ b/src/wyvern/compile.py @@ -11,19 +11,20 @@ import mypy.options import structlog +from wyvern.arc32 import write_arc32 from wyvern.awst import nodes as awst_nodes from wyvern.awst_build.main import transform_ast from wyvern.codegen.builder import compile_ir_to_teal from wyvern.codegen.emitprogram import CompiledContract from wyvern.context import CompileContext -from wyvern.errors import Errors, InternalError, ParseError +from wyvern.errors import Errors, InternalError, ParseError, log_exceptions from wyvern.ir.destructure.main import destructure_ssa from wyvern.ir.main import build_ir from wyvern.ir.optimize.main import optimize_contract_ir from wyvern.ir.to_text_visitor import output_contract_ir_to_path from wyvern.options import WyvernOptions from wyvern.parse import TYPESHED_PATH, ParseSource, parse_and_typecheck -from wyvern.utils import determine_out_dir +from wyvern.utils import determine_out_dir, make_path_relative_to_cwd logger = structlog.get_logger(__name__) @@ -91,8 +92,9 @@ def awst_to_teal( logger.warning(f"No contracts found in explicitly named source file: {src.path}") else: for contract_ir in module_ir: + metadata = contract_ir.metadata out_dir = determine_out_dir(src.path.parent, context.options) - contract_ir_base_path = out_dir / "_".join((src.path.stem, contract_ir.class_name)) + contract_ir_base_path = out_dir / "_".join((src.path.stem, metadata.class_name)) if context.options.output_ssa_ir: output_contract_ir_to_path( contract_ir, contract_ir_base_path.with_suffix(".ssa.ir") @@ -100,7 +102,7 @@ def awst_to_teal( if context.options.optimization_level > 0: logger.info( - f"Optimizing {contract_ir.full_name}" + f"Optimizing {metadata.full_name}" f" at level {context.options.optimization_level}" ) contract_ir = optimize_contract_ir( @@ -120,6 +122,26 @@ def awst_to_teal( return result +def write_arc32_application_spec( + context: CompileContext, + compiled_contracts_by_source_path: dict[ParseSource, list[CompiledContract]], +) -> None: + for src, compiled_contracts in compiled_contracts_by_source_path.items(): + arc4_contracts = [c for c in compiled_contracts if c.metadata.is_arc4] + if not arc4_contracts: + continue + base_path = determine_out_dir(src.path.parent, context.options) + for arc4_contract in arc4_contracts: + stem = ( + "application.json" + if len(arc4_contracts) == 1 + else f"application.{arc4_contract.metadata.full_name}.json" + ) + arc32_path = base_path / stem + logger.info(f"Writing {make_path_relative_to_cwd(str(arc32_path))}") + write_arc32(arc32_path, arc4_contract) + + def write_compiled_contracts( context: CompileContext, compiled_contracts_by_source_path: dict[ParseSource, list[CompiledContract]], @@ -132,7 +154,7 @@ def write_compiled_contracts( for contract in compiled_contracts: base_path = determine_out_dir(src.path.parent, context.options) - qualified_path = base_path / f"{src.path.stem}_{contract.name}" + qualified_path = base_path / f"{src.path.stem}_{contract.metadata.full_name}" write_contract_files(base_path=qualified_path, compiled_contract=contract) @@ -140,14 +162,18 @@ def compile_to_teal(wyvern_options: WyvernOptions) -> None: """Drive the actual core compilation step.""" context = parse_with_mypy(wyvern_options) awst = transform_ast(context) - compiled_contracts_by_source_path = awst_to_teal(context, awst) - if compiled_contracts_by_source_path is None: - logger.error("Build failed") - sys.exit(1) - elif not compiled_contracts_by_source_path: - logger.error("No contracts discovered in any source files") - elif wyvern_options.output_teal: - write_compiled_contracts(context, compiled_contracts_by_source_path) + with log_exceptions(context.errors): + compiled_contracts_by_source_path = awst_to_teal(context, awst) + if compiled_contracts_by_source_path is None: + logger.error("Build failed") + sys.exit(1) + elif not compiled_contracts_by_source_path: + logger.error("No contracts discovered in any source files") + else: + if wyvern_options.output_teal: + write_compiled_contracts(context, compiled_contracts_by_source_path) + if wyvern_options.output_arc32: + write_arc32_application_spec(context, compiled_contracts_by_source_path) def get_mypy_options() -> mypy.options.Options: @@ -204,5 +230,5 @@ def write_contract_files(base_path: Path, compiled_contract: CompiledContract) - continue output_path = base_path.with_suffix(suffix) output_text = "\n".join(src) - logger.info(f"Writing {output_path}") + logger.info(f"Writing {make_path_relative_to_cwd(str(output_path))}") output_path.write_text(output_text, encoding="utf-8") diff --git a/src/wyvern/errors.py b/src/wyvern/errors.py index ea3ea51714..1d54c6ae19 100644 --- a/src/wyvern/errors.py +++ b/src/wyvern/errors.py @@ -1,7 +1,10 @@ +import contextlib import logging import sys import traceback +import typing import typing as t +from collections.abc import Iterator import structlog @@ -43,26 +46,25 @@ def __init__(self) -> None: self.num_errors = 0 self.num_warnings = 0 - def _report(self, log_level: int, msg: str, location: SourceLocation) -> None: - logger.log( - log_level, - msg, - location=location, - ) + def _report(self, log_level: int, msg: str, location: SourceLocation | None) -> None: + kwargs: dict[str, typing.Any] = {} + if location: + kwargs["location"] = location + logger.log(log_level, msg, **kwargs) - def error(self, msg: str, location: SourceLocation) -> None: + def error(self, msg: str, location: SourceLocation | None) -> None: self._report(logging.ERROR, msg, location) self.num_errors += 1 - def warning(self, msg: str, location: SourceLocation) -> None: + def warning(self, msg: str, location: SourceLocation | None) -> None: self._report(logging.WARNING, msg, location) self.num_warnings += 1 - def note(self, msg: str, location: SourceLocation) -> None: + def note(self, msg: str, location: SourceLocation | None) -> None: self._report(logging.INFO, msg, location) -def crash_report(location: SourceLocation) -> t.Never: +def crash_report(location: SourceLocation | None) -> t.Never: # Adapted from report_internal_error in mypy err = sys.exc_info()[1] tb = traceback.extract_stack()[:-4] @@ -76,5 +78,22 @@ def crash_report(location: SourceLocation) -> t.Never: print("Traceback (most recent call last):") for s in traceback.format_list(tb + tb2): print(s.rstrip("\n")) - print(f"{location.file}:{location.line}: {type(err).__name__}: {err}") + if location: + print(f"{location.file}:{location.line}: {type(err).__name__}: {err}") raise SystemExit(2) + + +@contextlib.contextmanager +def log_exceptions( + errors: Errors, fallback_location: SourceLocation | None = None +) -> Iterator[None]: + try: + yield + except CodeError as ex: + errors.error(str(ex), location=ex.location or fallback_location) + except InternalError as ex: + errors.error(f"FATAL {ex!s}", location=ex.location or fallback_location) + crash_report(ex.location or fallback_location) + except Exception as ex: + errors.error(f"UNEXPECTED {ex!s}", location=fallback_location) + crash_report(fallback_location) diff --git a/src/wyvern/ir/arc4_router.py b/src/wyvern/ir/arc4_router.py new file mode 100644 index 0000000000..a59e750dff --- /dev/null +++ b/src/wyvern/ir/arc4_router.py @@ -0,0 +1,683 @@ +import itertools +from typing import Iterable, Sequence + +from wyvern.avm_type import AVMType +from wyvern.awst import ( + nodes as awst_nodes, + wtypes, +) +from wyvern.awst.nodes import NumericComparison, NumericComparisonExpression, UInt64Constant +from wyvern.awst_build.eb.transaction import check_transaction_type +from wyvern.errors import CodeError, InternalError +from wyvern.ir.arc4_util import get_abi_signature, wtype_to_arc4 +from wyvern.metadata import ( + ARC4Method, + ARC4MethodArg, + ARC4MethodConfig, + ARC4Returns, + ContractState, + OnCompletionAction, +) +from wyvern.parse import SourceLocation, parse_docstring + +__all__ = [ + "create_abi_router", + "create_default_clear_state", +] +ALL_VALID_APPROVAL_ON_COMPLETION_ACTIONS = { + OnCompletionAction.NoOp, + OnCompletionAction.OptIn, + OnCompletionAction.CloseOut, + OnCompletionAction.UpdateApplication, + OnCompletionAction.DeleteApplication, +} + + +def create_block( + location: SourceLocation, description: str | None, *stmts: awst_nodes.Statement +) -> awst_nodes.Block: + return awst_nodes.Block(source_location=location, body=stmts, description=description) + + +def call( + location: SourceLocation, function: awst_nodes.Function, *args: awst_nodes.Expression +) -> awst_nodes.SubroutineCallExpression: + return awst_nodes.SubroutineCallExpression( + source_location=location, + wtype=function.return_type, + target=awst_nodes.InstanceSubroutineTarget(name=function.name), + args=[awst_nodes.CallArg(name=None, value=arg) for arg in args], + ) + + +def load_abi_arg( + index: int, wtype: wtypes.WType, location: SourceLocation +) -> awst_nodes.IntrinsicCall: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtype, + op_code="txna", + immediates=["ApplicationArgs", index], + ) + + +def btoi(bytes_arg: awst_nodes.Expression, location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.uint64_wtype, + op_code="btoi", + stack_args=[bytes_arg], + ) + + +def has_app_id(location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.bool_wtype, # treat as bool + op_code="txn", + immediates=["ApplicationID"], + ) + + +def method_selector(location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.bytes_wtype, + op_code="txna", + immediates=["ApplicationArgs", 0], + ) + + +def has_app_args(location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.bool_wtype, # treat as bool + op_code="txn", + immediates=["NumAppArgs"], + ) + + +def reject(location: SourceLocation) -> awst_nodes.Statement: + return awst_nodes.AssertStatement( + source_location=location, + condition=awst_nodes.BoolConstant(source_location=location, value=False), + comment="reject transaction", + ) + + +def approve(location: SourceLocation) -> awst_nodes.ReturnStatement: + return awst_nodes.ReturnStatement( + source_location=location, + value=awst_nodes.BoolConstant(value=True, source_location=location), + ) + + +def on_completion(location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.uint64_wtype, + op_code="txn", + immediates=["OnCompletion"], + ) + + +def create_oca_switch( + block_mapping: dict[OnCompletionAction, awst_nodes.Block], + default_case: awst_nodes.Block, + location: SourceLocation, +) -> awst_nodes.Switch: + return awst_nodes.Switch( + source_location=location, + value=on_completion(location), + cases={ + awst_nodes.UInt64Constant(value=oca.value, source_location=location): block + for oca, block in block_mapping.items() + if block is not default_case + }, + default_case=default_case, + ) + + +def route_bare_methods( + location: SourceLocation, + bare_methods: dict[awst_nodes.ContractMethod, ARC4MethodConfig], + *, + add_create: bool, +) -> awst_nodes.Block | None: + if not bare_methods and not add_create: + return None + err_block = create_block( + location, + "reject_bare_on_completion", + reject(location), + ) + bare_blocks = {oca: err_block for oca in OnCompletionAction} + for bare_method, config in bare_methods.items(): + bare_location = bare_method.source_location + bare_block = create_block( + bare_location, + bare_method.name, + *assert_create_state(config), + awst_nodes.ExpressionStatement(expr=call(bare_location, bare_method)), + approve(bare_location), + ) + for oca in config.allowed_completion_types: + if bare_blocks[oca] is not err_block: + raise CodeError( + f"Cannot have multiple bare methods handling the same " + f"OnCompletionAction: {oca.name}", + bare_location, + ) + bare_blocks[oca] = bare_block + if add_create: + if bare_blocks[OnCompletionAction.NoOp] is not err_block: + raise CodeError( + "Application has no methods that can be called to create the contract, " + "but does have a NoOp bare method, so one couldn't be inserted. " + "In order to allow creating the contract add either an @abimethod or @baremethod" + 'decorated method with create=True or create="allow"', + location, + ) + else: + bare_blocks[OnCompletionAction.NoOp] = create_block( + location, + "create", + *assert_create_state( + ARC4MethodConfig( + name="", source_location=location, is_bare=True, require_create=True + ) + ), + approve(location), + ) + + return create_block( + location, + "bare_routing", + create_oca_switch(bare_blocks, err_block, location), + ) + + +def log_arc4_result( + location: SourceLocation, call_expr: awst_nodes.SubroutineCallExpression +) -> awst_nodes.ExpressionStatement: + abi_log_prefix = awst_nodes.BytesConstant( + source_location=location, + value=0x151F7C75.to_bytes(4), + encoding=awst_nodes.BytesEncoding.base16, + ) + abi_log = awst_nodes.BytesBinaryOperation( + source_location=location, + left=abi_log_prefix, + op=awst_nodes.BytesBinaryOperator.add, + right=awst_nodes.ReinterpretCast( + expr=call_expr, wtype=wtypes.bytes_wtype, source_location=call_expr.source_location + ), + ) + return awst_nodes.ExpressionStatement( + awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.void_wtype, + op_code="log", + stack_args=[abi_log], + ) + ) + + +def assert_create_state(config: ARC4MethodConfig) -> 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( + condition=awst_nodes.Not(expr=existing_app, source_location=location) + if config.require_create + else existing_app, + comment="is creating" if config.require_create else "is not creating", + source_location=location, + ), + ) + + +def constant(value: int, location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.UInt64Constant(value=value, source_location=location) + + +def left_shift(value: awst_nodes.Expression, location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.UInt64BinaryOperation( + source_location=location, + left=constant(1, location), + op=awst_nodes.UInt64BinaryOperator.lshift, + right=value, + ) + + +def bit_and( + lhs: awst_nodes.Expression, rhs: awst_nodes.Expression, location: SourceLocation +) -> awst_nodes.Expression: + return awst_nodes.UInt64BinaryOperation( + source_location=location, + left=lhs, + op=awst_nodes.UInt64BinaryOperator.bit_and, + right=rhs, + ) + + +def uint64_sub( + lhs: awst_nodes.Expression, rhs: awst_nodes.Expression, location: SourceLocation +) -> awst_nodes.Expression: + return awst_nodes.UInt64BinaryOperation( + source_location=location, + left=lhs, + op=awst_nodes.UInt64BinaryOperator.sub, + right=rhs, + ) + + +def bit_packed_oca( + allowed_oca: Iterable[OnCompletionAction], location: SourceLocation +) -> awst_nodes.Expression: + """Returns an integer constant, where each bit corresponding to an OnCompletionAction is + set to 1 if that action is allowed. This allows comparing a transaction's on completion value + against a set of allowed actions using a bitwise and op""" + bit_packed_value = 0 + for value in allowed_oca: + bit_packed_value |= 1 << value.value + return constant(bit_packed_value, location) + + +def as_bool(expr: awst_nodes.Expression, location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.ReinterpretCast( + expr=expr, + wtype=wtypes.bool_wtype, + source_location=location, + ) + + +def check_allowed_oca( + allowed_ocas: Sequence[OnCompletionAction], location: SourceLocation +) -> Sequence[awst_nodes.Statement]: + if set(allowed_ocas) == ALL_VALID_APPROVAL_ON_COMPLETION_ACTIONS: + # all actions are allowed, don't need to check + return () + not_allowed_ocas = sorted( + a for a in ALL_VALID_APPROVAL_ON_COMPLETION_ACTIONS if a not in allowed_ocas + ) + match allowed_ocas, not_allowed_ocas: + case [single_allowed], _: + condition: awst_nodes.Expression = NumericComparisonExpression( + lhs=on_completion(location), + rhs=UInt64Constant( + source_location=location, + value=single_allowed.value, + teal_alias=single_allowed.name, + ), + operator=NumericComparison.eq, + source_location=location, + ) + case _, [single_disallowed]: + condition = NumericComparisonExpression( + lhs=on_completion(location), + rhs=UInt64Constant( + source_location=location, + value=single_disallowed.value, + teal_alias=single_disallowed.name, + ), + operator=NumericComparison.ne, + source_location=location, + ) + case _: + condition = as_bool( + bit_and( + left_shift(on_completion(location), location), + bit_packed_oca(allowed_ocas, location), + location, + ), + location, + ) + oca_desc = ", ".join(a.name for a in allowed_ocas) + if len(allowed_ocas) > 1: + oca_desc = f"one of {oca_desc}" + return ( + awst_nodes.AssertStatement( + condition=condition, + comment=f"OnCompletion is {oca_desc}", + source_location=location, + ), + ) + + +def asset_id_at( + asset_index: awst_nodes.Expression, location: SourceLocation +) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.asset_wtype, + op_code="txnas", + immediates=["Assets"], + stack_args=[asset_index], + ) + + +def account_at( + account_index: awst_nodes.Expression, location: SourceLocation +) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.account_wtype, + op_code="txnas", + immediates=["Accounts"], + stack_args=[account_index], + ) + + +def application_at( + application_index: awst_nodes.Expression, location: SourceLocation +) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.application_wtype, + op_code="txnas", + immediates=["Applications"], + stack_args=[application_index], + ) + + +def current_group_index(location: SourceLocation) -> awst_nodes.Expression: + return awst_nodes.IntrinsicCall( + source_location=location, + wtype=wtypes.uint64_wtype, + op_code="txn", + immediates=["GroupIndex"], + stack_args=[], + ) + + +def map_abi_args( + args: Sequence[awst_nodes.SubroutineArgument], location: SourceLocation +) -> Iterable[awst_nodes.Expression]: + abi_arg_index = 1 # 0th arg is for method selector + transaction_arg_offset = sum(1 for a in args if wtypes.is_transaction_type(a.wtype)) + for arg in args: + match arg.wtype: + case wtypes.asset_wtype: + bytes_arg = load_abi_arg(abi_arg_index, arg.wtype, location) + asset_index = btoi(bytes_arg, location) + asset_id = asset_id_at(asset_index, location) + yield asset_id + abi_arg_index += 1 + case wtypes.account_wtype: + bytes_arg = load_abi_arg(abi_arg_index, arg.wtype, location) + account_index = btoi(bytes_arg, location) + account = account_at(account_index, location) + yield account + abi_arg_index += 1 + case wtypes.application_wtype: + bytes_arg = load_abi_arg(abi_arg_index, arg.wtype, location) + application_index = btoi(bytes_arg, location) + application = application_at(application_index, location) + yield application + abi_arg_index += 1 + case wtypes.WTransaction() as txn_wtype: + transaction_index = uint64_sub( + current_group_index(location), + constant( + transaction_arg_offset, + location, + ), + location, + ) + yield check_transaction_type(transaction_index, txn_wtype, location) + transaction_arg_offset -= 1 + case _: + abi_arg = load_abi_arg(abi_arg_index, arg.wtype, location) + yield abi_arg + abi_arg_index += 1 + + +def route_abi_methods( + location: SourceLocation, methods: dict[awst_nodes.ContractMethod, ARC4MethodConfig] +) -> awst_nodes.Block: + 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 + method_result = call(abi_loc, method, *map_abi_args(method.args, location)) + match method.return_type: + case wtypes.void_wtype: + call_and_maybe_log = awst_nodes.ExpressionStatement(method_result) + case _ if wtypes.is_arc4_encoded_type(method.return_type): + call_and_maybe_log = log_arc4_result(abi_loc, method_result) + case _: + raise CodeError( + f"{method.return_type} is not a valid ABI return type", method.source_location + ) + + method_routing_block = create_block( + abi_loc, + f"{config.name}_route", + *check_allowed_oca(config.allowed_completion_types, abi_loc), + *assert_create_state(config), + call_and_maybe_log, + approve(abi_loc), + ) + arc4_signature = get_abi_signature(method, config) + if arc4_signature in seen_signatures: + raise CodeError( + f"Cannot have duplicate ARC4 method signatures: {arc4_signature}", abi_loc + ) + seen_signatures.add(arc4_signature) + method_selector_value = awst_nodes.MethodConstant( + source_location=abi_loc, value=arc4_signature + ) + method_routing_cases[method_selector_value] = method_routing_block + return create_block( + location, + "abi_routing", + awst_nodes.Switch( + source_location=location, + value=method_selector(location), + cases=method_routing_cases, + default_case=None, + ), + ) + + +def _validate_default_args( + arc4_methods: Iterable[awst_nodes.ContractMethod], + known_sources: dict[str, ContractState | awst_nodes.ContractMethod], +) -> None: + for method in arc4_methods: + assert method.abimethod_config + args_by_name = {a.name: a for a in method.args} + for default_arg in method.abimethod_config.default_args: + # any invalid parameter matches should have been caught earlier + parameter = args_by_name[default_arg.parameter] + param_arc4_type = wtype_to_arc4(parameter.wtype) + # special handling for reference types + match param_arc4_type: + case "asset" | "application": + param_arc4_type = "uint64" + case "account": + param_arc4_type = "address" + + try: + source = known_sources[default_arg.source] + except KeyError as ex: + raise CodeError( + f"'{default_arg.source}' is not a known state or method attribute", + method.source_location, + ) from ex + + match source: + case awst_nodes.ContractMethod( + abimethod_config=ARC4MethodConfig() as abimethod_config, + args=args, + return_type=return_type, + ): + if OnCompletionAction.NoOp not in abimethod_config.allowed_completion_types: + raise CodeError( + f"'{default_arg.source}' does not allow no_op on completion calls", + method.source_location, + ) + if abimethod_config.require_create: + raise CodeError( + f"'{default_arg.source}' can only be used for create calls", + method.source_location, + ) + if not abimethod_config.readonly: + raise CodeError( + f"'{default_arg.source}' is not readonly", + method.source_location, + ) + if args: + raise CodeError( + f"'{default_arg.source}' does not take zero arguments", + method.source_location, + ) + if return_type is wtypes.void_wtype: + raise CodeError( + f"'{default_arg.source}' does not provide a value", + method.source_location, + ) + if wtype_to_arc4(return_type) != param_arc4_type: + raise CodeError( + f"'{default_arg.source}' does not provide '{param_arc4_type}' type", + method.source_location, + ) + case ContractState(storage_type=storage_type): + if ( + storage_type is AVMType.uint64 + # storage can provide an int to types <= uint64 + # TODO: check what ATC does with ufixed, see if it can be added + and (param_arc4_type == "byte" or param_arc4_type.startswith("uint")) + ) or ( + storage_type is AVMType.bytes + # storage can provide fixed byte arrays + and ( + (param_arc4_type.startswith("byte[") and param_arc4_type != "byte[]") + or param_arc4_type == "address" + ) + ): + pass + else: + raise CodeError( + f"'{default_arg.source}' cannot provide '{param_arc4_type}' type", + method.source_location, + ) + case _: + raise InternalError( + f"Unhandled known default argument source type {type(source).__name__}", + method.source_location, + ) + + +def create_abi_router( + contract: awst_nodes.ContractFragment, + arc4_methods_with_configs: dict[awst_nodes.ContractMethod, ARC4MethodConfig], + *, + global_state: list[ContractState], + local_state: list[ContractState], +) -> tuple[awst_nodes.ContractMethod, list[ARC4Method]]: + abi_methods = {} + bare_methods = {} + has_create = False + for m, abi_config in arc4_methods_with_configs.items(): + assert abi_config is m.abimethod_config + if abi_config.allow_create or abi_config.require_create: + has_create = True + if abi_config.is_bare: + bare_methods[m] = abi_config + else: + abi_methods[m] = abi_config + router_location = contract.source_location + router = awst_nodes.IfElse( + source_location=router_location, + condition=has_app_args(router_location), + if_branch=route_abi_methods(router_location, abi_methods), + else_branch=route_bare_methods(router_location, bare_methods, add_create=not has_create), + ) + + known_sources: dict[str, ContractState | awst_nodes.ContractMethod] = { + s.name: s for s in itertools.chain(global_state, local_state) + } + for method in arc4_methods_with_configs: + known_sources[method.name] = method + _validate_default_args(arc4_methods_with_configs.keys(), known_sources) + + docs = {s: parse_docstring(s.docstring) for s in arc4_methods_with_configs} + + arc4_method_metadata = [ + ARC4Method( + name=m.name, + desc=docs[m].description, + args=[ + ARC4MethodArg( + name=a.name, + type_=wtype_to_arc4(a.wtype), + desc=docs[m].args.get(a.name), + ) + for a in m.args + ], + returns=ARC4Returns( + desc=docs[m].returns, + type_=wtype_to_arc4(m.return_type), + ), + config=abi_config, + ) + for m, abi_config in arc4_methods_with_configs.items() + ] + if not has_create: + arc4_method_metadata.append( + ARC4Method( + name="", + desc=None, + args=[], + returns=ARC4Returns(type_="void", desc=None), + config=ARC4MethodConfig( + source_location=router_location, + name="", + is_bare=True, + require_create=True, + ), + ) + ) + + approval_program = awst_nodes.ContractMethod( + module_name=contract.module_name, + class_name=contract.name, + name="approval_program", + source_location=router_location, + args=[], + return_type=wtypes.bool_wtype, + body=create_block( + router_location, + "abi_bare_routing", + router, + reject(contract.source_location), + ), + docstring=None, + abimethod_config=None, + ) + return approval_program, arc4_method_metadata + + +def create_default_clear_state(contract: awst_nodes.ContractFragment) -> awst_nodes.ContractMethod: + # equivalent to: + # def clear_state_program(self) -> bool: + # return True + return awst_nodes.ContractMethod( + module_name=contract.module_name, + class_name=contract.name, + name="clear_state_program", + source_location=contract.source_location, + args=[], + return_type=wtypes.bool_wtype, + body=create_block( + contract.source_location, + None, + approve(contract.source_location), + ), + docstring=None, + abimethod_config=None, + ) diff --git a/src/wyvern/ir/arc4_util.py b/src/wyvern/ir/arc4_util.py new file mode 100644 index 0000000000..5e9ff895ec --- /dev/null +++ b/src/wyvern/ir/arc4_util.py @@ -0,0 +1,95 @@ +import typing +from collections.abc import Sequence +from itertools import zip_longest + +from wyvern.awst import ( + nodes as awst_nodes, + wtypes, +) +from wyvern.errors import InternalError +from wyvern.metadata import ARC4MethodConfig +from wyvern.parse import SourceLocation +from wyvern.utils import round_bits_to_nearest_bytes + + +def get_arc4_fixed_bit_size(wtype: wtypes.WType) -> int | None: + match wtype: + case wtypes.arc4_bool_wtype: + return 1 + case wtypes.ARC4UIntN(n=n) | wtypes.ARC4UFixedNxM(n=n): + return n + case wtypes.arc4_string_wtype | wtypes.ARC4DynamicArray(): + return None + case wtypes.ARC4StaticArray(element_type=element_type, array_size=array_size): + el_size = get_arc4_fixed_bit_size(element_type) + return el_size and round_bits_to_nearest_bytes(array_size * el_size) + case wtypes.ARC4Tuple(types=types) | wtypes.ARC4Struct(types=types): + return _get_size_of_sequence(types, dynamic_size=None) + raise InternalError(f"Unexpected ABI wtype: {wtype}") + + +def is_arc4_dynamic_size(wtype: wtypes.WType) -> bool: + return get_arc4_fixed_bit_size(wtype) is None + + +def determine_arc4_tuple_head_size( + types: Sequence[wtypes.WType], *, round_end_result: bool +) -> int: + return _get_size_of_sequence( + types, + dynamic_size=16, # size of "pointer" + round_end_result=round_end_result, + ) + + +def wtype_to_arc4(wtype: wtypes.WType, loc: SourceLocation | None = None) -> str: + match wtype: + case ( + wtypes.void_wtype + | wtypes.asset_wtype + | wtypes.account_wtype + | wtypes.application_wtype + ): + return wtype.name + case wtypes.ARC4Type(alias=alias) if alias is not None: + return alias + case wtypes.ARC4UIntN() | wtypes.ARC4UFixedNxM(): + return wtype.name.removeprefix("arc4.") + case wtypes.WTransaction(transaction_type=transaction_type): + if transaction_type is None: + raise InternalError( + "Only specific transaction types should appear as ARC4 types", loc + ) + else: + return transaction_type.name + case wtypes.ARC4DynamicArray(element_type=inner_type): + return f"{wtype_to_arc4(inner_type, loc)}[]" + case wtypes.ARC4StaticArray(element_type=inner_type, array_size=size): + return f"{wtype_to_arc4(inner_type, loc)}[{size}]" + case wtypes.ARC4Tuple(types=types) | wtypes.ARC4Struct(types=types): + item_types = ",".join([wtype_to_arc4(item) for item in types]) + return f"({item_types})" + raise InternalError(f"Unhandled ARC4 type: {wtype}", loc) + + +def get_abi_signature(subroutine: awst_nodes.ContractMethod, config: ARC4MethodConfig) -> str: + arg_types = [wtype_to_arc4(a.wtype, a.source_location) for a in subroutine.args] + return_type = wtype_to_arc4(subroutine.return_type, subroutine.source_location) + return f"{config.name}({','.join(arg_types)}){return_type}" + + +_TIntOrNone = typing.TypeVar("_TIntOrNone", int, None) + + +def _get_size_of_sequence( + types: Sequence[wtypes.WType], *, dynamic_size: _TIntOrNone, round_end_result: bool = True +) -> int | _TIntOrNone: + bit_size = 0 + for t, next_t in zip_longest(types, types[1:]): + size = get_arc4_fixed_bit_size(t) or dynamic_size + if size is None: + return None + bit_size += size + if t == wtypes.arc4_bool_wtype and next_t != t and (round_end_result or next_t): + bit_size = round_bits_to_nearest_bytes(bit_size) + return bit_size diff --git a/src/wyvern/ir/avm_ops.py b/src/wyvern/ir/avm_ops.py index e323aa5e0a..94693f8c79 100644 --- a/src/wyvern/ir/avm_ops.py +++ b/src/wyvern/ir/avm_ops.py @@ -2,6 +2,7 @@ import enum from collections.abc import Sequence +from wyvern.errors import InternalError from wyvern.ir.avm_ops_models import ( AVMOpData, DynamicSignatures, @@ -36,7 +37,10 @@ def get_signature(self, immediates: Sequence[str | int]) -> OpSignature: return self._signature im = immediates[self._signature.immediate_index] assert isinstance(im, str) - return self._signature.signatures[im] + try: + return self._signature.signatures[im] + except KeyError as ex: + raise InternalError(f"Unknown immediate for {self.code}: {im}") from ex acct_params_get = AVMOpData( op_code="acct_params_get", diff --git a/src/wyvern/ir/blocks_builder.py b/src/wyvern/ir/blocks_builder.py index 27ad6417f0..1f633c20ca 100644 --- a/src/wyvern/ir/blocks_builder.py +++ b/src/wyvern/ir/blocks_builder.py @@ -33,12 +33,8 @@ def __init__(self, context: IRFunctionBuildContext) -> None: blocks = [BasicBlock(id=0, source_location=context.function.source_location)] self._blocks = blocks # initialize ssa - self.ssa = BraunSSA(blocks) + self.ssa = BraunSSA(blocks, context.subroutine.parameters, self.active_block) self.ssa.seal_block(self.active_block) - for parameter in context.subroutine.parameters: - self.ssa.write_variable(parameter.name, self.active_block, parameter) - # TODO: FIX THE BELOW, SHOULD BE DONE AS PART OF SSA INIT - self.ssa._variable_versions[parameter.name] = 1 # noqa: SLF001 @property def blocks(self) -> Sequence[BasicBlock]: diff --git a/src/wyvern/ir/builder.py b/src/wyvern/ir/builder.py index 6e3e732583..ce38a06a01 100644 --- a/src/wyvern/ir/builder.py +++ b/src/wyvern/ir/builder.py @@ -1,4 +1,3 @@ -import base64 import itertools import typing from collections.abc import Iterator, Sequence @@ -6,17 +5,22 @@ import structlog import wyvern.awst.visitors +from wyvern.avm_type import AVMType from wyvern.awst import ( nodes as awst_nodes, wtypes, ) from wyvern.awst.nodes import ( BigUIntBinaryOperator, - BytesEncoding, Expression, UInt64BinaryOperator, ) from wyvern.errors import CodeError, InternalError, TodoError +from wyvern.ir.arc4_util import ( + determine_arc4_tuple_head_size, + get_arc4_fixed_bit_size, + is_arc4_dynamic_size, +) from wyvern.ir.avm_ops import AVMOp from wyvern.ir.blocks_builder import BlocksBuilder from wyvern.ir.context import IRBuildContext, IRFunctionBuildContext @@ -31,11 +35,13 @@ GotoNth, Intrinsic, InvokeSubroutine, + MethodConstant, Op, ProgramExit, Register, Subroutine, SubroutineReturn, + Switch, UInt64Constant, Value, ValueProvider, @@ -44,11 +50,11 @@ from wyvern.ir.ssa import BraunSSA from wyvern.ir.types_ import ( AVMBytesEncoding, - AVMType, bytes_enc_to_avm_bytes_enc, wtype_to_avm_type, ) from wyvern.parse import SourceLocation +from wyvern.utils import bits_to_bytes, lazy_setdefault TExpression: typing.TypeAlias = ValueProvider | None TStatement: typing.TypeAlias = None @@ -111,7 +117,7 @@ def insert_on_create_call(self, to: Subroutine) -> None: (app_id_r,) = self.assign( source=txn_app_id_intrinsic, temp_description="app_id", source_location=None ) - on_create_block, entrypoint_block = self._mkblocks( + on_create_block, entrypoint_block = mkblocks( to.source_location or self.context.function.source_location, "on_create", "entrypoint" ) self.block_builder.terminate( @@ -157,10 +163,6 @@ def _awst_tmp_name(self, tmp_var: awst_nodes.TemporaryVariable) -> str: self._awst_temp_var_names[tmp_var] = name return name - def _mkblocks(self, loc: SourceLocation, *comments: str | None) -> Iterator[BasicBlock]: - for c in comments: - yield BasicBlock(comment=c, source_location=loc) - def _visit_and_materialise_single(self, expr: awst_nodes.Expression) -> Value: """Translate an AWST Expression into a single Value""" values = self._visit_and_materialise(expr) @@ -258,6 +260,16 @@ def assign( return targets + def _reassign( + self, reg: Register, source: ValueProvider, source_location: SourceLocation | None + ) -> Register: + (updated,) = self.assign( + source=source, + names=[(reg.name, reg.source_location)], + source_location=source_location, + ) + return updated + def _assign_targets( self, source: ValueProvider, @@ -270,218 +282,100 @@ def _assign_targets( Assignment(targets=targets, source=source, source_location=assignment_location) ) - def visit_is_substring(self, expr: awst_nodes.IsSubstring) -> TExpression: - """ - Search for a shorter string in a larger one. - - search_start = 0 - found = 0 - while (search_start + len(item) <= len_sequence): - found = item == substr(sequence, search_start, search_start + len(item)) - if found: - break - search_start += 1 - return found + def _refresh_mutated_variable(self, reg: Register) -> Register: """ - src_loc = expr.source_location - - header, body, footer, next_block = self._mkblocks( - src_loc, - "substr_header", - "substr_body", - "substr_footer", - "substr_after", - ) - item = self._visit_and_materialise_single(expr.item) - sequence = self._visit_and_materialise_single(expr.sequence) - (found,) = self.assign( - temp_description="found", - source=UInt64Constant(value=0, source_location=src_loc), - source_location=src_loc, - ) - (len_sequence,) = self.assign( - temp_description="len_sequence", - source=Intrinsic(op=AVMOp.len_, args=[sequence], source_location=src_loc), - source_location=src_loc, - ) - (len_item,) = self.assign( - temp_description="len_item", - source=Intrinsic( - op=AVMOp.len_, - args=[item], - source_location=src_loc, - ), - source_location=src_loc, - ) - (search_start,) = self.assign( - temp_description="search_start", - source=UInt64Constant(value=0, source_location=src_loc), - source_location=src_loc, - ) - self.block_builder.goto_and_activate(header) - - (search_end,) = self.assign( - temp_description="search_end", - source_location=src_loc, - source=Intrinsic( - op=AVMOp.add, - args=[ - self.ssa.read_register(search_start, header), - self.ssa.read_register(len_item, header), - ], - source_location=src_loc, - ), - ) - - (cant_find,) = self.assign( - temp_description="cant_find", - source=Intrinsic( - op=AVMOp.gt, - args=[self.ssa.read_register(search_end, header), len_sequence], - source_location=src_loc, - ), - source_location=src_loc, - ) - - self.block_builder.terminate( - ConditionalBranch( - condition=cant_find, - non_zero=next_block, - zero=body, - source_location=src_loc, - ) - ) - self.block_builder.activate_block(body) - self._seal(body) - - (substr,) = self.assign( - temp_description="substr", - source=Intrinsic( - op=AVMOp.substring3, - args=[ - sequence, - self.ssa.read_register(search_start, body), - self.ssa.read_register(search_end, body), - ], - source_location=src_loc, - ), - source_location=src_loc, - ) - self.assign( - names=[(found.name, src_loc)], - source=Intrinsic( - op=AVMOp.eq, - args=[ - self.ssa.read_register(substr, body), - item, - ], - source_location=src_loc, - ), - source_location=src_loc, - ) + Given a register pointing to an underlying root operand (ie name) that is mutated, + do an SSA read in the current block. - self.block_builder.terminate( - ConditionalBranch( - condition=self.ssa.read_register(found, body), - zero=footer, - non_zero=next_block, - source_location=src_loc, - ) - ) - self.block_builder.activate_block(footer) - - self.assign( - names=[(search_start.name, src_loc)], - source=Intrinsic( - op=AVMOp.add, - args=[ - self.ssa.read_register(search_start, footer), - UInt64Constant( - value=1, - source_location=src_loc, - ), - ], - source_location=src_loc, - ), - source_location=src_loc, - ) - - self.block_builder.goto(header) - - self._seal(footer) - self._seal(header) - self.block_builder.activate_block(next_block) - self._seal(next_block) - - return self.ssa.read_register(found, next_block) + This is *only* required when there is control flow involved in the generated IR, + if it's only the builder that needs to loop then it should usually have an updated + reference to the most recent assigned register which will still be valid because it's + within the same block. + """ + return self.ssa.read_variable(reg.name, reg.atype, self.block_builder.active_block) - def visit_abi_decode(self, expr: awst_nodes.AbiDecode) -> TExpression: + def visit_arc4_decode(self, expr: awst_nodes.ARC4Decode) -> TExpression: value = self._visit_and_materialise_single(expr.value) match expr.value.wtype: - case wtypes.AbiUIntN(n=scale): - match scale: - case 8: - op = AVMOp.getbyte - case 16: - op = AVMOp.extract_uint16 - case 32: - op = AVMOp.extract_uint32 - case 64: - op = AVMOp.extract_uint64 - case _: - (integer_bytes,) = self.assign( - source=Intrinsic( - op=AVMOp.extract3, - args=[ - value, - UInt64Constant(value=0, source_location=expr.source_location), - UInt64Constant( - value=scale // 8, - source_location=expr.source_location, - ), - ], - source_location=expr.source_location, - ), - temp_description="integer_bytes", - source_location=expr.source_location, - ) - return Intrinsic( - op=AVMOp.btoi, - args=[ - self.ssa.read_register( - integer_bytes, self.block_builder.active_block - ), - ], - source_location=expr.source_location, - ) - + case wtypes.ARC4UIntN(n=scale) | wtypes.ARC4UFixedNxM(n=scale): + if scale > 64: + return value + else: + return Intrinsic( + op=AVMOp.btoi, + args=[value], + source_location=expr.source_location, + ) + case wtypes.arc4_bool_wtype: return Intrinsic( - op=op, - args=[value, UInt64Constant(value=0, source_location=expr.source_location)], + op=AVMOp.getbit, + args=[value, UInt64Constant(value=0, source_location=None)], source_location=expr.source_location, ) - case wtypes.abi_string_wtype: + case wtypes.arc4_string_wtype: return Intrinsic( op=AVMOp.extract, immediates=[2, 0], args=[value], source_location=expr.source_location, ) + case wtypes.ARC4Tuple() as arc4_tuple: + return self._visit_arc4_tuple_decode( + arc4_tuple, value, source_location=expr.source_location + ) case _: - raise TodoError(expr.source_location, "TODO: visit_abi_decode") + raise InternalError( + f"Unsupported wtype for ARC4Decode: {expr.value.wtype}", + location=expr.source_location, + ) - def visit_abi_constant(self, expr: awst_nodes.AbiConstant) -> TExpression: - return BytesConstant( - source_location=expr.source_location, - encoding=bytes_enc_to_avm_bytes_enc(expr.bytes_encoding), - value=expr.value, - ) + def _visit_arc4_tuple_decode( + self, + wtype: wtypes.ARC4Tuple | wtypes.ARC4Struct, + value: Value, + source_location: SourceLocation, + ) -> ValueProvider: + items = list[Value]() + + for index in range(len(wtype.types)): + index_const = UInt64Constant(value=index, source_location=source_location) + item_value = self._read_nth_item_of_arc4_heterogeneous_container( + array_bytes_sans_length_header=value, + tuple_type=wtype, + index=index_const, + source_location=source_location, + ) + (item,) = self.assign( + temp_description=f"item{index}", + source=item_value, + source_location=source_location, + ) - def visit_abi_encode(self, expr: awst_nodes.AbiEncode) -> TExpression: - value = self._visit_and_materialise_single(expr.value) + items.append(item) + return ValueTuple(source_location=source_location, values=items) + def visit_arc4_encode(self, expr: awst_nodes.ARC4Encode) -> TExpression: match expr.wtype: - case wtypes.abi_string_wtype: + case wtypes.arc4_bool_wtype: + value = self._visit_and_materialise_single(expr.value) + return encode_arc4_bool(value, expr.source_location) + case wtypes.ARC4UIntN() | wtypes.ARC4UFixedNxM() as wt: + value = self._visit_and_materialise_single(expr.value) + num_bytes = wt.n // 8 + return self._itob_fixed(value, num_bytes, expr.source_location) + case wtypes.ARC4Tuple(types=item_types) | wtypes.ARC4Struct(types=item_types): + return self._visit_arc4_tuple_encode(expr, item_types) + case wtypes.arc4_string_wtype: + if isinstance(expr.value, awst_nodes.BytesConstant): + ir_const = self.visit_bytes_constant(expr.value) + prefix = len(ir_const.value).to_bytes(2, "big") + value_prefixed = prefix + ir_const.value + return BytesConstant( + source_location=expr.source_location, + value=value_prefixed, + encoding=ir_const.encoding, + ) + value = self._visit_and_materialise_single(expr.value) (length,) = self.assign( temp_description="length", source_location=expr.source_location, @@ -493,34 +387,83 @@ def visit_abi_encode(self, expr: awst_nodes.AbiEncode) -> TExpression: ) return Intrinsic( op=AVMOp.concat, - args=[ - self._value_as_uint16(length, expr.source_location), - value, - ], + args=[self._value_as_uint16(length), value], source_location=expr.source_location, ) - case wtypes.AbiUIntN(n=scale) if scale <= 64: - (val_as_bytes,) = self.assign( - temp_description="val_as_bytes", - source_location=expr.source_location, - source=Intrinsic( - op=AVMOp.itob, args=[value], source_location=expr.source_location - ), + case wtypes.ARC4DynamicArray() | wtypes.ARC4StaticArray(): + raise InternalError( + "ARC4ArrayEncode should be used instead of ARC4Encode for arrays", + expr.source_location, + ) + case _: + raise InternalError( + f"Unsupported wtype for ARC4Encode: {expr.wtype}", + location=expr.source_location, ) - scale_bytes = scale // 8 + def _itob_fixed( + self, value: Value, num_bytes: int, source_location: SourceLocation + ) -> ValueProvider: + if value.atype == AVMType.uint64: + (val_as_bytes,) = self.assign( + temp_description="val_as_bytes", + source=Intrinsic(op=AVMOp.itob, args=[value], source_location=source_location), + source_location=source_location, + ) + + if num_bytes == 8: + return val_as_bytes + if num_bytes < 8: return Intrinsic( - op=AVMOp.substring3, + op=AVMOp.extract, + immediates=[8 - num_bytes, num_bytes], + args=[val_as_bytes], + source_location=source_location, + ) + bytes_value: Value = val_as_bytes + else: + (len_,) = self.assign( + temp_description="len_", + source=Intrinsic(op=AVMOp.len_, args=[value], source_location=source_location), + source_location=source_location, + ) + (no_overflow,) = self.assign( + temp_description="no_overflow", + source=Intrinsic( + op=AVMOp.lte, args=[ - val_as_bytes, - UInt64Constant( - value=8 - scale_bytes, source_location=expr.source_location - ), - UInt64Constant(value=8, source_location=expr.source_location), + len_, + UInt64Constant(value=num_bytes, source_location=source_location), ], - source_location=expr.source_location, + source_location=source_location, + ), + source_location=source_location, + ) + + self.block_builder.add( + Intrinsic( + op=AVMOp.assert_, + args=[no_overflow], + source_location=source_location, + comment="overflow", ) - raise TodoError(expr.source_location, "TODO: Handle wtype") + ) + bytes_value = value + + (b_zeros,) = self.assign( + temp_description="b_zeros", + source=Intrinsic( + op=AVMOp.bzero, + args=[UInt64Constant(value=num_bytes, source_location=source_location)], + source_location=source_location, + ), + source_location=source_location, + ) + return Intrinsic( + op=AVMOp.bitwise_or_bytes, + args=[bytes_value, b_zeros], + source_location=source_location, + ) def visit_assignment_statement(self, stmt: awst_nodes.AssignmentStatement) -> TStatement: self._handle_assignment_expr( @@ -638,57 +581,17 @@ def _handle_assignment( f" {type(target).__name__}", ) - @staticmethod - def _create_uint64_binary_op( - op: UInt64BinaryOperator, left: Value, right: Value, source_location: SourceLocation - ) -> Intrinsic: - avm_op: AVMOp - match op: - case UInt64BinaryOperator.floor_div: - avm_op = AVMOp.div_floor - case UInt64BinaryOperator.pow: - avm_op = AVMOp.exp - case UInt64BinaryOperator.lshift: - avm_op = AVMOp.shl - case UInt64BinaryOperator.rshift: - avm_op = AVMOp.shr - case _: - try: - avm_op = AVMOp(op.value) - except ValueError as ex: - raise InternalError( - f"Unhandled uint64 binary operator: {op}", source_location - ) from ex - return Intrinsic(op=avm_op, args=[left, right], source_location=source_location) - - @staticmethod - def _create_biguint_binary_op( - op: BigUIntBinaryOperator, left: Value, right: Value, source_location: SourceLocation - ) -> Intrinsic: - avm_op: AVMOp - match op: - case BigUIntBinaryOperator.floor_div: - avm_op = AVMOp.div_floor_bytes - case _: - try: - avm_op = AVMOp("b" + op.value) - except ValueError as ex: - raise InternalError( - f"Unhandled uint64 binary operator: {op}", source_location - ) from ex - return Intrinsic(op=avm_op, args=[left, right], source_location=source_location) - def visit_uint64_binary_operation(self, expr: awst_nodes.UInt64BinaryOperation) -> TExpression: left = self._visit_and_materialise_single(expr.left) right = self._visit_and_materialise_single(expr.right) - return self._create_uint64_binary_op(expr.op, left, right, expr.source_location) + return create_uint64_binary_op(expr.op, left, right, expr.source_location) def visit_biguint_binary_operation( self, expr: awst_nodes.BigUIntBinaryOperation ) -> TExpression: left = self._visit_and_materialise_single(expr.left) right = self._visit_and_materialise_single(expr.right) - return self._create_biguint_binary_op(expr.op, left, right, expr.source_location) + return create_biguint_binary_op(expr.op, left, right, expr.source_location) def visit_uint64_unary_operation(self, expr: awst_nodes.UInt64UnaryOperation) -> TExpression: return Intrinsic( @@ -704,21 +607,52 @@ def visit_bytes_unary_operation(self, expr: awst_nodes.BytesUnaryOperation) -> T source_location=expr.source_location, ) - def visit_uint64_constant(self, expr: awst_nodes.UInt64Constant) -> TExpression: - return UInt64Constant( - value=expr.value, source_location=expr.source_location, teal_alias=expr.teal_alias - ) + def visit_integer_constant(self, expr: awst_nodes.IntegerConstant) -> TExpression: + match expr.wtype: + case wtypes.uint64_wtype: + return UInt64Constant( + value=expr.value, + source_location=expr.source_location, + teal_alias=expr.teal_alias, + ) + case wtypes.biguint_wtype: + return BigUIntConstant(value=expr.value, source_location=expr.source_location) + case wtypes.ARC4UIntN(n=bit_size): + num_bytes = bit_size // 8 + return BytesConstant( + source_location=expr.source_location, + encoding=AVMBytesEncoding.base16, + value=expr.value.to_bytes(num_bytes, "big", signed=False), + ) + case _: + raise InternalError( + f"Unhandled wtype {expr.wtype} for integer constant {expr.value}", + expr.source_location, + ) - def visit_biguint_constant(self, expr: awst_nodes.BigUIntConstant) -> TExpression: - return BigUIntConstant(value=expr.value, source_location=expr.source_location) + def visit_decimal_constant(self, expr: awst_nodes.DecimalConstant) -> TExpression: + match expr.wtype: + case wtypes.ARC4UFixedNxM(n=bit_size): + num_bytes = bit_size // 8 + adjusted_int = int(str(expr.value).replace(".", "")) + return BytesConstant( + source_location=expr.source_location, + encoding=AVMBytesEncoding.base16, + value=adjusted_int.to_bytes(num_bytes, "big", signed=False), + ) + case _: + raise InternalError( + f"Unhandled wtype {expr.wtype} for decimal constant {expr.value}", + expr.source_location, + ) def visit_bool_constant(self, expr: awst_nodes.BoolConstant) -> TExpression: return UInt64Constant(value=int(expr.value), source_location=expr.source_location) - def visit_bytes_constant(self, expr: awst_nodes.BytesConstant) -> TExpression: + def visit_bytes_constant(self, expr: awst_nodes.BytesConstant) -> BytesConstant: return BytesConstant( value=expr.value, - encoding=AVMBytesEncoding.utf8, + encoding=bytes_enc_to_avm_bytes_enc(expr.encoding), source_location=expr.source_location, ) @@ -733,14 +667,18 @@ def visit_numeric_comparison_expression( ) -> TExpression: left = self._visit_and_materialise_single(expr.lhs) right = self._visit_and_materialise_single(expr.rhs) - if left.atype != right.atype: + if not (left.atype & right.atype): raise InternalError( "Numeric comparison between different numeric types", expr.source_location ) - if left.atype == AVMType.any: + if left.atype != AVMType.any: + atype = left.atype + elif right.atype != AVMType.any: + atype = right.atype + else: raise InternalError("Numeric comparison mapped to any type", expr.source_location) op_code = expr.operator.value - if left.atype == AVMType.bytes: + if atype == AVMType.bytes: op_code = "b" + op_code try: @@ -756,6 +694,35 @@ def visit_numeric_comparison_expression( source_location=expr.source_location, ) + def visit_checked_maybe(self, expr: awst_nodes.CheckedMaybe) -> TExpression: + value_atype = wtype_to_avm_type(expr.wtype) + value_tmp = self._mktemp( + atype=value_atype, + source_location=expr.source_location, + description="maybe_value", + ) + did_exist_tmp = self._mktemp( + atype=AVMType.uint64, + source_location=expr.source_location, + description="maybe_value_did_exist", + ) + maybe_value = self._visit_expr(expr.expr) + self._assign_targets( + source=maybe_value, + targets=[value_tmp, did_exist_tmp], + assignment_location=expr.source_location, + ) + self.block_builder.add( + Intrinsic( + op=AVMOp.assert_, + args=[did_exist_tmp], + comment=expr.comment or "check value exists", + source_location=expr.source_location, + ) + ) + + return value_tmp + def visit_var_expression(self, expr: awst_nodes.VarExpression) -> TExpression: if isinstance(expr.wtype, wtypes.WTuple): return ValueTuple( @@ -797,29 +764,16 @@ def visit_intrinsic_call(self, call: awst_nodes.IntrinsicCall) -> TExpression: immediates=list(call.immediates), ) - def visit_bytes_decode(self, expr: awst_nodes.BytesDecode) -> TExpression: - match expr.encoding: - case BytesEncoding.base16: - value = base64.b16decode(expr.value) - encoding = AVMBytesEncoding.base16 - case BytesEncoding.base32: - value = base64.b32decode(expr.value) - encoding = AVMBytesEncoding.base32 - case BytesEncoding.base64: - value = base64.b64decode(expr.value) - encoding = AVMBytesEncoding.base64 - case BytesEncoding.method: - raise TodoError(expr.source_location, f"TODO: support encoding {expr.encoding}") - case _: - raise InternalError("Unsupported bytes encoding") - return BytesConstant(value=value, encoding=encoding, source_location=expr.source_location) + def visit_method_constant(self, expr: wyvern.awst.nodes.MethodConstant) -> TExpression: + return MethodConstant(value=expr.value, source_location=expr.source_location) def visit_tuple_expression(self, expr: awst_nodes.TupleExpression) -> TExpression: items = [] for item in expr.items: try: + # TODO: don't rely on a pure function's side effects (raising) for validation wtype_to_avm_type(item) - except InternalError: # TODO: UNYUCK THIS FUCK + except InternalError: raise CodeError( "Nested tuples or other compound types are not supported yet", item.source_location, @@ -837,124 +791,178 @@ def visit_tuple_item_expression(self, expr: awst_nodes.TupleItemExpression) -> T def visit_field_expression(self, expr: awst_nodes.FieldExpression) -> TExpression: raise TodoError(expr.source_location, "TODO: IR building: visit_field_expression") - def visit_slice_expression(self, expr: wyvern.awst.nodes.SliceExpression) -> TExpression: - """ - Slices an enumerable type. - - - """ - if expr.base.wtype == wtypes.bytes_wtype: + def visit_slice_expression(self, expr: awst_nodes.SliceExpression) -> TExpression: + """Slices an enumerable type.""" + if isinstance(expr.wtype, wtypes.WTuple): + values = list(self._visit_and_materialise(expr.base)) + start_i = extract_const_int(expr.begin_index) + end_i = extract_const_int(expr.end_index) + return ValueTuple(source_location=expr.source_location, values=values[start_i:end_i]) + elif expr.base.wtype == wtypes.bytes_wtype: base = self._visit_and_materialise_single(expr.base) + if expr.begin_index is None and expr.end_index is None: + return base - # For certain constant values we can use the immediate version of extract/substring - match (base, expr.begin_index, expr.end_index): - case ( - _, - wyvern.awst.nodes.UInt64Constant() as start, - wyvern.awst.nodes.UInt64Constant() as stop, - ): - return self._extract_with_constants( - AVMOp.substring, base, start.value, stop.value, expr.source_location - ) - case (_, wyvern.awst.nodes.UInt64Constant() as start, None): - return self._extract_with_constants( - AVMOp.extract, base, start.value, 0, expr.source_location - ) - case (_, None, wyvern.awst.nodes.UInt64Constant() as stop): - return self._extract_with_constants( - AVMOp.extract, base, 0, stop.value, expr.source_location - ) - - (base_length,) = self.assign( - source_location=expr.source_location, - source=Intrinsic(op=AVMOp.len_, args=[base], source_location=expr.source_location), - temp_description="base_length", - ) - start_value: Value - match expr.begin_index: - case None: - start_value = UInt64Constant(value=0, source_location=expr.source_location) - case Expression() as begin_expr: - start_value = self._visit_and_materialise_single(begin_expr) - case _: - raise InternalError("Shouldn't get here") - - stop_value: Value - if expr.end_index: - match expr.end_index: - case Expression() as begin_expr: - stop_value = self._visit_and_materialise_single(begin_expr) - case _: - raise InternalError("Shouldn't get here") + if expr.begin_index is not None: + start_value = self._visit_and_materialise_single(expr.begin_index) + else: + start_value = UInt64Constant(value=0, source_location=expr.source_location) + if expr.end_index is not None: + stop_value = self._visit_and_materialise_single(expr.end_index) return Intrinsic( op=AVMOp.substring3, args=[base, start_value, stop_value], source_location=expr.source_location, ) + elif isinstance(start_value, UInt64Constant): + # we can use extract without computing the length when the start index is + # a constant value and the end index is None (ie end of array) + return Intrinsic( + op=AVMOp.extract, + immediates=[start_value.value, 0], + args=[base], + source_location=expr.source_location, + ) else: + (base_length,) = self.assign( + source_location=expr.source_location, + source=Intrinsic( + op=AVMOp.len_, args=[base], source_location=expr.source_location + ), + temp_description="base_length", + ) return Intrinsic( op=AVMOp.substring3, - args=[ - base, - start_value, - self.ssa.read_register(base_length, self.block_builder.active_block), - ], + args=[base, start_value, base_length], source_location=expr.source_location, ) - else: raise TodoError(expr.source_location, f"TODO: IR Slice {expr.wtype}") - @staticmethod - def _extract_with_constants( - op: typing.Literal[AVMOp.substring, AVMOp.extract], - expr: Value, - start: int, - stop_or_length: int, - source_location: SourceLocation, - ) -> Intrinsic: - return Intrinsic( - op=op, - args=[expr], - immediates=[start, stop_or_length], - source_location=source_location, - ) - def visit_index_expression(self, expr: awst_nodes.IndexExpression) -> TExpression: - if expr.base.wtype == wtypes.bytes_wtype and expr.index.wtype == wtypes.uint64_wtype: - # note: the below works because Bytes is immutable, so this index expression - # can never appear as an assignment target - base = self._visit_and_materialise_single(expr.base) - index = self._visit_and_materialise_single(expr.index) - if isinstance(index, UInt64Constant): - return self._extract_with_constants( - AVMOp.extract, base, index.value, 1, expr.source_location + index = self._visit_and_materialise_single(expr.index) + base = self._visit_and_materialise_single(expr.base) + match expr.index.wtype, expr.base.wtype: + case wtypes.uint64_wtype, wtypes.bytes_wtype: + # note: the below works because Bytes is immutable, so this index expression + # can never appear as an assignment target + if isinstance(index, UInt64Constant): + return Intrinsic( + op=AVMOp.extract, + args=[base], + immediates=[index.value, 1], + source_location=expr.source_location, + ) + (index_plus_1,) = self.assign( + Intrinsic( + op=AVMOp.add, + source_location=expr.source_location, + args=[ + index, + UInt64Constant(value=1, source_location=expr.source_location), + ], + ), + temp_description="index_plus_1", + source_location=expr.source_location, ) - (index_plus_1,) = self.assign( - Intrinsic( - op=AVMOp.add, + return Intrinsic( + op=AVMOp.substring3, + args=[base, index, index_plus_1], source_location=expr.source_location, - args=[ - index, - UInt64Constant(value=1, source_location=expr.source_location), - ], - ), - temp_description="index_plus_1", - source_location=expr.source_location, - ) - return Intrinsic( - op=AVMOp.substring3, - args=[base, index, index_plus_1], - source_location=expr.source_location, - ) + ) + case wtypes.uint64_wtype, wtypes.ARC4StaticArray( + array_size=array_size, element_type=element_type + ): + self._assert_index_in_bounds( + index=index, + length=UInt64Constant(value=array_size, source_location=expr.source_location), + source_location=expr.source_location, + ) + return self._read_nth_item_of_arc4_homogeneous_container( + source_location=expr.source_location, + array_bytes_sans_length_header=base, + index=index, + item_wtype=element_type, + ) + case wtypes.uint64_wtype, wtypes.ARC4DynamicArray(element_type=element_type): + self._assert_index_in_bounds( + index=index, + length=Intrinsic( + op=AVMOp.extract_uint16, + args=[ + base, + UInt64Constant(value=0, source_location=expr.source_location), + ], + source_location=expr.source_location, + ), + source_location=expr.source_location, + ) + (array_data_sans_header,) = self.assign( + source_location=expr.source_location, + temp_description="array_data_sans_header", + source=Intrinsic( + op=AVMOp.extract, + args=[base], + immediates=[2, 0], + source_location=expr.source_location, + ), + ) + return self._read_nth_item_of_arc4_homogeneous_container( + source_location=expr.source_location, + array_bytes_sans_length_header=array_data_sans_header, + index=index, + item_wtype=element_type, + ) + case wtypes.uint64_wtype, (wtypes.ARC4Tuple() | wtypes.ARC4Struct()) as tuple_type: + if not isinstance(index, UInt64Constant): + raise InternalError("Tuples must be index with a constant value") + return self._read_nth_item_of_arc4_heterogeneous_container( + source_location=expr.source_location, + array_bytes_sans_length_header=base, + index=index, + tuple_type=tuple_type, + ) + raise TodoError(expr.source_location, "TODO: IR building: visit_index_expression") + def _assert_index_in_bounds( + self, index: Value, length: ValueProvider, source_location: SourceLocation + ) -> None: + if isinstance(index, UInt64Constant) and isinstance(length, UInt64Constant): + if 0 <= index.value < length.value: + return + raise CodeError("Index access is out of bounds", source_location) + + (array_length,) = self.assign( + source_location=source_location, + temp_description="array_length", + source=length, + ) + + (index_is_in_bounds,) = self.assign( + source_location=source_location, + temp_description="index_is_in_bounds", + source=Intrinsic( + op=AVMOp.lt, + args=[index, array_length], + source_location=source_location, + ), + ) + self.block_builder.add( + Intrinsic( + op=AVMOp.assert_, + source_location=source_location, + args=[index_is_in_bounds], + comment="Index access is out of bounds", + ) + ) + def visit_conditional_expression(self, expr: awst_nodes.ConditionalExpression) -> TExpression: # TODO: if expr.true_value and exr.false_value are var expressions, # we can optimize with the `select` op - true_block, false_block, merge_block = self._mkblocks( + true_block, false_block, merge_block = mkblocks( expr.source_location, "ternary_true", "ternary_false", "ternary_merge" ) self._process_conditional( @@ -1098,7 +1106,10 @@ def visit_app_account_state_expression( def visit_new_array(self, expr: awst_nodes.NewArray) -> TExpression: raise TodoError(expr.source_location, "TODO: visit_new_array") - def _value_as_uint16(self, value: Value, source_location: SourceLocation) -> Value: + def _value_as_uint16( + self, value: Value, source_location: SourceLocation | None = None + ) -> Value: + source_location = source_location or value.source_location (value_as_bytes,) = self.assign( source_location=source_location, source=Intrinsic(op=AVMOp.itob, args=[value], source_location=source_location), @@ -1116,102 +1127,179 @@ def _value_as_uint16(self, value: Value, source_location: SourceLocation) -> Val ) return value_as_uint16 - def visit_new_abi_array(self, expr: awst_nodes.NewAbiArray) -> TExpression: - elements = [self._visit_and_materialise_single(el) for el in expr.elements] + def _visit_arc4_tuple_encode( + self, expr: awst_nodes.ARC4Encode, tuple_items: Sequence[wtypes.WType] + ) -> TExpression: + elements = self._visit_and_materialise(expr.value) + header_size = determine_arc4_tuple_head_size(tuple_items, round_end_result=True) + expr_loc = expr.source_location - array_data: Register | None = None + (current_tail_offset,) = self.assign( + temp_description="current_tail_offset", + source=UInt64Constant(value=header_size // 8, source_location=expr_loc), + source_location=expr_loc, + ) - if isinstance(expr.wtype, wtypes.AbiDynamicArray): - (array_data,) = self.assign( - source_location=expr.source_location, - source=BytesConstant( - source_location=expr.source_location, - encoding=AVMBytesEncoding.base16, - value=len(elements).to_bytes(2, "big"), - ), - temp_description="array_data", - ) - if expr.wtype.element_type == wtypes.abi_string_wtype: - (next_offset,) = self.assign( - source_location=expr.source_location, - source=UInt64Constant( - value=(2 * len(elements)), - source_location=expr.source_location, - ), - temp_description="next_offset", + (encoded_tuple_buffer,) = self.assign( + temp_description="encoded_tuple_buffer", + source_location=expr_loc, + source=BytesConstant( + value=b"", encoding=AVMBytesEncoding.base16, source_location=expr_loc + ), + ) + + def assign_buffer(source: ValueProvider) -> None: + nonlocal encoded_tuple_buffer + encoded_tuple_buffer = self._reassign(encoded_tuple_buffer, source, expr_loc) + + def append_to_buffer(item: Value) -> None: + assign_buffer( + Intrinsic( + op=AVMOp.concat, args=[encoded_tuple_buffer, item], source_location=expr_loc + ) ) - for element in elements: - if array_data is None: - (array_data,) = self.assign( - source_location=expr.source_location, - source=self._value_as_uint16( - self.ssa.read_register(next_offset, self.block_builder.active_block), - source_location=expr.source_location, + + for index, (element, el_wtype) in enumerate(zip(elements, tuple_items)): + if el_wtype == wtypes.arc4_bool_wtype: + # Pack boolean + before_header = determine_arc4_tuple_head_size( + tuple_items[0:index], round_end_result=False + ) + if before_header % 8 == 0: + append_to_buffer(element) + else: + (is_true,) = self.assign( + temp_description="is_true", + source=Intrinsic( + op=AVMOp.getbit, + args=[element, UInt64Constant(value=0, source_location=None)], + source_location=expr_loc, ), - temp_description="array_data", + source_location=expr_loc, + ) + + assign_buffer( + Intrinsic( + op=AVMOp.setbit, + args=[ + encoded_tuple_buffer, + UInt64Constant(value=before_header, source_location=expr_loc), + is_true, + ], + source_location=expr_loc, + ) + ) + elif not is_arc4_dynamic_size(el_wtype): + # Append value + append_to_buffer(element) + else: + # Append pointer + offset_as_uint16b = self._value_as_uint16(current_tail_offset) + append_to_buffer(offset_as_uint16b) + # Update Pointer + (data_length,) = self.assign( + temp_description="data_length", + source=Intrinsic(op=AVMOp.len_, args=[element], source_location=expr_loc), + source_location=expr_loc, + ) + next_tail_offset = Intrinsic( + op=AVMOp.add, + args=[current_tail_offset, data_length], + source_location=expr_loc, + ) + current_tail_offset = self._reassign( + current_tail_offset, next_tail_offset, expr_loc + ) + + for element, el_wtype in zip(elements, tuple_items): + if is_arc4_dynamic_size(el_wtype): + append_to_buffer(element) + return encoded_tuple_buffer + + def visit_arc4_array_encode(self, expr: awst_nodes.ARC4ArrayEncode) -> TExpression: + len_prefix = ( + len(expr.values).to_bytes(2, "big") + if isinstance(expr.wtype, wtypes.ARC4DynamicArray) + else b"" + ) + + expr_loc = expr.source_location + if not expr.values: + return BytesConstant( + value=len_prefix, encoding=AVMBytesEncoding.base16, source_location=expr_loc + ) + + elements = [self._visit_and_materialise_single(value) for value in expr.values] + element_type = expr.wtype.element_type + + (array_data,) = self.assign( + temp_description="array_data", + source=BytesConstant( + value=len_prefix, encoding=AVMBytesEncoding.base16, source_location=expr_loc + ), + source_location=expr_loc, + ) + if element_type == wtypes.arc4_bool_wtype: + for index, el in enumerate(elements): + if index % 8 == 0: + new_array_data_value = Intrinsic( + op=AVMOp.concat, args=[array_data, el], source_location=expr_loc ) else: - (array_data,) = self.assign( - source_location=expr.source_location, + (is_true,) = self.assign( + temp_description="is_true", source=Intrinsic( - op=AVMOp.concat, - args=[ - self.ssa.read_register( - array_data, self.block_builder.active_block - ), - self._value_as_uint16( - self.ssa.read_register( - next_offset, self.block_builder.active_block - ), - source_location=expr.source_location, - ), - ], - source_location=expr.source_location, + op=AVMOp.getbit, + args=[el, UInt64Constant(value=0, source_location=None)], + source_location=expr_loc, ), - names=[(array_data.name, expr.source_location)], + source_location=expr_loc, ) - - (element_length,) = self.assign( - source_location=expr.source_location, - source=Intrinsic( - op=AVMOp.len_, args=[element], source_location=expr.source_location - ), - temp_description="element_length", - ) - self.assign( - source_location=expr.source_location, - names=[(next_offset.name, expr.source_location)], - source=Intrinsic( - op=AVMOp.add, + new_array_data_value = Intrinsic( + op=AVMOp.setbit, args=[ - self.ssa.read_register(next_offset, self.block_builder.active_block), - element_length, + array_data, + UInt64Constant( + value=index + (len(len_prefix) * 8), + source_location=expr_loc, + ), + is_true, ], - source_location=expr.source_location, - ), + source_location=expr_loc, + ) + array_data = self._reassign(array_data, new_array_data_value, expr_loc) + + return array_data + + if is_arc4_dynamic_size(element_type): + (next_offset,) = self.assign( + temp_description="next_offset", + source=UInt64Constant(value=(2 * len(elements)), source_location=expr_loc), + source_location=expr_loc, + ) + for element in elements: + updated_array_data = Intrinsic( + op=AVMOp.concat, + args=[array_data, self._value_as_uint16(next_offset)], + source_location=expr_loc, ) + array_data = self._reassign(array_data, updated_array_data, expr_loc) - for element in elements: - if array_data is None: - (array_data,) = self.assign( - source_location=expr.source_location, - source=element, - temp_description="array_data", + (element_length,) = self.assign( + temp_description="element_length", + source=Intrinsic(op=AVMOp.len_, args=[element], source_location=expr_loc), + source_location=expr_loc, ) - else: - (array_data,) = self.assign( - source_location=expr.source_location, - source=Intrinsic( - op=AVMOp.concat, - args=[ - self.ssa.read_register(array_data, self.block_builder.active_block), - element, - ], - source_location=expr.source_location, - ), - names=[(array_data.name, expr.source_location)], + next_offset_value = Intrinsic( + op=AVMOp.add, args=[next_offset, element_length], source_location=expr_loc ) + next_offset = self._reassign(next_offset, next_offset_value, expr_loc) + for element in elements: + array_data_value = Intrinsic( + op=AVMOp.concat, args=[array_data, element], source_location=expr_loc + ) + array_data = self._reassign(array_data, array_data_value, expr_loc) return array_data def visit_bytes_comparison_expression( @@ -1262,47 +1350,16 @@ def visit_subroutine_call_expression( source_location=expr.source_location, args=resolved_args, target=target ) - @staticmethod - def _create_bytes_binary_op( - op: awst_nodes.BytesBinaryOperator, lhs: Value, rhs: Value, source_location: SourceLocation - ) -> ValueProvider: - match op: - case awst_nodes.BytesBinaryOperator.add: - return Intrinsic( - op=AVMOp.concat, - args=[lhs, rhs], - source_location=source_location, - ) - case awst_nodes.BytesBinaryOperator.bit_and: - return Intrinsic( - op=AVMOp.bitwise_and_bytes, - args=[lhs, rhs], - source_location=source_location, - ) - case awst_nodes.BytesBinaryOperator.bit_or: - return Intrinsic( - op=AVMOp.bitwise_or_bytes, - args=[lhs, rhs], - source_location=source_location, - ) - case awst_nodes.BytesBinaryOperator.bit_xor: - return Intrinsic( - op=AVMOp.bitwise_xor_bytes, - args=[lhs, rhs], - source_location=source_location, - ) - raise InternalError("Unsupported BytesBinaryOperator: " + op) - def visit_bytes_binary_operation(self, expr: awst_nodes.BytesBinaryOperation) -> TExpression: left = self._visit_and_materialise_single(expr.left) right = self._visit_and_materialise_single(expr.right) - return self._create_bytes_binary_op(expr.op, left, right, expr.source_location) + return create_bytes_binary_op(expr.op, left, right, expr.source_location) def visit_boolean_binary_operation( self, expr: awst_nodes.BooleanBinaryOperation ) -> TExpression: if not isinstance(expr.right, awst_nodes.VarExpression | awst_nodes.BoolConstant): - true_block, false_block, merge_block = self._mkblocks( + true_block, false_block, merge_block = mkblocks( expr.source_location, "bool_true", "bool_false", "bool_merge" ) @@ -1359,24 +1416,6 @@ def visit_not_expression(self, expr: awst_nodes.Not) -> TExpression: source_location=expr.source_location, ) - def _get_comparison_op_for_wtype( - self, numeric_comparison_equivalent: awst_nodes.NumericComparison, wtype: wtypes.WType - ) -> AVMOp: - match wtype: - case wtypes.biguint_wtype: - return AVMOp("b" + numeric_comparison_equivalent) - case wtypes.uint64_wtype: - return AVMOp(numeric_comparison_equivalent) - case wtypes.bytes_wtype: - match numeric_comparison_equivalent: - case awst_nodes.NumericComparison.eq: - return AVMOp.eq - case awst_nodes.NumericComparison.ne: - return AVMOp.neq - raise InternalError( - f"Unsupported operation of {numeric_comparison_equivalent} on type of {wtype}" - ) - def visit_contains_expression(self, expr: awst_nodes.Contains) -> TExpression: item_register = self._visit_and_materialise_single(expr.item) @@ -1396,9 +1435,7 @@ def visit_contains_expression(self, expr: awst_nodes.Contains) -> TExpression: condition = None for item in items_sequence: equal_i = Intrinsic( - op=self._get_comparison_op_for_wtype( - awst_nodes.NumericComparison.eq, expr.item.wtype - ), + op=get_comparison_op_for_wtype(awst_nodes.NumericComparison.eq, expr.item.wtype), args=[ item_register, item, @@ -1439,8 +1476,11 @@ def visit_block(self, block: awst_nodes.Block) -> TStatement: def visit_if_else(self, stmt: awst_nodes.IfElse) -> TStatement: # else_body might be unused, if so won't be added, so all good - if_body, else_body, next_block = self._mkblocks( - stmt.source_location, "if_body", "else_body", "after_if_else" + if_body, else_body, next_block = mkblocks( + stmt.source_location, + stmt.if_branch.description or "if_body", + (stmt.else_branch and stmt.else_branch.description) or "else_body", + "after_if_else", ) self._process_conditional( @@ -1472,6 +1512,53 @@ def visit_if_else(self, stmt: awst_nodes.IfElse) -> TStatement: raise InternalError("next block has no predecessors but does have op(s)") self._seal(next_block) + def visit_switch(self, statement: awst_nodes.Switch) -> TStatement: + case_blocks = dict[Value, BasicBlock]() + ir_blocks = dict[awst_nodes.Block, BasicBlock]() + for value, block in statement.cases.items(): + ir_value = self._visit_and_materialise_single(value) + case_blocks[ir_value] = lazy_setdefault( + ir_blocks, + block, + lambda b: BasicBlock( + source_location=b.source_location, + comment=b.description or f"switch_case_{len(ir_blocks)}", + ), + ) + default_block, next_block = mkblocks( + statement.source_location, + (statement.default_case and statement.default_case.description) + or "switch_case_default", + "switch_case_next", + ) + + self.block_builder.terminate( + Switch( + value=self._visit_and_materialise_single(statement.value), + cases=case_blocks, + default=default_block, + source_location=statement.source_location, + ) + ) + for ir_block in (default_block, *ir_blocks.values()): + self._seal(ir_block) + for block, ir_block in ir_blocks.items(): + self._branch(ir_block, block, next_block) + if statement.default_case: + self._branch(default_block, statement.default_case, next_block) + else: + self.block_builder.activate_block(default_block) + self.block_builder.goto(next_block) + if next_block.predecessors: + # Activate the "next" block if it is reachable. + # This might not be the case if all paths within the "if" and "else" branches + # return early. + self.block_builder.activate_block(next_block) + elif next_block.phis or next_block.ops or next_block.terminated: + # here as a sanity - there shouldn't've been any modifications of "next" block contents + raise InternalError("next block has no predecessors but does have op(s)") + self._seal(next_block) + def _branch( self, ir_block: BasicBlock, ast_block: awst_nodes.Block, next_ir_block: BasicBlock ) -> None: @@ -1522,8 +1609,11 @@ def _process_conditional( ) def visit_while_loop(self, statement: awst_nodes.WhileLoop) -> TStatement: - top, body, next_block = self._mkblocks( - statement.source_location, "while_top", "while_body", "after_while" + top, body, next_block = mkblocks( + statement.source_location, + "while_top", + statement.loop_body.description or "while_body", + "after_while", ) with self.block_builder.enter_loop(on_continue=top, on_break=next_block): @@ -1584,12 +1674,9 @@ def visit_expression_statement(self, statement: awst_nodes.ExpressionStatement) ) elif isinstance(result, Op): self.block_builder.add(result) - else: - raise InternalError( - "Unexpected IR type for expression statement:" - f" {type(result).__name__}, value is {result}", - statement.source_location, - ) + # If we get a Value (e.g. a Register or some such) it's something that's being + # discarded effectively. + # The frontend should have already warned about this def visit_assert_statement(self, statement: awst_nodes.AssertStatement) -> TStatement: condition_value = self._visit_and_materialise_single(statement.condition) @@ -1617,9 +1704,7 @@ def visit_uint64_augmented_assignment( ) -> TStatement: target_value = self._visit_and_materialise_single(statement.target) rhs = self._visit_and_materialise_single(statement.value) - expr = self._create_uint64_binary_op( - statement.op, target_value, rhs, statement.source_location - ) + expr = create_uint64_binary_op(statement.op, target_value, rhs, statement.source_location) self._handle_assignment( target=statement.target, @@ -1632,9 +1717,7 @@ def visit_biguint_augmented_assignment( ) -> TStatement: target_value = self._visit_and_materialise_single(statement.target) rhs = self._visit_and_materialise_single(statement.value) - expr = self._create_biguint_binary_op( - statement.op, target_value, rhs, statement.source_location - ) + expr = create_biguint_binary_op(statement.op, target_value, rhs, statement.source_location) self._handle_assignment( target=statement.target, @@ -1647,9 +1730,7 @@ def visit_bytes_augmented_assignment( ) -> TStatement: target_value = self._visit_and_materialise_single(statement.target) rhs = self._visit_and_materialise_single(statement.value) - expr = self._create_bytes_binary_op( - statement.op, target_value, rhs, statement.source_location - ) + expr = create_bytes_binary_op(statement.op, target_value, rhs, statement.source_location) self._handle_assignment( target=statement.target, @@ -1668,7 +1749,7 @@ def visit_for_in_loop(self, statement: awst_nodes.ForInLoop) -> TStatement: ): # TODO: fix this raise CodeError( - "when using enumerate(), loop variables must be an unpacked two item tuple", + "when using uenumerate(), loop variables must be an unpacked two item tuple", statement.sequence.source_location, ) index_var, item_var = statement.items.items @@ -1716,33 +1797,251 @@ def visit_for_in_loop(self, statement: awst_nodes.ForInLoop) -> TStatement: source_location=statement.source_location, ) - def assign_item_var_from_index(index_register: Register) -> None: - block = self.block_builder.active_block - self._handle_assignment( - target=item_var, - value=Intrinsic( - op=AVMOp.extract3, - args=[ - bytes_value, - self.ssa.read_register(index_register, block), - UInt64Constant(value=1, source_location=None), - ], - source_location=item_var.source_location, - ), - assignment_location=item_var.source_location, + def get_byte_at_index(index_register: Register) -> ValueProvider: + return Intrinsic( + op=AVMOp.extract3, + args=[ + bytes_value, + index_register, + UInt64Constant(value=1, source_location=None), + ], + source_location=item_var.source_location, ) self._iterate_indexable( loop_body=statement.loop_body, indexable_size=byte_length, - assign_item_var_from_index=assign_item_var_from_index, + get_value_at_index=get_byte_at_index, + item_var=item_var, + index_var=index_var, + statement_loc=statement.source_location, + ) + case awst_nodes.Expression( + wtype=wtypes.ARC4DynamicArray() as dynamic_array_wtype + ) as arc4_dynamic_array_expression: + array_value_with_length = self._visit_and_materialise_single( + arc4_dynamic_array_expression + ) + (dynamic_array_length,) = self.assign( + temp_description="array_length", + source=Intrinsic( + op=AVMOp.extract_uint16, + args=[ + array_value_with_length, + UInt64Constant(value=0, source_location=statement.source_location), + ], + source_location=statement.source_location, + ), + source_location=statement.source_location, + ) + (dynamic_array_value,) = self.assign( + temp_description="array_value", + source=Intrinsic( + op=AVMOp.extract, + args=[array_value_with_length], + immediates=[2, 0], + source_location=statement.source_location, + ), + source_location=statement.source_location, + ) + + def get_dynamic_array_item_at_index(index_register: Register) -> ValueProvider: + return self._read_nth_item_of_arc4_homogeneous_container( + array_bytes_sans_length_header=dynamic_array_value, + item_wtype=dynamic_array_wtype.element_type, + index=index_register, + source_location=statement.source_location, + ) + + self._iterate_indexable( + loop_body=statement.loop_body, + indexable_size=dynamic_array_length, + get_value_at_index=get_dynamic_array_item_at_index, + item_var=item_var, index_var=index_var, statement_loc=statement.source_location, ) + case awst_nodes.Expression( + wtype=wtypes.ARC4StaticArray(array_size=array_size) as static_array_wtype + ) as arc4_static_array_expression: + static_array_value = self._visit_and_materialise_single( + arc4_static_array_expression + ) + + static_array_length = UInt64Constant( + value=array_size, source_location=statement.source_location + ) + + def get_static_array_item_at_index(index_register: Register) -> ValueProvider: + return self._read_nth_item_of_arc4_homogeneous_container( + array_bytes_sans_length_header=static_array_value, + item_wtype=static_array_wtype.element_type, + index=index_register, + source_location=statement.source_location, + ) + self._iterate_indexable( + loop_body=statement.loop_body, + indexable_size=static_array_length, + get_value_at_index=get_static_array_item_at_index, + item_var=item_var, + index_var=index_var, + statement_loc=statement.source_location, + ) case _: raise TodoError(statement.source_location, "TODO: IR build support") + def _read_nth_item_of_arc4_heterogeneous_container( + self, + *, + array_bytes_sans_length_header: Value, + tuple_type: wtypes.ARC4Tuple | wtypes.ARC4Struct, + index: UInt64Constant, + source_location: SourceLocation, + ) -> ValueProvider: + tuple_item_types = tuple_type.types + + item_wtype = tuple_item_types[index.value] + item_bit_size = get_arc4_fixed_bit_size(item_wtype) + head_up_to_item = determine_arc4_tuple_head_size( + tuple_item_types[0 : index.value], round_end_result=False + ) + if item_bit_size is not None: + item_index: Value = UInt64Constant( + value=( + head_up_to_item + if item_wtype == wtypes.arc4_bool_wtype + else bits_to_bytes(head_up_to_item) + ), + source_location=source_location, + ) + else: + item_index_value = Intrinsic( + op=AVMOp.extract_uint16, + args=[ + array_bytes_sans_length_header, + UInt64Constant( + value=bits_to_bytes(head_up_to_item), source_location=source_location + ), + ], + source_location=source_location, + ) + (item_index,) = self.assign( + temp_description="item_index", + source=item_index_value, + source_location=source_location, + ) + return self._read_nth_item_of_arc4_container( + data=array_bytes_sans_length_header, + index=item_index, + item_wtype=item_wtype, + item_bit_size=item_bit_size, + source_location=source_location, + ) + + def _read_nth_item_of_arc4_homogeneous_container( + self, + *, + array_bytes_sans_length_header: Value, + item_wtype: wtypes.WType, + index: Value, + source_location: SourceLocation, + ) -> ValueProvider: + item_bit_size = get_arc4_fixed_bit_size(item_wtype) + if item_bit_size is not None: + item_index_value = Intrinsic( + op=AVMOp.mul, + args=[ + index, + UInt64Constant( + value=item_bit_size + if item_wtype == wtypes.arc4_bool_wtype + else (item_bit_size // 8), + source_location=source_location, + ), + ], + source_location=source_location, + ) + else: + (item_index_index,) = self.assign( + source_location=source_location, + temp_description="item_index_index", + source=Intrinsic( + source_location=source_location, + op=AVMOp.mul, + args=[index, UInt64Constant(value=2, source_location=source_location)], + ), + ) + item_index_value = Intrinsic( + source_location=source_location, + op=AVMOp.extract_uint16, + args=[array_bytes_sans_length_header, item_index_index], + ) + + (item_index,) = self.assign( + temp_description="item_index", source=item_index_value, source_location=source_location + ) + + return self._read_nth_item_of_arc4_container( + data=array_bytes_sans_length_header, + index=item_index, + item_wtype=item_wtype, + item_bit_size=item_bit_size, + source_location=source_location, + ) + + def _read_nth_item_of_arc4_container( + self, + *, + data: Value, + index: Value, + item_wtype: wtypes.WType, + item_bit_size: int | None, + source_location: SourceLocation, + ) -> ValueProvider: + """ + Reads the nth item of an arc4 array, tuple, or struct + """ + if item_wtype == wtypes.arc4_bool_wtype: + # item_index is the bit position + (is_true,) = self.assign( + temp_description="is_true", + source=Intrinsic( + op=AVMOp.getbit, args=[data, index], source_location=source_location + ), + source_location=source_location, + ) + return encode_arc4_bool(is_true, source_location) + if item_bit_size is not None: + # item_index is the byte position of our fixed length item + end: Value = UInt64Constant(value=item_bit_size // 8, source_location=source_location) + else: + # item_index is the position of the 'length' bytes of our variable length item + (item_length,) = self.assign( + temp_description="item_length", + source=Intrinsic( + op=AVMOp.extract_uint16, + args=[data, index], + source_location=source_location, + ), + source_location=source_location, + ) + (end,) = self.assign( + temp_description="item_length_plus_2", + source=Intrinsic( + op=AVMOp.add, + args=[ + item_length, + UInt64Constant(value=2, source_location=source_location), + ], + source_location=source_location, + ), + source_location=source_location, + ) + return Intrinsic( + op=AVMOp.extract3, args=[data, index, end], source_location=source_location + ) + def _iterate_urange( self, *, @@ -1755,7 +2054,7 @@ def _iterate_urange( range_step: Expression, range_loc: SourceLocation, ) -> None: - header, body, footer, next_block = self._mkblocks( + header, body, footer, next_block = mkblocks( statement_loc, "for_header", "for_body", @@ -1786,7 +2085,7 @@ def _iterate_urange( source=( Intrinsic( op=AVMOp("<"), - args=[self.ssa.read_register(range_item, header), stop], + args=[self._refresh_mutated_variable(range_item), stop], source_location=range_loc, ) ), @@ -1808,13 +2107,13 @@ def _iterate_urange( self._handle_assignment( target=item_var, - value=self.ssa.read_register(range_item, body), + value=self._refresh_mutated_variable(range_item), assignment_location=item_var.source_location, ) if index_var and range_index: self._handle_assignment( target=index_var, - value=self.ssa.read_register(range_index, body), + value=self._refresh_mutated_variable(range_index), assignment_location=index_var.source_location, ) @@ -1823,28 +2122,22 @@ def _iterate_urange( self.block_builder.goto_and_activate(footer) self._seal(footer) self._seal(next_block) - self.assign( - source=Intrinsic( - op=AVMOp("+"), - args=[self.ssa.read_register(range_item, footer), step], - source_location=range_loc, - ), - names=[(range_item.name, item_var.source_location)], - source_location=statement_loc, + new_range_item_value = Intrinsic( + op=AVMOp("+"), + args=[self._refresh_mutated_variable(range_item), step], + source_location=range_loc, ) + self._reassign(range_item, new_range_item_value, statement_loc) if range_index: - self.assign( - source=Intrinsic( - op=AVMOp("+"), - args=[ - self.ssa.read_register(range_index, footer), - UInt64Constant(value=1, source_location=None), - ], - source_location=None, - ), - names=[(range_index.name, index_var_src_loc)], - source_location=index_var_src_loc, + new_rang_index_value = Intrinsic( + op=AVMOp("+"), + args=[ + self._refresh_mutated_variable(range_index), + UInt64Constant(value=1, source_location=None), + ], + source_location=None, ) + self._reassign(range_index, new_rang_index_value, index_var_src_loc) self.block_builder.goto(header) self._seal(header) @@ -1855,12 +2148,13 @@ def _iterate_indexable( self, *, loop_body: awst_nodes.Block, + item_var: Expression, index_var: Expression | None, statement_loc: SourceLocation, - indexable_size: Register, - assign_item_var_from_index: typing.Callable[[Register], None], + indexable_size: Value, + get_value_at_index: typing.Callable[[Register], ValueProvider], ) -> None: - header, body, footer, next_block = self._mkblocks( + header, body, footer, next_block = mkblocks( statement_loc, "for_header", "for_body", @@ -1878,11 +2172,8 @@ def _iterate_indexable( (continue_looping,) = self.assign( source=( Intrinsic( - op=AVMOp("<"), - args=[ - self.ssa.read_register(index_internal, header), - self.ssa.read_register(indexable_size, header), - ], + op=AVMOp.lt, + args=[self._refresh_mutated_variable(index_internal), indexable_size], source_location=statement_loc, ) ), @@ -1902,12 +2193,18 @@ def _iterate_indexable( self.block_builder.activate_block(body) - assign_item_var_from_index(index_internal) + current_index_internal = self._refresh_mutated_variable(index_internal) + item_value = get_value_at_index(current_index_internal) + self._handle_assignment( + target=item_var, + value=item_value, + assignment_location=item_var.source_location, + ) if index_var: self._handle_assignment( target=index_var, - value=self.ssa.read_register(index_internal, body), + value=current_index_internal, assignment_location=index_var.source_location, ) @@ -1916,18 +2213,15 @@ def _iterate_indexable( self.block_builder.goto_and_activate(footer) self._seal(footer) self._seal(next_block) - self.assign( - source=Intrinsic( - op=AVMOp("+"), - args=[ - self.ssa.read_register(index_internal, footer), - UInt64Constant(value=1, source_location=None), - ], - source_location=None, - ), - names=[(index_internal.name, None)], + new_index_internal_value = Intrinsic( + op=AVMOp("+"), + args=[ + self._refresh_mutated_variable(index_internal), + UInt64Constant(value=1, source_location=None), + ], source_location=None, ) + self._reassign(index_internal, new_index_internal_value, source_location=None) self.block_builder.goto(header) self._seal(header) @@ -1947,7 +2241,7 @@ def _iterate_tuple( for index, _ in enumerate(tuple_items) ] - body, footer, next_block = self._mkblocks( + body, footer, next_block = mkblocks( statement_loc, "for_body", "for_footer", @@ -2017,5 +2311,130 @@ def visit_new_struct(self, expr: awst_nodes.NewStruct) -> TExpression: raise TodoError(expr.source_location, "TODO: visit_new_struct") +def mkblocks(loc: SourceLocation, *comments: str | None) -> Iterator[BasicBlock]: + for c in comments: + yield BasicBlock(comment=c, source_location=loc) + + +def create_uint64_binary_op( + op: UInt64BinaryOperator, left: Value, right: Value, source_location: SourceLocation +) -> Intrinsic: + avm_op: AVMOp + match op: + case UInt64BinaryOperator.floor_div: + avm_op = AVMOp.div_floor + case UInt64BinaryOperator.pow: + avm_op = AVMOp.exp + case UInt64BinaryOperator.lshift: + avm_op = AVMOp.shl + case UInt64BinaryOperator.rshift: + avm_op = AVMOp.shr + case _: + try: + avm_op = AVMOp(op.value) + except ValueError as ex: + raise InternalError( + f"Unhandled uint64 binary operator: {op}", source_location + ) from ex + return Intrinsic(op=avm_op, args=[left, right], source_location=source_location) + + +def create_biguint_binary_op( + op: BigUIntBinaryOperator, left: Value, right: Value, source_location: SourceLocation +) -> Intrinsic: + avm_op: AVMOp + match op: + case BigUIntBinaryOperator.floor_div: + avm_op = AVMOp.div_floor_bytes + case _: + try: + avm_op = AVMOp("b" + op.value) + except ValueError as ex: + raise InternalError( + f"Unhandled uint64 binary operator: {op}", source_location + ) from ex + return Intrinsic(op=avm_op, args=[left, right], source_location=source_location) + + +def create_bytes_binary_op( + op: awst_nodes.BytesBinaryOperator, lhs: Value, rhs: Value, source_location: SourceLocation +) -> ValueProvider: + match op: + case awst_nodes.BytesBinaryOperator.add: + return Intrinsic( + op=AVMOp.concat, + args=[lhs, rhs], + source_location=source_location, + ) + case awst_nodes.BytesBinaryOperator.bit_and: + return Intrinsic( + op=AVMOp.bitwise_and_bytes, + args=[lhs, rhs], + source_location=source_location, + ) + case awst_nodes.BytesBinaryOperator.bit_or: + return Intrinsic( + op=AVMOp.bitwise_or_bytes, + args=[lhs, rhs], + source_location=source_location, + ) + case awst_nodes.BytesBinaryOperator.bit_xor: + return Intrinsic( + op=AVMOp.bitwise_xor_bytes, + args=[lhs, rhs], + source_location=source_location, + ) + raise InternalError("Unsupported BytesBinaryOperator: " + op) + + def format_tuple_index(var_name: str, index: int | str) -> str: return f"{var_name}.{index}" + + +def encode_arc4_bool(value: Value, source_location: SourceLocation) -> ValueProvider: + return Intrinsic( + op=AVMOp.setbit, + args=[ + BytesConstant( + value=0x00.to_bytes(1, "big"), + source_location=source_location, + encoding=AVMBytesEncoding.base16, + ), + UInt64Constant(value=0, source_location=None), + value, + ], + source_location=source_location, + ) + + +def get_comparison_op_for_wtype( + numeric_comparison_equivalent: awst_nodes.NumericComparison, wtype: wtypes.WType +) -> AVMOp: + match wtype: + case wtypes.biguint_wtype: + return AVMOp("b" + numeric_comparison_equivalent) + case wtypes.uint64_wtype: + return AVMOp(numeric_comparison_equivalent) + case wtypes.bytes_wtype: + match numeric_comparison_equivalent: + case awst_nodes.NumericComparison.eq: + return AVMOp.eq + case awst_nodes.NumericComparison.ne: + return AVMOp.neq + raise InternalError( + f"Unsupported operation of {numeric_comparison_equivalent} on type of {wtype}" + ) + + +def extract_const_int(expr: awst_nodes.Expression | None) -> int | None: + """Check expr is an IntegerConstant or None, and return constant value (or None)""" + match expr: + case None: + return None + case awst_nodes.IntegerConstant(value=value): + return value + case _: + raise InternalError( + f"Expected either constant or None for index, got {type(expr).__name__}", + expr.source_location, + ) diff --git a/src/wyvern/ir/main.py b/src/wyvern/ir/main.py index 0b17d57525..df48380f3a 100644 --- a/src/wyvern/ir/main.py +++ b/src/wyvern/ir/main.py @@ -1,26 +1,31 @@ import itertools +import typing from collections.abc import Iterable, Iterator, Sequence import attrs import structlog +from wyvern import metadata +from wyvern.avm_type import AVMType from wyvern.awst import ( nodes as awst_nodes, wtypes, ) from wyvern.awst.function_traverser import FunctionTraverser from wyvern.context import CompileContext -from wyvern.errors import InternalError, TodoError +from wyvern.errors import CodeError, InternalError +from wyvern.ir.arc4_router import create_abi_router, create_default_clear_state +from wyvern.ir.arc4_util import get_abi_signature from wyvern.ir.builder import FunctionIRBuilder, format_tuple_index from wyvern.ir.context import IRBuildContext from wyvern.ir.models import ( Contract, - ContractState, Program, Register, Subroutine, ) -from wyvern.ir.types_ import AVMType, wtype_to_avm_type +from wyvern.ir.types_ import wtype_to_avm_type +from wyvern.metadata import ARC4Method, ARC4MethodConfig from wyvern.utils import attrs_extend logger = structlog.get_logger() @@ -47,16 +52,10 @@ def _build_ir(ctx: IRBuildContext, contract: awst_nodes.ContractFragment) -> Con raise InternalError("attempted to compile abstract contract") folded = fold_state_and_special_methods(ctx, contract) if not (folded.approval_program and folded.clear_program): - if contract.is_arc4: - raise TodoError( - contract.source_location, - "TODO: synthesise approval / clear methods for ARC4 contracts", - ) raise InternalError( "contract is non abstract but doesn't have approval and clear programs in hierarchy", contract.source_location, ) - # visit call graph starting at entry point(s) to collect all references for each approval_subs_srefs = SubroutineCollector.collect(ctx, start=folded.approval_program.body) clear_subs_srefs = SubroutineCollector.collect(ctx, start=folded.clear_program.body) @@ -80,15 +79,36 @@ def _build_ir(ctx: IRBuildContext, contract: awst_nodes.ContractFragment) -> Con clear_state_ir = _make_program(ctx, folded.clear_program, clear_subs_srefs, on_create=None) result = Contract( source_location=contract.source_location, - module_name=contract.module_name, - class_name=contract.name, - name_override=contract.name_override, - description=contract.docstring, - global_state=folded.global_state, - local_state=folded.local_state, approval_program=approval_ir, clear_program=clear_state_ir, + metadata=_create_contract_metadata( + contract, + folded.global_state, + folded.local_state, + folded.arc4_methods, + ), ) + + return result + + +def _create_contract_metadata( + contract: awst_nodes.ContractFragment, + global_state: list[metadata.ContractState], + local_state: list[metadata.ContractState], + arc4_methods: list[ARC4Method] | None, +) -> metadata.ContractMetaData: + result = metadata.ContractMetaData( + description=contract.docstring, + name_override=contract.name_override, + module_name=contract.module_name, + class_name=contract.name, + is_arc4=contract.is_arc4, + methods=arc4_methods or [], # TODO: fixme + global_state=global_state, + local_state=local_state, + ) + return result @@ -172,8 +192,15 @@ class FoldedContract: init: awst_nodes.ContractMethod | None = None approval_program: awst_nodes.ContractMethod | None = None clear_program: awst_nodes.ContractMethod | None = None - global_state: list[ContractState] = attrs.field(factory=list) - local_state: list[ContractState] = attrs.field(factory=list) + global_state: list[metadata.ContractState] = attrs.field(factory=list) + local_state: list[metadata.ContractState] = attrs.field(factory=list) + arc4_methods: list[ARC4Method] | None = attrs.field(default=None) + + +def wtype_to_storage_type(wtype: wtypes.WType) -> typing.Literal[AVMType.uint64, AVMType.bytes]: + atype = wtype_to_avm_type(wtype) + assert atype is not AVMType.any + return atype def fold_state_and_special_methods( @@ -181,6 +208,7 @@ def fold_state_and_special_methods( ) -> FoldedContract: bases = [ctx.resolve_contract_reference(cref) for cref in contract.bases] result = FoldedContract() + arc4_method_refs = dict[str, tuple[awst_nodes.ContractMethod, ARC4MethodConfig]]() for c in [contract, *bases]: if result.init is None: result.init = c.init @@ -189,10 +217,11 @@ def fold_state_and_special_methods( if result.clear_program is None: result.clear_program = c.clear_program for state in c.app_state: - translated = ContractState( + translated = metadata.ContractState( + name=state.member_name, source_location=state.source_location, key=state.key, - type=wtype_to_avm_type(state.storage_wtype), + storage_type=wtype_to_storage_type(state.storage_wtype), description=None, # TODO, have some way to provide this ) if state.kind == awst_nodes.AppStateKind.app_global: @@ -201,6 +230,24 @@ def fold_state_and_special_methods( result.local_state.append(translated) else: raise InternalError(f"Unhandled state kind: {state.kind}", state.source_location) + for cm in c.subroutines: + if cm.abimethod_config: + arc4_sig = get_abi_signature(cm, cm.abimethod_config) + arc4_method_refs.setdefault(arc4_sig, (cm, cm.abimethod_config)) + if contract.is_arc4: + if result.approval_program: + raise CodeError( + "approval_program should not be defined for ARC4 contracts", + contract.source_location, + ) + result.approval_program, result.arc4_methods = create_abi_router( + contract, + dict(arc4_method_refs.values()), + local_state=result.local_state, + global_state=result.global_state, + ) + if not result.clear_program: + result.clear_program = create_default_clear_state(contract) return result diff --git a/src/wyvern/ir/models.py b/src/wyvern/ir/models.py index 656ca80dff..a938a93797 100644 --- a/src/wyvern/ir/models.py +++ b/src/wyvern/ir/models.py @@ -4,11 +4,13 @@ import attrs +from wyvern.avm_type import AVMType from wyvern.errors import CodeError, InternalError from wyvern.ir.avm_ops import AVMOp from wyvern.ir.avm_ops_models import OpSignature -from wyvern.ir.types_ import AVMBytesEncoding, AVMType, stack_type_to_avm_type +from wyvern.ir.types_ import AVMBytesEncoding, stack_type_to_avm_type from wyvern.ir.visitor import IRVisitor +from wyvern.metadata import ContractMetaData from wyvern.parse import SourceLocation T = t.TypeVar("T") @@ -196,6 +198,18 @@ def accept(self, visitor: IRVisitor[T]) -> T: return visitor.visit_address_constant(self) +@attrs.define(eq=False) +class MethodConstant(Constant): + """Constant for method literals""" + + atype: AVMType = attrs.field(default=AVMType.bytes, init=False) + + value: str + + def accept(self, visitor: IRVisitor[T]) -> T: + return visitor.visit_method_constant(self) + + @attrs.define(eq=False) class Intrinsic(Op, ValueProvider): """Any TEAL op (or pseudo-op) that doesn't interrupt control flow, in the "basic block" sense. @@ -207,6 +221,8 @@ class Intrinsic(Op, ValueProvider): op: AVMOp # TODO: validation for immediates && args + # TODO: consider treating ops with no args (only immediates) as Value types + # e.g. `txn NumAppArgs` or `txna ApplicationArgs 0` immediates: list[str | int] = attrs.field(factory=list) args: list[Value] = attrs.field(factory=list) comment: str | None = None # used e.g. for asserts @@ -646,31 +662,12 @@ def all_subroutines(self) -> Iterable[Subroutine]: yield from self.subroutines -@attrs.define(eq=False) -class ContractState(Context): - source_location: SourceLocation - key: bytes - type: AVMType # noqa: A003 - description: str | None - - @attrs.define(eq=False) class Contract(Context): source_location: SourceLocation - module_name: str - class_name: str approval_program: Program clear_program: Program - - # metadata fields below - name_override: str | None - description: str | None - global_state: Sequence[ContractState] - local_state: Sequence[ContractState] - - @property - def full_name(self) -> str: - return ".".join((self.module_name, self.class_name)) + metadata: ContractMetaData def all_subroutines(self) -> Iterable[Subroutine]: from itertools import chain diff --git a/src/wyvern/ir/optimize/arithmetic.py b/src/wyvern/ir/optimize/arithmetic.py index 2a1d47f191..4c9042f297 100644 --- a/src/wyvern/ir/optimize/arithmetic.py +++ b/src/wyvern/ir/optimize/arithmetic.py @@ -1,11 +1,16 @@ +import operator +from collections.abc import Callable +from itertools import zip_longest + import attrs import structlog +from wyvern.avm_type import AVMType from wyvern.codegen.utils import format_bytes from wyvern.context import CompileContext +from wyvern.errors import CodeError from wyvern.ir import models from wyvern.ir.avm_ops import AVMOp -from wyvern.ir.types_ import AVMType logger: structlog.typing.FilteringBoundLogger = structlog.get_logger(__name__) @@ -16,16 +21,42 @@ def get_int_constant(value: models.ValueProvider) -> int | None: return None +def get_biguint_constant(value: models.ValueProvider) -> int | None: + if isinstance(value, models.BigUIntConstant): + return value.value + return None + + +def byte_wise(op: Callable[[int, int], int], lhs: bytes, rhs: bytes) -> bytes: + return bytes([op(a, b) for a, b in zip_longest(lhs[::-1], rhs[::-1], fillvalue=0)][::-1]) + + def try_simplify_arithmetic_ops(value: models.ValueProvider) -> models.ValueProvider | None: # TODO: handle bytes math # TODO: handle all math ops including shl, shr, exp, etc match value: case models.Intrinsic( - args=[models.UInt64Constant(value=x)], op=AVMOp.not_, source_location=op_loc + args=[models.UInt64Constant(value=x)], + op=(AVMOp.not_ | AVMOp.bitwise_not) as unary_uint64_op, + source_location=op_loc, ): - not_x = models.UInt64Constant(source_location=op_loc, value=0 if x else 1) - logger.debug(f"Folded !{x} to {not_x}") + if unary_uint64_op == AVMOp.not_: + not_x = models.UInt64Constant(source_location=op_loc, value=0 if x else 1) + logger.debug(f"Folded !{x} to {not_x}") + else: + not_x = models.UInt64Constant(source_location=op_loc, value=x ^ 0xFFFFFFFFFFFFFFFF) + logger.debug(f"Folded ~{x} to {not_x}") return not_x + case models.Intrinsic( + args=[models.BytesConstant(value=bites, encoding=encoding)], + op=AVMOp.bitwise_not_bytes, + source_location=op_loc, + ): + not_bites = models.BytesConstant( + source_location=op_loc, value=bytes([x ^ 0xFF for x in bites]), encoding=encoding + ) + logger.debug(f"Folded ~{bites!r} to {not_bites.value!r}") + return not_bites case models.Intrinsic( op=AVMOp.len_, args=[models.BytesConstant(value=x, encoding=encoding)], @@ -34,6 +65,126 @@ def try_simplify_arithmetic_ops(value: models.ValueProvider) -> models.ValueProv len_x = len(x) logger.debug(f"Folded len({format_bytes(x, encoding)}) to {len_x}") return models.UInt64Constant(source_location=op_loc, value=len_x) + case models.Intrinsic( + op=AVMOp.setbit, + args=[ + models.BytesConstant() as byte_const, + models.UInt64Constant() as index, + models.UInt64Constant() as value, + ], + source_location=op_loc, + ): + binary_array = [ + x for xs in [bin(bb)[2:].zfill(8) for bb in byte_const.value] for x in xs + ] + binary_array[index.value] = "1" if value.value else "0" + binary_string = "".join(binary_array) + adjusted_const_value = int(binary_string, 2).to_bytes( + len(byte_const.value), byteorder="big" + ) + return models.BytesConstant( + source_location=op_loc, encoding=byte_const.encoding, value=adjusted_const_value + ) + case models.Intrinsic( + op=AVMOp.getbit, + args=[ + models.BytesConstant() as byte_const, + models.UInt64Constant() as index, + ], + source_location=op_loc, + ): + binary_array = [ + x for xs in [bin(bb)[2:].zfill(8) for bb in byte_const.value] for x in xs + ] + the_bit = binary_array[index.value] + return models.UInt64Constant(source_location=op_loc, value=int(the_bit)) + case models.Intrinsic( + op=AVMOp.extract | AVMOp.extract3, + immediates=[int(S), int(L)], + args=[models.BytesConstant(value=A, encoding=encoding)], + source_location=op_loc, + ) | models.Intrinsic( + op=AVMOp.extract | AVMOp.extract3, + immediates=[], + args=[ + models.BytesConstant(value=A, encoding=encoding), + models.UInt64Constant(value=S), + models.UInt64Constant(value=L), + ], + source_location=op_loc, + ): + if L == 0: + extracted = A[S:] + else: + extracted = A[S : S + L] + return models.BytesConstant(source_location=op_loc, encoding=encoding, value=extracted) + case models.Intrinsic( + op=AVMOp.substring | AVMOp.substring3, + immediates=[int(S), int(E)], + args=[models.BytesConstant(value=A, encoding=encoding)], + source_location=op_loc, + ) | models.Intrinsic( + op=AVMOp.substring | AVMOp.substring3, + immediates=[], + args=[ + models.BytesConstant(value=A, encoding=encoding), + models.UInt64Constant(value=S), + models.UInt64Constant(value=E), + ], + source_location=op_loc, + ): + if E < S: + raise CodeError("substring would fail at runtime", op_loc) + extracted = A[S:E] + return models.BytesConstant(source_location=op_loc, encoding=encoding, value=extracted) + case models.Intrinsic( + op=AVMOp.concat, + args=[models.Value(atype=AVMType.bytes) as ba, models.BytesConstant(value=b"")], + ): + return ba + case models.Intrinsic( + op=AVMOp.concat, + args=[models.BytesConstant(value=b""), models.Value(atype=AVMType.bytes) as bb], + ): + return bb + case models.Intrinsic( + op=( + AVMOp.concat + | AVMOp.eq + | AVMOp.neq + | AVMOp.bitwise_and_bytes + | AVMOp.bitwise_or_bytes + | AVMOp.bitwise_xor_bytes + ) as bytes_op, + args=[ + models.BytesConstant(value=a, encoding=encoding_a), + models.BytesConstant(value=b, encoding=encoding_b), + ], + source_location=op_loc, + ): + if bytes_op == AVMOp.concat: + if encoding_a == encoding_b: + a_b = a + b + logger.debug( + f"Folded concat({format_bytes(a, encoding_a)}," + f" {format_bytes(b, encoding_b)}) to {a_b!r}" + ) + return models.BytesConstant( + source_location=op_loc, value=a_b, encoding=encoding_a + ) + elif bytes_op == AVMOp.eq: + return models.UInt64Constant(value=int(a == b), source_location=op_loc) + elif bytes_op == AVMOp.neq: + return models.UInt64Constant(value=int(a != b), source_location=op_loc) + else: + do_op = { + AVMOp.bitwise_and_bytes: operator.and_, + AVMOp.bitwise_or_bytes: operator.or_, + AVMOp.bitwise_xor_bytes: operator.xor, + }[bytes_op] + return models.BytesConstant( + value=byte_wise(do_op, a, b), encoding=encoding_a, source_location=op_loc + ) case models.Intrinsic( args=[ models.Value(atype=AVMType.uint64) as a, @@ -48,12 +199,16 @@ def try_simplify_arithmetic_ops(value: models.ValueProvider) -> models.ValueProv match op: case AVMOp.sub: c = 0 - case AVMOp.eq: + case AVMOp.eq | AVMOp.lte | AVMOp.gte: c = 1 case AVMOp.neq: c = 0 case AVMOp.div_floor: c = 1 + case AVMOp.bitwise_xor: + c = 0 + case AVMOp.bitwise_and | AVMOp.bitwise_or: + c = a # 0 == b <-> !b elif a_const == 0 and op == AVMOp.eq: return attrs.evolve(value, op=AVMOp.not_, args=[b]) @@ -71,7 +226,7 @@ def try_simplify_arithmetic_ops(value: models.ValueProvider) -> models.ValueProv c = b elif b_const == 1 and op == AVMOp.mul: c = a - elif a_const == 0 and op in (AVMOp.add, AVMOp.sub, AVMOp.or_): + elif a_const == 0 and op in (AVMOp.add, AVMOp.or_): c = b elif b_const == 0 and op in (AVMOp.add, AVMOp.sub, AVMOp.or_): c = a @@ -99,13 +254,105 @@ def try_simplify_arithmetic_ops(value: models.ValueProvider) -> models.ValueProv c = 1 if a_const == b_const else 0 case AVMOp.neq: c = 1 if a_const != b_const else 0 + case AVMOp.and_: + c = int(a_const and b_const) + case AVMOp.or_: + c = int(a_const or b_const) + case AVMOp.shl: + c = (a_const << b_const) % (2**64) + case AVMOp.shr: + c = a_const >> b_const + case AVMOp.exp: + if a_const == 0 and b_const == 0: + raise CodeError("exp would fail at runtime", value.source_location) + c = a_const**b_const + case AVMOp.bitwise_or: + c = a_const | b_const + case AVMOp.bitwise_and: + c = a_const & b_const + case AVMOp.bitwise_xor: + c = a_const ^ b_const if c is not None: if isinstance(c, models.ValueProvider): logger.debug(f"Folded {a} {op} {b} to {c}") return c else: + if c < 0: + # Value cannot be folded as it would result in a negative uint + return None logger.debug(f"Folded {a_const} {op} {b_const} to {c}") return models.UInt64Constant(value=c, source_location=value.source_location) + case models.Intrinsic( + args=[ + models.Value(atype=AVMType.bytes) as a, + models.Value(atype=AVMType.bytes) as b, + ], + op=op, + ): + c = None + a_const = get_biguint_constant(a) + b_const = get_biguint_constant(b) + if a == b: + match op: + case AVMOp.sub_bytes: + c = 0 + case AVMOp.eq_bytes | AVMOp.eq: + c = 1 + case AVMOp.neq_bytes | AVMOp.neq: + c = 0 + case AVMOp.div_floor_bytes: + c = 1 + elif a_const == 1 and op == AVMOp.mul_bytes: + c = b + elif b_const == 1 and op == AVMOp.mul_bytes: + c = a + elif a_const == 0 and op == AVMOp.add_bytes: + c = b + elif b_const == 0 and op in (AVMOp.add_bytes, AVMOp.sub_bytes): + c = a + elif 0 in (a_const, b_const) and op == AVMOp.mul_bytes: + c = 0 + elif a_const is not None and b_const is not None: + match op: + case AVMOp.add_bytes: + c = a_const + b_const + case AVMOp.sub_bytes: + c = a_const - b_const + case AVMOp.mul_bytes: + c = a_const * b_const + case AVMOp.div_floor_bytes: + c = a_const // b_const + case AVMOp.lt_bytes: + c = 1 if a_const < b_const else 0 + case AVMOp.lte_bytes: + c = 1 if a_const <= b_const else 0 + case AVMOp.gt_bytes: + c = 1 if a_const > b_const else 0 + case AVMOp.gte_bytes: + c = 1 if a_const >= b_const else 0 + case AVMOp.eq_bytes | AVMOp.eq: + c = 1 if a_const == b_const else 0 + case AVMOp.neq_bytes | AVMOp.neq: + c = 1 if a_const != b_const else 0 + if c is not None: + if isinstance(c, models.ValueProvider): + logger.debug(f"Folded {a} {op} {b} to {c}") + return c + logger.debug(f"Folded {a_const} {op} {b_const} to {c}") + if op in ( + AVMOp.eq_bytes, + AVMOp.eq, + AVMOp.neq_bytes, + AVMOp.neq, + AVMOp.lt_bytes, + AVMOp.lte_bytes, + AVMOp.gt_bytes, + AVMOp.gte_bytes, + ): + return models.UInt64Constant(value=c, source_location=value.source_location) + else: + return models.BigUIntConstant(value=c, source_location=value.source_location) + return None diff --git a/src/wyvern/ir/optimize/collapse_blocks.py b/src/wyvern/ir/optimize/collapse_blocks.py index 26f71c6b7b..f2866102e1 100644 --- a/src/wyvern/ir/optimize/collapse_blocks.py +++ b/src/wyvern/ir/optimize/collapse_blocks.py @@ -54,6 +54,14 @@ def visit_goto(self, goto: models.Goto) -> models.Goto: goto.target = self.replacement return goto + def visit_goto_nth(self, goto_nth: models.GotoNth) -> models.ControlOp: + if goto_nth.default == self.find: + goto_nth.default = self.replacement + for index, block in enumerate(goto_nth.blocks): + if block == self.find: + goto_nth.blocks[index] = self.replacement + return _replace_single_target_with_goto(goto_nth) + def visit_switch(self, switch: models.Switch) -> models.ControlOp: for case, target in switch.cases.items(): if target == self.find: diff --git a/src/wyvern/ir/optimize/constant_propagation.py b/src/wyvern/ir/optimize/constant_propagation.py index 88a581840d..eabfe2983b 100644 --- a/src/wyvern/ir/optimize/constant_propagation.py +++ b/src/wyvern/ir/optimize/constant_propagation.py @@ -1,8 +1,11 @@ import attrs import structlog +from wyvern.avm_type import AVMType from wyvern.context import CompileContext from wyvern.ir import models +from wyvern.ir.avm_ops import AVMOp +from wyvern.ir.models import Assignment, Intrinsic from wyvern.ir.ssa import TrivialPhiRemover from wyvern.ir.visitor_mutator import IRMutator @@ -52,27 +55,151 @@ def constant_replacer(_context: CompileContext, subroutine: models.Subroutine) - return modified > 0 +@attrs.define +class IntrinsicSimplifier(IRMutator): + modified: int = 0 + + def visit_assignment(self, ass: Assignment) -> Assignment | None: + match ass.source: + case models.Intrinsic( + op=AVMOp.select, args=[false, true, models.UInt64Constant(value=value)] + ): + self.modified += 1 + ass.source = true if value else false + return ass + + def visit_intrinsic_op(self, intrinsic: Intrinsic) -> Intrinsic | None: + match intrinsic: + case Intrinsic(op=AVMOp.assert_, args=[models.UInt64Constant(value=value)]): + if value: + self.modified += 1 + return None + case Intrinsic( + op=(AVMOp.extract3 | AVMOp.extract), + args=[ + models.Value(atype=AVMType.bytes), + models.UInt64Constant(value=S), + models.UInt64Constant(value=L), + ], + ) if S <= 255 and L <= 255: + self.modified += 1 + return attrs.evolve( + intrinsic, immediates=[S, L], args=intrinsic.args[:1], op=AVMOp.extract + ) + case Intrinsic( + op=AVMOp.substring3, + args=[ + models.Value(atype=AVMType.bytes), + models.UInt64Constant(value=S), + models.UInt64Constant(value=E), + ], + ) if S <= 255 and E <= 255: + self.modified += 1 + return attrs.evolve( + intrinsic, immediates=[S, E], args=intrinsic.args[:1], op=AVMOp.substring + ) + return intrinsic + + @classmethod + def apply(cls, to: models.Subroutine) -> int: + replacer = cls() + for block in to.body: + replacer.visit_block(block) + return replacer.modified + + +def intrinsic_simplifier(_context: CompileContext, subroutine: models.Subroutine) -> bool: + modified = IntrinsicSimplifier.apply(subroutine) + return modified > 0 + + +# the ratio of default cases to all cases when a match of constant values +# can be simplified to a goto-nth +SWITCH_SPARSENESS_SIMPLIFICATION_RATIO = 0.5 + + +def can_simplify_switch(switch: models.Switch) -> bool: + total_targets = 0 + for case in switch.cases: + if not isinstance(case, models.UInt64Constant): + return False + total_targets = max(total_targets, case.value) + default_targets = total_targets - len(switch.cases) + return default_targets < (total_targets * SWITCH_SPARSENESS_SIMPLIFICATION_RATIO) + + def simplify_conditional_branches(_context: CompileContext, subroutine: models.Subroutine) -> bool: changes = False modified_phis = [] + + def remove_target(parent: models.BasicBlock, to_remove: models.BasicBlock) -> None: + to_remove.predecessors.remove(parent) + for other_phi in to_remove.phis: + other_phi.args = [arg for arg in other_phi.args if arg.through is not parent] + modified_phis.append(other_phi) + for block in subroutine.body: terminator = block.terminator - # TODO: implement similar propagator for models.Switch - if isinstance(terminator, models.ConditionalBranch) and isinstance( - terminator.condition, models.UInt64Constant - ): - if terminator.condition.value == 0: - goto, other = terminator.zero, terminator.non_zero - else: - goto, other = terminator.non_zero, terminator.zero - block.terminator = models.Goto(source_location=terminator.source_location, target=goto) - if other is not goto: - other.predecessors.remove(block) - for other_phi in other.phis: - other_phi.args = [arg for arg in other_phi.args if arg.through is not block] - modified_phis.append(other_phi) - changes = True - logger.debug(f"ConditionalBranch {terminator} simplified to {block.terminator}") + match terminator: + case models.ConditionalBranch( + condition=models.UInt64Constant(value=value), zero=zero, non_zero=non_zero + ): + if value == 0: + goto, other = zero, non_zero + else: + goto, other = non_zero, zero + block.terminator = models.Goto( + source_location=terminator.source_location, target=goto + ) + if other is not goto: + remove_target(block, other) + case models.Switch( + value=models.Value(atype=AVMType.uint64) as value, + cases=cases, + default=default_block, + source_location=source_location, + ) as switch if can_simplify_switch(switch): + # reduce to GotoNth + block_map = dict[int, models.BasicBlock]() + for case, case_block in cases.items(): + assert isinstance(case, models.UInt64Constant) + block_map[case.value] = case_block + max_value = max(block_map) + block.terminator = models.GotoNth( + value=value, + blocks=[block_map.get(i, default_block) for i in range(max_value + 1)], + source_location=source_location, + default=default_block, + ) + case models.GotoNth( + value=models.UInt64Constant(value=value), + blocks=blocks, + default=default_block, + ): + goto = blocks[value] if value < len(blocks) else default_block + block.terminator = models.Goto( + source_location=terminator.source_location, target=goto + ) + for target in terminator.targets(): + if target is not goto: + remove_target(block, target) + # TODO: do these belong in constant_propagation? + case models.GotoNth( + value=value, + blocks=[zero], # the constant here is the size of blocks + default=non_zero, + ): # reduces to ConditionalBranch + block.terminator = models.ConditionalBranch( + condition=value, + zero=zero, + non_zero=non_zero, + source_location=terminator.source_location, + ) + case _: + continue + changes = True + original_terminator_name = terminator.__class__.__name__ + logger.debug(f"{original_terminator_name} {terminator} simplified to {block.terminator}") for phi in modified_phis: TrivialPhiRemover.try_remove(phi, subroutine.body) return changes diff --git a/src/wyvern/ir/optimize/dead_code_elimination.py b/src/wyvern/ir/optimize/dead_code_elimination.py index dd83ffe956..340c925929 100644 --- a/src/wyvern/ir/optimize/dead_code_elimination.py +++ b/src/wyvern/ir/optimize/dead_code_elimination.py @@ -1,4 +1,4 @@ -from collections.abc import Iterator +from collections.abc import Iterator, Set from typing import Iterable, Sequence import attrs @@ -91,46 +91,36 @@ def remove_unreachable_blocks(_context: CompileContext, subroutine: models.Subro block.predecessors = [b for b in block.predecessors if b in reachable_set] logger.debug(f"Removed unreachable predecessors from {block}") - unreachable_registers = collect_assignment_registers(unreachable_blocks) - if unreachable_registers: - logger.debug( - f"Found {', '.join(map(str, unreachable_registers))} to remove from Phi nodes" - ) - PhiRegisterRemover.apply(unreachable_registers, reachable_blocks) + UnreachablePhiArgsRemover.apply(unreachable_blocks, reachable_blocks) subroutine.body = reachable_blocks return True -def collect_assignment_registers(blocks: Sequence[models.BasicBlock]) -> list[models.Register]: - registers = list[models.Register]() - for block in blocks: - registers.extend(block.get_assigned_registers()) - return registers - - @attrs.define -class PhiRegisterRemover(visitor.IRTraverser): - _registers_to_remove: frozenset[models.Register] +class UnreachablePhiArgsRemover(visitor.IRTraverser): + _unreachable_blocks: Set[models.BasicBlock] _reachable_blocks: Sequence[models.BasicBlock] @classmethod def apply( cls, - registers_to_remove: Sequence[models.Register], + unreachable_blocks: Sequence[models.BasicBlock], reachable_blocks: Sequence[models.BasicBlock], ) -> None: - collector = cls(frozenset(registers_to_remove), reachable_blocks) + collector = cls(frozenset(unreachable_blocks), reachable_blocks) collector.visit_all_blocks(reachable_blocks) def visit_phi(self, phi: models.Phi) -> None: - phi.args = [a for a in phi.args if a.value not in self._registers_to_remove] + args_to_remove = [a for a in phi.args if a.through in self._unreachable_blocks] + if not args_to_remove: + return + logger.debug( + "Removing unreachable phi arguments: " + ", ".join(sorted(map(str, args_to_remove))) + ) + phi.args = [a for a in phi.args if a not in args_to_remove] if not phi.non_self_args: - raise InternalError(f"undefined phi created when removing {self._registers_to_remove}") - TrivialPhiRemover.try_remove(phi, self._reachable_blocks) - - def visit_register(self, reg: models.Register) -> None: - if reg in self._registers_to_remove: raise InternalError( - f"Tried to remove register outside a phi node: {reg} in {self.active_block}", - reg.source_location, + f"undefined phi created when removing args through " + f"{', '.join(map(str, self._unreachable_blocks))}" ) + TrivialPhiRemover.try_remove(phi, self._reachable_blocks) diff --git a/src/wyvern/ir/optimize/main.py b/src/wyvern/ir/optimize/main.py index 65d2be71de..221a773ebe 100644 --- a/src/wyvern/ir/optimize/main.py +++ b/src/wyvern/ir/optimize/main.py @@ -12,6 +12,7 @@ from wyvern.ir.optimize.collapse_blocks import remove_empty_blocks, remove_linear_jump from wyvern.ir.optimize.constant_propagation import ( constant_replacer, + intrinsic_simplifier, simplify_conditional_branches, ) from wyvern.ir.optimize.dead_code_elimination import ( @@ -53,6 +54,7 @@ def get_all_optimizations() -> Iterable[SubroutineOptimization]: SubroutineOptimization.from_function(arithmetic_simplification, loop=True), SubroutineOptimization.from_function(constant_replacer, loop=True), SubroutineOptimization.from_function(copy_propagation), + SubroutineOptimization.from_function(intrinsic_simplifier), SubroutineOptimization.from_function(remove_unused_variables), SubroutineOptimization.from_function(simplify_conditional_branches), SubroutineOptimization.from_function(remove_linear_jump), diff --git a/src/wyvern/ir/ssa.py b/src/wyvern/ir/ssa.py index 47d55b7b45..4658e85d93 100644 --- a/src/wyvern/ir/ssa.py +++ b/src/wyvern/ir/ssa.py @@ -3,9 +3,9 @@ import attrs import structlog +from wyvern.avm_type import AVMType from wyvern.errors import InternalError from wyvern.ir import models as ir -from wyvern.ir.types_ import AVMType from wyvern.ir.visitor_mem_replacer import MemoryReplacer from wyvern.parse import SourceLocation @@ -23,12 +23,21 @@ class BraunSSA: and formally verified. """ - def __init__(self, all_blocks: Sequence[ir.BasicBlock]) -> None: + def __init__( + self, + all_blocks: Sequence[ir.BasicBlock], + live_variables: Sequence[ir.Register], + active_block: ir.BasicBlock, + ) -> None: self._all_blocks = all_blocks # note: this is a shared reference with BlocksBuilder self._sealed_blocks = set[ir.BasicBlock]() self._current_def = dict[str, dict[ir.BasicBlock, ir.Register]]() self._incomplete_phis = dict[ir.BasicBlock, list[ir.Phi]]() self._variable_versions = dict[str, int]() + # initialize any live variables at the start of the subroutines, i.e. parameters + for parameter in live_variables: + self.write_variable(parameter.name, active_block, parameter) + self._variable_versions[parameter.name] = 1 def write_variable(self, variable: str, block: ir.BasicBlock, value: ir.Register) -> None: self._current_def.setdefault(variable, {})[block] = value @@ -48,9 +57,6 @@ def read_variable(self, variable: str, atype: AVMType, block: ir.BasicBlock) -> result = self._read_variable_recursive(variable, atype, block) return result - def read_register(self, reg: ir.Register, block: ir.BasicBlock) -> ir.Register: - return self.read_variable(variable=reg.name, atype=reg.atype, block=block) - def _read_variable_recursive( self, variable: str, atype: AVMType, block: ir.BasicBlock ) -> ir.Register: diff --git a/src/wyvern/ir/to_text_visitor.py b/src/wyvern/ir/to_text_visitor.py index 6ec4c8189d..6e6dc44d56 100644 --- a/src/wyvern/ir/to_text_visitor.py +++ b/src/wyvern/ir/to_text_visitor.py @@ -4,9 +4,9 @@ import structlog +from wyvern.avm_type import AVMType from wyvern.codegen.utils import format_bytes from wyvern.ir import models -from wyvern.ir.types_ import AVMType from wyvern.ir.visitor import IRVisitor logger = structlog.get_logger(__name__) @@ -35,6 +35,9 @@ def visit_bytes_constant(self, op: models.BytesConstant) -> str: def visit_address_constant(self, op: models.AddressConstant) -> str: return f"addr {op.value}" + def visit_method_constant(self, op: models.MethodConstant) -> str: + return f'method "{op.value}"' + def visit_intrinsic_op(self, intrinsic: models.Intrinsic) -> str: callee = intrinsic.op.code immediates = list(map(str, intrinsic.immediates)) @@ -143,7 +146,7 @@ def render_program(emitter: TextEmitter, name: str, program: models.Program) -> def render_contract(emitter: TextEmitter, contract: models.Contract) -> None: - emitter.append(f"contract {contract.full_name}:") + emitter.append(f"contract {contract.metadata.full_name}:") with emitter.indent(): render_program(emitter, "approval", contract.approval_program) emitter.append("") diff --git a/src/wyvern/ir/types_.py b/src/wyvern/ir/types_.py index 29ce10a3e6..357508d02a 100644 --- a/src/wyvern/ir/types_.py +++ b/src/wyvern/ir/types_.py @@ -1,5 +1,6 @@ import enum +from wyvern.avm_type import AVMType from wyvern.awst import ( nodes as awst_nodes, wtypes, @@ -11,14 +12,7 @@ @enum.unique -class AVMType(enum.Flag): - bytes = enum.auto() # noqa: A003 - uint64 = enum.auto() - any = bytes | uint64 # noqa: A003 - - -@enum.unique -class AVMBytesEncoding(enum.Enum): +class AVMBytesEncoding(enum.StrEnum): base16 = enum.auto() base32 = enum.auto() base64 = enum.auto() @@ -26,17 +20,10 @@ class AVMBytesEncoding(enum.Enum): def bytes_enc_to_avm_bytes_enc(bytes_encoding: BytesEncoding) -> AVMBytesEncoding: - match bytes_encoding: - case BytesEncoding.base16: - return AVMBytesEncoding.base16 - case BytesEncoding.base32: - return AVMBytesEncoding.base32 - case BytesEncoding.base64: - return AVMBytesEncoding.base64 - case BytesEncoding.utf8: - return AVMBytesEncoding.utf8 - case _: - raise InternalError("Unsupported bytes encoding") + try: + return AVMBytesEncoding(bytes_encoding.value) + except ValueError as ex: + raise InternalError(f"Unhandled BytesEncoding: {bytes_encoding}") from ex def wtype_to_avm_type( @@ -51,20 +38,15 @@ def wtype_to_avm_type( wtype = expr_or_wtype # TODO: compound types 🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔🤔 match wtype: - case wtypes.uint64_wtype | wtypes.bool_wtype | wtypes.asset_wtype: - return AVMType.uint64 case ( - wtypes.bytes_wtype - | wtypes.biguint_wtype - | wtypes.address_wtype - | wtypes.abi_string_wtype + wtypes.uint64_wtype + | wtypes.bool_wtype + | wtypes.asset_wtype + | wtypes.application_wtype + | wtypes.WTransaction() ): - return AVMType.bytes - case wtypes.AbiUIntN(): - return AVMType.bytes - case wtypes.AbiDynamicArray(): - return AVMType.bytes - case wtypes.AbiStaticArray(): + return AVMType.uint64 + case wtypes.bytes_wtype | wtypes.biguint_wtype | wtypes.account_wtype | wtypes.ARC4Type(): return AVMType.bytes case wtypes.void_wtype: raise InternalError("Can't translate void WType to AVMType", source_location) diff --git a/src/wyvern/ir/visitor.py b/src/wyvern/ir/visitor.py index f1a1d19b78..72fa143e25 100644 --- a/src/wyvern/ir/visitor.py +++ b/src/wyvern/ir/visitor.py @@ -36,6 +36,10 @@ def visit_bytes_constant(self, const: wyvern.ir.models.BytesConstant) -> T: def visit_address_constant(self, const: wyvern.ir.models.AddressConstant) -> T: ... + @abstractmethod + def visit_method_constant(self, const: wyvern.ir.models.MethodConstant) -> T: + ... + @abstractmethod def visit_phi(self, phi: wyvern.ir.models.Phi) -> T: ... @@ -117,6 +121,9 @@ def visit_bytes_constant(self, const: wyvern.ir.models.BytesConstant) -> None: def visit_address_constant(self, const: wyvern.ir.models.AddressConstant) -> None: pass + def visit_method_constant(self, const: wyvern.ir.models.MethodConstant) -> None: + pass + def visit_phi(self, phi: wyvern.ir.models.Phi) -> None: phi.register.accept(self) for arg in phi.args: diff --git a/src/wyvern/ir/visitor_mutator.py b/src/wyvern/ir/visitor_mutator.py index 3d49573a84..cc2839b8c9 100644 --- a/src/wyvern/ir/visitor_mutator.py +++ b/src/wyvern/ir/visitor_mutator.py @@ -17,6 +17,7 @@ GotoNth, Intrinsic, InvokeSubroutine, + MethodConstant, Op, Phi, PhiArgument, @@ -86,6 +87,9 @@ def visit_bytes_constant(self, const: BytesConstant) -> BytesConstant: def visit_address_constant(self, const: AddressConstant) -> AddressConstant: return const + def visit_method_constant(self, const: MethodConstant) -> MethodConstant: + return const + def visit_phi(self, phi: Phi) -> Phi | None: with self._enter_target_context(): phi.register = self.visit_register(phi.register) @@ -96,7 +100,7 @@ def visit_phi_argument(self, arg: PhiArgument) -> PhiArgument: arg.value = arg.value.accept(self) return arg - def visit_intrinsic_op(self, intrinsic: Intrinsic) -> Intrinsic: + def visit_intrinsic_op(self, intrinsic: Intrinsic) -> Intrinsic | None: intrinsic.args = [a.accept(self) for a in intrinsic.args] return intrinsic diff --git a/src/wyvern/lib_embedded/_algopy_.py b/src/wyvern/lib_embedded/_algopy_.py new file mode 100644 index 0000000000..4f73f35e49 --- /dev/null +++ b/src/wyvern/lib_embedded/_algopy_.py @@ -0,0 +1,46 @@ +from algopy import ( + Bytes, + CreateInnerTransaction, + Global, + OnCompleteAction, + TransactionType, + UInt64, + subroutine, + substring, +) + + +@subroutine +def ensure_budget(required_budget: UInt64, fee_source: UInt64) -> None: + # A budget buffer is necessary to deal with an edge case of ensure_budget(): + # if the current budget is equal to or only slightly higher than the + # required budget then it's possible for ensure_budget() to return with a + # current budget less than the required budget. The buffer prevents this + # from being the case. + required_budget_with_buffer = required_budget + 10 + while required_budget_with_buffer > Global.opcode_budget(): + CreateInnerTransaction.begin() + CreateInnerTransaction.set_type_enum(TransactionType.ApplicationCall) + CreateInnerTransaction.set_on_completion(OnCompleteAction.DeleteApplication) + CreateInnerTransaction.set_approval_program(Bytes.from_hex("068101")) + CreateInnerTransaction.set_clear_state_program(Bytes.from_hex("068101")) + match fee_source: + case 0: + CreateInnerTransaction.set_fee(0) + case 1: + CreateInnerTransaction.set_fee(Global.min_txn_fee()) + CreateInnerTransaction.submit() + + +@subroutine +def is_substring(item: Bytes, sequence: Bytes) -> bool: + """ + Search for a shorter string in a larger one. + """ + + start = UInt64(0) + while start + item.length <= sequence.length: + if item == substring(sequence, start, start + item.length): + return True + start += 1 + return False diff --git a/src/wyvern/metadata.py b/src/wyvern/metadata.py new file mode 100644 index 0000000000..302564b341 --- /dev/null +++ b/src/wyvern/metadata.py @@ -0,0 +1,103 @@ +import enum +from typing import Literal, Sequence + +import attrs + +from wyvern.avm_type import AVMType +from wyvern.parse import SourceLocation + + +class OnCompletionAction(enum.IntEnum): + NoOp = 0 + OptIn = 1 + CloseOut = 2 + ClearState = 3 + UpdateApplication = 4 + DeleteApplication = 5 + + +@attrs.frozen(kw_only=True) +class ARC4DefaultArgument: + parameter: str + source: str + + +@attrs.frozen(kw_only=True) +class ARC4MethodConfig: + source_location: SourceLocation + name: str + is_bare: bool = attrs.field(default=False) + allow_create: bool = attrs.field(default=False) + require_create: bool = attrs.field(default=False) + readonly: bool = attrs.field(default=False) + allowed_completion_types: Sequence[OnCompletionAction] = attrs.field( + default=(OnCompletionAction.NoOp,), + converter=tuple[OnCompletionAction], + validator=attrs.validators.min_len(1), + ) + default_args: Sequence[ARC4DefaultArgument] = attrs.field( + factory=list, converter=tuple[ARC4DefaultArgument, ...] + ) + structs: Sequence[tuple[str, "ARC32StructDef"]] = attrs.field( + factory=list, converter=tuple[tuple[str, "ARC32StructDef"], ...] + ) + # TODO: the rest + + +@attrs.define +class ARC4MethodArg: + name: str + type_: str + desc: str | None + + +@attrs.define +class ARC4Returns: + type_: str + desc: str | None + + +@attrs.define +class ARC4Method: + name: str + desc: str | None + args: list[ARC4MethodArg] + returns: ARC4Returns + config: ARC4MethodConfig + + +@attrs.frozen +class ARC32StructDef: + name: str + elements: Sequence[tuple[str, str]] = attrs.field( + factory=list, converter=tuple[tuple[str, str], ...] + ) + + +@attrs.define(eq=False) +class ContractState: + name: str + source_location: SourceLocation + key: bytes + storage_type: Literal[AVMType.uint64, AVMType.bytes] + description: str | None + + +@attrs.frozen +class ContractMetaData: + description: str | None + name_override: str | None + module_name: str + class_name: str + global_state: Sequence[ContractState] + local_state: Sequence[ContractState] + is_arc4: bool + methods: Sequence[ARC4Method] + + @property + def name(self) -> str: + return self.name_override or self.class_name + + @property + def full_name(self) -> str: + return ".".join((self.module_name, self.class_name)) diff --git a/src/wyvern/options.py b/src/wyvern/options.py index 0395b9c430..a885607660 100644 --- a/src/wyvern/options.py +++ b/src/wyvern/options.py @@ -10,6 +10,7 @@ class WyvernOptions: paths: Sequence[Path] = () output_teal: bool = True + output_arc32: bool = True output_awst: bool = False output_ssa_ir: bool = False output_optimization_ir: bool = False @@ -20,4 +21,4 @@ class WyvernOptions: out_dir: Path | None = None debug_level: int = 0 optimization_level: int = 0 - log_level: LogLevel = LogLevel.notset + log_level: LogLevel = LogLevel.info diff --git a/src/wyvern/parse.py b/src/wyvern/parse.py index 0bd0010c6e..fd6614ed22 100644 --- a/src/wyvern/parse.py +++ b/src/wyvern/parse.py @@ -6,6 +6,7 @@ from typing import Any, Self import attrs +import docstring_parser import mypy.build import mypy.errors import mypy.find_sources @@ -138,6 +139,16 @@ def parse_and_typecheck(paths: Sequence[Path], mypy_options: mypy.options.Option is_explicit=src_path in resolved_input_paths, ) ) + # insert embedded lib, after source list that is returned has been constructed, + # so we don't try to output it + algopy_lib_path = Path(__file__).parent / "lib_embedded" / "_algopy_.py" + mypy_build_sources.append( + mypy.build.BuildSource( + path=str(Path("") / "algopy.py"), + module="_algopy_", + text=algopy_lib_path.read_text(), + ) + ) result = _mypy_build(mypy_build_sources, mypy_options, mypy_fscache) missing_module_names = {s.module_name for s in sources} - result.manager.modules.keys() if missing_module_names: @@ -197,3 +208,38 @@ def split_log_message(message: str) -> tuple[str, str, str, str]: return f"{drive}:{path}", line, severity, msg path, line, severity, msg = message.split(":", maxsplit=3) return path, line, severity, msg + + +@attrs.define +class MethodDocumentation: + description: str | None = attrs.field(default=None) + args: dict[str, str] = attrs.field(factory=dict) + returns: str | None = attrs.field(default=None) + + +def _join_single_new_line(doc: str) -> str: + return doc.strip().replace("\n", " ") + + +def parse_docstring(docstring_raw: str | None) -> MethodDocumentation: + if docstring_raw is None: + return MethodDocumentation() + docstring = docstring_parser.parse(docstring_raw) + method_desc = "\n".join( + _join_single_new_line(line) + for lines in filter(None, (docstring.short_description, docstring.long_description)) + for line in lines.split("\n\n") + ) + return MethodDocumentation( + description=method_desc if method_desc else None, + args={ + p.arg_name: _join_single_new_line(p.description) + for p in docstring.params + if p.description + }, + returns=( + _join_single_new_line(docstring.returns.description) + if docstring.returns and docstring.returns.description + else None + ), + ) diff --git a/src/wyvern/utils.py b/src/wyvern/utils.py index b75533f047..a7c1d22839 100644 --- a/src/wyvern/utils.py +++ b/src/wyvern/utils.py @@ -1,6 +1,7 @@ import contextlib import functools import itertools +import math import os from collections.abc import Callable, Iterable, MutableMapping, MutableSet, Set from pathlib import Path @@ -13,6 +14,18 @@ T_A = TypeVar("T_A", bound=attrs.AttrsInstance) +def sha512_256_hash(value: bytes) -> bytes: + """ + Returns the SHA512/256 hash of a value. This is the hashing algorithm used + to generate address checksums + """ + from Cryptodome.Hash import SHA512 + + sha = SHA512.new(truncate="256") + sha.update(value) + return sha.digest() + + def attrs_extend(new_type: type[T_A], base_instance: Any, **changes: Any) -> T_A: # noqa: ANN401 """Like attrs.evolve but allows creating a sub-type""" base_type = type(base_instance) @@ -128,3 +141,19 @@ def lazy_setdefault(m: MutableMapping[T, U], /, key: T, default: Callable[[T], U def invert_ordered_binary_op(op: str) -> str: return op.translate(_INVERT_ORDERED_BINARY_OP) + + +def clamp(value: int, *, low: int, high: int) -> int: + if value < low: + return low + if value > high: + return high + return value + + +def bits_to_bytes(bit_size: int) -> int: + return int(math.ceil(bit_size / 8)) + + +def round_bits_to_nearest_bytes(bit_size: int) -> int: + return bits_to_bytes(bit_size) * 8 diff --git a/tests/conftest.py b/tests/conftest.py index 0a6cf80761..0bd7476ac6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,13 @@ import pytest +from algokit_utils import ( + Account, + get_algod_client, + get_default_localnet_config, + get_localnet_default_account, +) +from algosdk import transaction +from algosdk.atomic_transaction_composer import AtomicTransactionComposer, TransactionWithSigner +from algosdk.v2client.algod import AlgodClient from wyvern.logging_config import LogLevel, configure_logging @@ -7,3 +16,49 @@ def _setup_logging() -> None: # configure logging for tests # note cache_logger should be False if calling configure_logging more than once configure_logging(min_log_level=LogLevel.notset, cache_logger=False) + + +@pytest.fixture(scope="session") +def algod_client() -> AlgodClient: + return get_algod_client(get_default_localnet_config("algod")) + + +@pytest.fixture(scope="session") +def account(algod_client: AlgodClient) -> Account: + return get_localnet_default_account(algod_client) + + +@pytest.fixture(scope="session") +def asset_a(algod_client: AlgodClient, account: Account) -> int: + return create_asset(algod_client, account, "a") + + +@pytest.fixture(scope="session") +def asset_b(algod_client: AlgodClient, account: Account) -> int: + return create_asset(algod_client, account, "b") + + +def create_asset(algod_client: AlgodClient, account: Account, asset_unit: str) -> int: + sp = algod_client.suggested_params() + atc = AtomicTransactionComposer() + atc.add_transaction( + TransactionWithSigner( + transaction.AssetCreateTxn( + account.address, + sp, + 10_000_000, + 0, + default_frozen=False, + asset_name=f"asset {asset_unit}", + unit_name=asset_unit, + ), + signer=account.signer, + ) + ) + response = atc.execute(algod_client, 4) + txn_id = response.tx_ids[0] + result = algod_client.pending_transaction_info(txn_id) + assert isinstance(result, dict) + asset_index = result["asset-index"] + assert isinstance(asset_index, int) + return asset_index diff --git a/tests/test_arc32.py b/tests/test_arc32.py new file mode 100644 index 0000000000..b00ce3b436 --- /dev/null +++ b/tests/test_arc32.py @@ -0,0 +1,534 @@ +import math +import random +from pathlib import Path + +import algokit_utils +import algokit_utils.config +import algosdk +import pytest +from algosdk import transaction +from algosdk.atomic_transaction_composer import AtomicTransactionComposer, TransactionWithSigner +from algosdk.v2client.algod import AlgodClient +from nacl.signing import SigningKey +from wyvern.arc32 import create_arc32_json +from wyvern.awst_build.main import transform_ast +from wyvern.compile import awst_to_teal, parse_with_mypy +from wyvern.options import WyvernOptions + +VCS_ROOT = Path(__file__).parent.parent +EXAMPLES_DIR = VCS_ROOT / "examples" + + +def compile_arc32(src_path: Path, optimization_level: int = 1) -> str: + wyvern_options = WyvernOptions( + paths=[src_path], + optimization_level=optimization_level, + debug_level=2, + ) + context = parse_with_mypy(wyvern_options) + awst = transform_ast(context) + teal = awst_to_teal(context, awst) + assert teal is not None, "compile error" + ((contract,),) = teal.values() + return create_arc32_json(contract) + + +@pytest.fixture() +def user_account() -> algokit_utils.Account: + private_key, address = algosdk.account.generate_account() + return algokit_utils.Account(private_key=private_key, address=address) + + +@pytest.fixture() +def funded_user_account(algod_client: AlgodClient) -> algokit_utils.Account: + private_key, address = algosdk.account.generate_account() + user = algokit_utils.Account(private_key=private_key, address=address) + algokit_utils.ensure_funded( + algod_client, + algokit_utils.EnsureBalanceParameters( + account_to_fund=user, + min_spending_balance_micro_algos=1_000_000, + ), + ) + return user + + +def token_balances( + app_client: algokit_utils.ApplicationClient, + account: algokit_utils.Account, + pool_token: int, + asset_a: int, + asset_b: int, +) -> dict[str, dict[str, int] | int]: + account_info = app_client.algod_client.account_info(account.address) + assert isinstance(account_info, dict) + + account_balances = {} + for asset in account_info["assets"]: + if asset["asset-id"] == pool_token: + account_balances["pool"] = asset["amount"] + if asset["asset-id"] == asset_a: + account_balances["asset_a"] = asset["amount"] + if asset["asset-id"] == asset_b: + account_balances["asset_b"] = asset["amount"] + + app_account_info = app_client.algod_client.account_info(app_client.app_address) + assert isinstance(app_account_info, dict) + + app_balances = {} + for asset in app_account_info["assets"]: + if asset["asset-id"] == pool_token: + app_balances["pool"] = asset["amount"] + if asset["asset-id"] == asset_a: + app_balances["asset_a"] = asset["amount"] + if asset["asset-id"] == asset_b: + app_balances["asset_b"] = asset["amount"] + + state = app_client.get_global_state() + ratio = state["ratio"] + assert isinstance(ratio, int) + return {"account": account_balances, "app": app_balances, "ratio": ratio} + + +def test_amm( + algod_client: AlgodClient, + account: algokit_utils.Account, + asset_a: int, + asset_b: int, +) -> None: + example = EXAMPLES_DIR / "amm" + app_spec = algokit_utils.ApplicationSpecification.from_json(compile_arc32(example, 1)) + app_client = algokit_utils.ApplicationClient(algod_client, app_spec, signer=account) + + # create + create_response = app_client.create() + assert create_response.confirmed_round + + pay_txn = TransactionWithSigner( + transaction.PaymentTxn( + sender=account.address, + receiver=app_client.app_address, + amt=int(1e7), + sp=algod_client.suggested_params(), + ), + signer=account.signer, + ) + sp = algod_client.suggested_params() + sp.flat_fee = True + sp.fee = 4_000 + + # bootstrap + bootstrap_response = app_client.call( + "bootstrap", + transaction_parameters=algokit_utils.OnCompleteCallParameters(suggested_params=sp), + seed=pay_txn, + a_asset=asset_a, + b_asset=asset_b, + ) + pool_token = bootstrap_response.return_value + assert token_balances(app_client, account, pool_token, asset_a, asset_b) == { + "account": { + "asset_a": 10_000_000, + "asset_b": 10_000_000, + }, + "app": { + "asset_a": 0, + "asset_b": 0, + "pool": 10_000_000_000, + }, + "ratio": 0, + } + + # pool_id should be newer than asset a + b + assert pool_token > asset_a + assert pool_token > asset_b + + # opt user into tokens + # fund user account with assets a & b + sp = algod_client.suggested_params() + atc = AtomicTransactionComposer() + atc.add_transaction( + TransactionWithSigner( + txn=transaction.AssetTransferTxn(account.address, sp, account.address, 0, asset_a), + signer=account.signer, + ) + ) + atc.add_transaction( + TransactionWithSigner( + txn=transaction.AssetTransferTxn(account.address, sp, account.address, 0, asset_b), + signer=account.signer, + ) + ) + atc.add_transaction( + TransactionWithSigner( + txn=transaction.AssetTransferTxn(account.address, sp, account.address, 0, pool_token), + signer=account.signer, + ) + ) + atc.execute(algod_client, wait_rounds=1) + + # mint + sp = algod_client.suggested_params() + sp.flat_fee = True + sp.fee = 3_000 + + app_client.call( + "mint", + a_xfer=TransactionWithSigner( + txn=transaction.AssetTransferTxn( + account.address, sp, app_client.app_address, 10_000, asset_a + ), + signer=account.signer, + ), + b_xfer=TransactionWithSigner( + txn=transaction.AssetTransferTxn( + account.address, sp, app_client.app_address, 3000, asset_b + ), + signer=account.signer, + ), + transaction_parameters=algokit_utils.OnCompleteCallParameters(suggested_params=sp), + ) + assert token_balances(app_client, account, pool_token, asset_a, asset_b) == { + "account": { + "asset_a": 9_990_000, + "asset_b": 9_997_000, + "pool": 4_477, + }, + "app": { + "asset_a": 10_000, + "asset_b": 3_000, + "pool": 9_999_995_523, + }, + "ratio": 3_333, + } + + app_client.call( + "mint", + a_xfer=TransactionWithSigner( + txn=transaction.AssetTransferTxn( + account.address, sp, app_client.app_address, 100_000, asset_a + ), + signer=account.signer, + ), + b_xfer=TransactionWithSigner( + txn=transaction.AssetTransferTxn( + account.address, sp, app_client.app_address, 1_000, asset_b + ), + signer=account.signer, + ), + transaction_parameters=algokit_utils.OnCompleteCallParameters(suggested_params=sp), + ) + assert token_balances(app_client, account, pool_token, asset_a, asset_b) == { + "account": { + "asset_a": 9_890_000, + "asset_b": 9_996_000, + "pool": 5_967, + }, + "app": { + "asset_a": 110_000, + "asset_b": 4_000, + "pool": 9_999_994_033, + }, + "ratio": 27_500, + } + + # swap + app_client.call( + "swap", + swap_xfer=TransactionWithSigner( + txn=transaction.AssetTransferTxn( + account.address, sp, app_client.app_address, 500, asset_a + ), + signer=account.signer, + ), + ) + assert token_balances(app_client, account, pool_token, asset_a, asset_b) == { + "account": { + "asset_a": 9_903_252, + "asset_b": 9_996_000, + "pool": 5_967, + }, + "app": { + "asset_a": 96_748, + "asset_b": 4_000, + "pool": 9_999_994_033, + }, + "ratio": 24_187, + } + + app_client.call( + "swap", + swap_xfer=TransactionWithSigner( + txn=transaction.AssetTransferTxn( + account.address, sp, app_client.app_address, 500, asset_b + ), + signer=account.signer, + ), + ) + assert token_balances(app_client, account, pool_token, asset_a, asset_b) == { + "account": { + "asset_a": 9_903_252, + "asset_b": 9_995_523, + "pool": 5_967, + }, + "app": { + "asset_a": 96_748, + "asset_b": 4_477, + "pool": 9_999_994_033, + }, + "ratio": 21_610, + } + + # burn + app_client.call( + "burn", + pool_xfer=TransactionWithSigner( + txn=transaction.AssetTransferTxn( + account.address, sp, app_client.app_address, 100, pool_token + ), + signer=account.signer, + ), + ) + assert token_balances(app_client, account, pool_token, asset_a, asset_b) == { + "account": { + "asset_a": 9_904_929, + "asset_b": 9_995_600, + "pool": 5_867, + }, + "app": { + "asset_a": 95_071, + "asset_b": 4_400, + "pool": 9_999_994_133, + }, + "ratio": 21_607, + } + + +@pytest.fixture() +def voter_account(algod_client: AlgodClient) -> algokit_utils.Account: + v = algosdk.account.generate_account() + voter_account = algokit_utils.Account(private_key=v[0], address=v[1]) + algokit_utils.transfer( + client=algod_client, + parameters=algokit_utils.TransferParameters( + from_account=algokit_utils.get_localnet_default_account(algod_client), + to_address=voter_account.address, + micro_algos=10000000, + ), + ) + return voter_account + + +def test_voting_app( + algod_client: AlgodClient, + account: algokit_utils.Account, + voter_account: algokit_utils.Account, +) -> None: + creator_account = account + + private_key = SigningKey.generate() + + example = VCS_ROOT / "examples" / "voting" + app_spec = algokit_utils.ApplicationSpecification.from_json(compile_arc32(example, 1)) + app_client = algokit_utils.ApplicationClient(algod_client, app_spec, signer=creator_account) + + quorum = math.ceil(random.randint(1, 9) * 1000) + question_counts = [1] * 10 + + health = algod_client.status() + assert isinstance(health, dict) + response = algod_client.block_info(health["last-round"]) + assert isinstance(response, dict) + block = response["block"] + block_ts = block["ts"] + app_client.create( + "create", + vote_id="1", + metadata_ipfs_cid="cid", + start_time=int(block_ts), + end_time=int(block_ts) + 1000, + quorum=quorum, + snapshot_public_key=private_key.verify_key.encode(), + nft_image_url="ipfs://cid", + option_counts=question_counts, + ) + + def suggested_params( + *, fee: int | None = None, flat_fee: bool | None = None + ) -> algosdk.transaction.SuggestedParams: + sp = app_client.algod_client.suggested_params() + + if fee is not None: + sp.fee = fee + if flat_fee is not None: + sp.flat_fee = flat_fee + + return sp + + def payment_transaction( + *, amount: int, receiver: str, sender: algokit_utils.Account, note: bytes | None = None + ) -> TransactionWithSigner: + return TransactionWithSigner( + txn=algosdk.transaction.PaymentTxn( + sender=sender.address, + receiver=receiver, + amt=amount, + note=note, + sp=suggested_params(), + ), + signer=sender.signer, + ) + + app_client.call( + call_abi_method="bootstrap", + transaction_parameters=algokit_utils.OnCompleteCallParameters(boxes=[(0, "V")]), + fund_min_bal_req=payment_transaction( + amount=(100000 * 2) + 1000 + 2500 + 400 * (1 + 8 * 10), + sender=creator_account, + note=b"Bootstrap payment", + receiver=app_client.app_address, + ), + ) + + def get_account_signature(voter_public_key: bytes) -> bytes: + signed = private_key.sign(voter_public_key) + return signed.signature + + pre_conditions = app_client.call( + call_abi_method="get_preconditions", + transaction_parameters=algokit_utils.OnCompleteCallParameters( + sender=voter_account.address, + signer=voter_account.signer, + boxes=[(0, voter_account.public_key)], + suggested_params=suggested_params(fee=4000), + ), + signature=get_account_signature(voter_account.public_key), + ) + (is_open, can_vote, has_voted, _time) = pre_conditions.return_value + assert is_open + assert can_vote + assert not has_voted + + app_client.call( + call_abi_method="vote", + transaction_parameters=algokit_utils.OnCompleteCallParameters( + boxes=[(0, "V"), (0, voter_account.public_key)], + sender=voter_account.address, + signer=voter_account.signer, + suggested_params=suggested_params(fee=12000, flat_fee=True), + ), + answer_ids=[0] * 10, + fund_min_bal_req=payment_transaction( + amount=400 * (32 + 2 + 10) + 2500, + sender=voter_account, + note=b"Vote payment", + receiver=app_client.app_address, + ), + signature=get_account_signature(voter_account.public_key), + ) + + pre_conditions = app_client.call( + call_abi_method="get_preconditions", + transaction_parameters=algokit_utils.OnCompleteCallParameters( + sender=voter_account.address, + signer=voter_account.signer, + boxes=[(0, voter_account.public_key)], + suggested_params=suggested_params(fee=4000), + ), + signature=get_account_signature(voter_account.public_key), + ) + (is_open, can_vote, has_voted, _time) = pre_conditions.return_value + assert is_open + assert can_vote + assert has_voted + + app_client.call( + call_abi_method="close", + transaction_parameters=algokit_utils.OnCompleteCallParameters( + boxes=[(0, "V")], + sender=creator_account.address, + signer=creator_account.signer, + suggested_params=suggested_params(fee=1000000, flat_fee=True), + ), + ) + + pre_conditions = app_client.call( + call_abi_method="get_preconditions", + transaction_parameters=algokit_utils.OnCompleteCallParameters( + boxes=[(0, account.public_key)], + suggested_params=suggested_params(fee=4000), + ), + signature=get_account_signature(voter_account.public_key), + ) + (is_open, _can_vote, _has_voted, _time) = pre_conditions.return_value + assert not is_open + + +def test_arc4_routing( + algod_client: AlgodClient, + account: algokit_utils.Account, +) -> None: + app_spec = algokit_utils.ApplicationSpecification.from_json( + compile_arc32(EXAMPLES_DIR / "abi_routing") + ) + app_client = algokit_utils.ApplicationClient(algod_client, app_spec, signer=account) + + # create + create_response = app_client.create() + assert create_response.confirmed_round + + app_client.call("method_with_default_args") + + +def test_transaction(algod_client: AlgodClient, account: algokit_utils.Account) -> None: + app_spec = algokit_utils.ApplicationSpecification.from_json( + compile_arc32(EXAMPLES_DIR / "transaction") + ) + app_client = algokit_utils.ApplicationClient(algod_client, app_spec, signer=account) + + # create + create_response = app_client.create() + assert create_response.confirmed_round + + # ensure app meets minimum balance requirements + algokit_utils.ensure_funded( + algod_client, + algokit_utils.EnsureBalanceParameters( + account_to_fund=app_client.app_address, + min_spending_balance_micro_algos=100_000, + ), + ) + + app_client.call( + "pay", + txn=TransactionWithSigner( + transaction.PaymentTxn( + sender=account.address, + receiver=app_client.app_address, + amt=1001, + sp=algod_client.suggested_params(), + ), + signer=account.signer, + ), + ) + + # TODO: call remaining transaction methods + + +def test_dynamic_array_of_string( + algod_client: AlgodClient, + account: algokit_utils.Account, +) -> None: + app_spec = algokit_utils.ApplicationSpecification.from_json( + compile_arc32(EXAMPLES_DIR / "arc4_types/dynamic_string_array.py") + ) + app_client = algokit_utils.ApplicationClient(algod_client, app_spec, signer=account) + + create_response = app_client.create() + assert create_response.confirmed_round + + xyz_result = app_client.call("xyz") + assert xyz_result.return_value == list("XYZ") + + xyz_raw_result = app_client.call("xyz_raw") + assert xyz_raw_result.return_value == list("XYZ") diff --git a/tests/test_awst/module.test b/tests/test_awst/module.test index 23ef8f0a03..8f9ba61040 100644 --- a/tests/test_awst/module.test +++ b/tests/test_awst/module.test @@ -70,29 +70,30 @@ class NotAllowed(AllowedStruct): ## E: Struct classes must only inherit directly b: UInt64 ## case: allowed_struct_types -from algopy import Address, BigUInt, Bytes, Struct, UInt64 +from algopy import Account, BigUInt, Bytes, Struct, UInt64 class MyStruct(Struct): allowed_uint64: UInt64 allowed_Bytes: Bytes allowed_biguint: BigUInt - allowed_address: Address + allowed_account: Account allowed_bool: bool ## case: not_allowed_struct_types from algopy import Struct +# TODO: fix error messages for these cases class NotAllowedBytes(Struct): - not_allowed_bytes: bytes ## E: Unsupported type: builtins.bytes + not_allowed_bytes: bytes ## E: Unhandled algopy name: builtins.bytes class NotAllowedStr(Struct): - not_allowed_str: str ## E: Unsupported type: builtins.str + not_allowed_str: str ## E: Unhandled algopy name: builtins.str class NotAllowedFloat(Struct): - not_allowed_float: float ## E: Unsupported type: builtins.float + not_allowed_float: float ## E: Unhandled algopy name: builtins.float class NotAllowedInt(Struct): - not_allowed_int: int ## E: Unsupported type: builtins.int + not_allowed_int: int ## E: Unhandled algopy name: builtins.int ## case: not_allowed_struct_statements from algopy import Struct, UInt64 @@ -219,4 +220,4 @@ class MyContract(MyContractBase): @subroutine def get_value(self) -> UInt64: - return UInt64(1) \ No newline at end of file + return UInt64(1) diff --git a/tests/test_execution.py b/tests/test_execution.py index a99bf1461c..c8c4603b63 100644 --- a/tests/test_execution.py +++ b/tests/test_execution.py @@ -5,7 +5,7 @@ import os import re import typing -from collections.abc import Sequence +from collections.abc import Callable, Iterable, Sequence from pathlib import Path from tempfile import TemporaryDirectory from textwrap import dedent @@ -19,21 +19,19 @@ LogicError, Program, execute_atc_with_logic_error, - get_algod_client, - get_default_localnet_config, - get_localnet_default_account, ) from algosdk import constants, transaction from algosdk.atomic_transaction_composer import AtomicTransactionComposer, TransactionWithSigner from algosdk.transaction import ApplicationCallTxn, ApplicationCreateTxn, OnComplete, StateSchema from algosdk.v2client.algod import AlgodClient from algosdk.v2client.models import SimulateRequest, SimulateTraceConfig +from nacl.signing import SigningKey +from wyvern.avm_type import AVMType from wyvern.awst_build.main import transform_ast from wyvern.codegen.emitprogram import CompiledContract, CompiledProgram from wyvern.codegen.teal_annotaters import AlignedWriter from wyvern.compile import awst_to_teal, parse_with_mypy -from wyvern.ir.models import ContractState -from wyvern.ir.types_ import AVMType +from wyvern.metadata import ContractMetaData, ContractState from wyvern.options import WyvernOptions VCS_ROOT = Path(__file__).parent.parent @@ -77,52 +75,6 @@ def encode_utf8(value: str) -> str: return encode_bytes(value.encode("utf8")) -@pytest.fixture(scope="session") -def algod_client() -> AlgodClient: - return get_algod_client(get_default_localnet_config("algod")) - - -@pytest.fixture(scope="session") -def account(algod_client: AlgodClient) -> Account: - return get_localnet_default_account(algod_client) - - -@pytest.fixture(scope="session") -def asset_a(algod_client: AlgodClient, account: Account) -> int: - return create_asset(algod_client, account, "a") - - -@pytest.fixture(scope="session") -def asset_b(algod_client: AlgodClient, account: Account) -> int: - return create_asset(algod_client, account, "b") - - -def create_asset(algod_client: AlgodClient, account: Account, asset_unit: str) -> int: - sp = algod_client.suggested_params() - atc = AtomicTransactionComposer() - atc.add_transaction( - TransactionWithSigner( - transaction.AssetCreateTxn( # type: ignore[no-untyped-call] - account.address, - sp, - 10_000_000, - 0, - default_frozen=False, - asset_name=f"asset {asset_unit}", - unit_name=asset_unit, - ), - signer=account.signer, - ) - ) - response = atc.execute(algod_client, 4) - txn_id = response.tx_ids[0] - result = algod_client.pending_transaction_info(txn_id) - assert isinstance(result, dict) - asset_index = result["asset-index"] - assert isinstance(asset_index, int) - return asset_index - - @attrs.define(kw_only=True) class Compilation: contract: CompiledContract @@ -134,9 +86,9 @@ class Compilation: def assemble_src(contract: CompiledContract, client: AlgodClient) -> Compilation: def state_to_schema(state: Sequence[ContractState]) -> StateSchema: - return StateSchema( # type: ignore[no-untyped-call] - num_uints=sum(1 for x in state if x.type == AVMType.uint64), - num_byte_slices=sum(1 for x in state if x.type == AVMType.bytes), + return StateSchema( + num_uints=sum(1 for x in state if x.storage_type is AVMType.uint64), + num_byte_slices=sum(1 for x in state if x.storage_type is AVMType.bytes), ) assert contract.approval_program.debug_src is not None @@ -147,8 +99,8 @@ def state_to_schema(state: Sequence[ContractState]) -> StateSchema: contract=contract, approval=approval_program, clear=clear_program, - local_schema=state_to_schema(contract.local_state), - global_schema=state_to_schema(contract.global_state), + local_schema=state_to_schema(contract.metadata.local_state), + global_schema=state_to_schema(contract.metadata.global_state), ) return compilation @@ -157,14 +109,22 @@ def state_to_schema(state: Sequence[ContractState]) -> StateSchema: @attrs.frozen -class AppCallRequest: +class AppTransactionParameters: args: list[AppArgs] = attrs.field(factory=list) accounts: list[str] | None = None assets: list[int] | None = None on_complete: OnComplete = OnComplete.NoOpOC + sp: transaction.SuggestedParams | None = None + + +GroupTransactionsProvider: typing.TypeAlias = Callable[[int], Iterable[TransactionWithSigner]] + + +@attrs.frozen +class AppCallRequest(AppTransactionParameters): increase_budget: int = 0 trace_output: Path | None = None - sp: transaction.SuggestedParams | None = None + group_transactions: GroupTransactionsProvider | None = None def get_trace_output_path_for_level(self, opt_level: int) -> Path | None: path = self.trace_output @@ -219,47 +179,50 @@ def __init__( def add_deployment_transaction( self, - args: list[AppArgs], - accounts: list[str] | None = None, - on_complete: OnComplete = OnComplete.NoOpOC, + request: AppTransactionParameters, ) -> typing.Self: self.atc.add_transaction( TransactionWithSigner( - txn=ApplicationCreateTxn( # type: ignore[no-untyped-call] - sender=self.sender, - sp=self.sp, - on_complete=on_complete, - accounts=accounts, + txn=ApplicationCreateTxn( approval_program=self.compilation.approval.raw_binary, clear_program=self.compilation.clear.raw_binary, - app_args=args, local_schema=self.compilation.local_schema, global_schema=self.compilation.global_schema, + **self._txn_args_from_request(request), ), signer=self.signer, ) ) return self + def _txn_args_from_request(self, request: AppTransactionParameters) -> dict[str, object]: + return { + "sender": self.sender, + "sp": request.sp or self.sp, + "on_complete": request.on_complete, + "accounts": request.accounts, + "foreign_assets": request.assets, + "app_args": request.args, + } + + def add_transactions( + self, *, app_id: int, get_group_transactions: GroupTransactionsProvider | None + ) -> typing.Self: + if get_group_transactions: + for txn in get_group_transactions(app_id): + self.atc.add_transaction(txn) + return self + def add_app_call_transaction( self, app_id: int, - args: list[AppArgs], - on_complete: OnComplete, - accounts: list[str] | None = None, - assets: list[int] | None = None, - sp: transaction.SuggestedParams | None = None, + request: AppTransactionParameters, ) -> typing.Self: self.atc.add_transaction( TransactionWithSigner( - txn=ApplicationCallTxn( # type: ignore[no-untyped-call] - sender=self.sender, - sp=sp or self.sp, + txn=ApplicationCallTxn( index=app_id, - on_complete=on_complete, - app_args=args, - accounts=accounts, - foreign_assets=assets, + **self._txn_args_from_request(request), ), signer=self.signer, ) @@ -269,7 +232,7 @@ def add_app_call_transaction( def add_fund_transaction(self, app_id: int, micro_algos: int) -> typing.Self: self.atc.add_transaction( TransactionWithSigner( - txn=transaction.PaymentTxn( # type: ignore[no-untyped-call] + txn=transaction.PaymentTxn( sender=self.sender, receiver=algosdk.logic.get_application_address(app_id), amt=micro_algos, @@ -284,7 +247,11 @@ def add_op_ups(self, *, count: int) -> typing.Self: for idx in range(count): assert self.op_up_app_id is not None self.add_app_call_transaction( - app_id=self.op_up_app_id, args=[idx], on_complete=OnComplete.NoOpOC + app_id=self.op_up_app_id, + request=AppTransactionParameters( + args=[idx], + on_complete=OnComplete.NoOpOC, + ), ) return self @@ -351,7 +318,17 @@ def _write_trace_to_file( def map_stack_addition(value: dict[str, typing.Any]) -> int | str: match value["type"]: case 1: - return str(value.get("bytes", "")) + b64 = value.get("bytes") + if b64 is None: + return "0x" + try: + utf8 = decode_utf8(b64) + except UnicodeDecodeError: + pass + else: + if utf8.isprintable(): + return f'"{utf8}"' + return "0x" + decode_bytes(b64).hex().upper() case 2: return int(value.get("uint", 0)) case _: @@ -438,9 +415,8 @@ def deploy( o_level_deploy_results = { o_level: ( self._new_runner(compilation) - .add_deployment_transaction( - args=request.args, on_complete=request.on_complete, accounts=request.accounts - ) + .add_transactions(app_id=0, get_group_transactions=request.group_transactions) + .add_deployment_transaction(request) .add_op_ups(count=request.increase_budget) .run(trace_path=request.get_trace_output_path_for_level(o_level)) ) @@ -467,13 +443,13 @@ def call(self, request: AppCallRequest) -> AppCallResult: o_level_results = { o_level: ( self._new_runner(compilation) + .add_transactions( + app_id=self._app_ids_by_level[o_level], + get_group_transactions=request.group_transactions, + ) .add_app_call_transaction( app_id=self._app_ids_by_level[o_level], - args=request.args, - on_complete=request.on_complete, - accounts=request.accounts, - assets=request.assets, - sp=request.sp, + request=request, ) .add_op_ups(count=request.increase_budget) .run(trace_path=request.get_trace_output_path_for_level(o_level)) @@ -514,19 +490,26 @@ def no_op_app_id(algod_client: AlgodClient, account: Account, worker_id: str) -> debug_src=src, ) contract = CompiledContract( - name="", approval_program=teal_always_approve, clear_program=teal_always_approve, - description=None, - name_override=None, - global_state=[], - local_state=[], + metadata=ContractMetaData( + module_name="", + class_name="", + description=None, + name_override=None, + global_state=[], + local_state=[], + is_arc4=False, + methods=[], + ), ) compilation = assemble_src(contract=contract, client=algod_client) result = ( ATCRunner(client=algod_client, account=account, compilation=compilation) .add_deployment_transaction( - args=[worker_id], # this ensures a unique instance per parallel test run + AppTransactionParameters( + args=[worker_id], # this ensures a unique instance per parallel test run + ), ) .run(trace_path=None) ) @@ -740,7 +723,7 @@ def test_simplish(harness: _TestHarness) -> None: def test_address(harness: _TestHarness) -> None: result = harness.deploy(EXAMPLES_DIR / "address_constant.py") - sender_bytes = algosdk.encoding.decode_address(harness.sender) # type: ignore[no-untyped-call] + sender_bytes = algosdk.encoding.decode_address(harness.sender) assert result.decode_logs("b") == [sender_bytes] @@ -885,11 +868,51 @@ def test_augmented_assignment_with_side_effects(harness: _TestHarness) -> None: assert result.decode_logs("i") == [1] -def test_abi(harness: _TestHarness) -> None: +def test_abi_string(harness: _TestHarness) -> None: + harness.deploy( + EXAMPLES_DIR / "arc4_types" / "string.py", + AppCallRequest(trace_output=EXAMPLES_DIR / "arc4_types" / "out" / "string.log"), + ) + + +def test_abi_numeric(harness: _TestHarness) -> None: + harness.deploy( + EXAMPLES_DIR / "arc4_types" / "numeric.py", + AppCallRequest(trace_output=EXAMPLES_DIR / "arc4_types" / "out" / "numeric.log"), + ) + + +def test_abi_array(harness: _TestHarness) -> None: + harness.deploy( + EXAMPLES_DIR / "arc4_types" / "array.py", + AppCallRequest(trace_output=EXAMPLES_DIR / "arc4_types" / "out" / "array.log"), + ) + + +def test_abi_bool(harness: _TestHarness) -> None: harness.deploy( - EXAMPLES_DIR / "abi_types", - AppCallRequest(trace_output=EXAMPLES_DIR / "abi_types" / "out" / "abi_types.log"), + EXAMPLES_DIR / "arc4_types" / "bool.py", + AppCallRequest(trace_output=EXAMPLES_DIR / "arc4_types" / "out" / "bool.log"), + ) + + +def test_abi_tuple(harness: _TestHarness) -> None: + harness.deploy( + EXAMPLES_DIR / "arc4_types" / "tuples.py", + AppCallRequest(trace_output=EXAMPLES_DIR / "arc4_types" / "out" / "tuples.log"), + ) + + +def test_abi_struct(harness: _TestHarness) -> None: + result = harness.deploy( + EXAMPLES_DIR / "arc4_types" / "structs.py", + AppCallRequest(trace_output=EXAMPLES_DIR / "arc4_types" / "out" / "structs.log"), ) + x, y, z = result.decode_logs("bbb") + + assert x == 0x1079F7E42E.to_bytes(8, "big") + assert y == 0x4607097084.to_bytes(8, "big") + assert z == 0b10100000.to_bytes() @pytest.mark.parametrize( @@ -1008,3 +1031,57 @@ def test_asset(harness: _TestHarness, asset_a: int, asset_b: int) -> None: harness.call(AppCallRequest(args=[b"is_opted_in"], assets=[asset_a])) with pytest.raises(LogicError, match=re.escape("asset self.asa == asset")): harness.call(AppCallRequest(args=[b"is_opted_in"], assets=[asset_b])) + + +def test_verify(harness: _TestHarness) -> None: + key = SigningKey.generate() + data = b"random bytes" + sig = key.sign(data).signature + public_key = key.verify_key.encode() + + result = harness.deploy( + EXAMPLES_DIR / "edverify", + AppCallRequest( + args=[data, sig, public_key], + increase_budget=4, + ), + ) + (verify_outcome,) = result.decode_logs("i") + + assert verify_outcome == 1 + + +def test_application(harness: _TestHarness) -> None: + harness.deploy(EXAMPLES_DIR / "application") + + harness.call(AppCallRequest(args=[b"validate"])) + + +def test_conditional_execution(harness: _TestHarness) -> None: + harness.deploy( + EXAMPLES_DIR / "conditional_execution", + request=AppCallRequest( + trace_output=EXAMPLES_DIR / "conditional_execution" / "out" / "trace.log" + ), + ) + + +def test_ignored_value(harness: _TestHarness) -> None: + def test() -> None: + from algopy import Contract, subroutine + + class Silly(Contract): + def approval_program(self) -> bool: + True # noqa: B018 + self.silly() + return True + + @subroutine + def silly(self) -> bool: + True # noqa: B018 + return True + + def clear_state_program(self) -> bool: + return True + + harness.deploy_from_closure(test)