From cd2dbd1218a50303ef88b483f1b279e3c1f9e86f Mon Sep 17 00:00:00 2001 From: Daniel McGregor Date: Thu, 31 Oct 2024 21:26:51 +0800 Subject: [PATCH] feat: add support for AVM version 11 --- examples/sizes.txt | 4 +- langspec.json | 946 +++++++++- langspec.puya.json | 877 +++++++--- scripts/generate_avm_ops.py | 12 +- scripts/generate_stubs.py | 27 +- scripts/transform_lang_spec.py | 10 +- src/puya/algo_constants.py | 4 +- src/puya/awst/nodes.py | 12 + src/puya/compile.py | 2 +- src/puya/ir/avm_ops.py | 1518 ++++++++++++++++- src/puya/ir/avm_ops_models.py | 2 + src/puya/ir/main.py | 8 +- src/puya/ir/models.py | 3 +- src/puya/ir/validation/_base.py | 18 +- .../validation/min_avm_version_validator.py | 19 +- src/puya/mir/main.py | 1 + src/puya/mir/models.py | 1 + src/puya/options.py | 4 +- src/puya/teal/main.py | 6 +- src/puya/teal/models.py | 2 +- src/puya/teal/output.py | 2 +- src/puya/ussemble/assemble.py | 2 +- src/puya/ussemble/op_spec.py | 35 +- src/puyapy/__main__.py | 6 +- src/puyapy/awst_build/contract.py | 1 + src/puyapy/awst_build/intrinsic_data.py | 209 +++ src/puyapy/awst_build/module.py | 40 +- src/puyapy/compile.py | 2 +- src/puyapy/models.py | 1 + stubs/algopy-stubs/_contract.pyi | 4 + stubs/algopy-stubs/_logic_sig.pyi | 6 +- stubs/algopy-stubs/op.pyi | 187 ++ stubs/pyproject.toml | 2 +- test_cases/avm_11/contract.py | 42 + test_cases/avm_11/out/Contract.approval.teal | 158 ++ test_cases/avm_11/out/Contract.arc32.json | 50 + test_cases/avm_11/out/Contract.clear.teal | 5 + .../avm_11/out/Contract.destructured.ir | 84 + test_cases/avm_11/out/Contract.ssa.ir | 127 ++ .../avm_11/out/Contract.ssa.opt_pass_1.ir | 87 + .../avm_11/out/Contract.ssa.opt_pass_2.ir | 84 + .../avm_11/out/avm_11_sig.destructured.ir | 6 + test_cases/avm_11/out/avm_11_sig.mir | 11 + test_cases/avm_11/out/avm_11_sig.ssa.ir | 6 + test_cases/avm_11/out/avm_11_sig.teal | 9 + test_cases/avm_11/out/client_Contract.py | 13 + test_cases/avm_11/out/module.awst | 50 + .../avm_11/out_O2/Contract.approval.teal | 107 ++ test_cases/avm_11/out_O2/Contract.clear.teal | 5 + .../avm_11/out_O2/Contract.destructured.ir | 84 + .../avm_11/out_O2/avm_11_sig.destructured.ir | 6 + test_cases/avm_11/out_O2/avm_11_sig.teal | 7 + .../out_unoptimized/Contract.approval.teal | 205 +++ .../out_unoptimized/Contract.clear.teal | 5 + .../out_unoptimized/Contract.destructured.ir | 111 ++ .../avm_11_sig.destructured.ir | 6 + .../avm_11/out_unoptimized/avm_11_sig.teal | 9 + test_cases/avm_11/puya.log | 764 +++++++++ tests/test_assemble.py | 2 +- 59 files changed, 5684 insertions(+), 332 deletions(-) create mode 100644 test_cases/avm_11/contract.py create mode 100644 test_cases/avm_11/out/Contract.approval.teal create mode 100644 test_cases/avm_11/out/Contract.arc32.json create mode 100644 test_cases/avm_11/out/Contract.clear.teal create mode 100644 test_cases/avm_11/out/Contract.destructured.ir create mode 100644 test_cases/avm_11/out/Contract.ssa.ir create mode 100644 test_cases/avm_11/out/Contract.ssa.opt_pass_1.ir create mode 100644 test_cases/avm_11/out/Contract.ssa.opt_pass_2.ir create mode 100644 test_cases/avm_11/out/avm_11_sig.destructured.ir create mode 100644 test_cases/avm_11/out/avm_11_sig.mir create mode 100644 test_cases/avm_11/out/avm_11_sig.ssa.ir create mode 100644 test_cases/avm_11/out/avm_11_sig.teal create mode 100644 test_cases/avm_11/out/client_Contract.py create mode 100644 test_cases/avm_11/out/module.awst create mode 100644 test_cases/avm_11/out_O2/Contract.approval.teal create mode 100644 test_cases/avm_11/out_O2/Contract.clear.teal create mode 100644 test_cases/avm_11/out_O2/Contract.destructured.ir create mode 100644 test_cases/avm_11/out_O2/avm_11_sig.destructured.ir create mode 100644 test_cases/avm_11/out_O2/avm_11_sig.teal create mode 100644 test_cases/avm_11/out_unoptimized/Contract.approval.teal create mode 100644 test_cases/avm_11/out_unoptimized/Contract.clear.teal create mode 100644 test_cases/avm_11/out_unoptimized/Contract.destructured.ir create mode 100644 test_cases/avm_11/out_unoptimized/avm_11_sig.destructured.ir create mode 100644 test_cases/avm_11/out_unoptimized/avm_11_sig.teal create mode 100644 test_cases/avm_11/puya.log diff --git a/examples/sizes.txt b/examples/sizes.txt index 2fcbd621de..705c9cfc06 100644 --- a/examples/sizes.txt +++ b/examples/sizes.txt @@ -24,6 +24,8 @@ asset/Reference 268 261 - | 144 141 - auction/Auction 592 522 - | 328 281 - augmented_assignment/Augmented 151 156 - | 77 78 - + avm_11 197 149 - | 129 92 - + avm_11/avm_11_sig 6 - - | 4 - - avm_types_in_abi/Test 386 317 - | 237 178 - biguint_binary_ops/BiguintBinaryOps 186 77 - | 100 20 - boolean_binary_ops/BooleanBinaryOps 1124 471 - | 680 258 - @@ -130,4 +132,4 @@ unssa/UnSSA 432 368 - | 241 204 - voting/VotingRoundApp 1593 1483 - | 734 649 - with_reentrancy/WithReentrancy 255 242 - | 132 122 - - Total 69200 53576 53517 | 32843 21764 21720 \ No newline at end of file + Total 69403 53731 53672 | 32976 21860 21816 \ No newline at end of file diff --git a/langspec.json b/langspec.json index e22d04212d..43d5d2e526 100644 --- a/langspec.json +++ b/langspec.json @@ -1,5 +1,5 @@ { - "Version": 10, + "Version": 11, "LogicSigVersion": 10, "NamedTypes": [ { @@ -217,6 +217,10 @@ 0, 0 ], + "ArgEnumVersion": [ + 5, + 7 + ], "DocCost": "Secp256k1=1700; Secp256r1=2500", "Doc": "for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey =\u003e {0 or 1}", "DocExtra": "The 32 byte Y-component of a public key is the last element on the stack, preceded by X-component of a pubkey, preceded by S and R components of a signature, preceded by the data that is fifth element on the stack. All values are big-endian encoded. The signed data must be 32 bytes long, and signatures in lower-S form are only accepted.", @@ -262,6 +266,10 @@ 0, 0 ], + "ArgEnumVersion": [ + 5, + 7 + ], "DocCost": "Secp256k1=650; Secp256r1=2400", "Doc": "decompress pubkey A into components X, Y", "DocExtra": "The 33 byte public key in a compressed form to be decompressed into X and Y (top) components. All values are big-endian encoded.", @@ -310,6 +318,10 @@ 0, 0 ], + "ArgEnumVersion": [ + 5, + 7 + ], "DocCost": "2000", "Doc": "for (data A, recovery id B, signature C, D) recover a public key", "DocExtra": "S (top) and R elements of a signature, recovery id and data (bottom) are expected on the stack and used to deriver a public key. All values are big-endian encoded. The signed data must be 32 bytes long.", @@ -1475,6 +1487,76 @@ 3, 3 ], + "ArgEnumVersion": [ + 0, + 0, + 0, + 7, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 7, + 7, + 7, + 7 + ], "DocCost": "1", "Doc": "field F of current transaction", "ImmediateNote": [ @@ -1517,7 +1599,12 @@ "CallerApplicationAddress", "AssetCreateMinBalance", "AssetOptInMinBalance", - "GenesisHash" + "GenesisHash", + "PayoutsEnabled", + "PayoutsGoOnlineFee", + "PayoutsPercent", + "PayoutsMinBalance", + "PayoutsMaxBalance" ], "ArgEnumDoc": [ "microalgos", @@ -1537,7 +1624,12 @@ "The application address of the application that called this application. ZeroAddress if this application is at the top-level. Application mode only.", "The additional minimum balance required to create (and opt-in to) an asset.", "The additional minimum balance required to opt-in to an asset.", - "The Genesis Hash for the network." + "The Genesis Hash for the network.", + "Whether block proposal payouts are enabled.", + "The fee required in a keyreg transaction to make an account incentive eligible.", + "The percentage of transaction fees in a block that can be paid to the block proposer.", + "The minimum algo balance an account must have in the agreement round to receive block payouts in the proposal round.", + "The maximum algo balance an account can have in the agreement round to receive block payouts in the proposal round." ], "ArgEnumTypes": [ "uint64", @@ -1557,7 +1649,12 @@ "address", "uint64", "uint64", - "[32]byte" + "[32]byte", + "bool", + "uint64", + "uint64", + "uint64", + "uint64" ], "ArgEnumBytes": [ 0, @@ -1577,7 +1674,12 @@ 14, 15, 16, - 17 + 17, + 18, + 19, + 20, + 21, + 22 ], "ArgModes": [ 3, @@ -1597,8 +1699,38 @@ 2, 3, 3, + 3, + 3, + 3, + 3, + 3, 3 ], + "ArgEnumVersion": [ + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 3, + 5, + 5, + 6, + 6, + 6, + 10, + 10, + 10, + 11, + 11, + 11, + 11, + 11 + ], "DocCost": "1", "Doc": "global field F", "ImmediateNote": [ @@ -1973,6 +2105,76 @@ 3, 3 ], + "ArgEnumVersion": [ + 0, + 0, + 0, + 7, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 7, + 7, + 7, + 7 + ], "DocCost": "1", "Doc": "field F of the Tth transaction in the current group", "DocExtra": "for notes on transaction fields available, see `txn`. If this transaction is _i_ in the group, `gtxn i field` is equivalent to `txn field`.", @@ -2094,6 +2296,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Ith value of the array field F of the current transaction\n`txna` can be called using `txn` with 2 immediates.", "ImmediateNote": [ @@ -2168,6 +2379,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Ith value of the array field F from the Tth transaction in the current group\n`gtxna` can be called using `gtxn` with 3 immediates.", "ImmediateNote": [ @@ -2555,65 +2775,135 @@ 3, 3 ], - "DocCost": "1", - "Doc": "field F of the Ath transaction in the current group", - "DocExtra": "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.", - "ImmediateNote": [ - { - "Comment": "transaction field index", - "Encoding": "uint8", - "Name": "F", - "Reference": "txn" - } - ], - "IntroducedVersion": 3, - "Groups": [ - "Loading Values" - ], - "Modes": 3 - }, - { - "Opcode": 57, - "Name": "gtxnsa", - "Cost": "1", - "Args": [ - "uint64" - ], - "Returns": [ - "any" - ], - "Size": 3, - "ArgEnum": [ - "ApplicationArgs", - "Accounts", - "Assets", - "Applications", - "Logs", - "ApprovalProgramPages", - "ClearStateProgramPages" - ], - "ArgEnumDoc": [ - "Arguments passed to the application in the ApplicationCall transaction", - "Accounts listed in the ApplicationCall transaction", - "Foreign Assets listed in the ApplicationCall transaction", - "Foreign Apps listed in the ApplicationCall transaction", - "Log messages emitted by an application call (only with `itxn` in v5). Application mode only", - "Approval Program as an array of pages", - "ClearState Program as an array of pages" - ], - "ArgEnumTypes": [ - "[]byte", - "address", - "uint64", - "uint64", - "[]byte", - "[]byte", - "[]byte" - ], - "ArgEnumBytes": [ - 26, - 28, - 48, + "ArgEnumVersion": [ + 0, + 0, + 0, + 7, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 7, + 7, + 7, + 7 + ], + "DocCost": "1", + "Doc": "field F of the Ath transaction in the current group", + "DocExtra": "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.", + "ImmediateNote": [ + { + "Comment": "transaction field index", + "Encoding": "uint8", + "Name": "F", + "Reference": "txn" + } + ], + "IntroducedVersion": 3, + "Groups": [ + "Loading Values" + ], + "Modes": 3 + }, + { + "Opcode": 57, + "Name": "gtxnsa", + "Cost": "1", + "Args": [ + "uint64" + ], + "Returns": [ + "any" + ], + "Size": 3, + "ArgEnum": [ + "ApplicationArgs", + "Accounts", + "Assets", + "Applications", + "Logs", + "ApprovalProgramPages", + "ClearStateProgramPages" + ], + "ArgEnumDoc": [ + "Arguments passed to the application in the ApplicationCall transaction", + "Accounts listed in the ApplicationCall transaction", + "Foreign Assets listed in the ApplicationCall transaction", + "Foreign Apps listed in the ApplicationCall transaction", + "Log messages emitted by an application call (only with `itxn` in v5). Application mode only", + "Approval Program as an array of pages", + "ClearState Program as an array of pages" + ], + "ArgEnumTypes": [ + "[]byte", + "address", + "uint64", + "uint64", + "[]byte", + "[]byte", + "[]byte" + ], + "ArgEnumBytes": [ + 26, + 28, + 48, 50, 58, 64, @@ -2628,6 +2918,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Ith value of the array field F from the Ath transaction in the current group\n`gtxnsa` can be called using `gtxns` with 2 immediates.", "ImmediateNote": [ @@ -3480,6 +3779,10 @@ 0, 0 ], + "ArgEnumVersion": [ + 6, + 6 + ], "DocCost": "1 + 1 per 16 bytes of A", "Doc": "decode A which was base64-encoded using _encoding_ E. Fail if A is not base64 encoded with encoding E", "DocExtra": "*Warning*: Usage should be restricted to very rare use cases. In almost all cases, smart contracts should directly handle non-encoded byte-strings.\tThis opcode should only be used in cases where base64 is the only available option, e.g. interoperability with a third-party that only signs base64 strings.\n\n Decodes A using the base64 encoding E. Specify the encoding with an immediate arg either as URL and Filename Safe (`URLEncoding`) or Standard (`StdEncoding`). See [RFC 4648 sections 4 and 5](https://rfc-editor.org/rfc/rfc4648.html#section-4). It is assumed that the encoding ends with the exact number of `=` padding characters as required by the RFC. When padding occurs, any unused pad bits in the encoding must be set to zero or the decoding will fail. The special cases of `\\n` and `\\r` are allowed but completely ignored. An error will result when attempting to decode a string with a character that is not in the encoding alphabet or not one of `=`, `\\r`, or `\\n`.", @@ -3534,6 +3837,11 @@ 0, 0 ], + "ArgEnumVersion": [ + 7, + 7, + 7 + ], "DocCost": "25 + 2 per 7 bytes of A", "Doc": "key B's value, of type R, from a [valid](jsonspec.md) utf-8 encoded json object A", "DocExtra": "*Warning*: Usage should be restricted to very rare use cases, as JSON decoding is expensive and quite limited. In addition, JSON objects are large and not optimized for size.\n\nAlmost all smart contracts should use simpler and smaller methods (such as the [ABI](https://arc.algorand.foundation/ARCs/arc-0004). This opcode should only be used in cases where JSON is only available option, e.g. when a third-party only signs JSON.", @@ -3782,6 +4090,10 @@ 0, 0 ], + "ArgEnumVersion": [ + 2, + 2 + ], "DocCost": "1", "Doc": "X is field F from account A's holding of asset B. Y is 1 if A is opted into B, else 0", "DocExtra": "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.", @@ -3881,6 +4193,20 @@ 0, 0 ], + "ArgEnumVersion": [ + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 5 + ], "DocCost": "1", "Doc": "X is field F from asset A. Y is 1 if A exists, else 0", "DocExtra": "params: Txn.ForeignAssets offset (or, since v4, an _available_ asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value.", @@ -3965,6 +4291,17 @@ 0, 0 ], + "ArgEnumVersion": [ + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5 + ], "DocCost": "1", "Doc": "X is field F from app A. Y is 1 if A exists, else 0", "DocExtra": "params: Txn.ForeignApps offset or an _available_ app id. Return: did_exist flag (1 if the application existed and 0 otherwise), value.", @@ -4006,7 +4343,10 @@ "AcctTotalAssetsCreated", "AcctTotalAssets", "AcctTotalBoxes", - "AcctTotalBoxBytes" + "AcctTotalBoxBytes", + "AcctIncentiveEligible", + "AcctLastProposed", + "AcctLastHeartbeat" ], "ArgEnumDoc": [ "Account balance in microalgos", @@ -4020,7 +4360,10 @@ "The number of existing ASAs created by this account.", "The numbers of ASAs held by this account (including ASAs this account created).", "The number of existing boxes created by this account's app.", - "The total number of bytes used by this account's app's box keys and values." + "The total number of bytes used by this account's app's box keys and values.", + "Has this account opted into block payouts", + "The round number of the last block this account proposed.", + "The round number of the last block this account sent a heartbeat." ], "ArgEnumTypes": [ "uint64", @@ -4034,6 +4377,9 @@ "uint64", "uint64", "uint64", + "uint64", + "bool", + "uint64", "uint64" ], "ArgEnumBytes": [ @@ -4048,7 +4394,10 @@ 8, 9, 10, - 11 + 11, + 12, + 13, + 14 ], "ArgModes": [ 0, @@ -4062,8 +4411,28 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], + "ArgEnumVersion": [ + 6, + 6, + 6, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 8, + 11, + 11, + 11 + ], "DocCost": "1", "Doc": "X is field F from account A. Y is 1 if A owns positive algos, else 0", "ImmediateNote": [ @@ -4080,6 +4449,74 @@ ], "Modes": 2 }, + { + "Opcode": 116, + "Name": "voter_params_get", + "Cost": "1", + "Args": [ + "any" + ], + "Returns": [ + "any", + "bool" + ], + "Size": 2, + "ArgEnum": [ + "VoterBalance", + "VoterIncentiveEligible" + ], + "ArgEnumDoc": [ + "Online stake in microalgos", + "Had this account opted into block payouts" + ], + "ArgEnumTypes": [ + "uint64", + "bool" + ], + "ArgEnumBytes": [ + 0, + 1 + ], + "ArgModes": [ + 2, + 2 + ], + "ArgEnumVersion": [ + 6, + 11 + ], + "DocCost": "1", + "Doc": "X is field F from online account A as of the balance round: 320 rounds before the current round. Y is 1 if A had positive algos online in the agreement round, else Y is 0 and X is a type specific zero-value", + "ImmediateNote": [ + { + "Comment": "voter params field index", + "Encoding": "uint8", + "Name": "F", + "Reference": "voter_params" + } + ], + "IntroducedVersion": 11, + "Groups": [ + "State Access" + ], + "Modes": 2 + }, + { + "Opcode": 117, + "Name": "online_stake", + "Cost": "1", + "Returns": [ + "uint64" + ], + "Size": 1, + "DocCost": "1", + "Doc": "the total online stake in the agreement round", + "IntroducedVersion": 11, + "Groups": [ + "State Access" + ], + "Modes": 2 + }, { "Opcode": 120, "Name": "min_balance", @@ -4211,6 +4648,46 @@ ], "Modes": 3 }, + { + "Opcode": 133, + "Name": "falcon_verify", + "Cost": "1700", + "Args": [ + "[]byte", + "[1232]byte", + "[1793]byte" + ], + "Returns": [ + "bool" + ], + "Size": 1, + "DocCost": "1700", + "Doc": "for (data A, compressed-format signature B, pubkey C) verify the signature of data against the pubkey", + "IntroducedVersion": 11, + "Groups": [ + "Cryptography" + ], + "Modes": 3 + }, + { + "Opcode": 134, + "Name": "sumhash512", + "Cost": "150 + 7 per 4 bytes of A", + "Args": [ + "[]byte" + ], + "Returns": [ + "[64]byte" + ], + "Size": 1, + "DocCost": "150 + 7 per 4 bytes of A", + "Doc": "sumhash512 of value A, yields [64]byte", + "IntroducedVersion": 11, + "Groups": [ + "Cryptography" + ], + "Modes": 3 + }, { "Opcode": 136, "Name": "callsub", @@ -5162,7 +5639,60 @@ 3, 3, 3, - 3 + 3 + ], + "ArgEnumVersion": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 5, + 6, + 7, + 7 ], "DocCost": "1", "Doc": "set field F of the current inner transaction to A", @@ -5553,6 +6083,76 @@ 3, 3 ], + "ArgEnumVersion": [ + 0, + 0, + 0, + 7, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 7, + 7, + 7, + 7 + ], "DocCost": "1", "Doc": "field F of the last inner transaction", "ImmediateNote": [ @@ -5622,6 +6222,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Ith value of the array field F of the last inner transaction", "ImmediateNote": [ @@ -6015,6 +6624,76 @@ 3, 3 ], + "ArgEnumVersion": [ + 0, + 0, + 0, + 7, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 4, + 5, + 5, + 5, + 5, + 5, + 6, + 6, + 7, + 7, + 7, + 7 + ], "DocCost": "1", "Doc": "field F of the Tth transaction in the last inner group submitted", "ImmediateNote": [ @@ -6089,6 +6768,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Ith value of the array field F from the Tth transaction in the last inner group submitted", "ImmediateNote": [ @@ -6309,6 +6997,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Ath value of the array field F of the current transaction", "ImmediateNote": [ @@ -6381,6 +7078,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Ath value of the array field F from the Tth transaction in the current group", "ImmediateNote": [ @@ -6459,6 +7165,15 @@ 3, 3 ], + "ArgEnumVersion": [ + 2, + 2, + 3, + 3, + 5, + 7, + 7 + ], "DocCost": "1", "Doc": "Bth value of the array field F from the Ath transaction in the current group", "ImmediateNote": [ @@ -6599,6 +7314,9 @@ "ArgModes": [ 0 ], + "ArgEnumVersion": [ + 7 + ], "DocCost": "5700", "Doc": "Verify the proof B of message A against pubkey C. Returns vrf output and verification flag.", "DocExtra": "`VrfAlgorand` is the VRF used in Algorand. It is ECVRF-ED25519-SHA512-Elligator2, specified in the IETF internet draft [draft-irtf-cfrg-vrf-03](https://datatracker.ietf.org/doc/draft-irtf-cfrg-vrf/03/).", @@ -6629,24 +7347,76 @@ "Size": 2, "ArgEnum": [ "BlkSeed", - "BlkTimestamp" + "BlkTimestamp", + "BlkProposer", + "BlkFeesCollected", + "BlkBonus", + "BlkBranch", + "BlkFeeSink", + "BlkProtocol", + "BlkTxnCounter", + "BlkProposerPayout" ], "ArgEnumDoc": [ + "", + "", + "", + "", + "", + "", + "", + "", "", "" ], "ArgEnumTypes": [ + "[32]byte", + "uint64", + "address", + "uint64", + "uint64", + "[32]byte", + "address", "[]byte", + "uint64", "uint64" ], "ArgEnumBytes": [ 0, - 1 + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 ], "ArgModes": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, 0, 0 ], + "ArgEnumVersion": [ + 7, + 7, + 11, + 11, + 11, + 11, + 11, + 11, + 11, + 11 + ], "DocCost": "1", "Doc": "field F of block A. Fail unless A falls between txn.LastValid-1002 and txn.FirstValid (exclusive)", "ImmediateNote": [ @@ -6736,6 +7506,12 @@ 0, 0 ], + "ArgEnumVersion": [ + 10, + 10, + 10, + 10 + ], "DocCost": "BN254g1=125; BN254g2=170; BLS12_381g1=205; BLS12_381g2=290", "Doc": "for curve points A and B, return the curve point A + B", "DocExtra": "A and B are curve points in affine representation: field element X concatenated with field element Y. Field element `Z` is encoded as follows.\nFor the base field elements (Fp), `Z` is encoded as a big-endian number and must be lower than the field modulus.\nFor the quadratic field extension (Fp2), `Z` is encoded as the concatenation of the individual encoding of the coefficients. For an Fp2 element of the form `Z = Z0 + Z1 i`, where `i` is a formal quadratic non-residue, the encoding of Z is the concatenation of the encoding of `Z0` and `Z1` in this order. (`Z0` and `Z1` must be less than the field modulus).\n\nThe point at infinity is encoded as `(X,Y) = (0,0)`.\nGroups G1 and G2 are denoted additively.\n\nFails if A or B is not in G.\nA and/or B are allowed to be the point at infinity.\nDoes _not_ check if A and B are in the main prime-order subgroup.", @@ -6789,6 +7565,12 @@ 0, 0 ], + "ArgEnumVersion": [ + 10, + 10, + 10, + 10 + ], "DocCost": "BN254g1=1810; BN254g2=3430; BLS12_381g1=2950; BLS12_381g2=6530", "Doc": "for curve point A and scalar B, return the curve point BA, the point A multiplied by the scalar B.", "DocExtra": "A is a curve point encoded and checked as described in `ec_add`. Scalar B is interpreted as a big-endian unsigned integer. Fails if B exceeds 32 bytes.", @@ -6842,6 +7624,12 @@ 0, 0 ], + "ArgEnumVersion": [ + 10, + 10, + 10, + 10 + ], "DocCost": "BN254g1=8000 + 7400 per 64 bytes of B; BN254g2=8000 + 7400 per 128 bytes of B; BLS12_381g1=13000 + 10000 per 96 bytes of B; BLS12_381g2=13000 + 10000 per 192 bytes of B", "Doc": "1 if the product of the pairing of each point in A with its respective point in B is equal to the identity element of the target group Gt, else 0", "DocExtra": "A and B are concatenated points, encoded and checked as described in `ec_add`. A contains points of the group G, B contains points of the associated group (G2 if G is G1, and vice versa). Fails if A and B have a different number of points, or if any point is not in its described group or outside the main prime-order subgroup - a stronger condition than other opcodes. AVM values are limited to 4096 bytes, so `ec_pairing_check` is limited by the size of the points in the groups being operated upon.", @@ -6895,6 +7683,12 @@ 0, 0 ], + "ArgEnumVersion": [ + 10, + 10, + 10, + 10 + ], "DocCost": "BN254g1=3600 + 90 per 32 bytes of B; BN254g2=7200 + 270 per 32 bytes of B; BLS12_381g1=6500 + 95 per 32 bytes of B; BLS12_381g2=14850 + 485 per 32 bytes of B", "Doc": "for curve points A and scalars B, return curve point B0A0 + B1A1 + B2A2 + ... + BnAn", "DocExtra": "A is a list of concatenated points, encoded and checked as described in `ec_add`. B is a list of concatenated scalars which, unlike ec_scalar_mul, must all be exactly 32 bytes long.\nThe name `ec_multi_scalar_mul` was chosen to reflect common usage, but a more consistent name would be `ec_multi_scalar_mul`. AVM values are limited to 4096 bytes, so `ec_multi_scalar_mul` is limited by the size of the points in the group being operated upon.", @@ -6947,6 +7741,12 @@ 0, 0 ], + "ArgEnumVersion": [ + 10, + 10, + 10, + 10 + ], "DocCost": "BN254g1=20; BN254g2=3100; BLS12_381g1=1850; BLS12_381g2=2340", "Doc": "1 if A is in the main prime-order subgroup of G (including the point at infinity) else 0. Program fails if A is not in G at all.", "ImmediateNote": [ @@ -6998,6 +7798,12 @@ 0, 0 ], + "ArgEnumVersion": [ + 10, + 10, + 10, + 10 + ], "DocCost": "BN254g1=630; BN254g2=3300; BLS12_381g1=1950; BLS12_381g2=8150", "Doc": "maps field element A to group G", "DocExtra": "BN254 points are mapped by the SVDW map. BLS12-381 points are mapped by the SSWU map.\nG1 element inputs are base field elements and G2 element inputs are quadratic field elements, with nearly the same encoding rules (for field elements) as defined in `ec_add`. There is one difference of encoding rule: G1 element inputs do not need to be 0-padded if they fit in less than 32 bytes for BN254 and less than 48 bytes for BLS12-381. (As usual, the empty byte array represents 0.) G2 elements inputs need to be always have the required size.", diff --git a/langspec.puya.json b/langspec.puya.json index 2cf952cc0e..e7ef1e7a4e 100644 --- a/langspec.puya.json +++ b/langspec.puya.json @@ -4079,6 +4079,49 @@ } ] }, + "falcon_verify": { + "name": "falcon_verify", + "code": 133, + "size": 1, + "doc": [ + "for (data A, compressed-format signature B, pubkey C) verify the signature of data against the pubkey" + ], + "cost": { + "value": 1700, + "doc": "1700" + }, + "min_avm_version": 11, + "halts": false, + "mode": "any", + "groups": [ + "Cryptography" + ], + "stack_inputs": [ + { + "name": "A", + "stack_type": "[]byte", + "doc": null + }, + { + "name": "B", + "stack_type": "[1232]byte", + "doc": null + }, + { + "name": "C", + "stack_type": "[1793]byte", + "doc": null + } + ], + "immediate_args": [], + "stack_outputs": [ + { + "name": "X", + "stack_type": "bool", + "doc": null + } + ] + }, "frame_bury": { "name": "frame_bury", "code": 140, @@ -5650,6 +5693,33 @@ } ] }, + "online_stake": { + "name": "online_stake", + "code": 117, + "size": 1, + "doc": [ + "the total online stake in the agreement round" + ], + "cost": { + "value": 1, + "doc": "1" + }, + "min_avm_version": 11, + "halts": false, + "mode": "app", + "groups": [ + "State Access" + ], + "stack_inputs": [], + "immediate_args": [], + "stack_outputs": [ + { + "name": "X", + "stack_type": "uint64", + "doc": null + } + ] + }, "pop": { "name": "pop", "code": 72, @@ -6522,6 +6592,39 @@ } ] }, + "sumhash512": { + "name": "sumhash512", + "code": 134, + "size": 1, + "doc": [ + "sumhash512 of value A, yields [64]byte" + ], + "cost": { + "value": null, + "doc": "150 + 7 per 4 bytes of A" + }, + "min_avm_version": 11, + "halts": false, + "mode": "any", + "groups": [ + "Cryptography" + ], + "stack_inputs": [ + { + "name": "A", + "stack_type": "[]byte", + "doc": null + } + ], + "immediate_args": [], + "stack_outputs": [ + { + "name": "X", + "stack_type": "[64]byte", + "doc": null + } + ] + }, "swap": { "name": "swap", "code": 76, @@ -6766,6 +6869,53 @@ } ] }, + "voter_params_get": { + "name": "voter_params_get", + "code": 116, + "size": 2, + "doc": [ + "X is field F from online account A as of the balance round: 320 rounds before the current round. Y is 1 if A had positive algos online in the agreement round, else Y is 0 and X is a type specific zero-value" + ], + "cost": { + "value": 1, + "doc": "1" + }, + "min_avm_version": 11, + "halts": false, + "mode": "app", + "groups": [ + "State Access" + ], + "stack_inputs": [ + { + "name": "A", + "stack_type": "any", + "doc": null + } + ], + "immediate_args": [ + { + "name": "F", + "immediate_type": "arg_enum", + "arg_enum": "voter_params", + "modifies_stack_input": null, + "modifies_stack_output": 0, + "doc": "voter params field index" + } + ], + "stack_outputs": [ + { + "name": "X", + "stack_type": "any", + "doc": null + }, + { + "name": "Y", + "stack_type": "bool", + "doc": null + } + ] + }, "vrf_verify": { "name": "vrf_verify", "code": 208, @@ -6941,84 +7091,120 @@ "doc": "Account balance in microalgos", "stack_type": "uint64", "mode": "app", - "value": 0 + "value": 0, + "min_avm_version": 6 }, { "name": "AcctMinBalance", "doc": "Minimum required balance for account, in microalgos", "stack_type": "uint64", "mode": "app", - "value": 1 + "value": 1, + "min_avm_version": 6 }, { "name": "AcctAuthAddr", "doc": "Address the account is rekeyed to.", "stack_type": "address", "mode": "app", - "value": 2 + "value": 2, + "min_avm_version": 6 }, { "name": "AcctTotalNumUint", "doc": "The total number of uint64 values allocated by this account in Global and Local States.", "stack_type": "uint64", "mode": "app", - "value": 3 + "value": 3, + "min_avm_version": 8 }, { "name": "AcctTotalNumByteSlice", "doc": "The total number of byte array values allocated by this account in Global and Local States.", "stack_type": "uint64", "mode": "app", - "value": 4 + "value": 4, + "min_avm_version": 8 }, { "name": "AcctTotalExtraAppPages", "doc": "The number of extra app code pages used by this account.", "stack_type": "uint64", "mode": "app", - "value": 5 + "value": 5, + "min_avm_version": 8 }, { "name": "AcctTotalAppsCreated", "doc": "The number of existing apps created by this account.", "stack_type": "uint64", "mode": "app", - "value": 6 + "value": 6, + "min_avm_version": 8 }, { "name": "AcctTotalAppsOptedIn", "doc": "The number of apps this account is opted into.", "stack_type": "uint64", "mode": "app", - "value": 7 + "value": 7, + "min_avm_version": 8 }, { "name": "AcctTotalAssetsCreated", "doc": "The number of existing ASAs created by this account.", "stack_type": "uint64", "mode": "app", - "value": 8 + "value": 8, + "min_avm_version": 8 }, { "name": "AcctTotalAssets", "doc": "The numbers of ASAs held by this account (including ASAs this account created).", "stack_type": "uint64", "mode": "app", - "value": 9 + "value": 9, + "min_avm_version": 8 }, { "name": "AcctTotalBoxes", "doc": "The number of existing boxes created by this account's app.", "stack_type": "uint64", "mode": "app", - "value": 10 + "value": 10, + "min_avm_version": 8 }, { "name": "AcctTotalBoxBytes", "doc": "The total number of bytes used by this account's app's box keys and values.", "stack_type": "uint64", "mode": "app", - "value": 11 + "value": 11, + "min_avm_version": 8 + }, + { + "name": "AcctIncentiveEligible", + "doc": "Has this account opted into block payouts", + "stack_type": "bool", + "mode": "app", + "value": 12, + "min_avm_version": 11 + }, + { + "name": "AcctLastProposed", + "doc": "The round number of the last block this account proposed.", + "stack_type": "uint64", + "mode": "app", + "value": 13, + "min_avm_version": 11 + }, + { + "name": "AcctLastHeartbeat", + "doc": "The round number of the last block this account sent a heartbeat.", + "stack_type": "uint64", + "mode": "app", + "value": 14, + "min_avm_version": 11 } ], "app_params": [ @@ -7027,63 +7213,72 @@ "doc": "Bytecode of Approval Program", "stack_type": "[]byte", "mode": "app", - "value": 0 + "value": 0, + "min_avm_version": 5 }, { "name": "AppClearStateProgram", "doc": "Bytecode of Clear State Program", "stack_type": "[]byte", "mode": "app", - "value": 1 + "value": 1, + "min_avm_version": 5 }, { "name": "AppGlobalNumUint", "doc": "Number of uint64 values allowed in Global State", "stack_type": "uint64", "mode": "app", - "value": 2 + "value": 2, + "min_avm_version": 5 }, { "name": "AppGlobalNumByteSlice", "doc": "Number of byte array values allowed in Global State", "stack_type": "uint64", "mode": "app", - "value": 3 + "value": 3, + "min_avm_version": 5 }, { "name": "AppLocalNumUint", "doc": "Number of uint64 values allowed in Local State", "stack_type": "uint64", "mode": "app", - "value": 4 + "value": 4, + "min_avm_version": 5 }, { "name": "AppLocalNumByteSlice", "doc": "Number of byte array values allowed in Local State", "stack_type": "uint64", "mode": "app", - "value": 5 + "value": 5, + "min_avm_version": 5 }, { "name": "AppExtraProgramPages", "doc": "Number of Extra Program Pages of code space", "stack_type": "uint64", "mode": "app", - "value": 6 + "value": 6, + "min_avm_version": 5 }, { "name": "AppCreator", "doc": "Creator address", "stack_type": "address", "mode": "app", - "value": 7 + "value": 7, + "min_avm_version": 5 }, { "name": "AppAddress", "doc": "Address for which this application has authority", "stack_type": "address", "mode": "app", - "value": 8 + "value": 8, + "min_avm_version": 5 } ], "asset_holding": [ @@ -7092,14 +7287,16 @@ "doc": "Amount of the asset unit held by this account", "stack_type": "uint64", "mode": "app", - "value": 0 + "value": 0, + "min_avm_version": 2 }, { "name": "AssetFrozen", "doc": "Is the asset frozen or not", "stack_type": "bool", "mode": "app", - "value": 1 + "value": 1, + "min_avm_version": 2 } ], "asset_params": [ @@ -7108,84 +7305,96 @@ "doc": "Total number of units of this asset", "stack_type": "uint64", "mode": "app", - "value": 0 + "value": 0, + "min_avm_version": 2 }, { "name": "AssetDecimals", "doc": "See AssetParams.Decimals", "stack_type": "uint64", "mode": "app", - "value": 1 + "value": 1, + "min_avm_version": 2 }, { "name": "AssetDefaultFrozen", "doc": "Frozen by default or not", "stack_type": "bool", "mode": "app", - "value": 2 + "value": 2, + "min_avm_version": 2 }, { "name": "AssetUnitName", "doc": "Asset unit name", "stack_type": "[]byte", "mode": "app", - "value": 3 + "value": 3, + "min_avm_version": 2 }, { "name": "AssetName", "doc": "Asset name", "stack_type": "[]byte", "mode": "app", - "value": 4 + "value": 4, + "min_avm_version": 2 }, { "name": "AssetURL", "doc": "URL with additional info about the asset", "stack_type": "[]byte", "mode": "app", - "value": 5 + "value": 5, + "min_avm_version": 2 }, { "name": "AssetMetadataHash", "doc": "Arbitrary commitment", "stack_type": "[32]byte", "mode": "app", - "value": 6 + "value": 6, + "min_avm_version": 2 }, { "name": "AssetManager", "doc": "Manager address", "stack_type": "address", "mode": "app", - "value": 7 + "value": 7, + "min_avm_version": 2 }, { "name": "AssetReserve", "doc": "Reserve address", "stack_type": "address", "mode": "app", - "value": 8 + "value": 8, + "min_avm_version": 2 }, { "name": "AssetFreeze", "doc": "Freeze address", "stack_type": "address", "mode": "app", - "value": 9 + "value": 9, + "min_avm_version": 2 }, { "name": "AssetClawback", "doc": "Clawback address", "stack_type": "address", "mode": "app", - "value": 10 + "value": 10, + "min_avm_version": 2 }, { "name": "AssetCreator", "doc": "Creator address", "stack_type": "address", "mode": "app", - "value": 11 + "value": 11, + "min_avm_version": 5 } ], "base64": [ @@ -7194,30 +7403,98 @@ "doc": null, "stack_type": null, "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 6 }, { "name": "StdEncoding", "doc": null, "stack_type": null, "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 6 } ], "block": [ { "name": "BlkSeed", "doc": null, - "stack_type": "[]byte", + "stack_type": "[32]byte", "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 7 }, { "name": "BlkTimestamp", "doc": null, "stack_type": "uint64", "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 7 + }, + { + "name": "BlkProposer", + "doc": null, + "stack_type": "address", + "mode": "any", + "value": 2, + "min_avm_version": 11 + }, + { + "name": "BlkFeesCollected", + "doc": null, + "stack_type": "uint64", + "mode": "any", + "value": 3, + "min_avm_version": 11 + }, + { + "name": "BlkBonus", + "doc": null, + "stack_type": "uint64", + "mode": "any", + "value": 4, + "min_avm_version": 11 + }, + { + "name": "BlkBranch", + "doc": null, + "stack_type": "[32]byte", + "mode": "any", + "value": 5, + "min_avm_version": 11 + }, + { + "name": "BlkFeeSink", + "doc": null, + "stack_type": "address", + "mode": "any", + "value": 6, + "min_avm_version": 11 + }, + { + "name": "BlkProtocol", + "doc": null, + "stack_type": "[]byte", + "mode": "any", + "value": 7, + "min_avm_version": 11 + }, + { + "name": "BlkTxnCounter", + "doc": null, + "stack_type": "uint64", + "mode": "any", + "value": 8, + "min_avm_version": 11 + }, + { + "name": "BlkProposerPayout", + "doc": null, + "stack_type": "uint64", + "mode": "any", + "value": 9, + "min_avm_version": 11 } ], "EC": [ @@ -7226,28 +7503,32 @@ "doc": "G1 of the BN254 curve. Points encoded as 32 byte X following by 32 byte Y", "stack_type": null, "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 10 }, { "name": "BN254g2", "doc": "G2 of the BN254 curve. Points encoded as 64 byte X following by 64 byte Y", "stack_type": null, "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 10 }, { "name": "BLS12_381g1", "doc": "G1 of the BLS 12-381 curve. Points encoded as 48 byte X following by 48 byte Y", "stack_type": null, "mode": "any", - "value": 2 + "value": 2, + "min_avm_version": 10 }, { "name": "BLS12_381g2", "doc": "G2 of the BLS 12-381 curve. Points encoded as 96 byte X following by 96 byte Y", "stack_type": null, "mode": "any", - "value": 3 + "value": 3, + "min_avm_version": 10 } ], "ECDSA": [ @@ -7256,14 +7537,16 @@ "doc": "secp256k1 curve, used in Bitcoin", "stack_type": null, "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 5 }, { "name": "Secp256r1", "doc": "secp256r1 curve, NIST standard", "stack_type": null, "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 7 } ], "txn": [ @@ -7272,476 +7555,544 @@ "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 0 }, { "name": "Fee", "doc": "microalgos", "stack_type": "uint64", "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 0 }, { "name": "FirstValid", "doc": "round number", "stack_type": "uint64", "mode": "any", - "value": 2 + "value": 2, + "min_avm_version": 0 }, { "name": "FirstValidTime", "doc": "UNIX timestamp of block before txn.FirstValid. Fails if negative", "stack_type": "uint64", "mode": "any", - "value": 3 + "value": 3, + "min_avm_version": 7 }, { "name": "LastValid", "doc": "round number", "stack_type": "uint64", "mode": "any", - "value": 4 + "value": 4, + "min_avm_version": 0 }, { "name": "Note", "doc": "Any data up to 1024 bytes", "stack_type": "[]byte", "mode": "any", - "value": 5 + "value": 5, + "min_avm_version": 0 }, { "name": "Lease", "doc": "32 byte lease value", "stack_type": "[32]byte", "mode": "any", - "value": 6 + "value": 6, + "min_avm_version": 0 }, { "name": "Receiver", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 7 + "value": 7, + "min_avm_version": 0 }, { "name": "Amount", "doc": "microalgos", "stack_type": "uint64", "mode": "any", - "value": 8 + "value": 8, + "min_avm_version": 0 }, { "name": "CloseRemainderTo", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 9 + "value": 9, + "min_avm_version": 0 }, { "name": "VotePK", "doc": "32 byte address", "stack_type": "[32]byte", "mode": "any", - "value": 10 + "value": 10, + "min_avm_version": 0 }, { "name": "SelectionPK", "doc": "32 byte address", "stack_type": "[32]byte", "mode": "any", - "value": 11 + "value": 11, + "min_avm_version": 0 }, { "name": "VoteFirst", "doc": "The first round that the participation key is valid.", "stack_type": "uint64", "mode": "any", - "value": 12 + "value": 12, + "min_avm_version": 0 }, { "name": "VoteLast", "doc": "The last round that the participation key is valid.", "stack_type": "uint64", "mode": "any", - "value": 13 + "value": 13, + "min_avm_version": 0 }, { "name": "VoteKeyDilution", "doc": "Dilution for the 2-level participation key", "stack_type": "uint64", "mode": "any", - "value": 14 + "value": 14, + "min_avm_version": 0 }, { "name": "Type", "doc": "Transaction type as bytes", "stack_type": "[]byte", "mode": "any", - "value": 15 + "value": 15, + "min_avm_version": 0 }, { "name": "TypeEnum", "doc": "Transaction type as integer", "stack_type": "uint64", "mode": "any", - "value": 16 + "value": 16, + "min_avm_version": 0 }, { "name": "XferAsset", "doc": "Asset ID", "stack_type": "asset", "mode": "any", - "value": 17 + "value": 17, + "min_avm_version": 0 }, { "name": "AssetAmount", "doc": "value in Asset's units", "stack_type": "uint64", "mode": "any", - "value": 18 + "value": 18, + "min_avm_version": 0 }, { "name": "AssetSender", "doc": "32 byte address. Source of assets if Sender is the Asset's Clawback address.", "stack_type": "address", "mode": "any", - "value": 19 + "value": 19, + "min_avm_version": 0 }, { "name": "AssetReceiver", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 20 + "value": 20, + "min_avm_version": 0 }, { "name": "AssetCloseTo", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 21 + "value": 21, + "min_avm_version": 0 }, { "name": "GroupIndex", "doc": "Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1", "stack_type": "uint64", "mode": "any", - "value": 22 + "value": 22, + "min_avm_version": 0 }, { "name": "TxID", "doc": "The computed ID for this transaction. 32 bytes.", "stack_type": "[32]byte", "mode": "any", - "value": 23 + "value": 23, + "min_avm_version": 0 }, { "name": "ApplicationID", "doc": "ApplicationID from ApplicationCall transaction", "stack_type": "application", "mode": "any", - "value": 24 + "value": 24, + "min_avm_version": 2 }, { "name": "OnCompletion", "doc": "ApplicationCall transaction on completion action", "stack_type": "uint64", "mode": "any", - "value": 25 + "value": 25, + "min_avm_version": 2 }, { "name": "ApplicationArgs", "doc": "Arguments passed to the application in the ApplicationCall transaction", "stack_type": "[]byte", "mode": "any", - "value": 26 + "value": 26, + "min_avm_version": 2 }, { "name": "NumAppArgs", "doc": "Number of ApplicationArgs", "stack_type": "uint64", "mode": "any", - "value": 27 + "value": 27, + "min_avm_version": 2 }, { "name": "Accounts", "doc": "Accounts listed in the ApplicationCall transaction", "stack_type": "address", "mode": "any", - "value": 28 + "value": 28, + "min_avm_version": 2 }, { "name": "NumAccounts", "doc": "Number of Accounts", "stack_type": "uint64", "mode": "any", - "value": 29 + "value": 29, + "min_avm_version": 2 }, { "name": "ApprovalProgram", "doc": "Approval program", "stack_type": "[]byte", "mode": "any", - "value": 30 + "value": 30, + "min_avm_version": 2 }, { "name": "ClearStateProgram", "doc": "Clear state program", "stack_type": "[]byte", "mode": "any", - "value": 31 + "value": 31, + "min_avm_version": 2 }, { "name": "RekeyTo", "doc": "32 byte Sender's new AuthAddr", "stack_type": "address", "mode": "any", - "value": 32 + "value": 32, + "min_avm_version": 2 }, { "name": "ConfigAsset", "doc": "Asset ID in asset config transaction", "stack_type": "asset", "mode": "any", - "value": 33 + "value": 33, + "min_avm_version": 2 }, { "name": "ConfigAssetTotal", "doc": "Total number of units of this asset created", "stack_type": "uint64", "mode": "any", - "value": 34 + "value": 34, + "min_avm_version": 2 }, { "name": "ConfigAssetDecimals", "doc": "Number of digits to display after the decimal place when displaying the asset", "stack_type": "uint64", "mode": "any", - "value": 35 + "value": 35, + "min_avm_version": 2 }, { "name": "ConfigAssetDefaultFrozen", "doc": "Whether the asset's slots are frozen by default or not, 0 or 1", "stack_type": "bool", "mode": "any", - "value": 36 + "value": 36, + "min_avm_version": 2 }, { "name": "ConfigAssetUnitName", "doc": "Unit name of the asset", "stack_type": "[]byte", "mode": "any", - "value": 37 + "value": 37, + "min_avm_version": 2 }, { "name": "ConfigAssetName", "doc": "The asset name", "stack_type": "[]byte", "mode": "any", - "value": 38 + "value": 38, + "min_avm_version": 2 }, { "name": "ConfigAssetURL", "doc": "URL", "stack_type": "[]byte", "mode": "any", - "value": 39 + "value": 39, + "min_avm_version": 2 }, { "name": "ConfigAssetMetadataHash", "doc": "32 byte commitment to unspecified asset metadata", "stack_type": "[32]byte", "mode": "any", - "value": 40 + "value": 40, + "min_avm_version": 2 }, { "name": "ConfigAssetManager", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 41 + "value": 41, + "min_avm_version": 2 }, { "name": "ConfigAssetReserve", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 42 + "value": 42, + "min_avm_version": 2 }, { "name": "ConfigAssetFreeze", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 43 + "value": 43, + "min_avm_version": 2 }, { "name": "ConfigAssetClawback", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 44 + "value": 44, + "min_avm_version": 2 }, { "name": "FreezeAsset", "doc": "Asset ID being frozen or un-frozen", "stack_type": "asset", "mode": "any", - "value": 45 + "value": 45, + "min_avm_version": 2 }, { "name": "FreezeAssetAccount", "doc": "32 byte address of the account whose asset slot is being frozen or un-frozen", "stack_type": "address", "mode": "any", - "value": 46 + "value": 46, + "min_avm_version": 2 }, { "name": "FreezeAssetFrozen", "doc": "The new frozen value, 0 or 1", "stack_type": "bool", "mode": "any", - "value": 47 + "value": 47, + "min_avm_version": 2 }, { "name": "Assets", "doc": "Foreign Assets listed in the ApplicationCall transaction", "stack_type": "uint64", "mode": "any", - "value": 48 + "value": 48, + "min_avm_version": 3 }, { "name": "NumAssets", "doc": "Number of Assets", "stack_type": "uint64", "mode": "any", - "value": 49 + "value": 49, + "min_avm_version": 3 }, { "name": "Applications", "doc": "Foreign Apps listed in the ApplicationCall transaction", "stack_type": "uint64", "mode": "any", - "value": 50 + "value": 50, + "min_avm_version": 3 }, { "name": "NumApplications", "doc": "Number of Applications", "stack_type": "uint64", "mode": "any", - "value": 51 + "value": 51, + "min_avm_version": 3 }, { "name": "GlobalNumUint", "doc": "Number of global state integers in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 52 + "value": 52, + "min_avm_version": 3 }, { "name": "GlobalNumByteSlice", "doc": "Number of global state byteslices in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 53 + "value": 53, + "min_avm_version": 3 }, { "name": "LocalNumUint", "doc": "Number of local state integers in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 54 + "value": 54, + "min_avm_version": 3 }, { "name": "LocalNumByteSlice", "doc": "Number of local state byteslices in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 55 + "value": 55, + "min_avm_version": 3 }, { "name": "ExtraProgramPages", "doc": "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.", "stack_type": "uint64", "mode": "any", - "value": 56 + "value": 56, + "min_avm_version": 4 }, { "name": "Nonparticipation", "doc": "Marks an account nonparticipating for rewards", "stack_type": "bool", "mode": "any", - "value": 57 + "value": 57, + "min_avm_version": 5 }, { "name": "Logs", "doc": "Log messages emitted by an application call (only with `itxn` in v5). Application mode only", "stack_type": "[]byte", "mode": "app", - "value": 58 + "value": 58, + "min_avm_version": 5 }, { "name": "NumLogs", "doc": "Number of Logs (only with `itxn` in v5). Application mode only", "stack_type": "uint64", "mode": "app", - "value": 59 + "value": 59, + "min_avm_version": 5 }, { "name": "CreatedAssetID", "doc": "Asset ID allocated by the creation of an ASA (only with `itxn` in v5). Application mode only", "stack_type": "asset", "mode": "app", - "value": 60 + "value": 60, + "min_avm_version": 5 }, { "name": "CreatedApplicationID", "doc": "ApplicationID allocated by the creation of an application (only with `itxn` in v5). Application mode only", "stack_type": "application", "mode": "app", - "value": 61 + "value": 61, + "min_avm_version": 5 }, { "name": "LastLog", "doc": "The last message emitted. Empty bytes if none were emitted. Application mode only", "stack_type": "[]byte", "mode": "app", - "value": 62 + "value": 62, + "min_avm_version": 6 }, { "name": "StateProofPK", "doc": "64 byte state proof public key", "stack_type": "[]byte", "mode": "any", - "value": 63 + "value": 63, + "min_avm_version": 6 }, { "name": "ApprovalProgramPages", "doc": "Approval Program as an array of pages", "stack_type": "[]byte", "mode": "any", - "value": 64 + "value": 64, + "min_avm_version": 7 }, { "name": "NumApprovalProgramPages", "doc": "Number of Approval Program pages", "stack_type": "uint64", "mode": "any", - "value": 65 + "value": 65, + "min_avm_version": 7 }, { "name": "ClearStateProgramPages", "doc": "ClearState Program as an array of pages", "stack_type": "[]byte", "mode": "any", - "value": 66 + "value": 66, + "min_avm_version": 7 }, { "name": "NumClearStateProgramPages", "doc": "Number of ClearState Program pages", "stack_type": "uint64", "mode": "any", - "value": 67 + "value": 67, + "min_avm_version": 7 } ], "txna": [ @@ -7750,49 +8101,56 @@ "doc": "Arguments passed to the application in the ApplicationCall transaction", "stack_type": "[]byte", "mode": "any", - "value": 26 + "value": 26, + "min_avm_version": 2 }, { "name": "Accounts", "doc": "Accounts listed in the ApplicationCall transaction", "stack_type": "address", "mode": "any", - "value": 28 + "value": 28, + "min_avm_version": 2 }, { "name": "Assets", "doc": "Foreign Assets listed in the ApplicationCall transaction", "stack_type": "asset", "mode": "any", - "value": 48 + "value": 48, + "min_avm_version": 3 }, { "name": "Applications", "doc": "Foreign Apps listed in the ApplicationCall transaction", "stack_type": "application", "mode": "any", - "value": 50 + "value": 50, + "min_avm_version": 3 }, { "name": "Logs", "doc": "Log messages emitted by an application call (only with `itxn` in v5). Application mode only", "stack_type": "[]byte", "mode": "app", - "value": 58 + "value": 58, + "min_avm_version": 5 }, { "name": "ApprovalProgramPages", "doc": "Approval Program as an array of pages", "stack_type": "[]byte", "mode": "any", - "value": 64 + "value": 64, + "min_avm_version": 7 }, { "name": "ClearStateProgramPages", "doc": "ClearState Program as an array of pages", "stack_type": "[]byte", "mode": "any", - "value": 66 + "value": 66, + "min_avm_version": 7 } ], "global": [ @@ -7801,126 +8159,184 @@ "doc": "microalgos", "stack_type": "uint64", "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 0 }, { "name": "MinBalance", "doc": "microalgos", "stack_type": "uint64", "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 0 }, { "name": "MaxTxnLife", "doc": "rounds", "stack_type": "uint64", "mode": "any", - "value": 2 + "value": 2, + "min_avm_version": 0 }, { "name": "ZeroAddress", "doc": "32 byte address of all zero bytes", "stack_type": "address", "mode": "any", - "value": 3 + "value": 3, + "min_avm_version": 0 }, { "name": "GroupSize", "doc": "Number of transactions in this atomic transaction group. At least 1", "stack_type": "uint64", "mode": "any", - "value": 4 + "value": 4, + "min_avm_version": 0 }, { "name": "LogicSigVersion", "doc": "Maximum supported version", "stack_type": "uint64", "mode": "any", - "value": 5 + "value": 5, + "min_avm_version": 2 }, { "name": "Round", "doc": "Current round number. Application mode only.", "stack_type": "uint64", "mode": "app", - "value": 6 + "value": 6, + "min_avm_version": 2 }, { "name": "LatestTimestamp", "doc": "Last confirmed block UNIX timestamp. Fails if negative. Application mode only.", "stack_type": "uint64", "mode": "app", - "value": 7 + "value": 7, + "min_avm_version": 2 }, { "name": "CurrentApplicationID", "doc": "ID of current application executing. Application mode only.", "stack_type": "application", "mode": "app", - "value": 8 + "value": 8, + "min_avm_version": 2 }, { "name": "CreatorAddress", "doc": "Address of the creator of the current application. Application mode only.", "stack_type": "address", "mode": "app", - "value": 9 + "value": 9, + "min_avm_version": 3 }, { "name": "CurrentApplicationAddress", "doc": "Address that the current application controls. Application mode only.", "stack_type": "address", "mode": "app", - "value": 10 + "value": 10, + "min_avm_version": 5 }, { "name": "GroupID", "doc": "ID of the transaction group. 32 zero bytes if the transaction is not part of a group.", "stack_type": "[32]byte", "mode": "any", - "value": 11 + "value": 11, + "min_avm_version": 5 }, { "name": "OpcodeBudget", "doc": "The remaining cost that can be spent by opcodes in this program.", "stack_type": "uint64", "mode": "any", - "value": 12 + "value": 12, + "min_avm_version": 6 }, { "name": "CallerApplicationID", "doc": "The application ID of the application that called this application. 0 if this application is at the top-level. Application mode only.", "stack_type": "uint64", "mode": "app", - "value": 13 + "value": 13, + "min_avm_version": 6 }, { "name": "CallerApplicationAddress", "doc": "The application address of the application that called this application. ZeroAddress if this application is at the top-level. Application mode only.", "stack_type": "address", "mode": "app", - "value": 14 + "value": 14, + "min_avm_version": 6 }, { "name": "AssetCreateMinBalance", "doc": "The additional minimum balance required to create (and opt-in to) an asset.", "stack_type": "uint64", "mode": "any", - "value": 15 + "value": 15, + "min_avm_version": 10 }, { "name": "AssetOptInMinBalance", "doc": "The additional minimum balance required to opt-in to an asset.", "stack_type": "uint64", "mode": "any", - "value": 16 + "value": 16, + "min_avm_version": 10 }, { "name": "GenesisHash", "doc": "The Genesis Hash for the network.", "stack_type": "[32]byte", "mode": "any", - "value": 17 + "value": 17, + "min_avm_version": 10 + }, + { + "name": "PayoutsEnabled", + "doc": "Whether block proposal payouts are enabled.", + "stack_type": "bool", + "mode": "any", + "value": 18, + "min_avm_version": 11 + }, + { + "name": "PayoutsGoOnlineFee", + "doc": "The fee required in a keyreg transaction to make an account incentive eligible.", + "stack_type": "uint64", + "mode": "any", + "value": 19, + "min_avm_version": 11 + }, + { + "name": "PayoutsPercent", + "doc": "The percentage of transaction fees in a block that can be paid to the block proposer.", + "stack_type": "uint64", + "mode": "any", + "value": 20, + "min_avm_version": 11 + }, + { + "name": "PayoutsMinBalance", + "doc": "The minimum algo balance an account must have in the agreement round to receive block payouts in the proposal round.", + "stack_type": "uint64", + "mode": "any", + "value": 21, + "min_avm_version": 11 + }, + { + "name": "PayoutsMaxBalance", + "doc": "The maximum algo balance an account can have in the agreement round to receive block payouts in the proposal round.", + "stack_type": "uint64", + "mode": "any", + "value": 22, + "min_avm_version": 11 } ], "itxn_field": [ @@ -7929,357 +8345,408 @@ "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 0 }, { "name": "Fee", "doc": "microalgos", "stack_type": "uint64", "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 0 }, { "name": "Note", "doc": "Any data up to 1024 bytes", "stack_type": "[]byte", "mode": "any", - "value": 5 + "value": 5, + "min_avm_version": 0 }, { "name": "Receiver", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 7 + "value": 7, + "min_avm_version": 0 }, { "name": "Amount", "doc": "microalgos", "stack_type": "uint64", "mode": "any", - "value": 8 + "value": 8, + "min_avm_version": 0 }, { "name": "CloseRemainderTo", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 9 + "value": 9, + "min_avm_version": 0 }, { "name": "VotePK", "doc": "32 byte address", "stack_type": "[32]byte", "mode": "any", - "value": 10 + "value": 10, + "min_avm_version": 0 }, { "name": "SelectionPK", "doc": "32 byte address", "stack_type": "[32]byte", "mode": "any", - "value": 11 + "value": 11, + "min_avm_version": 0 }, { "name": "VoteFirst", "doc": "The first round that the participation key is valid.", "stack_type": "uint64", "mode": "any", - "value": 12 + "value": 12, + "min_avm_version": 0 }, { "name": "VoteLast", "doc": "The last round that the participation key is valid.", "stack_type": "uint64", "mode": "any", - "value": 13 + "value": 13, + "min_avm_version": 0 }, { "name": "VoteKeyDilution", "doc": "Dilution for the 2-level participation key", "stack_type": "uint64", "mode": "any", - "value": 14 + "value": 14, + "min_avm_version": 0 }, { "name": "Type", "doc": "Transaction type as bytes", "stack_type": "[]byte", "mode": "any", - "value": 15 + "value": 15, + "min_avm_version": 0 }, { "name": "TypeEnum", "doc": "Transaction type as integer", "stack_type": "uint64", "mode": "any", - "value": 16 + "value": 16, + "min_avm_version": 0 }, { "name": "XferAsset", "doc": "Asset ID", "stack_type": "asset", "mode": "any", - "value": 17 + "value": 17, + "min_avm_version": 0 }, { "name": "AssetAmount", "doc": "value in Asset's units", "stack_type": "uint64", "mode": "any", - "value": 18 + "value": 18, + "min_avm_version": 0 }, { "name": "AssetSender", "doc": "32 byte address. Source of assets if Sender is the Asset's Clawback address.", "stack_type": "address", "mode": "any", - "value": 19 + "value": 19, + "min_avm_version": 0 }, { "name": "AssetReceiver", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 20 + "value": 20, + "min_avm_version": 0 }, { "name": "AssetCloseTo", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 21 + "value": 21, + "min_avm_version": 0 }, { "name": "ApplicationID", "doc": "ApplicationID from ApplicationCall transaction", "stack_type": "application", "mode": "any", - "value": 24 + "value": 24, + "min_avm_version": 2 }, { "name": "OnCompletion", "doc": "ApplicationCall transaction on completion action", "stack_type": "uint64", "mode": "any", - "value": 25 + "value": 25, + "min_avm_version": 2 }, { "name": "ApplicationArgs", "doc": "Arguments passed to the application in the ApplicationCall transaction", "stack_type": "[]byte", "mode": "any", - "value": 26 + "value": 26, + "min_avm_version": 2 }, { "name": "Accounts", "doc": "Accounts listed in the ApplicationCall transaction", "stack_type": "address", "mode": "any", - "value": 28 + "value": 28, + "min_avm_version": 2 }, { "name": "ApprovalProgram", "doc": "Approval program", "stack_type": "[]byte", "mode": "any", - "value": 30 + "value": 30, + "min_avm_version": 2 }, { "name": "ClearStateProgram", "doc": "Clear state program", "stack_type": "[]byte", "mode": "any", - "value": 31 + "value": 31, + "min_avm_version": 2 }, { "name": "RekeyTo", "doc": "32 byte Sender's new AuthAddr", "stack_type": "address", "mode": "any", - "value": 32 + "value": 32, + "min_avm_version": 2 }, { "name": "ConfigAsset", "doc": "Asset ID in asset config transaction", "stack_type": "asset", "mode": "any", - "value": 33 + "value": 33, + "min_avm_version": 2 }, { "name": "ConfigAssetTotal", "doc": "Total number of units of this asset created", "stack_type": "uint64", "mode": "any", - "value": 34 + "value": 34, + "min_avm_version": 2 }, { "name": "ConfigAssetDecimals", "doc": "Number of digits to display after the decimal place when displaying the asset", "stack_type": "uint64", "mode": "any", - "value": 35 + "value": 35, + "min_avm_version": 2 }, { "name": "ConfigAssetDefaultFrozen", "doc": "Whether the asset's slots are frozen by default or not, 0 or 1", "stack_type": "bool", "mode": "any", - "value": 36 + "value": 36, + "min_avm_version": 2 }, { "name": "ConfigAssetUnitName", "doc": "Unit name of the asset", "stack_type": "[]byte", "mode": "any", - "value": 37 + "value": 37, + "min_avm_version": 2 }, { "name": "ConfigAssetName", "doc": "The asset name", "stack_type": "[]byte", "mode": "any", - "value": 38 + "value": 38, + "min_avm_version": 2 }, { "name": "ConfigAssetURL", "doc": "URL", "stack_type": "[]byte", "mode": "any", - "value": 39 + "value": 39, + "min_avm_version": 2 }, { "name": "ConfigAssetMetadataHash", "doc": "32 byte commitment to unspecified asset metadata", "stack_type": "[32]byte", "mode": "any", - "value": 40 + "value": 40, + "min_avm_version": 2 }, { "name": "ConfigAssetManager", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 41 + "value": 41, + "min_avm_version": 2 }, { "name": "ConfigAssetReserve", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 42 + "value": 42, + "min_avm_version": 2 }, { "name": "ConfigAssetFreeze", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 43 + "value": 43, + "min_avm_version": 2 }, { "name": "ConfigAssetClawback", "doc": "32 byte address", "stack_type": "address", "mode": "any", - "value": 44 + "value": 44, + "min_avm_version": 2 }, { "name": "FreezeAsset", "doc": "Asset ID being frozen or un-frozen", "stack_type": "asset", "mode": "any", - "value": 45 + "value": 45, + "min_avm_version": 2 }, { "name": "FreezeAssetAccount", "doc": "32 byte address of the account whose asset slot is being frozen or un-frozen", "stack_type": "address", "mode": "any", - "value": 46 + "value": 46, + "min_avm_version": 2 }, { "name": "FreezeAssetFrozen", "doc": "The new frozen value, 0 or 1", "stack_type": "bool", "mode": "any", - "value": 47 + "value": 47, + "min_avm_version": 2 }, { "name": "Assets", "doc": "Foreign Assets listed in the ApplicationCall transaction", "stack_type": "uint64", "mode": "any", - "value": 48 + "value": 48, + "min_avm_version": 3 }, { "name": "Applications", "doc": "Foreign Apps listed in the ApplicationCall transaction", "stack_type": "uint64", "mode": "any", - "value": 50 + "value": 50, + "min_avm_version": 3 }, { "name": "GlobalNumUint", "doc": "Number of global state integers in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 52 + "value": 52, + "min_avm_version": 3 }, { "name": "GlobalNumByteSlice", "doc": "Number of global state byteslices in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 53 + "value": 53, + "min_avm_version": 3 }, { "name": "LocalNumUint", "doc": "Number of local state integers in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 54 + "value": 54, + "min_avm_version": 3 }, { "name": "LocalNumByteSlice", "doc": "Number of local state byteslices in ApplicationCall", "stack_type": "uint64", "mode": "any", - "value": 55 + "value": 55, + "min_avm_version": 3 }, { "name": "ExtraProgramPages", "doc": "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.", "stack_type": "uint64", "mode": "any", - "value": 56 + "value": 56, + "min_avm_version": 4 }, { "name": "Nonparticipation", "doc": "Marks an account nonparticipating for rewards", "stack_type": "bool", "mode": "any", - "value": 57 + "value": 57, + "min_avm_version": 5 }, { "name": "StateProofPK", "doc": "64 byte state proof public key", "stack_type": "[]byte", "mode": "any", - "value": 63 + "value": 63, + "min_avm_version": 6 }, { "name": "ApprovalProgramPages", "doc": "Approval Program as an array of pages", "stack_type": "[]byte", "mode": "any", - "value": 64 + "value": 64, + "min_avm_version": 7 }, { "name": "ClearStateProgramPages", "doc": "ClearState Program as an array of pages", "stack_type": "[]byte", "mode": "any", - "value": 66 + "value": 66, + "min_avm_version": 7 } ], "json_ref": [ @@ -8288,21 +8755,42 @@ "doc": null, "stack_type": "[]byte", "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 7 }, { "name": "JSONUint64", "doc": null, "stack_type": "uint64", "mode": "any", - "value": 1 + "value": 1, + "min_avm_version": 7 }, { "name": "JSONObject", "doc": null, "stack_type": "[]byte", "mode": "any", - "value": 2 + "value": 2, + "min_avm_version": 7 + } + ], + "voter_params": [ + { + "name": "VoterBalance", + "doc": "Online stake in microalgos", + "stack_type": "uint64", + "mode": "app", + "value": 0, + "min_avm_version": 6 + }, + { + "name": "VoterIncentiveEligible", + "doc": "Had this account opted into block payouts", + "stack_type": "bool", + "mode": "app", + "value": 1, + "min_avm_version": 11 } ], "vrf_verify": [ @@ -8311,7 +8799,8 @@ "doc": null, "stack_type": null, "mode": "any", - "value": 0 + "value": 0, + "min_avm_version": 7 } ] } diff --git a/scripts/generate_avm_ops.py b/scripts/generate_avm_ops.py index 3328c3f8e3..a9f3be88c3 100644 --- a/scripts/generate_avm_ops.py +++ b/scripts/generate_avm_ops.py @@ -138,11 +138,13 @@ def generate_op_node( stack_returns = [get_stack_type(out.stack_type) for out in op.stack_outputs] if dynamic_im_index is None: variant = Variant( + enum=None, signature=OpSignature( args=stack_args, returns=stack_returns, ), supported_modes=_map_run_mode(op.mode), + min_avm_version=op.min_avm_version, ) else: im = op.immediate_args[dynamic_im_index] @@ -162,11 +164,13 @@ def generate_op_node( assert arg_enum.stack_type is not None, "🤕" to_mod[list_index] = get_stack_type(arg_enum.stack_type) variant.variant_map[arg_enum.name] = Variant( + enum=arg_enum.name, signature=OpSignature( args=list(stack_args), returns=list(stack_returns), ), supported_modes=_map_run_mode(arg_enum.mode), + min_avm_version=arg_enum.min_avm_version, ) data = AVMOpData( @@ -201,13 +205,7 @@ def _map_run_mode(mode: langspec.RunMode) -> RunMode: def get_stack_type(stack_type: langspec.StackType) -> StackType: - if stack_type in ( - langspec.StackType.bytes_8, - langspec.StackType.bytes_32, - langspec.StackType.bytes_33, - langspec.StackType.bytes_64, - langspec.StackType.bytes_80, - ): + if stack_type.name.startswith("bytes_"): return StackType.bytes else: return StackType[stack_type.name] diff --git a/scripts/generate_stubs.py b/scripts/generate_stubs.py index 2e503ee95e..a8d8444ad6 100755 --- a/scripts/generate_stubs.py +++ b/scripts/generate_stubs.py @@ -11,6 +11,7 @@ import attrs from puya import log +from puya.algo_constants import SUPPORTED_AVM_VERSIONS from puyapy.awst_build import pytypes from puyapy.awst_build.intrinsic_models import FunctionOpMapping, OpMappingWithOverloads from puyapy.awst_build.utils import snake_case @@ -28,6 +29,7 @@ logger = log.get_logger(__name__) INDENT = " " * 4 VCS_ROOT = Path(__file__).parent.parent +MIN_SUPPORTED_VERSION = min(SUPPORTED_AVM_VERSIONS) PYTYPE_TO_LITERAL: dict[pytypes.PyType, pytypes.LiteralOnlyType | None] = { @@ -56,6 +58,8 @@ StackType.bytes_33: [pytypes.BytesType], StackType.bytes_64: [pytypes.BytesType], StackType.bytes_80: [pytypes.BytesType], + StackType.bytes_1232: [pytypes.BytesType], + StackType.bytes_1793: [pytypes.BytesType], StackType.bool: [pytypes.BoolType, pytypes.UInt64Type], StackType.uint64: [pytypes.UInt64Type], StackType.any: [pytypes.BytesType, pytypes.UInt64Type], @@ -344,6 +348,7 @@ class FunctionDef: args: list[TypedName] = attrs.field(factory=list) return_docs: list[str] = attrs.field(factory=list) op_mapping: OpMappingWithOverloads + min_avm_version: int @attrs.define @@ -523,6 +528,7 @@ def build_class_var_stub(function: FunctionDef, indent: str) -> Iterable[str]: returns = pytype_stub_repr(function.op_mapping.result) return_docs = function.return_docs doc = return_docs if return_docs else function.doc[:] + _maybe_add_min_version_doc(doc, function.min_avm_version) yield f"{indent}{function.name}: typing.Final[{returns}] = ..." yield f'{indent}"""' for doc_line in doc: @@ -577,6 +583,9 @@ def build_class_from_overriding_immediate( method = build_operation_method( op, snake_case(value.name), aliases, const_immediate_value=(immediate, value) ) + # some enums are reused across ops, so need to take the max minimum of op and enum version + method.min_avm_version = max(op.min_avm_version, value.min_avm_version) + _maybe_add_min_version_doc(method.doc, method.min_avm_version) for op_mapping in method.op_mapping.overloads: class_ops.add(op_mapping.op_code) @@ -588,7 +597,7 @@ def build_class_from_overriding_immediate( def get_op_doc(op: Op) -> list[str]: doc = [d.replace("\\", "\\\\") for d in op.doc] - + _maybe_add_min_version_doc(doc, op.min_avm_version) return doc @@ -618,9 +627,24 @@ def build_enum(spec: LanguageSpec, arg_enum: str) -> Iterable[str]: yield f'{INDENT}"""Available values for the `{arg_enum}` enum"""' for value in values: yield f"{INDENT}{value.name}: {enum_name} = ..." + enum_doc = [] + if value.doc: + enum_doc.append(value.doc) + _maybe_add_min_version_doc(enum_doc, value.min_avm_version) + if enum_doc: + yield f'{INDENT}"""' + for doc_line in enum_doc: + yield f"{INDENT}{doc_line}" + yield f'{INDENT}"""' yield "" +def _maybe_add_min_version_doc(doc: list[str], version: int) -> None: + # only output min AVM version if it is greater than our min supported version + if version > MIN_SUPPORTED_VERSION: + doc.append(f"Min AVM version: {version}") + + def build_operation_method( op: Op, op_function_name: str, @@ -722,6 +746,7 @@ def build_operation_method( result=result_typ, overloads=op_mappings, ), + min_avm_version=op.min_avm_version, ) return proto_function diff --git a/scripts/transform_lang_spec.py b/scripts/transform_lang_spec.py index f7c656222e..1c1a55cf5c 100755 --- a/scripts/transform_lang_spec.py +++ b/scripts/transform_lang_spec.py @@ -106,6 +106,7 @@ class Operation(typing.TypedDict, total=False): ArgEnumTypes: list[str] ArgEnumBytes: list[int] ArgModes: list[int] + ArgEnumVersion: list[int] ImmediateNote: list[ImmediateNote] # the following values are not in the original langspec.json @@ -131,6 +132,8 @@ class StackType(enum.StrEnum): bytes_33 = "[33]byte" bytes_64 = "[64]byte" bytes_80 = "[80]byte" + bytes_1232 = "[1232]byte" + bytes_1793 = "[1793]byte" bool = enum.auto() address = enum.auto() address_or_index = enum.auto() @@ -163,6 +166,7 @@ class ArgEnum: stack_type: StackType | None mode: RunMode value: int + min_avm_version: int class ImmediateKind(enum.StrEnum): @@ -373,13 +377,14 @@ def create_indexed_enum(op: Operation) -> list[ArgEnum]: enum_docs = op["ArgEnumDoc"] enum_bytes = op["ArgEnumBytes"] enum_modes = op["ArgModes"] + enum_versions = op["ArgEnumVersion"] if not enum_types: enum_types = [None] * len(enum_names) result = list[ArgEnum]() - for enum_name, enum_type, enum_doc, enum_mode, enum_byte in zip( - enum_names, enum_types, enum_docs, enum_modes, enum_bytes, strict=True + for enum_name, enum_type, enum_doc, enum_mode, enum_byte, enum_version in zip( + enum_names, enum_types, enum_docs, enum_modes, enum_bytes, enum_versions, strict=True ): stack_type = None if enum_type is None else StackType(enum_type) enum_value = ArgEnum( @@ -388,6 +393,7 @@ def create_indexed_enum(op: Operation) -> list[ArgEnum]: stack_type=stack_type, mode=_map_enum_mode(op["Modes"], enum_mode), value=enum_byte, + min_avm_version=enum_version, ) result.append(enum_value) return result diff --git a/src/puya/algo_constants.py b/src/puya/algo_constants.py index 39f54530ae..ecf5da255e 100644 --- a/src/puya/algo_constants.py +++ b/src/puya/algo_constants.py @@ -19,6 +19,6 @@ # Which language versions does this version of puya support targeting # This will typically just be the current mainnet version and potentially the vNext if it doesn't # contain breaking changes -SUPPORTED_TEAL_LANGUAGE_VERSIONS = [10] +SUPPORTED_AVM_VERSIONS = [10, 11] # Which language version is currently deployed to mainnet -MAINNET_TEAL_LANGUAGE_VERSION = 10 +MAINNET_AVM_VERSION = 10 diff --git a/src/puya/awst/nodes.py b/src/puya/awst/nodes.py index 32d421907f..8db4f40355 100644 --- a/src/puya/awst/nodes.py +++ b/src/puya/awst/nodes.py @@ -9,6 +9,7 @@ import attrs from immutabledict import immutabledict +from puya.algo_constants import SUPPORTED_AVM_VERSIONS from puya.avm_type import AVMType from puya.awst import wtypes from puya.awst.txn_fields import TxnField @@ -1597,12 +1598,21 @@ def accept(self, visitor: ContractMemberVisitor[T]) -> T: return visitor.visit_app_storage_definition(self) +def _validate_avm_version(node: Node, _: object, avm_version: int | None) -> None: + if avm_version is not None and avm_version not in SUPPORTED_AVM_VERSIONS: + raise CodeError( + "unsupported AVM version", + node.source_location, + ) + + @attrs.frozen(kw_only=True) class LogicSignature(RootNode): id: LogicSigReference short_name: str program: Subroutine = attrs.field() docstring: str | None + avm_version: int | None = attrs.field(validator=_validate_avm_version) @program.validator def _validate_program(self, _instance: object, program: Subroutine) -> None: @@ -1729,6 +1739,8 @@ class Contract(RootNode): """State totals which can override in part or in full those implied by `app_state`.""" reserved_scratch_space: Set[int] """Scratch slots that the contract is explicitly setting aside for direct/explicit usage.""" + avm_version: int | None = attrs.field(validator=_validate_avm_version) + """AVM version to target, defaults to options.target_avm_version""" @approval_program.validator def check_approval(self, _attribute: object, approval: ContractMethod) -> None: diff --git a/src/puya/compile.py b/src/puya/compile.py index 88e3c9ec35..9a68972016 100644 --- a/src/puya/compile.py +++ b/src/puya/compile.py @@ -194,7 +194,7 @@ def _dummy_program() -> _CompiledProgram: return _CompiledProgram( teal=TealProgram( id="", - target_avm_version=0, + avm_version=0, main=TealSubroutine( is_main=True, signature=Signature( diff --git a/src/puya/ir/avm_ops.py b/src/puya/ir/avm_ops.py index 13effc44e8..9c630ca621 100644 --- a/src/puya/ir/avm_ops.py +++ b/src/puya/ir/avm_ops.py @@ -56,84 +56,134 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctBalance", supported_modes=RunMode.app, + min_avm_version=6, ), "AcctMinBalance": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctMinBalance", supported_modes=RunMode.app, + min_avm_version=6, ), "AcctAuthAddr": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.address, StackType.bool], ), + enum="AcctAuthAddr", supported_modes=RunMode.app, + min_avm_version=6, ), "AcctTotalNumUint": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalNumUint", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalNumByteSlice": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalNumByteSlice", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalExtraAppPages": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalExtraAppPages", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalAppsCreated": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalAppsCreated", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalAppsOptedIn": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalAppsOptedIn", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalAssetsCreated": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalAssetsCreated", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalAssets": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalAssets", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalBoxes": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalBoxes", supported_modes=RunMode.app, + min_avm_version=8, ), "AcctTotalBoxBytes": Variant( signature=OpSignature( args=[StackType.address_or_index], returns=[StackType.uint64, StackType.bool], ), + enum="AcctTotalBoxBytes", supported_modes=RunMode.app, + min_avm_version=8, + ), + "AcctIncentiveEligible": Variant( + signature=OpSignature( + args=[StackType.address_or_index], returns=[StackType.bool, StackType.bool] + ), + enum="AcctIncentiveEligible", + supported_modes=RunMode.app, + min_avm_version=11, + ), + "AcctLastProposed": Variant( + signature=OpSignature( + args=[StackType.address_or_index], + returns=[StackType.uint64, StackType.bool], + ), + enum="AcctLastProposed", + supported_modes=RunMode.app, + min_avm_version=11, + ), + "AcctLastHeartbeat": Variant( + signature=OpSignature( + args=[StackType.address_or_index], + returns=[StackType.uint64, StackType.bool], + ), + enum="AcctLastHeartbeat", + supported_modes=RunMode.app, + min_avm_version=11, ), }, ), @@ -152,7 +202,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -172,7 +224,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bigint] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=10, @@ -190,7 +244,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64, StackType.uint64], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -207,7 +263,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -222,7 +280,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="app_global_del", variants=Variant( signature=OpSignature(args=[StackType.state_key], returns=[]), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -243,7 +303,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="app_global_get", variants=Variant( signature=OpSignature(args=[StackType.state_key], returns=[StackType.any]), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -263,7 +325,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.application, StackType.state_key], returns=[StackType.any, StackType.bool], ), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -282,7 +346,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="app_global_put", variants=Variant( signature=OpSignature(args=[StackType.state_key, StackType.any], returns=[]), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -299,7 +365,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.address_or_index, StackType.state_key], returns=[] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -322,7 +390,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.address_or_index, StackType.state_key], returns=[StackType.any] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -343,7 +413,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.address_or_index, StackType.application, StackType.state_key], returns=[StackType.any, StackType.bool], ), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -365,7 +437,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.address_or_index, StackType.state_key, StackType.any], returns=[] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -384,7 +458,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.address_or_index, StackType.application], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -407,55 +483,73 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.application], returns=[StackType.bytes, StackType.bool] ), + enum="AppApprovalProgram", supported_modes=RunMode.app, + min_avm_version=5, ), "AppClearStateProgram": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.bytes, StackType.bool] ), + enum="AppClearStateProgram", supported_modes=RunMode.app, + min_avm_version=5, ), "AppGlobalNumUint": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.uint64, StackType.bool] ), + enum="AppGlobalNumUint", supported_modes=RunMode.app, + min_avm_version=5, ), "AppGlobalNumByteSlice": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.uint64, StackType.bool] ), + enum="AppGlobalNumByteSlice", supported_modes=RunMode.app, + min_avm_version=5, ), "AppLocalNumUint": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.uint64, StackType.bool] ), + enum="AppLocalNumUint", supported_modes=RunMode.app, + min_avm_version=5, ), "AppLocalNumByteSlice": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.uint64, StackType.bool] ), + enum="AppLocalNumByteSlice", supported_modes=RunMode.app, + min_avm_version=5, ), "AppExtraProgramPages": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.uint64, StackType.bool] ), + enum="AppExtraProgramPages", supported_modes=RunMode.app, + min_avm_version=5, ), "AppCreator": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.address, StackType.bool] ), + enum="AppCreator", supported_modes=RunMode.app, + min_avm_version=5, ), "AppAddress": Variant( signature=OpSignature( args=[StackType.application], returns=[StackType.address, StackType.bool] ), + enum="AppAddress", supported_modes=RunMode.app, + min_avm_version=5, ), }, ), @@ -474,7 +568,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: arg = AVMOpData( op_code="arg", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.bytes]), supported_modes=RunMode.lsig + signature=OpSignature(args=[], returns=[StackType.bytes]), + enum=None, + supported_modes=RunMode.lsig, + min_avm_version=1, ), immediate_types=(ImmediateKind.uint8,), cost=1, @@ -488,7 +585,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: arg_0 = AVMOpData( op_code="arg_0", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.bytes]), supported_modes=RunMode.lsig + signature=OpSignature(args=[], returns=[StackType.bytes]), + enum=None, + supported_modes=RunMode.lsig, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -502,7 +602,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: arg_1 = AVMOpData( op_code="arg_1", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.bytes]), supported_modes=RunMode.lsig + signature=OpSignature(args=[], returns=[StackType.bytes]), + enum=None, + supported_modes=RunMode.lsig, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -516,7 +619,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: arg_2 = AVMOpData( op_code="arg_2", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.bytes]), supported_modes=RunMode.lsig + signature=OpSignature(args=[], returns=[StackType.bytes]), + enum=None, + supported_modes=RunMode.lsig, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -530,7 +636,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: arg_3 = AVMOpData( op_code="arg_3", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.bytes]), supported_modes=RunMode.lsig + signature=OpSignature(args=[], returns=[StackType.bytes]), + enum=None, + supported_modes=RunMode.lsig, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -545,7 +654,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="args", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.lsig, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -559,7 +670,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: assert_ = AVMOpData( op_code="assert", variants=Variant( - signature=OpSignature(args=[StackType.uint64], returns=[]), supported_modes=RunMode.any + signature=OpSignature(args=[StackType.uint64], returns=[]), + enum=None, + supported_modes=RunMode.any, + min_avm_version=3, ), immediate_types=(), cost=1, @@ -580,14 +694,18 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.address_or_index, StackType.asset], returns=[StackType.uint64, StackType.bool], ), + enum="AssetBalance", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetFrozen": Variant( signature=OpSignature( args=[StackType.address_or_index, StackType.asset], returns=[StackType.bool, StackType.bool], ), + enum="AssetFrozen", supported_modes=RunMode.app, + min_avm_version=2, ), }, ), @@ -613,73 +731,97 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.asset], returns=[StackType.uint64, StackType.bool] ), + enum="AssetTotal", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetDecimals": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.uint64, StackType.bool] ), + enum="AssetDecimals", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetDefaultFrozen": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.bool, StackType.bool] ), + enum="AssetDefaultFrozen", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetUnitName": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.bytes, StackType.bool] ), + enum="AssetUnitName", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetName": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.bytes, StackType.bool] ), + enum="AssetName", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetURL": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.bytes, StackType.bool] ), + enum="AssetURL", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetMetadataHash": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.bytes, StackType.bool] ), + enum="AssetMetadataHash", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetManager": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.address, StackType.bool] ), + enum="AssetManager", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetReserve": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.address, StackType.bool] ), + enum="AssetReserve", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetFreeze": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.address, StackType.bool] ), + enum="AssetFreeze", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetClawback": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.address, StackType.bool] ), + enum="AssetClawback", supported_modes=RunMode.app, + min_avm_version=2, ), "AssetCreator": Variant( signature=OpSignature( args=[StackType.asset], returns=[StackType.address, StackType.bool] ), + enum="AssetCreator", supported_modes=RunMode.app, + min_avm_version=5, ), }, ), @@ -699,7 +841,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="balance", variants=Variant( signature=OpSignature(args=[StackType.address_or_index], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.app, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -719,7 +863,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="base64_decode", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=7, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -750,7 +896,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="bitlen", variants=Variant( signature=OpSignature(args=[StackType.any], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -770,7 +918,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -787,7 +937,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=6, @@ -802,7 +954,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="~", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -817,7 +971,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="b~", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=4, @@ -834,7 +990,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -851,7 +1009,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=6, @@ -868,7 +1028,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -885,7 +1047,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=6, @@ -903,11 +1067,63 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "BlkSeed": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="BlkSeed", supported_modes=RunMode.any, + min_avm_version=7, ), "BlkTimestamp": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="BlkTimestamp", + supported_modes=RunMode.any, + min_avm_version=7, + ), + "BlkProposer": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="BlkProposer", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "BlkFeesCollected": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="BlkFeesCollected", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "BlkBonus": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="BlkBonus", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "BlkBranch": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="BlkBranch", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "BlkFeeSink": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="BlkFeeSink", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "BlkProtocol": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="BlkProtocol", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "BlkTxnCounter": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="BlkTxnCounter", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "BlkProposerPayout": Variant( + signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="BlkProposerPayout", supported_modes=RunMode.any, + min_avm_version=11, ), }, ), @@ -927,7 +1143,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.box_name, StackType.uint64], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=8, ), immediate_types=(), cost=1, @@ -946,7 +1164,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="box_del", variants=Variant( signature=OpSignature(args=[StackType.box_name], returns=[StackType.bool]), + enum=None, supported_modes=RunMode.app, + min_avm_version=8, ), immediate_types=(), cost=1, @@ -964,7 +1184,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.box_name, StackType.uint64, StackType.uint64], returns=[StackType.bytes], ), + enum=None, supported_modes=RunMode.app, + min_avm_version=8, ), immediate_types=(), cost=1, @@ -982,7 +1204,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.box_name], returns=[StackType.bytes, StackType.bool] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=8, ), immediate_types=(), cost=1, @@ -1001,7 +1225,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.box_name], returns=[StackType.uint64, StackType.bool] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=8, ), immediate_types=(), cost=1, @@ -1016,7 +1242,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="box_put", variants=Variant( signature=OpSignature(args=[StackType.box_name, StackType.bytes], returns=[]), + enum=None, supported_modes=RunMode.app, + min_avm_version=8, ), immediate_types=(), cost=1, @@ -1036,7 +1264,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.box_name, StackType.uint64, StackType.bytes], returns=[] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=8, ), immediate_types=(), cost=1, @@ -1052,7 +1282,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="box_resize", variants=Variant( signature=OpSignature(args=[StackType.box_name, StackType.uint64], returns=[]), + enum=None, supported_modes=RunMode.app, + min_avm_version=10, ), immediate_types=(), cost=1, @@ -1072,7 +1304,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.box_name, StackType.uint64, StackType.uint64, StackType.bytes], returns=[], ), + enum=None, supported_modes=RunMode.app, + min_avm_version=10, ), immediate_types=(), cost=1, @@ -1091,7 +1325,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="bsqrt", variants=Variant( signature=OpSignature(args=[StackType.bigint], returns=[StackType.bigint]), + enum=None, supported_modes=RunMode.any, + min_avm_version=6, ), immediate_types=(), cost=40, @@ -1107,7 +1343,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="btoi", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -1125,7 +1363,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="bzero", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -1142,7 +1382,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -1161,7 +1403,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -1180,7 +1424,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bigint] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=20, @@ -1199,7 +1445,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.uint64, StackType.uint64, StackType.uint64, StackType.uint64], returns=[StackType.uint64, StackType.uint64, StackType.uint64, StackType.uint64], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=20, @@ -1220,7 +1468,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.uint64, StackType.uint64, StackType.uint64], returns=[StackType.uint64], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=6, ), immediate_types=(), cost=1, @@ -1240,7 +1490,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=10, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1278,7 +1530,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="ec_map_to", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=10, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1303,7 +1557,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=10, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1327,7 +1583,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=10, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1352,7 +1610,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=10, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1371,7 +1631,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="ec_subgroup_check", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bool]), + enum=None, supported_modes=RunMode.any, + min_avm_version=10, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1389,7 +1651,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes], returns=[StackType.bytes, StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1410,7 +1674,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.bytes, StackType.uint64, StackType.bytes, StackType.bytes], returns=[StackType.bytes, StackType.bytes], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(ImmediateKind.arg_enum,), cost=2000, @@ -1438,7 +1704,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: ], returns=[StackType.bool], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(ImmediateKind.arg_enum,), cost=None, @@ -1461,7 +1729,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes, StackType.bytes], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1900, @@ -1483,7 +1753,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes, StackType.bytes], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=7, ), immediate_types=(), cost=1900, @@ -1499,7 +1771,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="==", variants=Variant( signature=OpSignature(args=[StackType.any, StackType.any], returns=[StackType.bool]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -1516,7 +1790,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -1533,7 +1809,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -1551,7 +1829,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64, StackType.uint64], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=10, @@ -1567,7 +1847,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="extract", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(ImmediateKind.uint8, ImmediateKind.uint8), cost=1, @@ -1586,7 +1868,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.bytes, StackType.uint64, StackType.uint64], returns=[StackType.bytes], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -1606,7 +1890,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -1624,7 +1910,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -1642,7 +1930,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -1654,10 +1944,33 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: B+8. If B+8 is larger than the array length, the program fails """ + falcon_verify = AVMOpData( + op_code="falcon_verify", + variants=Variant( + signature=OpSignature( + args=[StackType.bytes, StackType.bytes, StackType.bytes], returns=[StackType.bool] + ), + enum=None, + supported_modes=RunMode.any, + min_avm_version=11, + ), + immediate_types=(), + cost=1700, + min_avm_version=11, + supported_modes=RunMode.any, + ) + """ + for (data A, compressed-format signature B, pubkey C) verify the signature of data against the + pubkey + """ + gaid = AVMOpData( op_code="gaid", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.uint64]), supported_modes=RunMode.app + signature=OpSignature(args=[], returns=[StackType.uint64]), + enum=None, + supported_modes=RunMode.app, + min_avm_version=4, ), immediate_types=(ImmediateKind.uint8,), cost=1, @@ -1675,7 +1988,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="gaids", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.app, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -1695,7 +2010,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.any, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=3, ), immediate_types=(), cost=1, @@ -1715,7 +2032,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=3, ), immediate_types=(), cost=1, @@ -1734,275 +2053,411 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "Sender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Sender", supported_modes=RunMode.any, + min_avm_version=0, ), "Fee": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Fee", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValid", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValidTime": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValidTime", supported_modes=RunMode.any, + min_avm_version=7, ), "LastValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LastValid", supported_modes=RunMode.any, + min_avm_version=0, ), "Note": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Note", supported_modes=RunMode.any, + min_avm_version=0, ), "Lease": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Lease", supported_modes=RunMode.any, + min_avm_version=0, ), "Receiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Receiver", supported_modes=RunMode.any, + min_avm_version=0, ), "Amount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Amount", supported_modes=RunMode.any, + min_avm_version=0, ), "CloseRemainderTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="CloseRemainderTo", supported_modes=RunMode.any, + min_avm_version=0, ), "VotePK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="VotePK", supported_modes=RunMode.any, + min_avm_version=0, ), "SelectionPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="SelectionPK", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteFirst": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteFirst", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteLast": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteLast", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteKeyDilution": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteKeyDilution", supported_modes=RunMode.any, + min_avm_version=0, ), "Type": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Type", supported_modes=RunMode.any, + min_avm_version=0, ), "TypeEnum": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="TypeEnum", supported_modes=RunMode.any, + min_avm_version=0, ), "XferAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="XferAsset", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetAmount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="AssetAmount", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetSender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetSender", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetReceiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetReceiver", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetCloseTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetCloseTo", supported_modes=RunMode.any, + min_avm_version=0, ), "GroupIndex": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GroupIndex", supported_modes=RunMode.any, + min_avm_version=0, ), "TxID": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="TxID", supported_modes=RunMode.any, + min_avm_version=0, ), "ApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="ApplicationID", supported_modes=RunMode.any, + min_avm_version=2, ), "OnCompletion": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="OnCompletion", supported_modes=RunMode.any, + min_avm_version=2, ), "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAppArgs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAppArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAccounts": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAccounts", supported_modes=RunMode.any, + min_avm_version=2, ), "ApprovalProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "ClearStateProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "RekeyTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="RekeyTo", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="ConfigAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetTotal": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetTotal", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDecimals": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetDecimals", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDefaultFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="ConfigAssetDefaultFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetUnitName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetUnitName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetURL": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetURL", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetMetadataHash": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetMetadataHash", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetManager": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetManager", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetReserve": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetReserve", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetFreeze": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetFreeze", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetClawback": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetClawback", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="FreezeAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetAccount": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="FreezeAssetAccount", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="FreezeAssetFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "NumAssets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAssets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "NumApplications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApplications", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "ExtraProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ExtraProgramPages", supported_modes=RunMode.any, + min_avm_version=4, ), "Nonparticipation": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="Nonparticipation", supported_modes=RunMode.any, + min_avm_version=5, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "NumLogs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumLogs", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedAssetID": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="CreatedAssetID", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="CreatedApplicationID", supported_modes=RunMode.app, + min_avm_version=5, ), "LastLog": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="LastLog", supported_modes=RunMode.app, + min_avm_version=6, ), "StateProofPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="StateProofPK", supported_modes=RunMode.any, + min_avm_version=6, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -2022,31 +2477,45 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -2066,33 +2535,47 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature( args=[StackType.uint64], returns=[StackType.application] ), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -2108,7 +2591,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: gload = AVMOpData( op_code="gload", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.any]), supported_modes=RunMode.app + signature=OpSignature(args=[], returns=[StackType.any]), + enum=None, + supported_modes=RunMode.app, + min_avm_version=4, ), immediate_types=(ImmediateKind.uint8, ImmediateKind.uint8), cost=1, @@ -2125,7 +2611,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="gloads", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.any]), + enum=None, supported_modes=RunMode.app, + min_avm_version=4, ), immediate_types=(ImmediateKind.uint8,), cost=1, @@ -2144,7 +2632,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.any] ), + enum=None, supported_modes=RunMode.app, + min_avm_version=6, ), immediate_types=(), cost=1, @@ -2162,75 +2652,141 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "MinTxnFee": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="MinTxnFee", supported_modes=RunMode.any, + min_avm_version=0, ), "MinBalance": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="MinBalance", supported_modes=RunMode.any, + min_avm_version=0, ), "MaxTxnLife": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="MaxTxnLife", supported_modes=RunMode.any, + min_avm_version=0, ), "ZeroAddress": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ZeroAddress", supported_modes=RunMode.any, + min_avm_version=0, ), "GroupSize": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GroupSize", supported_modes=RunMode.any, + min_avm_version=0, ), "LogicSigVersion": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LogicSigVersion", supported_modes=RunMode.any, + min_avm_version=2, ), "Round": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Round", supported_modes=RunMode.app, + min_avm_version=2, ), "LatestTimestamp": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LatestTimestamp", supported_modes=RunMode.app, + min_avm_version=2, ), "CurrentApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="CurrentApplicationID", supported_modes=RunMode.app, + min_avm_version=2, ), "CreatorAddress": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="CreatorAddress", supported_modes=RunMode.app, + min_avm_version=3, ), "CurrentApplicationAddress": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="CurrentApplicationAddress", supported_modes=RunMode.app, + min_avm_version=5, ), "GroupID": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="GroupID", supported_modes=RunMode.any, + min_avm_version=5, ), "OpcodeBudget": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="OpcodeBudget", supported_modes=RunMode.any, + min_avm_version=6, ), "CallerApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="CallerApplicationID", supported_modes=RunMode.app, + min_avm_version=6, ), "CallerApplicationAddress": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="CallerApplicationAddress", supported_modes=RunMode.app, + min_avm_version=6, ), "AssetCreateMinBalance": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="AssetCreateMinBalance", supported_modes=RunMode.any, + min_avm_version=10, ), "AssetOptInMinBalance": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="AssetOptInMinBalance", supported_modes=RunMode.any, + min_avm_version=10, ), "GenesisHash": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="GenesisHash", + supported_modes=RunMode.any, + min_avm_version=10, + ), + "PayoutsEnabled": Variant( + signature=OpSignature(args=[], returns=[StackType.bool]), + enum="PayoutsEnabled", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "PayoutsGoOnlineFee": Variant( + signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="PayoutsGoOnlineFee", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "PayoutsPercent": Variant( + signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="PayoutsPercent", + supported_modes=RunMode.any, + min_avm_version=11, + ), + "PayoutsMinBalance": Variant( + signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="PayoutsMinBalance", supported_modes=RunMode.any, + min_avm_version=11, + ), + "PayoutsMaxBalance": Variant( + signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="PayoutsMaxBalance", + supported_modes=RunMode.any, + min_avm_version=11, ), }, ), @@ -2249,7 +2805,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -2266,7 +2824,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -2283,7 +2843,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -2300,7 +2862,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -2319,275 +2883,411 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "Sender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Sender", supported_modes=RunMode.any, + min_avm_version=0, ), "Fee": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Fee", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValid", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValidTime": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValidTime", supported_modes=RunMode.any, + min_avm_version=7, ), "LastValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LastValid", supported_modes=RunMode.any, + min_avm_version=0, ), "Note": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Note", supported_modes=RunMode.any, + min_avm_version=0, ), "Lease": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Lease", supported_modes=RunMode.any, + min_avm_version=0, ), "Receiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Receiver", supported_modes=RunMode.any, + min_avm_version=0, ), "Amount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Amount", supported_modes=RunMode.any, + min_avm_version=0, ), "CloseRemainderTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="CloseRemainderTo", supported_modes=RunMode.any, + min_avm_version=0, ), "VotePK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="VotePK", supported_modes=RunMode.any, + min_avm_version=0, ), "SelectionPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="SelectionPK", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteFirst": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteFirst", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteLast": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteLast", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteKeyDilution": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteKeyDilution", supported_modes=RunMode.any, + min_avm_version=0, ), "Type": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Type", supported_modes=RunMode.any, + min_avm_version=0, ), "TypeEnum": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="TypeEnum", supported_modes=RunMode.any, + min_avm_version=0, ), "XferAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="XferAsset", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetAmount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="AssetAmount", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetSender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetSender", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetReceiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetReceiver", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetCloseTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetCloseTo", supported_modes=RunMode.any, + min_avm_version=0, ), "GroupIndex": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GroupIndex", supported_modes=RunMode.any, + min_avm_version=0, ), "TxID": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="TxID", supported_modes=RunMode.any, + min_avm_version=0, ), "ApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="ApplicationID", supported_modes=RunMode.any, + min_avm_version=2, ), "OnCompletion": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="OnCompletion", supported_modes=RunMode.any, + min_avm_version=2, ), "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAppArgs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAppArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAccounts": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAccounts", supported_modes=RunMode.any, + min_avm_version=2, ), "ApprovalProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "ClearStateProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "RekeyTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="RekeyTo", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="ConfigAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetTotal": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetTotal", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDecimals": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetDecimals", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDefaultFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="ConfigAssetDefaultFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetUnitName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetUnitName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetURL": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetURL", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetMetadataHash": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetMetadataHash", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetManager": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetManager", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetReserve": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetReserve", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetFreeze": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetFreeze", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetClawback": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetClawback", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="FreezeAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetAccount": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="FreezeAssetAccount", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="FreezeAssetFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "NumAssets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAssets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "NumApplications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApplications", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "ExtraProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ExtraProgramPages", supported_modes=RunMode.any, + min_avm_version=4, ), "Nonparticipation": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="Nonparticipation", supported_modes=RunMode.any, + min_avm_version=5, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "NumLogs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumLogs", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedAssetID": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="CreatedAssetID", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="CreatedApplicationID", supported_modes=RunMode.app, + min_avm_version=5, ), "LastLog": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="LastLog", supported_modes=RunMode.app, + min_avm_version=6, ), "StateProofPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="StateProofPK", supported_modes=RunMode.any, + min_avm_version=6, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -2610,31 +3310,45 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -2656,33 +3370,47 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature( args=[StackType.uint64], returns=[StackType.application] ), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -2702,279 +3430,415 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "Sender": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Sender", supported_modes=RunMode.any, + min_avm_version=0, ), "Fee": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="Fee", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValid": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="FirstValid", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValidTime": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="FirstValidTime", supported_modes=RunMode.any, + min_avm_version=7, ), "LastValid": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="LastValid", supported_modes=RunMode.any, + min_avm_version=0, ), "Note": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Note", supported_modes=RunMode.any, + min_avm_version=0, ), "Lease": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Lease", supported_modes=RunMode.any, + min_avm_version=0, ), "Receiver": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Receiver", supported_modes=RunMode.any, + min_avm_version=0, ), "Amount": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="Amount", supported_modes=RunMode.any, + min_avm_version=0, ), "CloseRemainderTo": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="CloseRemainderTo", supported_modes=RunMode.any, + min_avm_version=0, ), "VotePK": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="VotePK", supported_modes=RunMode.any, + min_avm_version=0, ), "SelectionPK": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="SelectionPK", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteFirst": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="VoteFirst", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteLast": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="VoteLast", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteKeyDilution": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="VoteKeyDilution", supported_modes=RunMode.any, + min_avm_version=0, ), "Type": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Type", supported_modes=RunMode.any, + min_avm_version=0, ), "TypeEnum": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="TypeEnum", supported_modes=RunMode.any, + min_avm_version=0, ), "XferAsset": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="XferAsset", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetAmount": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="AssetAmount", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetSender": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="AssetSender", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetReceiver": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="AssetReceiver", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetCloseTo": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="AssetCloseTo", supported_modes=RunMode.any, + min_avm_version=0, ), "GroupIndex": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="GroupIndex", supported_modes=RunMode.any, + min_avm_version=0, ), "TxID": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="TxID", supported_modes=RunMode.any, + min_avm_version=0, ), "ApplicationID": Variant( signature=OpSignature( args=[StackType.uint64], returns=[StackType.application] ), + enum="ApplicationID", supported_modes=RunMode.any, + min_avm_version=2, ), "OnCompletion": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="OnCompletion", supported_modes=RunMode.any, + min_avm_version=2, ), "ApplicationArgs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAppArgs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="NumAppArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAccounts": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="NumAccounts", supported_modes=RunMode.any, + min_avm_version=2, ), "ApprovalProgram": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApprovalProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "ClearStateProgram": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ClearStateProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "RekeyTo": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="RekeyTo", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAsset": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="ConfigAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetTotal": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="ConfigAssetTotal", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDecimals": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="ConfigAssetDecimals", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDefaultFrozen": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bool]), + enum="ConfigAssetDefaultFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetUnitName": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ConfigAssetUnitName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetName": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ConfigAssetName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetURL": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ConfigAssetURL", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetMetadataHash": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ConfigAssetMetadataHash", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetManager": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="ConfigAssetManager", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetReserve": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="ConfigAssetReserve", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetFreeze": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="ConfigAssetFreeze", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetClawback": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="ConfigAssetClawback", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAsset": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="FreezeAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetAccount": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="FreezeAssetAccount", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetFrozen": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bool]), + enum="FreezeAssetFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "NumAssets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="NumAssets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "NumApplications": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="NumApplications", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumUint": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="GlobalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumByteSlice": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="GlobalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumUint": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="LocalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumByteSlice": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="LocalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "ExtraProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="ExtraProgramPages", supported_modes=RunMode.any, + min_avm_version=4, ), "Nonparticipation": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bool]), + enum="Nonparticipation", supported_modes=RunMode.any, + min_avm_version=5, ), "Logs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "NumLogs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="NumLogs", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedAssetID": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="CreatedAssetID", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedApplicationID": Variant( signature=OpSignature( args=[StackType.uint64], returns=[StackType.application] ), + enum="CreatedApplicationID", supported_modes=RunMode.app, + min_avm_version=5, ), "LastLog": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="LastLog", supported_modes=RunMode.app, + min_avm_version=6, ), "StateProofPK": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="StateProofPK", supported_modes=RunMode.any, + min_avm_version=6, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="NumApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum="NumClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -2998,33 +3862,47 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature( args=[StackType.uint64], returns=[StackType.application] ), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -3048,43 +3926,57 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bytes] ), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.address] ), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.asset] ), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.application] ), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bytes] ), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bytes] ), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bytes] ), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -3101,7 +3993,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="itob", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -3119,275 +4013,411 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "Sender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Sender", supported_modes=RunMode.any, + min_avm_version=0, ), "Fee": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Fee", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValid", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValidTime": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValidTime", supported_modes=RunMode.any, + min_avm_version=7, ), "LastValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LastValid", supported_modes=RunMode.any, + min_avm_version=0, ), "Note": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Note", supported_modes=RunMode.any, + min_avm_version=0, ), "Lease": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Lease", supported_modes=RunMode.any, + min_avm_version=0, ), "Receiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Receiver", supported_modes=RunMode.any, + min_avm_version=0, ), "Amount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Amount", supported_modes=RunMode.any, + min_avm_version=0, ), "CloseRemainderTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="CloseRemainderTo", supported_modes=RunMode.any, + min_avm_version=0, ), "VotePK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="VotePK", supported_modes=RunMode.any, + min_avm_version=0, ), "SelectionPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="SelectionPK", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteFirst": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteFirst", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteLast": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteLast", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteKeyDilution": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteKeyDilution", supported_modes=RunMode.any, + min_avm_version=0, ), "Type": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Type", supported_modes=RunMode.any, + min_avm_version=0, ), "TypeEnum": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="TypeEnum", supported_modes=RunMode.any, + min_avm_version=0, ), "XferAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="XferAsset", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetAmount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="AssetAmount", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetSender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetSender", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetReceiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetReceiver", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetCloseTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetCloseTo", supported_modes=RunMode.any, + min_avm_version=0, ), "GroupIndex": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GroupIndex", supported_modes=RunMode.any, + min_avm_version=0, ), "TxID": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="TxID", supported_modes=RunMode.any, + min_avm_version=0, ), "ApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="ApplicationID", supported_modes=RunMode.any, + min_avm_version=2, ), "OnCompletion": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="OnCompletion", supported_modes=RunMode.any, + min_avm_version=2, ), "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAppArgs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAppArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAccounts": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAccounts", supported_modes=RunMode.any, + min_avm_version=2, ), "ApprovalProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "ClearStateProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "RekeyTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="RekeyTo", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="ConfigAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetTotal": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetTotal", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDecimals": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetDecimals", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDefaultFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="ConfigAssetDefaultFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetUnitName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetUnitName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetURL": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetURL", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetMetadataHash": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetMetadataHash", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetManager": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetManager", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetReserve": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetReserve", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetFreeze": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetFreeze", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetClawback": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetClawback", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="FreezeAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetAccount": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="FreezeAssetAccount", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="FreezeAssetFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "NumAssets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAssets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "NumApplications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApplications", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "ExtraProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ExtraProgramPages", supported_modes=RunMode.any, + min_avm_version=4, ), "Nonparticipation": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="Nonparticipation", supported_modes=RunMode.any, + min_avm_version=5, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "NumLogs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumLogs", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedAssetID": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="CreatedAssetID", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="CreatedApplicationID", supported_modes=RunMode.app, + min_avm_version=5, ), "LastLog": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="LastLog", supported_modes=RunMode.app, + min_avm_version=6, ), "StateProofPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="StateProofPK", supported_modes=RunMode.any, + min_avm_version=6, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -3402,7 +4432,12 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: itxn_begin = AVMOpData( op_code="itxn_begin", - variants=Variant(signature=OpSignature(args=[], returns=[]), supported_modes=RunMode.app), + variants=Variant( + signature=OpSignature(args=[], returns=[]), + enum=None, + supported_modes=RunMode.app, + min_avm_version=5, + ), immediate_types=(), cost=1, min_avm_version=5, @@ -3424,207 +4459,309 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "Sender": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="Sender", supported_modes=RunMode.any, + min_avm_version=0, ), "Fee": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="Fee", supported_modes=RunMode.any, + min_avm_version=0, ), "Note": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="Note", supported_modes=RunMode.any, + min_avm_version=0, ), "Receiver": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="Receiver", supported_modes=RunMode.any, + min_avm_version=0, ), "Amount": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="Amount", supported_modes=RunMode.any, + min_avm_version=0, ), "CloseRemainderTo": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="CloseRemainderTo", supported_modes=RunMode.any, + min_avm_version=0, ), "VotePK": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="VotePK", supported_modes=RunMode.any, + min_avm_version=0, ), "SelectionPK": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="SelectionPK", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteFirst": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="VoteFirst", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteLast": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="VoteLast", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteKeyDilution": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="VoteKeyDilution", supported_modes=RunMode.any, + min_avm_version=0, ), "Type": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="Type", supported_modes=RunMode.any, + min_avm_version=0, ), "TypeEnum": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="TypeEnum", supported_modes=RunMode.any, + min_avm_version=0, ), "XferAsset": Variant( signature=OpSignature(args=[StackType.asset], returns=[]), + enum="XferAsset", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetAmount": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="AssetAmount", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetSender": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="AssetSender", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetReceiver": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="AssetReceiver", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetCloseTo": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="AssetCloseTo", supported_modes=RunMode.any, + min_avm_version=0, ), "ApplicationID": Variant( signature=OpSignature(args=[StackType.application], returns=[]), + enum="ApplicationID", supported_modes=RunMode.any, + min_avm_version=2, ), "OnCompletion": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="OnCompletion", supported_modes=RunMode.any, + min_avm_version=2, ), "ApplicationArgs": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "ApprovalProgram": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ApprovalProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "ClearStateProgram": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ClearStateProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "RekeyTo": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="RekeyTo", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAsset": Variant( signature=OpSignature(args=[StackType.asset], returns=[]), + enum="ConfigAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetTotal": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="ConfigAssetTotal", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDecimals": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="ConfigAssetDecimals", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDefaultFrozen": Variant( signature=OpSignature(args=[StackType.bool], returns=[]), + enum="ConfigAssetDefaultFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetUnitName": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ConfigAssetUnitName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetName": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ConfigAssetName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetURL": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ConfigAssetURL", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetMetadataHash": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ConfigAssetMetadataHash", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetManager": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="ConfigAssetManager", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetReserve": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="ConfigAssetReserve", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetFreeze": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="ConfigAssetFreeze", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetClawback": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="ConfigAssetClawback", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAsset": Variant( signature=OpSignature(args=[StackType.asset], returns=[]), + enum="FreezeAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetAccount": Variant( signature=OpSignature(args=[StackType.address], returns=[]), + enum="FreezeAssetAccount", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetFrozen": Variant( signature=OpSignature(args=[StackType.bool], returns=[]), + enum="FreezeAssetFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumUint": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="GlobalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumByteSlice": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="GlobalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumUint": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="LocalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumByteSlice": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="LocalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "ExtraProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[]), + enum="ExtraProgramPages", supported_modes=RunMode.any, + min_avm_version=4, ), "Nonparticipation": Variant( signature=OpSignature(args=[StackType.bool], returns=[]), + enum="Nonparticipation", supported_modes=RunMode.any, + min_avm_version=5, ), "StateProofPK": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="StateProofPK", supported_modes=RunMode.any, + min_avm_version=6, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.bytes], returns=[]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -3645,7 +4782,12 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: itxn_next = AVMOpData( op_code="itxn_next", - variants=Variant(signature=OpSignature(args=[], returns=[]), supported_modes=RunMode.app), + variants=Variant( + signature=OpSignature(args=[], returns=[]), + enum=None, + supported_modes=RunMode.app, + min_avm_version=6, + ), immediate_types=(), cost=1, min_avm_version=6, @@ -3659,7 +4801,12 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: itxn_submit = AVMOpData( op_code="itxn_submit", - variants=Variant(signature=OpSignature(args=[], returns=[]), supported_modes=RunMode.app), + variants=Variant( + signature=OpSignature(args=[], returns=[]), + enum=None, + supported_modes=RunMode.app, + min_avm_version=5, + ), immediate_types=(), cost=1, min_avm_version=5, @@ -3680,31 +4827,45 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -3724,33 +4885,47 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature( args=[StackType.uint64], returns=[StackType.application] ), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -3772,19 +4947,25 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum="JSONString", supported_modes=RunMode.any, + min_avm_version=7, ), "JSONUint64": Variant( signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.uint64] ), + enum="JSONUint64", supported_modes=RunMode.any, + min_avm_version=7, ), "JSONObject": Variant( signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum="JSONObject", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -3809,7 +4990,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="keccak256", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=130, @@ -3824,7 +5007,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="len", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -3838,7 +5023,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: load = AVMOpData( op_code="load", variants=Variant( - signature=OpSignature(args=[], returns=[StackType.any]), supported_modes=RunMode.any + signature=OpSignature(args=[], returns=[StackType.any]), + enum=None, + supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(ImmediateKind.uint8,), cost=1, @@ -3853,7 +5041,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="loads", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.any]), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -3867,7 +5057,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: log = AVMOpData( op_code="log", variants=Variant( - signature=OpSignature(args=[StackType.bytes], returns=[]), supported_modes=RunMode.app + signature=OpSignature(args=[StackType.bytes], returns=[]), + enum=None, + supported_modes=RunMode.app, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -3887,7 +5080,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -3904,7 +5099,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -3921,7 +5118,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -3938,7 +5137,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -3954,7 +5155,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="min_balance", variants=Variant( signature=OpSignature(args=[StackType.address_or_index], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.app, + min_avm_version=3, ), immediate_types=(), cost=1, @@ -3978,7 +5181,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -3995,7 +5200,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bigint] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=20, @@ -4012,7 +5219,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -4032,7 +5241,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bigint] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=20, @@ -4050,7 +5261,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64, StackType.uint64], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -4065,7 +5278,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="!=", variants=Variant( signature=OpSignature(args=[StackType.any, StackType.any], returns=[StackType.bool]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -4082,7 +5297,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -4097,7 +5314,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="!", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bool]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -4108,13 +5327,32 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: A == 0 yields 1; else 0 """ + online_stake = AVMOpData( + op_code="online_stake", + variants=Variant( + signature=OpSignature(args=[], returns=[StackType.uint64]), + enum=None, + supported_modes=RunMode.app, + min_avm_version=11, + ), + immediate_types=(), + cost=1, + min_avm_version=11, + supported_modes=RunMode.app, + ) + """ + the total online stake in the agreement round + """ + or_ = AVMOpData( op_code="||", variants=Variant( signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.bool] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -4131,7 +5369,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bytes, StackType.bytes], returns=[StackType.bytes] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=7, ), immediate_types=(ImmediateKind.uint8,), cost=1, @@ -4152,7 +5392,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.bytes, StackType.uint64, StackType.bytes], returns=[StackType.bytes], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=7, ), immediate_types=(), cost=1, @@ -4172,7 +5414,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.any, StackType.any, StackType.bool], returns=[StackType.any] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=3, ), immediate_types=(), cost=1, @@ -4189,7 +5433,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.any, StackType.uint64, StackType.uint64], returns=[StackType.any] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=3, ), immediate_types=(), cost=1, @@ -4213,7 +5459,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.bytes, StackType.uint64, StackType.uint64], returns=[StackType.bytes], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=3, ), immediate_types=(), cost=1, @@ -4229,7 +5477,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="sha256", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=35, @@ -4244,7 +5494,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="sha3_256", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=7, ), immediate_types=(), cost=130, @@ -4259,7 +5511,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="sha512_256", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=45, @@ -4276,7 +5530,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -4293,7 +5549,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=1, @@ -4308,7 +5566,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="sqrt", variants=Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.uint64]), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=4, @@ -4322,7 +5582,10 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: store = AVMOpData( op_code="store", variants=Variant( - signature=OpSignature(args=[StackType.any], returns=[]), supported_modes=RunMode.any + signature=OpSignature(args=[StackType.any], returns=[]), + enum=None, + supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(ImmediateKind.uint8,), cost=1, @@ -4337,7 +5600,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="stores", variants=Variant( signature=OpSignature(args=[StackType.uint64, StackType.any], returns=[]), + enum=None, supported_modes=RunMode.any, + min_avm_version=5, ), immediate_types=(), cost=1, @@ -4354,7 +5619,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.uint64, StackType.uint64], returns=[StackType.uint64] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=1, ), immediate_types=(), cost=1, @@ -4371,7 +5638,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: signature=OpSignature( args=[StackType.bigint, StackType.bigint], returns=[StackType.bigint] ), + enum=None, supported_modes=RunMode.any, + min_avm_version=4, ), immediate_types=(), cost=10, @@ -4386,7 +5655,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: op_code="substring", variants=Variant( signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, supported_modes=RunMode.any, + min_avm_version=2, ), immediate_types=(ImmediateKind.uint8, ImmediateKind.uint8), cost=1, @@ -4405,7 +5676,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.bytes, StackType.uint64, StackType.uint64], returns=[StackType.bytes], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=2, ), immediate_types=(), cost=1, @@ -4417,6 +5690,23 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: than the array length, the program fails """ + sumhash512 = AVMOpData( + op_code="sumhash512", + variants=Variant( + signature=OpSignature(args=[StackType.bytes], returns=[StackType.bytes]), + enum=None, + supported_modes=RunMode.any, + min_avm_version=11, + ), + immediate_types=(), + cost=None, + min_avm_version=11, + supported_modes=RunMode.any, + ) + """ + sumhash512 of value A, yields [64]byte + """ + txn = AVMOpData( op_code="txn", variants=DynamicVariants( @@ -4424,275 +5714,411 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "Sender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Sender", supported_modes=RunMode.any, + min_avm_version=0, ), "Fee": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Fee", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValid", supported_modes=RunMode.any, + min_avm_version=0, ), "FirstValidTime": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="FirstValidTime", supported_modes=RunMode.any, + min_avm_version=7, ), "LastValid": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LastValid", supported_modes=RunMode.any, + min_avm_version=0, ), "Note": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Note", supported_modes=RunMode.any, + min_avm_version=0, ), "Lease": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Lease", supported_modes=RunMode.any, + min_avm_version=0, ), "Receiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Receiver", supported_modes=RunMode.any, + min_avm_version=0, ), "Amount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Amount", supported_modes=RunMode.any, + min_avm_version=0, ), "CloseRemainderTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="CloseRemainderTo", supported_modes=RunMode.any, + min_avm_version=0, ), "VotePK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="VotePK", supported_modes=RunMode.any, + min_avm_version=0, ), "SelectionPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="SelectionPK", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteFirst": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteFirst", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteLast": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteLast", supported_modes=RunMode.any, + min_avm_version=0, ), "VoteKeyDilution": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="VoteKeyDilution", supported_modes=RunMode.any, + min_avm_version=0, ), "Type": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Type", supported_modes=RunMode.any, + min_avm_version=0, ), "TypeEnum": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="TypeEnum", supported_modes=RunMode.any, + min_avm_version=0, ), "XferAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="XferAsset", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetAmount": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="AssetAmount", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetSender": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetSender", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetReceiver": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetReceiver", supported_modes=RunMode.any, + min_avm_version=0, ), "AssetCloseTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="AssetCloseTo", supported_modes=RunMode.any, + min_avm_version=0, ), "GroupIndex": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GroupIndex", supported_modes=RunMode.any, + min_avm_version=0, ), "TxID": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="TxID", supported_modes=RunMode.any, + min_avm_version=0, ), "ApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="ApplicationID", supported_modes=RunMode.any, + min_avm_version=2, ), "OnCompletion": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="OnCompletion", supported_modes=RunMode.any, + min_avm_version=2, ), "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAppArgs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAppArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "NumAccounts": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAccounts", supported_modes=RunMode.any, + min_avm_version=2, ), "ApprovalProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "ClearStateProgram": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgram", supported_modes=RunMode.any, + min_avm_version=2, ), "RekeyTo": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="RekeyTo", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="ConfigAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetTotal": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetTotal", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDecimals": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ConfigAssetDecimals", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetDefaultFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="ConfigAssetDefaultFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetUnitName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetUnitName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetName": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetName", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetURL": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetURL", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetMetadataHash": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ConfigAssetMetadataHash", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetManager": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetManager", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetReserve": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetReserve", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetFreeze": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetFreeze", supported_modes=RunMode.any, + min_avm_version=2, ), "ConfigAssetClawback": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="ConfigAssetClawback", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAsset": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="FreezeAsset", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetAccount": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="FreezeAssetAccount", supported_modes=RunMode.any, + min_avm_version=2, ), "FreezeAssetFrozen": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="FreezeAssetFrozen", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "NumAssets": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumAssets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "NumApplications": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApplications", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "GlobalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="GlobalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumUint": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumUint", supported_modes=RunMode.any, + min_avm_version=3, ), "LocalNumByteSlice": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="LocalNumByteSlice", supported_modes=RunMode.any, + min_avm_version=3, ), "ExtraProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="ExtraProgramPages", supported_modes=RunMode.any, + min_avm_version=4, ), "Nonparticipation": Variant( signature=OpSignature(args=[], returns=[StackType.bool]), + enum="Nonparticipation", supported_modes=RunMode.any, + min_avm_version=5, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "NumLogs": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumLogs", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedAssetID": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="CreatedAssetID", supported_modes=RunMode.app, + min_avm_version=5, ), "CreatedApplicationID": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="CreatedApplicationID", supported_modes=RunMode.app, + min_avm_version=5, ), "LastLog": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="LastLog", supported_modes=RunMode.app, + min_avm_version=6, ), "StateProofPK": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="StateProofPK", supported_modes=RunMode.any, + min_avm_version=6, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "NumClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.uint64]), + enum="NumClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -4712,31 +6138,45 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature(args=[], returns=[StackType.application]), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -4758,33 +6198,47 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: variant_map={ "ApplicationArgs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApplicationArgs", supported_modes=RunMode.any, + min_avm_version=2, ), "Accounts": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.address]), + enum="Accounts", supported_modes=RunMode.any, + min_avm_version=2, ), "Assets": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.asset]), + enum="Assets", supported_modes=RunMode.any, + min_avm_version=3, ), "Applications": Variant( signature=OpSignature( args=[StackType.uint64], returns=[StackType.application] ), + enum="Applications", supported_modes=RunMode.any, + min_avm_version=3, ), "Logs": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="Logs", supported_modes=RunMode.app, + min_avm_version=5, ), "ApprovalProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ApprovalProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), "ClearStateProgramPages": Variant( signature=OpSignature(args=[StackType.uint64], returns=[StackType.bytes]), + enum="ClearStateProgramPages", supported_modes=RunMode.any, + min_avm_version=7, ), }, ), @@ -4797,6 +6251,40 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: Ath value of the array field F of the current transaction """ + voter_params_get = AVMOpData( + op_code="voter_params_get", + variants=DynamicVariants( + immediate_index=0, + variant_map={ + "VoterBalance": Variant( + signature=OpSignature( + args=[StackType.any], returns=[StackType.uint64, StackType.bool] + ), + enum="VoterBalance", + supported_modes=RunMode.app, + min_avm_version=6, + ), + "VoterIncentiveEligible": Variant( + signature=OpSignature( + args=[StackType.any], returns=[StackType.bool, StackType.bool] + ), + enum="VoterIncentiveEligible", + supported_modes=RunMode.app, + min_avm_version=11, + ), + }, + ), + immediate_types=(ImmediateKind.arg_enum,), + cost=1, + min_avm_version=11, + supported_modes=RunMode.app, + ) + """ + X is field F from online account A as of the balance round: 320 rounds before the current + round. Y is 1 if A had positive algos online in the agreement round, else Y is 0 and X is a + type specific zero-value + """ + vrf_verify = AVMOpData( op_code="vrf_verify", variants=Variant( @@ -4804,7 +6292,9 @@ def get_variant(self, immediates: Sequence[str | int]) -> Variant: args=[StackType.bytes, StackType.bytes, StackType.bytes], returns=[StackType.bytes, StackType.bool], ), + enum=None, supported_modes=RunMode.any, + min_avm_version=7, ), immediate_types=(ImmediateKind.arg_enum,), cost=5700, diff --git a/src/puya/ir/avm_ops_models.py b/src/puya/ir/avm_ops_models.py index 0b6d28606f..c1477a2688 100644 --- a/src/puya/ir/avm_ops_models.py +++ b/src/puya/ir/avm_ops_models.py @@ -47,7 +47,9 @@ class OpSignature: @attrs.frozen class Variant: signature: OpSignature + enum: str | None supported_modes: RunMode + min_avm_version: int @attrs.frozen diff --git a/src/puya/ir/main.py b/src/puya/ir/main.py index a30666fdc0..76f28455b6 100644 --- a/src/puya/ir/main.py +++ b/src/puya/ir/main.py @@ -41,7 +41,7 @@ StateTotals, ) from puya.parse import SourceLocation -from puya.utils import StableSet, attrs_extend, set_remove +from puya.utils import StableSet, attrs_extend, coalesce, set_remove logger = log.get_logger(__name__) @@ -244,6 +244,7 @@ def _build_ir(ctx: IRBuildContext, contract: awst_nodes.Contract) -> Contract: if not sub.body: # in case something is pre-built (ie from embedded lib) FunctionIRBuilder.build_body(ctx, function=func, subroutine=sub) + avm_version = coalesce(contract.avm_version, ctx.options.target_avm_version) approval_ir = _make_program( ctx, contract.approval_program, @@ -252,6 +253,7 @@ def _build_ir(ctx: IRBuildContext, contract: awst_nodes.Contract) -> Contract: *ctx.embedded_funcs_lookup.values(), ), program_id=".".join((contract.id, contract.approval_program.short_name)), + avm_version=avm_version, ) clear_state_ir = _make_program( ctx, @@ -261,6 +263,7 @@ def _build_ir(ctx: IRBuildContext, contract: awst_nodes.Contract) -> Contract: *ctx.embedded_funcs_lookup.values(), ), program_id=".".join((contract.id, contract.clear_program.short_name)), + avm_version=avm_version, ) result = Contract( source_location=contract.source_location, @@ -307,6 +310,7 @@ def _build_logic_sig_ir( *ctx.embedded_funcs_lookup.values(), ), program_id=logic_sig.id, + avm_version=coalesce(logic_sig.avm_version, ctx.options.target_avm_version), ) result = LogicSignature( source_location=logic_sig.source_location, @@ -391,6 +395,7 @@ def _make_program( references: Iterable[Subroutine], *, program_id: str, + avm_version: int, ) -> Program: if main.args: raise InternalError("main method should not have args") @@ -410,6 +415,7 @@ def _make_program( id=program_id, main=main_sub, subroutines=tuple(references), + avm_version=avm_version, ) diff --git a/src/puya/ir/models.py b/src/puya/ir/models.py index 1dc3a856fc..b5644d4c1c 100644 --- a/src/puya/ir/models.py +++ b/src/puya/ir/models.py @@ -913,7 +913,7 @@ def validate_with_ssa(self) -> None: attrs.validate(self) -@attrs.define(eq=False) +@attrs.define(kw_only=True, eq=False) class Program(Context): """An individual compilation unit - ie either an Approval or a Clear State program""" @@ -938,6 +938,7 @@ class Program(Context): main: Subroutine subroutines: Sequence[Subroutine] source_location: SourceLocation | None = None + avm_version: int def __attrs_post_init__(self) -> None: if self.source_location is None: diff --git a/src/puya/ir/validation/_base.py b/src/puya/ir/validation/_base.py index 864cd6b5e5..2dd969c7fe 100644 --- a/src/puya/ir/validation/_base.py +++ b/src/puya/ir/validation/_base.py @@ -3,16 +3,20 @@ from puya.context import CompileContext from puya.ir.avm_ops_models import RunMode -from puya.ir.models import Contract, LogicSignature, ModuleArtifact +from puya.ir.models import Contract, LogicSignature, ModuleArtifact, Program from puya.ir.visitor import IRTraverser class DestructuredIRValidator(IRTraverser, abc.ABC): def __init__( - self, context: CompileContext, run_mode: typing.Literal[RunMode.app, RunMode.lsig] + self, + context: CompileContext, + program: Program, + run_mode: typing.Literal[RunMode.app, RunMode.lsig], ): self.context = context self.current_run_mode = run_mode + self.active_program = program @classmethod def validate(cls, context: CompileContext, artifact: ModuleArtifact) -> None: @@ -26,13 +30,13 @@ def validate(cls, context: CompileContext, artifact: ModuleArtifact) -> None: @classmethod def validate_logic_sig(cls, context: CompileContext, logic_sig: LogicSignature) -> None: - validator = cls(context, RunMode.lsig) + validator = cls(context, logic_sig.program, RunMode.lsig) for sub in logic_sig.program.all_subroutines: validator.visit_all_blocks(sub.body) @classmethod def validate_contract(cls, context: CompileContext, contract: Contract) -> None: - validator = cls(context, RunMode.app) - subs = (sub for program in contract.all_programs() for sub in program.all_subroutines) - for sub in subs: - validator.visit_all_blocks(sub.body) + for program in contract.all_programs(): + validator = cls(context, program, RunMode.app) + for sub in program.all_subroutines: + validator.visit_all_blocks(sub.body) diff --git a/src/puya/ir/validation/min_avm_version_validator.py b/src/puya/ir/validation/min_avm_version_validator.py index 0ac1e420df..68b744df98 100644 --- a/src/puya/ir/validation/min_avm_version_validator.py +++ b/src/puya/ir/validation/min_avm_version_validator.py @@ -10,11 +10,16 @@ class MinAvmVersionValidator(DestructuredIRValidator): @typing.override def visit_intrinsic_op(self, intrinsic: Intrinsic) -> None: - target_avm_version = self.context.options.target_avm_version - if intrinsic.op.min_avm_version > target_avm_version: - logger.warning( - f"Opcode {intrinsic.op} requires a min AVM version of " - f"{intrinsic.op.min_avm_version} but the target AVM version is" - f" {target_avm_version}", - intrinsic.source_location, + program_avm_version = self.active_program.avm_version + op_avm_version = intrinsic.op_variant.min_avm_version + if op_avm_version > program_avm_version: + op_desc = intrinsic.op.value + # if variant min version differs from op min version, then include variant enum + if op_avm_version != intrinsic.op.min_avm_version: + op_desc += f" {intrinsic.op_variant.enum}" + logger.error( + f"Opcode {op_desc!r} requires a min AVM version of " + f"{op_avm_version} but the target AVM version is" + f" {program_avm_version}", + location=intrinsic.source_location, ) diff --git a/src/puya/mir/main.py b/src/puya/mir/main.py index c8328f860d..b85c9d029c 100644 --- a/src/puya/mir/main.py +++ b/src/puya/mir/main.py @@ -22,6 +22,7 @@ def program_ir_to_mir( _lower_subroutine_to_mir(ctx, ir_sub, is_main=False, name=ir_sub.full_name) for ir_sub in program_ir.subroutines ], + avm_version=program_ir.avm_version, ) global_stack_allocation(ctx, result, mir_output_path) return result diff --git a/src/puya/mir/models.py b/src/puya/mir/models.py index 15819b351e..b1ffc24190 100644 --- a/src/puya/mir/models.py +++ b/src/puya/mir/models.py @@ -624,6 +624,7 @@ class Program: id: str main: MemorySubroutine subroutines: list[MemorySubroutine] + avm_version: int @property def all_subroutines(self) -> Iterator[MemorySubroutine]: diff --git a/src/puya/options.py b/src/puya/options.py index 6c3ef62491..0a6ac6334e 100644 --- a/src/puya/options.py +++ b/src/puya/options.py @@ -4,7 +4,7 @@ import attrs -from puya.algo_constants import MAINNET_TEAL_LANGUAGE_VERSION +from puya.algo_constants import MAINNET_AVM_VERSION class LocalsCoalescingStrategy(enum.StrEnum): @@ -25,7 +25,7 @@ class PuyaOptions: output_bytecode: bool = False debug_level: int = 1 optimization_level: int = 1 - target_avm_version: int = MAINNET_TEAL_LANGUAGE_VERSION + target_avm_version: int = MAINNET_AVM_VERSION cli_template_definitions: Mapping[str, int | bytes] = attrs.field(factory=dict) template_vars_prefix: str = "TMPL_" # TODO: the below is probably not scalable as a set of optimisation on/off flags, diff --git a/src/puya/teal/main.py b/src/puya/teal/main.py index 95264ea868..7f844a9f28 100644 --- a/src/puya/teal/main.py +++ b/src/puya/teal/main.py @@ -11,7 +11,7 @@ def mir_to_teal(context: CompileContext, program_mir: mir.Program) -> teal_models.TealProgram: - teal = _build_teal(context, program_mir) + teal = _build_teal(program_mir) before = _get_all_stack_manipulations(teal) teal = optimize_teal_program(context, teal) @@ -36,10 +36,10 @@ def _get_all_stack_manipulations( ] -def _build_teal(context: CompileContext, mir_program: mir.Program) -> teal_models.TealProgram: +def _build_teal(mir_program: mir.Program) -> teal_models.TealProgram: program = teal_models.TealProgram( id=mir_program.id, - target_avm_version=context.options.target_avm_version, + avm_version=mir_program.avm_version, main=TealBuilder.build_subroutine(mir_program.main), subroutines=[TealBuilder.build_subroutine(mir_sub) for mir_sub in mir_program.subroutines], ) diff --git a/src/puya/teal/models.py b/src/puya/teal/models.py index 99f7ffc528..43c0efdf7a 100644 --- a/src/puya/teal/models.py +++ b/src/puya/teal/models.py @@ -503,7 +503,7 @@ class TealSubroutine: @attrs.define class TealProgram: id: str - target_avm_version: int + avm_version: int main: TealSubroutine subroutines: list[TealSubroutine] diff --git a/src/puya/teal/output.py b/src/puya/teal/output.py index cd16204467..5bb7a105e0 100644 --- a/src/puya/teal/output.py +++ b/src/puya/teal/output.py @@ -10,7 +10,7 @@ def emit_teal(context: CompileContext, program: models.TealProgram) -> str: indent = " " * 4 result = [ - f"#pragma version {context.options.target_avm_version}", + f"#pragma version {program.avm_version}", "", ] for subroutine in program.all_subroutines: diff --git a/src/puya/ussemble/assemble.py b/src/puya/ussemble/assemble.py index b43efb0bfc..a2a7eac6c9 100644 --- a/src/puya/ussemble/assemble.py +++ b/src/puya/ussemble/assemble.py @@ -27,7 +27,7 @@ def assemble_bytecode_and_debug_info( ) -> models.AssembledProgram: function_block_ids = {s.blocks[0].label: s.signature.name for s in program.all_subroutines} - version_bytes = _encode_varuint(ctx.options.target_avm_version) + version_bytes = _encode_varuint(program.avm_version) pc_events = defaultdict[int, DebugEvent](DebugEvent) # type: ignore[arg-type] pc_ops = dict[int, models.AVMOp]() label_pcs = dict[str, int]() diff --git a/src/puya/ussemble/op_spec.py b/src/puya/ussemble/op_spec.py index b1de4c3c24..c073a81b9e 100644 --- a/src/puya/ussemble/op_spec.py +++ b/src/puya/ussemble/op_spec.py @@ -164,6 +164,11 @@ "AssetCreateMinBalance": 15, "AssetOptInMinBalance": 16, "GenesisHash": 17, + "PayoutsEnabled": 18, + "PayoutsGoOnlineFee": 19, + "PayoutsPercent": 20, + "PayoutsMinBalance": 21, + "PayoutsMaxBalance": 22, } ) ], @@ -506,16 +511,27 @@ "AcctTotalAssets": 9, "AcctTotalBoxes": 10, "AcctTotalBoxBytes": 11, + "AcctIncentiveEligible": 12, + "AcctLastProposed": 13, + "AcctLastHeartbeat": 14, } ) ], ), + "voter_params_get": OpSpec( + name="voter_params_get", + code=116, + immediates=[ImmediateEnum(codes={"VoterBalance": 0, "VoterIncentiveEligible": 1})], + ), + "online_stake": OpSpec(name="online_stake", code=117, immediates=[]), "min_balance": OpSpec(name="min_balance", code=120, immediates=[]), "pushbytes": OpSpec(name="pushbytes", code=128, immediates=[ImmediateKind.bytes]), "pushint": OpSpec(name="pushint", code=129, immediates=[ImmediateKind.varuint]), "pushbytess": OpSpec(name="pushbytess", code=130, immediates=[ImmediateKind.bytes_array]), "pushints": OpSpec(name="pushints", code=131, immediates=[ImmediateKind.varuint_array]), "ed25519verify_bare": OpSpec(name="ed25519verify_bare", code=132, immediates=[]), + "falcon_verify": OpSpec(name="falcon_verify", code=133, immediates=[]), + "sumhash512": OpSpec(name="sumhash512", code=134, immediates=[]), "callsub": OpSpec(name="callsub", code=136, immediates=[ImmediateKind.label]), "retsub": OpSpec(name="retsub", code=137, immediates=[]), "proto": OpSpec(name="proto", code=138, immediates=[ImmediateKind.uint8, ImmediateKind.uint8]), @@ -907,7 +923,24 @@ name="vrf_verify", code=208, immediates=[ImmediateEnum(codes={"VrfAlgorand": 0})] ), "block": OpSpec( - name="block", code=209, immediates=[ImmediateEnum(codes={"BlkSeed": 0, "BlkTimestamp": 1})] + name="block", + code=209, + immediates=[ + ImmediateEnum( + codes={ + "BlkSeed": 0, + "BlkTimestamp": 1, + "BlkProposer": 2, + "BlkFeesCollected": 3, + "BlkBonus": 4, + "BlkBranch": 5, + "BlkFeeSink": 6, + "BlkProtocol": 7, + "BlkTxnCounter": 8, + "BlkProposerPayout": 9, + } + ) + ], ), "box_splice": OpSpec(name="box_splice", code=210, immediates=[]), "box_resize": OpSpec(name="box_resize", code=211, immediates=[]), diff --git a/src/puyapy/__main__.py b/src/puyapy/__main__.py index 00989e6ede..2ed2988716 100644 --- a/src/puyapy/__main__.py +++ b/src/puyapy/__main__.py @@ -4,7 +4,7 @@ from importlib.metadata import version from pathlib import Path -from puya.algo_constants import MAINNET_TEAL_LANGUAGE_VERSION, SUPPORTED_TEAL_LANGUAGE_VERSIONS +from puya.algo_constants import MAINNET_AVM_VERSION, SUPPORTED_AVM_VERSIONS from puya.log import LogLevel, configure_logging from puya.options import LocalsCoalescingStrategy @@ -138,8 +138,8 @@ def main() -> None: parser.add_argument( "--target-avm-version", type=int, - choices=SUPPORTED_TEAL_LANGUAGE_VERSIONS, - default=MAINNET_TEAL_LANGUAGE_VERSION, + choices=SUPPORTED_AVM_VERSIONS, + default=MAINNET_AVM_VERSION, ) parser.add_argument( "--locals-coalescing-strategy", diff --git a/src/puyapy/awst_build/contract.py b/src/puyapy/awst_build/contract.py index 3a0ce15ecd..856d02a7d7 100644 --- a/src/puyapy/awst_build/contract.py +++ b/src/puyapy/awst_build/contract.py @@ -220,6 +220,7 @@ def build(self, context: ASTConversionModuleContext) -> awst_nodes.Contract | No source_location=self.fragment.source_location, reserved_scratch_space=self.fragment.reserved_scratch_space, state_totals=self.fragment.options.state_totals, + avm_version=self.fragment.options.avm_version, ) def empty_statement(self, _stmt: mypy.nodes.Statement) -> None: diff --git a/src/puyapy/awst_build/intrinsic_data.py b/src/puyapy/awst_build/intrinsic_data.py index 6abedf998d..e9694a2b80 100644 --- a/src/puyapy/awst_build/intrinsic_data.py +++ b/src/puyapy/awst_build/intrinsic_data.py @@ -324,6 +324,16 @@ ), ], ), + falcon_verify=OpMappingWithOverloads( + result=pytypes.BoolType, + arity=3, + overloads=[ + FunctionOpMapping( + "falcon_verify", + args=[(pytypes.BytesType,), (pytypes.BytesType,), (pytypes.BytesType,)], + ), + ], + ), gaid=OpMappingWithOverloads( result=pytypes.UInt64Type, arity=1, @@ -441,6 +451,15 @@ ), ], ), + online_stake=OpMappingWithOverloads( + result=pytypes.UInt64Type, + arity=0, + overloads=[ + FunctionOpMapping( + "online_stake", + ), + ], + ), replace=OpMappingWithOverloads( result=pytypes.BytesType, arity=3, @@ -589,6 +608,16 @@ ), ], ), + sumhash512=OpMappingWithOverloads( + result=pytypes.BytesType, + arity=1, + overloads=[ + FunctionOpMapping( + "sumhash512", + args=[(pytypes.BytesType,)], + ), + ], + ), vrf_verify=OpMappingWithOverloads( result=pytypes.GenericTupleType.parameterise( (pytypes.BytesType, pytypes.BoolType), source_location=None @@ -763,6 +792,45 @@ ), ], ), + acct_incentive_eligible=OpMappingWithOverloads( + result=pytypes.GenericTupleType.parameterise( + (pytypes.BoolType, pytypes.BoolType), source_location=None + ), + arity=1, + overloads=[ + FunctionOpMapping( + "acct_params_get", + immediates=["AcctIncentiveEligible"], + args=[(pytypes.AccountType, pytypes.UInt64Type)], + ), + ], + ), + acct_last_proposed=OpMappingWithOverloads( + result=pytypes.GenericTupleType.parameterise( + (pytypes.UInt64Type, pytypes.BoolType), source_location=None + ), + arity=1, + overloads=[ + FunctionOpMapping( + "acct_params_get", + immediates=["AcctLastProposed"], + args=[(pytypes.AccountType, pytypes.UInt64Type)], + ), + ], + ), + acct_last_heartbeat=OpMappingWithOverloads( + result=pytypes.GenericTupleType.parameterise( + (pytypes.UInt64Type, pytypes.BoolType), source_location=None + ), + arity=1, + overloads=[ + FunctionOpMapping( + "acct_params_get", + immediates=["AcctLastHeartbeat"], + args=[(pytypes.AccountType, pytypes.UInt64Type)], + ), + ], + ), ), AppGlobal=dict( get_bytes=OpMappingWithOverloads( @@ -1238,6 +1306,94 @@ ), ], ), + blk_proposer=OpMappingWithOverloads( + result=pytypes.AccountType, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkProposer"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), + blk_fees_collected=OpMappingWithOverloads( + result=pytypes.UInt64Type, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkFeesCollected"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), + blk_bonus=OpMappingWithOverloads( + result=pytypes.UInt64Type, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkBonus"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), + blk_branch=OpMappingWithOverloads( + result=pytypes.BytesType, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkBranch"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), + blk_fee_sink=OpMappingWithOverloads( + result=pytypes.AccountType, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkFeeSink"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), + blk_protocol=OpMappingWithOverloads( + result=pytypes.BytesType, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkProtocol"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), + blk_txn_counter=OpMappingWithOverloads( + result=pytypes.UInt64Type, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkTxnCounter"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), + blk_proposer_payout=OpMappingWithOverloads( + result=pytypes.UInt64Type, + arity=1, + overloads=[ + FunctionOpMapping( + "block", + immediates=["BlkProposerPayout"], + args=[(pytypes.UInt64Type,)], + ), + ], + ), ), Box=dict( create=OpMappingWithOverloads( @@ -3445,6 +3601,31 @@ "GenesisHash", pytypes.BytesType, ), + payouts_enabled=PropertyOpMapping( + "global", + "PayoutsEnabled", + pytypes.BoolType, + ), + payouts_go_online_fee=PropertyOpMapping( + "global", + "PayoutsGoOnlineFee", + pytypes.UInt64Type, + ), + payouts_percent=PropertyOpMapping( + "global", + "PayoutsPercent", + pytypes.UInt64Type, + ), + payouts_min_balance=PropertyOpMapping( + "global", + "PayoutsMinBalance", + pytypes.UInt64Type, + ), + payouts_max_balance=PropertyOpMapping( + "global", + "PayoutsMaxBalance", + pytypes.UInt64Type, + ), ), ITxn=dict( sender=OpMappingWithOverloads( @@ -5191,4 +5372,32 @@ pytypes.UInt64Type, ), ), + VoterParamsGet=dict( + voter_balance=OpMappingWithOverloads( + result=pytypes.GenericTupleType.parameterise( + (pytypes.UInt64Type, pytypes.BoolType), source_location=None + ), + arity=1, + overloads=[ + FunctionOpMapping( + "voter_params_get", + immediates=["VoterBalance"], + args=[(pytypes.BytesType, pytypes.UInt64Type)], + ), + ], + ), + voter_incentive_eligible=OpMappingWithOverloads( + result=pytypes.GenericTupleType.parameterise( + (pytypes.BoolType, pytypes.BoolType), source_location=None + ), + arity=1, + overloads=[ + FunctionOpMapping( + "voter_params_get", + immediates=["VoterIncentiveEligible"], + args=[(pytypes.BytesType, pytypes.UInt64Type)], + ), + ], + ), + ), ) diff --git a/src/puyapy/awst_build/module.py b/src/puyapy/awst_build/module.py index d03be6c1b7..5862c91bc8 100644 --- a/src/puyapy/awst_build/module.py +++ b/src/puyapy/awst_build/module.py @@ -39,6 +39,7 @@ @attrs.frozen(kw_only=True) class _LogicSigDecoratorInfo: name_override: str | None + avm_version: int | None _BUILTIN_INHERITABLE: typing.Final = frozenset( @@ -99,6 +100,7 @@ def deferred(ctx: ASTConversionModuleContext) -> RootNode: short_name=coalesce(info.name_override, program.name), docstring=func_def.docstring, source_location=self._location(logicsig_dec), + avm_version=info.avm_version, ) return [deferred] @@ -120,19 +122,33 @@ def deferred(ctx: ASTConversionModuleContext) -> RootNode: def _process_logic_sig_decorator( self, decorator: mypy.nodes.Expression ) -> _LogicSigDecoratorInfo: + name_override = None + avm_version = None match decorator: - case mypy.nodes.NameExpr() | mypy.nodes.CallExpr(args=[]): + case mypy.nodes.NameExpr(): pass - case mypy.nodes.CallExpr(arg_names=["name"], args=[name_arg]): - name_const = name_arg.accept(self) - if isinstance(name_const, str): - return _LogicSigDecoratorInfo(name_override=name_const) - self.context.error(f"Expected a string, got {name_const!r}", name_arg) + case mypy.nodes.CallExpr(arg_names=arg_names, args=args): + for arg_name, arg in zip(arg_names, args, strict=True): + match arg_name: + case "name": + name_const = arg.accept(self) + if isinstance(name_const, str): + name_override = name_const + else: + self.context.error("expected a str", arg) + case "avm_version": + version_const = arg.accept(self) + if isinstance(version_const, int): + avm_version = version_const + else: + self.context.error("expected an int", arg) + case _: + self.context.error("unexpected argument", arg) case _: self.context.error( - f"Invalid {constants.LOGICSIG_DECORATOR_ALIAS} usage", decorator + f"invalid {constants.LOGICSIG_DECORATOR_ALIAS} usage", decorator ) - return _LogicSigDecoratorInfo(name_override=None) + return _LogicSigDecoratorInfo(name_override=name_override, avm_version=avm_version) def visit_class_def(self, cdef: mypy.nodes.ClassDef) -> StatementResult: self.check_fatal_decorators(cdef.decorators) @@ -581,6 +597,7 @@ def _process_contract_class_options( name_override: str | None = None scratch_slot_reservations = set[int]() state_totals = None + avm_version = None for kw_name, kw_expr in cdef.keywords.items(): with context.log_exceptions(kw_expr): match kw_name: @@ -622,6 +639,12 @@ def _process_contract_class_options( else: arg_map[arg_name] = arg_value state_totals = StateTotals(**arg_map) + case "avm_version": + version_value = kw_expr.accept(expr_visitor) + if isinstance(version_value, int): + avm_version = version_value + else: + context.error("unexpected argument type", kw_expr) case "metaclass": context.error("metaclass option is unsupported", kw_expr) case _: @@ -630,6 +653,7 @@ def _process_contract_class_options( name_override=name_override, scratch_slot_reservations=scratch_slot_reservations, state_totals=state_totals, + avm_version=avm_version, ) diff --git a/src/puyapy/compile.py b/src/puyapy/compile.py index be5470f450..f8520691de 100644 --- a/src/puyapy/compile.py +++ b/src/puyapy/compile.py @@ -33,7 +33,7 @@ # this should contain the lowest version number that this compiler does NOT support # i.e. the next minor version after what is defined in stubs/pyproject.toml:tool.poetry.version -MAX_SUPPORTED_ALGOPY_VERSION_EX = version.parse("2.3.0") +MAX_SUPPORTED_ALGOPY_VERSION_EX = version.parse("2.4.0") MIN_SUPPORTED_ALGOPY_VERSION = version.parse(f"{MAX_SUPPORTED_ALGOPY_VERSION_EX.major}.0.0") logger = log.get_logger(__name__) diff --git a/src/puyapy/models.py b/src/puyapy/models.py index 18687c24ad..b7284136ef 100644 --- a/src/puyapy/models.py +++ b/src/puyapy/models.py @@ -27,6 +27,7 @@ class ContractClassOptions: name_override: str | None scratch_slot_reservations: Set[int] | None state_totals: StateTotals | None + avm_version: int | None @attrs.frozen diff --git a/stubs/algopy-stubs/_contract.pyi b/stubs/algopy-stubs/_contract.pyi index cfe633d852..e7621c95f1 100644 --- a/stubs/algopy-stubs/_contract.pyi +++ b/stubs/algopy-stubs/_contract.pyi @@ -38,6 +38,7 @@ class Contract(abc.ABC): name: str = ..., scratch_slots: urange | tuple[int | urange, ...] | list[int | urange] = ..., state_totals: StateTotals = ..., + avm_version: int = ..., ): """ When declaring a Contract subclass, options and configuration are passed in @@ -80,6 +81,9 @@ class Contract(abc.ABC): specified. Note that it is valid to not provide any arguments to the `StateTotals` constructor, like so `state_totals=StateTotals()`, in which case all values will be automatically calculated. + :param avm_version: + Determines which AVM version to use, this affects what operations are supported. + Defaults to value provided supplied on command line (which defaults to current mainnet version) """ @abc.abstractmethod diff --git a/stubs/algopy-stubs/_logic_sig.pyi b/stubs/algopy-stubs/_logic_sig.pyi index 33b37a2a70..dffd79c23b 100644 --- a/stubs/algopy-stubs/_logic_sig.pyi +++ b/stubs/algopy-stubs/_logic_sig.pyi @@ -9,5 +9,9 @@ class LogicSig: @typing.overload def logicsig(sub: Callable[[], bool | UInt64], /) -> LogicSig: ... @typing.overload -def logicsig(*, name: str) -> Callable[[Callable[[], bool | UInt64]], LogicSig]: +def logicsig( + *, + name: str = ..., + avm_version: int = ..., +) -> Callable[[Callable[[], bool | UInt64]], LogicSig]: """Decorator to indicate a function is a logic signature""" diff --git a/stubs/algopy-stubs/op.pyi b/stubs/algopy-stubs/op.pyi index d948ba1ac8..d31be95519 100644 --- a/stubs/algopy-stubs/op.pyi +++ b/stubs/algopy-stubs/op.pyi @@ -15,9 +15,21 @@ class EC(str): """Available values for the `EC` enum""" BN254g1: EC = ... + """ + G1 of the BN254 curve. Points encoded as 32 byte X following by 32 byte Y + """ BN254g2: EC = ... + """ + G2 of the BN254 curve. Points encoded as 64 byte X following by 64 byte Y + """ BLS12_381g1: EC = ... + """ + G1 of the BLS 12-381 curve. Points encoded as 48 byte X following by 48 byte Y + """ BLS12_381g2: EC = ... + """ + G2 of the BLS 12-381 curve. Points encoded as 96 byte X following by 96 byte Y + """ class Base64(str): """Available values for the `base64` enum""" @@ -29,7 +41,13 @@ class ECDSA(str): """Available values for the `ECDSA` enum""" Secp256k1: ECDSA = ... + """ + secp256k1 curve, used in Bitcoin + """ Secp256r1: ECDSA = ... + """ + secp256r1 curve, NIST standard + """ class VrfVerify(str): """Available values for the `vrf_verify` enum""" @@ -244,6 +262,14 @@ def extract_uint64(a: Bytes | bytes, b: UInt64 | int, /) -> UInt64: Native TEAL opcode: [`extract_uint64`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#extract_uint64) """ +def falcon_verify(a: Bytes | bytes, b: Bytes | bytes, c: Bytes | bytes, /) -> bool: + """ + for (data A, compressed-format signature B, pubkey C) verify the signature of data against the pubkey + Min AVM version: 11 + + Native TEAL opcode: [`falcon_verify`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#falcon_verify) + """ + def gaid(a: UInt64 | int, /) -> UInt64: """ ID of the asset or application created in the Ath transaction of the current group @@ -310,6 +336,14 @@ def mulw(a: UInt64 | int, b: UInt64 | int, /) -> tuple[UInt64, UInt64]: Native TEAL opcode: [`mulw`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#mulw) """ +def online_stake() -> UInt64: + """ + the total online stake in the agreement round + Min AVM version: 11 + + Native TEAL opcode: [`online_stake`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#online_stake) + """ + def replace(a: Bytes | bytes, b: UInt64 | int, c: Bytes | bytes, /) -> Bytes: """ Copy of A with the bytes starting at B replaced by the bytes of C. Fails if B+len(C) exceeds len(A) @@ -404,6 +438,14 @@ def substring(a: Bytes | bytes, b: UInt64 | int, c: UInt64 | int, /) -> Bytes: Native TEAL opcode: [`substring`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#substring), [`substring3`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#substring3) """ +def sumhash512(a: Bytes | bytes, /) -> Bytes: + """ + sumhash512 of value A, yields [64]byte + Min AVM version: 11 + + Native TEAL opcode: [`sumhash512`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#sumhash512) + """ + def vrf_verify( s: VrfVerify, a: Bytes | bytes, b: Bytes | bytes, c: Bytes | bytes, / ) -> tuple[Bytes, bool]: @@ -517,6 +559,33 @@ class AcctParamsGet: Native TEAL opcode: [`acct_params_get`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#acct_params_get) """ + @staticmethod + def acct_incentive_eligible(a: Account | UInt64 | int, /) -> tuple[bool, bool]: + """ + Min AVM version: 11 + :returns tuple[bool, bool]: Has this account opted into block payouts + + Native TEAL opcode: [`acct_params_get`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#acct_params_get) + """ + + @staticmethod + def acct_last_proposed(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: + """ + Min AVM version: 11 + :returns tuple[UInt64, bool]: The round number of the last block this account proposed. + + Native TEAL opcode: [`acct_params_get`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#acct_params_get) + """ + + @staticmethod + def acct_last_heartbeat(a: Account | UInt64 | int, /) -> tuple[UInt64, bool]: + """ + Min AVM version: 11 + :returns tuple[UInt64, bool]: The round number of the last block this account sent a heartbeat. + + Native TEAL opcode: [`acct_params_get`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#acct_params_get) + """ + class AppGlobal: """ Get or modify Global app state @@ -870,6 +939,70 @@ class Block: Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) """ + @staticmethod + def blk_proposer(a: UInt64 | int, /) -> Account: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + + @staticmethod + def blk_fees_collected(a: UInt64 | int, /) -> UInt64: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + + @staticmethod + def blk_bonus(a: UInt64 | int, /) -> UInt64: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + + @staticmethod + def blk_branch(a: UInt64 | int, /) -> Bytes: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + + @staticmethod + def blk_fee_sink(a: UInt64 | int, /) -> Account: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + + @staticmethod + def blk_protocol(a: UInt64 | int, /) -> Bytes: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + + @staticmethod + def blk_txn_counter(a: UInt64 | int, /) -> UInt64: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + + @staticmethod + def blk_proposer_payout(a: UInt64 | int, /) -> UInt64: + """ + Min AVM version: 11 + + Native TEAL opcode: [`block`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#block) + """ + class Box: """ Get or modify box state @@ -2294,6 +2427,36 @@ class Global: The Genesis Hash for the network. """ + payouts_enabled: typing.Final[bool] = ... + """ + Whether block proposal payouts are enabled. + Min AVM version: 11 + """ + + payouts_go_online_fee: typing.Final[UInt64] = ... + """ + The fee required in a keyreg transaction to make an account incentive eligible. + Min AVM version: 11 + """ + + payouts_percent: typing.Final[UInt64] = ... + """ + The percentage of transaction fees in a block that can be paid to the block proposer. + Min AVM version: 11 + """ + + payouts_min_balance: typing.Final[UInt64] = ... + """ + The minimum algo balance an account must have in the agreement round to receive block payouts in the proposal round. + Min AVM version: 11 + """ + + payouts_max_balance: typing.Final[UInt64] = ... + """ + The maximum algo balance an account can have in the agreement round to receive block payouts in the proposal round. + Min AVM version: 11 + """ + class ITxn: """ Get values for the last inner transaction @@ -3701,3 +3864,27 @@ class Txn: """ Number of ClearState Program pages """ + +class VoterParamsGet: + """ + X is field F from online account A as of the balance round: 320 rounds before the current round. Y is 1 if A had positive algos online in the agreement round, else Y is 0 and X is a type specific zero-value + Native TEAL op: [`voter_params_get`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#voter_params_get) + """ + + @staticmethod + def voter_balance(a: Bytes | UInt64 | bytes | int, /) -> tuple[UInt64, bool]: + """ + Min AVM version: 11 + :returns tuple[UInt64, bool]: Online stake in microalgos + + Native TEAL opcode: [`voter_params_get`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#voter_params_get) + """ + + @staticmethod + def voter_incentive_eligible(a: Bytes | UInt64 | bytes | int, /) -> tuple[bool, bool]: + """ + Min AVM version: 11 + :returns tuple[bool, bool]: Had this account opted into block payouts + + Native TEAL opcode: [`voter_params_get`](https://developer.algorand.org/docs/get-details/dapps/avm/teal/opcodes/v10/#voter_params_get) + """ diff --git a/stubs/pyproject.toml b/stubs/pyproject.toml index be072296eb..0cc98349bf 100644 --- a/stubs/pyproject.toml +++ b/stubs/pyproject.toml @@ -3,7 +3,7 @@ name = "algorand-python" # this version represents the version of the stub API's and should follow semver semantics # when updating this value also update src/compile.py:MAX_SUPPORTED_ALGOPY_VERSION_EX if it is a major/minor change # also see stubs/README.md#versioning -version = "2.2.0" +version = "2.3.0" description = "API for writing Algorand Python Smart contracts" authors = ["Algorand Foundation "] readme = "README.md" diff --git a/test_cases/avm_11/contract.py b/test_cases/avm_11/contract.py new file mode 100644 index 0000000000..6b919429d7 --- /dev/null +++ b/test_cases/avm_11/contract.py @@ -0,0 +1,42 @@ +from algopy import ARC4Contract, Txn, UInt64, arc4, logicsig, op + + +@logicsig(avm_version=11) +def avm_11_sig() -> UInt64: + return op.sumhash512(b"").length + + +class Contract(ARC4Contract, avm_version=11): + + @arc4.abimethod + def test_new_ops(self) -> None: + # op functions + assert not op.falcon_verify(b"", b"", op.bzero(1793)) + assert op.sumhash512(b"") + assert op.online_stake() + + # AcctParamsGet, TODO: add to Account once 11 is in mainnet? + a, b = op.AcctParamsGet.acct_incentive_eligible(Txn.sender) + c, d = op.AcctParamsGet.acct_last_proposed(Txn.sender) + e, f = op.AcctParamsGet.acct_last_heartbeat(Txn.sender) + + # Block + assert not op.Block.blk_proposer(0), "proposer" + assert op.Block.blk_fees_collected(0), "fees collected" + assert op.Block.blk_bonus(0), "bonus" + assert op.Block.blk_branch(0), "branch" + assert op.Block.blk_fee_sink(0), "fee sink" + assert op.Block.blk_protocol(0), "protocol" + assert op.Block.blk_txn_counter(0), "txn counter" + assert op.Block.blk_proposer_payout(0), "proposer payout" + + # Global + assert op.Global.payouts_enabled, "payouts_enabled" + assert op.Global.payouts_go_online_fee, "payouts_go_online_fee" + assert op.Global.payouts_percent, "payouts_percent" + assert op.Global.payouts_min_balance, "payouts_min_balance" + assert op.Global.payouts_max_balance, "payouts_max_balance" + + # Voter params + g, h = op.VoterParamsGet.voter_balance(0) + i, j = op.VoterParamsGet.voter_incentive_eligible(0) diff --git a/test_cases/avm_11/out/Contract.approval.teal b/test_cases/avm_11/out/Contract.approval.teal new file mode 100644 index 0000000000..e05c11f54b --- /dev/null +++ b/test_cases/avm_11/out/Contract.approval.teal @@ -0,0 +1,158 @@ +#pragma version 11 + +test_cases.avm_11.contract.Contract.approval_program: + intcblock 0 1 + callsub __puya_arc4_router__ + return + + +// test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> uint64: +__puya_arc4_router__: + // avm_11/contract.py:9 + // class Contract(ARC4Contract, avm_version=11): + proto 0 1 + txn NumAppArgs + bz __puya_arc4_router___bare_routing@5 + pushbytes 0xc2b8dd8a // method "test_new_ops()void" + txna ApplicationArgs 0 + match __puya_arc4_router___test_new_ops_route@2 + intc_0 // 0 + retsub + +__puya_arc4_router___test_new_ops_route@2: + // avm_11/contract.py:11 + // @arc4.abimethod + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub test_new_ops + intc_1 // 1 + retsub + +__puya_arc4_router___bare_routing@5: + // avm_11/contract.py:9 + // class Contract(ARC4Contract, avm_version=11): + txn OnCompletion + bnz __puya_arc4_router___after_if_else@9 + txn ApplicationID + ! + assert // is creating + intc_1 // 1 + retsub + +__puya_arc4_router___after_if_else@9: + // avm_11/contract.py:9 + // class Contract(ARC4Contract, avm_version=11): + intc_0 // 0 + retsub + + +// test_cases.avm_11.contract.Contract.test_new_ops() -> void: +test_new_ops: + // avm_11/contract.py:11-12 + // @arc4.abimethod + // def test_new_ops(self) -> None: + proto 0 0 + // avm_11/contract.py:13-14 + // # op functions + // assert not op.falcon_verify(b"", b"", op.bzero(1793)) + pushint 1793 // 1793 + bzero + pushbytes 0x + dup + uncover 2 + falcon_verify + ! + assert + // avm_11/contract.py:15 + // assert op.sumhash512(b"") + pushbytes 0x + sumhash512 + len + assert + // avm_11/contract.py:16 + // assert op.online_stake() + online_stake + assert + // avm_11/contract.py:23-24 + // # Block + // assert not op.Block.blk_proposer(0), "proposer" + intc_0 // 0 + block BlkProposer + global ZeroAddress + == + assert // proposer + // avm_11/contract.py:25 + // assert op.Block.blk_fees_collected(0), "fees collected" + intc_0 // 0 + block BlkFeesCollected + assert // fees collected + // avm_11/contract.py:26 + // assert op.Block.blk_bonus(0), "bonus" + intc_0 // 0 + block BlkBonus + assert // bonus + // avm_11/contract.py:27 + // assert op.Block.blk_branch(0), "branch" + intc_0 // 0 + block BlkBranch + len + assert // branch + // avm_11/contract.py:28 + // assert op.Block.blk_fee_sink(0), "fee sink" + intc_0 // 0 + block BlkFeeSink + global ZeroAddress + != + assert // fee sink + // avm_11/contract.py:29 + // assert op.Block.blk_protocol(0), "protocol" + intc_0 // 0 + block BlkProtocol + len + assert // protocol + // avm_11/contract.py:30 + // assert op.Block.blk_txn_counter(0), "txn counter" + intc_0 // 0 + block BlkTxnCounter + assert // txn counter + // avm_11/contract.py:31 + // assert op.Block.blk_proposer_payout(0), "proposer payout" + intc_0 // 0 + block BlkProposerPayout + assert // proposer payout + // avm_11/contract.py:33-34 + // # Global + // assert op.Global.payouts_enabled, "payouts_enabled" + global PayoutsEnabled + assert // payouts_enabled + // avm_11/contract.py:35 + // assert op.Global.payouts_go_online_fee, "payouts_go_online_fee" + global PayoutsGoOnlineFee + assert // payouts_go_online_fee + // avm_11/contract.py:36 + // assert op.Global.payouts_percent, "payouts_percent" + global PayoutsPercent + assert // payouts_percent + // avm_11/contract.py:37 + // assert op.Global.payouts_min_balance, "payouts_min_balance" + global PayoutsMinBalance + assert // payouts_min_balance + // avm_11/contract.py:38 + // assert op.Global.payouts_max_balance, "payouts_max_balance" + global PayoutsMaxBalance + assert // payouts_max_balance + // avm_11/contract.py:40-41 + // # Voter params + // g, h = op.VoterParamsGet.voter_balance(0) + intc_0 // 0 + voter_params_get VoterBalance + popn 2 + // avm_11/contract.py:42 + // i, j = op.VoterParamsGet.voter_incentive_eligible(0) + intc_0 // 0 + voter_params_get VoterIncentiveEligible + popn 2 + retsub diff --git a/test_cases/avm_11/out/Contract.arc32.json b/test_cases/avm_11/out/Contract.arc32.json new file mode 100644 index 0000000000..39c621d99b --- /dev/null +++ b/test_cases/avm_11/out/Contract.arc32.json @@ -0,0 +1,50 @@ +{ + "hints": { + "test_new_ops()void": { + "call_config": { + "no_op": "CALL" + } + } + }, + "source": { + "approval": "I3ByYWdtYSB2ZXJzaW9uIDExCgp0ZXN0X2Nhc2VzLmF2bV8xMS5jb250cmFjdC5Db250cmFjdC5hcHByb3ZhbF9wcm9ncmFtOgogICAgaW50Y2Jsb2NrIDAgMQogICAgY2FsbHN1YiBfX3B1eWFfYXJjNF9yb3V0ZXJfXwogICAgcmV0dXJuCgoKLy8gdGVzdF9jYXNlcy5hdm1fMTEuY29udHJhY3QuQ29udHJhY3QuX19wdXlhX2FyYzRfcm91dGVyX18oKSAtPiB1aW50NjQ6Cl9fcHV5YV9hcmM0X3JvdXRlcl9fOgogICAgLy8gYXZtXzExL2NvbnRyYWN0LnB5OjkKICAgIC8vIGNsYXNzIENvbnRyYWN0KEFSQzRDb250cmFjdCwgYXZtX3ZlcnNpb249MTEpOgogICAgcHJvdG8gMCAxCiAgICB0eG4gTnVtQXBwQXJncwogICAgYnogX19wdXlhX2FyYzRfcm91dGVyX19fYmFyZV9yb3V0aW5nQDUKICAgIHB1c2hieXRlcyAweGMyYjhkZDhhIC8vIG1ldGhvZCAidGVzdF9uZXdfb3BzKCl2b2lkIgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAogICAgbWF0Y2ggX19wdXlhX2FyYzRfcm91dGVyX19fdGVzdF9uZXdfb3BzX3JvdXRlQDIKICAgIGludGNfMCAvLyAwCiAgICByZXRzdWIKCl9fcHV5YV9hcmM0X3JvdXRlcl9fX3Rlc3RfbmV3X29wc19yb3V0ZUAyOgogICAgLy8gYXZtXzExL2NvbnRyYWN0LnB5OjExCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgTm9PcAogICAgdHhuIEFwcGxpY2F0aW9uSUQKICAgIGFzc2VydCAvLyBpcyBub3QgY3JlYXRpbmcKICAgIGNhbGxzdWIgdGVzdF9uZXdfb3BzCiAgICBpbnRjXzEgLy8gMQogICAgcmV0c3ViCgpfX3B1eWFfYXJjNF9yb3V0ZXJfX19iYXJlX3JvdXRpbmdANToKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weTo5CiAgICAvLyBjbGFzcyBDb250cmFjdChBUkM0Q29udHJhY3QsIGF2bV92ZXJzaW9uPTExKToKICAgIHR4biBPbkNvbXBsZXRpb24KICAgIGJueiBfX3B1eWFfYXJjNF9yb3V0ZXJfX19hZnRlcl9pZl9lbHNlQDkKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICAhCiAgICBhc3NlcnQgLy8gaXMgY3JlYXRpbmcKICAgIGludGNfMSAvLyAxCiAgICByZXRzdWIKCl9fcHV5YV9hcmM0X3JvdXRlcl9fX2FmdGVyX2lmX2Vsc2VAOToKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weTo5CiAgICAvLyBjbGFzcyBDb250cmFjdChBUkM0Q29udHJhY3QsIGF2bV92ZXJzaW9uPTExKToKICAgIGludGNfMCAvLyAwCiAgICByZXRzdWIKCgovLyB0ZXN0X2Nhc2VzLmF2bV8xMS5jb250cmFjdC5Db250cmFjdC50ZXN0X25ld19vcHMoKSAtPiB2b2lkOgp0ZXN0X25ld19vcHM6CiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MTEtMTIKICAgIC8vIEBhcmM0LmFiaW1ldGhvZAogICAgLy8gZGVmIHRlc3RfbmV3X29wcyhzZWxmKSAtPiBOb25lOgogICAgcHJvdG8gMCAwCiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MTMtMTQKICAgIC8vICMgb3AgZnVuY3Rpb25zCiAgICAvLyBhc3NlcnQgbm90IG9wLmZhbGNvbl92ZXJpZnkoYiIiLCBiIiIsIG9wLmJ6ZXJvKDE3OTMpKQogICAgcHVzaGludCAxNzkzIC8vIDE3OTMKICAgIGJ6ZXJvCiAgICBwdXNoYnl0ZXMgMHgKICAgIGR1cAogICAgdW5jb3ZlciAyCiAgICBmYWxjb25fdmVyaWZ5CiAgICAhCiAgICBhc3NlcnQKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weToxNQogICAgLy8gYXNzZXJ0IG9wLnN1bWhhc2g1MTIoYiIiKQogICAgcHVzaGJ5dGVzIDB4CiAgICBzdW1oYXNoNTEyCiAgICBsZW4KICAgIGFzc2VydAogICAgLy8gYXZtXzExL2NvbnRyYWN0LnB5OjE2CiAgICAvLyBhc3NlcnQgb3Aub25saW5lX3N0YWtlKCkKICAgIG9ubGluZV9zdGFrZQogICAgYXNzZXJ0CiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MjMtMjQKICAgIC8vICMgQmxvY2sKICAgIC8vIGFzc2VydCBub3Qgb3AuQmxvY2suYmxrX3Byb3Bvc2VyKDApLCAicHJvcG9zZXIiCiAgICBpbnRjXzAgLy8gMAogICAgYmxvY2sgQmxrUHJvcG9zZXIKICAgIGdsb2JhbCBaZXJvQWRkcmVzcwogICAgPT0KICAgIGFzc2VydCAvLyBwcm9wb3NlcgogICAgLy8gYXZtXzExL2NvbnRyYWN0LnB5OjI1CiAgICAvLyBhc3NlcnQgb3AuQmxvY2suYmxrX2ZlZXNfY29sbGVjdGVkKDApLCAiZmVlcyBjb2xsZWN0ZWQiCiAgICBpbnRjXzAgLy8gMAogICAgYmxvY2sgQmxrRmVlc0NvbGxlY3RlZAogICAgYXNzZXJ0IC8vIGZlZXMgY29sbGVjdGVkCiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MjYKICAgIC8vIGFzc2VydCBvcC5CbG9jay5ibGtfYm9udXMoMCksICJib251cyIKICAgIGludGNfMCAvLyAwCiAgICBibG9jayBCbGtCb251cwogICAgYXNzZXJ0IC8vIGJvbnVzCiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MjcKICAgIC8vIGFzc2VydCBvcC5CbG9jay5ibGtfYnJhbmNoKDApLCAiYnJhbmNoIgogICAgaW50Y18wIC8vIDAKICAgIGJsb2NrIEJsa0JyYW5jaAogICAgbGVuCiAgICBhc3NlcnQgLy8gYnJhbmNoCiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MjgKICAgIC8vIGFzc2VydCBvcC5CbG9jay5ibGtfZmVlX3NpbmsoMCksICJmZWUgc2luayIKICAgIGludGNfMCAvLyAwCiAgICBibG9jayBCbGtGZWVTaW5rCiAgICBnbG9iYWwgWmVyb0FkZHJlc3MKICAgICE9CiAgICBhc3NlcnQgLy8gZmVlIHNpbmsKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weToyOQogICAgLy8gYXNzZXJ0IG9wLkJsb2NrLmJsa19wcm90b2NvbCgwKSwgInByb3RvY29sIgogICAgaW50Y18wIC8vIDAKICAgIGJsb2NrIEJsa1Byb3RvY29sCiAgICBsZW4KICAgIGFzc2VydCAvLyBwcm90b2NvbAogICAgLy8gYXZtXzExL2NvbnRyYWN0LnB5OjMwCiAgICAvLyBhc3NlcnQgb3AuQmxvY2suYmxrX3R4bl9jb3VudGVyKDApLCAidHhuIGNvdW50ZXIiCiAgICBpbnRjXzAgLy8gMAogICAgYmxvY2sgQmxrVHhuQ291bnRlcgogICAgYXNzZXJ0IC8vIHR4biBjb3VudGVyCiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MzEKICAgIC8vIGFzc2VydCBvcC5CbG9jay5ibGtfcHJvcG9zZXJfcGF5b3V0KDApLCAicHJvcG9zZXIgcGF5b3V0IgogICAgaW50Y18wIC8vIDAKICAgIGJsb2NrIEJsa1Byb3Bvc2VyUGF5b3V0CiAgICBhc3NlcnQgLy8gcHJvcG9zZXIgcGF5b3V0CiAgICAvLyBhdm1fMTEvY29udHJhY3QucHk6MzMtMzQKICAgIC8vICMgR2xvYmFsCiAgICAvLyBhc3NlcnQgb3AuR2xvYmFsLnBheW91dHNfZW5hYmxlZCwgInBheW91dHNfZW5hYmxlZCIKICAgIGdsb2JhbCBQYXlvdXRzRW5hYmxlZAogICAgYXNzZXJ0IC8vIHBheW91dHNfZW5hYmxlZAogICAgLy8gYXZtXzExL2NvbnRyYWN0LnB5OjM1CiAgICAvLyBhc3NlcnQgb3AuR2xvYmFsLnBheW91dHNfZ29fb25saW5lX2ZlZSwgInBheW91dHNfZ29fb25saW5lX2ZlZSIKICAgIGdsb2JhbCBQYXlvdXRzR29PbmxpbmVGZWUKICAgIGFzc2VydCAvLyBwYXlvdXRzX2dvX29ubGluZV9mZWUKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weTozNgogICAgLy8gYXNzZXJ0IG9wLkdsb2JhbC5wYXlvdXRzX3BlcmNlbnQsICJwYXlvdXRzX3BlcmNlbnQiCiAgICBnbG9iYWwgUGF5b3V0c1BlcmNlbnQKICAgIGFzc2VydCAvLyBwYXlvdXRzX3BlcmNlbnQKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weTozNwogICAgLy8gYXNzZXJ0IG9wLkdsb2JhbC5wYXlvdXRzX21pbl9iYWxhbmNlLCAicGF5b3V0c19taW5fYmFsYW5jZSIKICAgIGdsb2JhbCBQYXlvdXRzTWluQmFsYW5jZQogICAgYXNzZXJ0IC8vIHBheW91dHNfbWluX2JhbGFuY2UKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weTozOAogICAgLy8gYXNzZXJ0IG9wLkdsb2JhbC5wYXlvdXRzX21heF9iYWxhbmNlLCAicGF5b3V0c19tYXhfYmFsYW5jZSIKICAgIGdsb2JhbCBQYXlvdXRzTWF4QmFsYW5jZQogICAgYXNzZXJ0IC8vIHBheW91dHNfbWF4X2JhbGFuY2UKICAgIC8vIGF2bV8xMS9jb250cmFjdC5weTo0MC00MQogICAgLy8gIyBWb3RlciBwYXJhbXMKICAgIC8vIGcsIGggPSBvcC5Wb3RlclBhcmFtc0dldC52b3Rlcl9iYWxhbmNlKDApCiAgICBpbnRjXzAgLy8gMAogICAgdm90ZXJfcGFyYW1zX2dldCBWb3RlckJhbGFuY2UKICAgIHBvcG4gMgogICAgLy8gYXZtXzExL2NvbnRyYWN0LnB5OjQyCiAgICAvLyBpLCBqID0gb3AuVm90ZXJQYXJhbXNHZXQudm90ZXJfaW5jZW50aXZlX2VsaWdpYmxlKDApCiAgICBpbnRjXzAgLy8gMAogICAgdm90ZXJfcGFyYW1zX2dldCBWb3RlckluY2VudGl2ZUVsaWdpYmxlCiAgICBwb3BuIDIKICAgIHJldHN1Ygo=", + "clear": "I3ByYWdtYSB2ZXJzaW9uIDExCgp0ZXN0X2Nhc2VzLmF2bV8xMS5jb250cmFjdC5Db250cmFjdC5jbGVhcl9zdGF0ZV9wcm9ncmFtOgogICAgcHVzaGludCAxIC8vIDEKICAgIHJldHVybgo=" + }, + "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": "Contract", + "methods": [ + { + "name": "test_new_ops", + "args": [], + "readonly": false, + "returns": { + "type": "void" + } + } + ], + "networks": {} + }, + "bare_call_config": { + "no_op": "CREATE" + } +} \ No newline at end of file diff --git a/test_cases/avm_11/out/Contract.clear.teal b/test_cases/avm_11/out/Contract.clear.teal new file mode 100644 index 0000000000..00e6c16dd3 --- /dev/null +++ b/test_cases/avm_11/out/Contract.clear.teal @@ -0,0 +1,5 @@ +#pragma version 11 + +test_cases.avm_11.contract.Contract.clear_state_program: + pushint 1 // 1 + return diff --git a/test_cases/avm_11/out/Contract.destructured.ir b/test_cases/avm_11/out/Contract.destructured.ir new file mode 100644 index 0000000000..0d60a684c3 --- /dev/null +++ b/test_cases/avm_11/out/Contract.destructured.ir @@ -0,0 +1,84 @@ +contract test_cases.avm_11.contract.Contract: + program approval: + subroutine algopy.arc4.ARC4Contract.approval_program() -> bool: + block@0: // L1 + let tmp%0#0: bool = test_cases.avm_11.contract.Contract.__puya_arc4_router__() + return tmp%0#0 + + subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> bool: + block@0: // L9 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@5 + block@1: // abi_routing_L9 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "test_new_ops()void" => block@2, * => return 0u} + block@2: // test_new_ops_route_L11 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: bool = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + test_cases.avm_11.contract.Contract.test_new_ops() + return 1u + block@5: // bare_routing_L9 + let tmp%7#0: uint64 = (txn OnCompletion) + goto tmp%7#0 ? block@9 : block@6 + block@6: // __algopy_default_create_L1 + let tmp%8#0: uint64 = (txn ApplicationID) + let tmp%9#0: bool = (! tmp%8#0) + (assert tmp%9#0) // is creating + return 1u + block@9: // after_if_else_L9 + return 0u + + subroutine test_cases.avm_11.contract.Contract.test_new_ops() -> void: + block@0: // L11 + let tmp%0#0: bytes = (bzero 1793u) + let tmp%1#0: bool = (falcon_verify 0x 0x tmp%0#0) + let tmp%2#0: bool = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: bytes = (sumhash512 0x) + let tmp%4#0: uint64 = (len tmp%3#0) + (assert tmp%4#0) + let tmp%6#0: uint64 = online_stake + (assert tmp%6#0) + let tmp%11#0: bytes = ((block BlkProposer) 0u) + let tmp%12#0: bytes = (global ZeroAddress) + let tmp%13#0: bool = (== tmp%11#0 tmp%12#0) + (assert tmp%13#0) // proposer + let tmp%14#0: uint64 = ((block BlkFeesCollected) 0u) + (assert tmp%14#0) // fees collected + let tmp%16#0: uint64 = ((block BlkBonus) 0u) + (assert tmp%16#0) // bonus + let tmp%18#0: bytes = ((block BlkBranch) 0u) + let tmp%19#0: uint64 = (len tmp%18#0) + (assert tmp%19#0) // branch + let tmp%21#0: bytes = ((block BlkFeeSink) 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: bool = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // fee sink + let tmp%24#0: bytes = ((block BlkProtocol) 0u) + let tmp%25#0: uint64 = (len tmp%24#0) + (assert tmp%25#0) // protocol + let tmp%27#0: uint64 = ((block BlkTxnCounter) 0u) + (assert tmp%27#0) // txn counter + let tmp%29#0: uint64 = ((block BlkProposerPayout) 0u) + (assert tmp%29#0) // proposer payout + let tmp%31#0: bool = (global PayoutsEnabled) + (assert tmp%31#0) // payouts_enabled + let tmp%32#0: uint64 = (global PayoutsGoOnlineFee) + (assert tmp%32#0) // payouts_go_online_fee + let tmp%34#0: uint64 = (global PayoutsPercent) + (assert tmp%34#0) // payouts_percent + let tmp%36#0: uint64 = (global PayoutsMinBalance) + (assert tmp%36#0) // payouts_min_balance + let tmp%38#0: uint64 = (global PayoutsMaxBalance) + (assert tmp%38#0) // payouts_max_balance + let (g#0: uint64, h#0: bool) = ((voter_params_get VoterBalance) 0u) + let (i#0: bool, j#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) + return + + program clear-state: + subroutine algopy.arc4.ARC4Contract.clear_state_program() -> bool: + block@0: // L1 + return 1u \ No newline at end of file diff --git a/test_cases/avm_11/out/Contract.ssa.ir b/test_cases/avm_11/out/Contract.ssa.ir new file mode 100644 index 0000000000..0112af3013 --- /dev/null +++ b/test_cases/avm_11/out/Contract.ssa.ir @@ -0,0 +1,127 @@ +contract test_cases.avm_11.contract.Contract: + program approval: + subroutine algopy.arc4.ARC4Contract.approval_program() -> bool: + block@0: // L1 + let tmp%0#0: bool = test_cases.avm_11.contract.Contract.__puya_arc4_router__() + return tmp%0#0 + + subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> bool: + block@0: // L9 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: bool = (!= tmp%0#0 0u) + goto tmp%1#0 ? block@1 : block@5 + block@1: // abi_routing_L9 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "test_new_ops()void" => block@2, * => block@3} + block@2: // test_new_ops_route_L11 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: bool = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: bool = (!= tmp%5#0 0u) + (assert tmp%6#0) // is not creating + test_cases.avm_11.contract.Contract.test_new_ops() + return 1u + block@3: // switch_case_default_L9 + goto block@4 + block@4: // switch_case_next_L9 + goto block@9 + block@5: // bare_routing_L9 + let tmp%7#0: uint64 = (txn OnCompletion) + switch tmp%7#0 {0u => block@6, * => block@7} + block@6: // __algopy_default_create_L1 + let tmp%8#0: uint64 = (txn ApplicationID) + let tmp%9#0: bool = (== tmp%8#0 0u) + (assert tmp%9#0) // is creating + test_cases.avm_11.contract.Contract.__algopy_default_create() + return 1u + block@7: // switch_case_default_L9 + goto block@8 + block@8: // switch_case_next_L9 + goto block@9 + block@9: // after_if_else_L9 + return 0u + + subroutine test_cases.avm_11.contract.Contract.test_new_ops() -> void: + block@0: // L11 + let tmp%0#0: bytes = (bzero 1793u) + let tmp%1#0: bool = (falcon_verify 0x 0x tmp%0#0) + let tmp%2#0: bool = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: bytes = (sumhash512 0x) + let tmp%4#0: uint64 = (len tmp%3#0) + let tmp%5#0: bool = (!= tmp%4#0 0u) + (assert tmp%5#0) + let tmp%6#0: uint64 = online_stake + let tmp%7#0: bool = (!= tmp%6#0 0u) + (assert tmp%7#0) + let tmp%8#0: bytes = (txn Sender) + let (tuple_assignment%0#0: bool, tuple_assignment%1#0: bool) = ((acct_params_get AcctIncentiveEligible) tmp%8#0) + let a#0: bool = tuple_assignment%0#0 + let b#0: bool = tuple_assignment%1#0 + let tmp%9#0: bytes = (txn Sender) + let (tuple_assignment%2#0: uint64, tuple_assignment%3#0: bool) = ((acct_params_get AcctLastProposed) tmp%9#0) + let c#0: uint64 = tuple_assignment%2#0 + let d#0: bool = tuple_assignment%3#0 + let tmp%10#0: bytes = (txn Sender) + let (tuple_assignment%4#0: uint64, tuple_assignment%5#0: bool) = ((acct_params_get AcctLastHeartbeat) tmp%10#0) + let e#0: uint64 = tuple_assignment%4#0 + let f#0: bool = tuple_assignment%5#0 + let tmp%11#0: bytes = ((block BlkProposer) 0u) + let tmp%12#0: bytes = (global ZeroAddress) + let tmp%13#0: bool = (== tmp%11#0 tmp%12#0) + (assert tmp%13#0) // proposer + let tmp%14#0: uint64 = ((block BlkFeesCollected) 0u) + let tmp%15#0: bool = (!= tmp%14#0 0u) + (assert tmp%15#0) // fees collected + let tmp%16#0: uint64 = ((block BlkBonus) 0u) + let tmp%17#0: bool = (!= tmp%16#0 0u) + (assert tmp%17#0) // bonus + let tmp%18#0: bytes = ((block BlkBranch) 0u) + let tmp%19#0: uint64 = (len tmp%18#0) + let tmp%20#0: bool = (!= tmp%19#0 0u) + (assert tmp%20#0) // branch + let tmp%21#0: bytes = ((block BlkFeeSink) 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: bool = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // fee sink + let tmp%24#0: bytes = ((block BlkProtocol) 0u) + let tmp%25#0: uint64 = (len tmp%24#0) + let tmp%26#0: bool = (!= tmp%25#0 0u) + (assert tmp%26#0) // protocol + let tmp%27#0: uint64 = ((block BlkTxnCounter) 0u) + let tmp%28#0: bool = (!= tmp%27#0 0u) + (assert tmp%28#0) // txn counter + let tmp%29#0: uint64 = ((block BlkProposerPayout) 0u) + let tmp%30#0: bool = (!= tmp%29#0 0u) + (assert tmp%30#0) // proposer payout + let tmp%31#0: bool = (global PayoutsEnabled) + (assert tmp%31#0) // payouts_enabled + let tmp%32#0: uint64 = (global PayoutsGoOnlineFee) + let tmp%33#0: bool = (!= tmp%32#0 0u) + (assert tmp%33#0) // payouts_go_online_fee + let tmp%34#0: uint64 = (global PayoutsPercent) + let tmp%35#0: bool = (!= tmp%34#0 0u) + (assert tmp%35#0) // payouts_percent + let tmp%36#0: uint64 = (global PayoutsMinBalance) + let tmp%37#0: bool = (!= tmp%36#0 0u) + (assert tmp%37#0) // payouts_min_balance + let tmp%38#0: uint64 = (global PayoutsMaxBalance) + let tmp%39#0: bool = (!= tmp%38#0 0u) + (assert tmp%39#0) // payouts_max_balance + let (tuple_assignment%6#0: uint64, tuple_assignment%7#0: bool) = ((voter_params_get VoterBalance) 0u) + let g#0: uint64 = tuple_assignment%6#0 + let h#0: bool = tuple_assignment%7#0 + let (tuple_assignment%8#0: bool, tuple_assignment%9#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) + let i#0: bool = tuple_assignment%8#0 + let j#0: bool = tuple_assignment%9#0 + return + + subroutine test_cases.avm_11.contract.Contract.__algopy_default_create() -> void: + block@0: // L1 + return + + program clear-state: + subroutine algopy.arc4.ARC4Contract.clear_state_program() -> bool: + block@0: // L1 + return 1u \ No newline at end of file diff --git a/test_cases/avm_11/out/Contract.ssa.opt_pass_1.ir b/test_cases/avm_11/out/Contract.ssa.opt_pass_1.ir new file mode 100644 index 0000000000..51f314905e --- /dev/null +++ b/test_cases/avm_11/out/Contract.ssa.opt_pass_1.ir @@ -0,0 +1,87 @@ +contract test_cases.avm_11.contract.Contract: + program approval: + subroutine algopy.arc4.ARC4Contract.approval_program() -> bool: + block@0: // L1 + let tmp%0#0: bool = test_cases.avm_11.contract.Contract.__puya_arc4_router__() + return tmp%0#0 + + subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> bool: + block@0: // L9 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@5 + block@1: // abi_routing_L9 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "test_new_ops()void" => block@2, * => return 0u} + block@2: // test_new_ops_route_L11 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: bool = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + test_cases.avm_11.contract.Contract.test_new_ops() + return 1u + block@5: // bare_routing_L9 + let tmp%7#0: uint64 = (txn OnCompletion) + goto tmp%7#0 ? block@9 : block@6 + block@6: // __algopy_default_create_L1 + let tmp%8#0: uint64 = (txn ApplicationID) + let tmp%9#0: bool = (! tmp%8#0) + (assert tmp%9#0) // is creating + return 1u + block@9: // after_if_else_L9 + return 0u + + subroutine test_cases.avm_11.contract.Contract.test_new_ops() -> void: + block@0: // L11 + let tmp%0#0: bytes = (bzero 1793u) + let tmp%1#0: bool = (falcon_verify 0x 0x tmp%0#0) + let tmp%2#0: bool = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: bytes = (sumhash512 0x) + let tmp%4#0: uint64 = (len tmp%3#0) + (assert tmp%4#0) + let tmp%6#0: uint64 = online_stake + (assert tmp%6#0) + let tmp%8#0: bytes = (txn Sender) + let tmp%9#0: bytes = (txn Sender) + let tmp%10#0: bytes = (txn Sender) + let tmp%11#0: bytes = ((block BlkProposer) 0u) + let tmp%12#0: bytes = (global ZeroAddress) + let tmp%13#0: bool = (== tmp%11#0 tmp%12#0) + (assert tmp%13#0) // proposer + let tmp%14#0: uint64 = ((block BlkFeesCollected) 0u) + (assert tmp%14#0) // fees collected + let tmp%16#0: uint64 = ((block BlkBonus) 0u) + (assert tmp%16#0) // bonus + let tmp%18#0: bytes = ((block BlkBranch) 0u) + let tmp%19#0: uint64 = (len tmp%18#0) + (assert tmp%19#0) // branch + let tmp%21#0: bytes = ((block BlkFeeSink) 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: bool = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // fee sink + let tmp%24#0: bytes = ((block BlkProtocol) 0u) + let tmp%25#0: uint64 = (len tmp%24#0) + (assert tmp%25#0) // protocol + let tmp%27#0: uint64 = ((block BlkTxnCounter) 0u) + (assert tmp%27#0) // txn counter + let tmp%29#0: uint64 = ((block BlkProposerPayout) 0u) + (assert tmp%29#0) // proposer payout + let tmp%31#0: bool = (global PayoutsEnabled) + (assert tmp%31#0) // payouts_enabled + let tmp%32#0: uint64 = (global PayoutsGoOnlineFee) + (assert tmp%32#0) // payouts_go_online_fee + let tmp%34#0: uint64 = (global PayoutsPercent) + (assert tmp%34#0) // payouts_percent + let tmp%36#0: uint64 = (global PayoutsMinBalance) + (assert tmp%36#0) // payouts_min_balance + let tmp%38#0: uint64 = (global PayoutsMaxBalance) + (assert tmp%38#0) // payouts_max_balance + let (g#0: uint64, h#0: bool) = ((voter_params_get VoterBalance) 0u) + let (i#0: bool, j#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) + return + + program clear-state: + subroutine algopy.arc4.ARC4Contract.clear_state_program() -> bool: + block@0: // L1 + return 1u \ No newline at end of file diff --git a/test_cases/avm_11/out/Contract.ssa.opt_pass_2.ir b/test_cases/avm_11/out/Contract.ssa.opt_pass_2.ir new file mode 100644 index 0000000000..0d60a684c3 --- /dev/null +++ b/test_cases/avm_11/out/Contract.ssa.opt_pass_2.ir @@ -0,0 +1,84 @@ +contract test_cases.avm_11.contract.Contract: + program approval: + subroutine algopy.arc4.ARC4Contract.approval_program() -> bool: + block@0: // L1 + let tmp%0#0: bool = test_cases.avm_11.contract.Contract.__puya_arc4_router__() + return tmp%0#0 + + subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> bool: + block@0: // L9 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@5 + block@1: // abi_routing_L9 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "test_new_ops()void" => block@2, * => return 0u} + block@2: // test_new_ops_route_L11 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: bool = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + test_cases.avm_11.contract.Contract.test_new_ops() + return 1u + block@5: // bare_routing_L9 + let tmp%7#0: uint64 = (txn OnCompletion) + goto tmp%7#0 ? block@9 : block@6 + block@6: // __algopy_default_create_L1 + let tmp%8#0: uint64 = (txn ApplicationID) + let tmp%9#0: bool = (! tmp%8#0) + (assert tmp%9#0) // is creating + return 1u + block@9: // after_if_else_L9 + return 0u + + subroutine test_cases.avm_11.contract.Contract.test_new_ops() -> void: + block@0: // L11 + let tmp%0#0: bytes = (bzero 1793u) + let tmp%1#0: bool = (falcon_verify 0x 0x tmp%0#0) + let tmp%2#0: bool = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: bytes = (sumhash512 0x) + let tmp%4#0: uint64 = (len tmp%3#0) + (assert tmp%4#0) + let tmp%6#0: uint64 = online_stake + (assert tmp%6#0) + let tmp%11#0: bytes = ((block BlkProposer) 0u) + let tmp%12#0: bytes = (global ZeroAddress) + let tmp%13#0: bool = (== tmp%11#0 tmp%12#0) + (assert tmp%13#0) // proposer + let tmp%14#0: uint64 = ((block BlkFeesCollected) 0u) + (assert tmp%14#0) // fees collected + let tmp%16#0: uint64 = ((block BlkBonus) 0u) + (assert tmp%16#0) // bonus + let tmp%18#0: bytes = ((block BlkBranch) 0u) + let tmp%19#0: uint64 = (len tmp%18#0) + (assert tmp%19#0) // branch + let tmp%21#0: bytes = ((block BlkFeeSink) 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: bool = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // fee sink + let tmp%24#0: bytes = ((block BlkProtocol) 0u) + let tmp%25#0: uint64 = (len tmp%24#0) + (assert tmp%25#0) // protocol + let tmp%27#0: uint64 = ((block BlkTxnCounter) 0u) + (assert tmp%27#0) // txn counter + let tmp%29#0: uint64 = ((block BlkProposerPayout) 0u) + (assert tmp%29#0) // proposer payout + let tmp%31#0: bool = (global PayoutsEnabled) + (assert tmp%31#0) // payouts_enabled + let tmp%32#0: uint64 = (global PayoutsGoOnlineFee) + (assert tmp%32#0) // payouts_go_online_fee + let tmp%34#0: uint64 = (global PayoutsPercent) + (assert tmp%34#0) // payouts_percent + let tmp%36#0: uint64 = (global PayoutsMinBalance) + (assert tmp%36#0) // payouts_min_balance + let tmp%38#0: uint64 = (global PayoutsMaxBalance) + (assert tmp%38#0) // payouts_max_balance + let (g#0: uint64, h#0: bool) = ((voter_params_get VoterBalance) 0u) + let (i#0: bool, j#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) + return + + program clear-state: + subroutine algopy.arc4.ARC4Contract.clear_state_program() -> bool: + block@0: // L1 + return 1u \ No newline at end of file diff --git a/test_cases/avm_11/out/avm_11_sig.destructured.ir b/test_cases/avm_11/out/avm_11_sig.destructured.ir new file mode 100644 index 0000000000..0e977ec107 --- /dev/null +++ b/test_cases/avm_11/out/avm_11_sig.destructured.ir @@ -0,0 +1,6 @@ +program logicsig test_cases.avm_11.contract.avm_11_sig: + subroutine test_cases.avm_11.contract.avm_11_sig() -> uint64: + block@0: // L4 + let tmp%0#0: bytes = (sumhash512 0x) + let tmp%1#0: uint64 = (len tmp%0#0) + return tmp%1#0 \ No newline at end of file diff --git a/test_cases/avm_11/out/avm_11_sig.mir b/test_cases/avm_11/out/avm_11_sig.mir new file mode 100644 index 0000000000..87b1bf3d6b --- /dev/null +++ b/test_cases/avm_11/out/avm_11_sig.mir @@ -0,0 +1,11 @@ +// Op Stack (out) +// test_cases.avm_11.contract.avm_11_sig() -> uint64: +main_block@0: + // avm_11/contract.py:6 + // return op.sumhash512(b"").length + byte 0x 0x + sumhash512 tmp%0#0 + len tmp%1#0 + return + + diff --git a/test_cases/avm_11/out/avm_11_sig.ssa.ir b/test_cases/avm_11/out/avm_11_sig.ssa.ir new file mode 100644 index 0000000000..0e977ec107 --- /dev/null +++ b/test_cases/avm_11/out/avm_11_sig.ssa.ir @@ -0,0 +1,6 @@ +program logicsig test_cases.avm_11.contract.avm_11_sig: + subroutine test_cases.avm_11.contract.avm_11_sig() -> uint64: + block@0: // L4 + let tmp%0#0: bytes = (sumhash512 0x) + let tmp%1#0: uint64 = (len tmp%0#0) + return tmp%1#0 \ No newline at end of file diff --git a/test_cases/avm_11/out/avm_11_sig.teal b/test_cases/avm_11/out/avm_11_sig.teal new file mode 100644 index 0000000000..aff150abb9 --- /dev/null +++ b/test_cases/avm_11/out/avm_11_sig.teal @@ -0,0 +1,9 @@ +#pragma version 11 + +test_cases.avm_11.contract.avm_11_sig: + // avm_11/contract.py:6 + // return op.sumhash512(b"").length + pushbytes 0x + sumhash512 + len + return diff --git a/test_cases/avm_11/out/client_Contract.py b/test_cases/avm_11/out/client_Contract.py new file mode 100644 index 0000000000..17a5280f81 --- /dev/null +++ b/test_cases/avm_11/out/client_Contract.py @@ -0,0 +1,13 @@ +# This file is auto-generated, do not modify +# flake8: noqa +# fmt: off +import typing + +import algopy + + +class Contract(algopy.arc4.ARC4Client, typing.Protocol): + @algopy.arc4.abimethod + def test_new_ops( + self, + ) -> None: ... diff --git a/test_cases/avm_11/out/module.awst b/test_cases/avm_11/out/module.awst new file mode 100644 index 0000000000..1d1ae024a2 --- /dev/null +++ b/test_cases/avm_11/out/module.awst @@ -0,0 +1,50 @@ +logicsig test_cases.avm_11.contract.avm_11_sig +{ + return len(sumhash512(hex<"">)) +} + +contract Contract +{ + method_resolution_order: ( + algopy.arc4.ARC4Contract, + ) + + subroutine algopy.arc4.ARC4Contract.approval_program(): bool + { + return arc4_router() + } + + subroutine algopy.arc4.ARC4Contract.clear_state_program(): bool + { + return true + } + + abimethod test_cases.avm_11.contract.Contract.test_new_ops(): void + { + assert(!(falcon_verify(hex<"">, hex<"">, bzero(1793u)))) + assert(len(sumhash512(hex<"">)) != 0u) + assert(online_stake() != 0u) + (a, b): tuple = acct_params_get(txn()) + (c, d): tuple = acct_params_get(txn()) + (e, f): tuple = acct_params_get(txn()) + assert(block(0u) == global(), comment="proposer") + assert(block(0u) != 0u, comment="fees collected") + assert(block(0u) != 0u, comment="bonus") + assert(len(block(0u)) != 0u, comment="branch") + assert(block(0u) != global(), comment="fee sink") + assert(len(block(0u)) != 0u, comment="protocol") + assert(block(0u) != 0u, comment="txn counter") + assert(block(0u) != 0u, comment="proposer payout") + assert(global(), comment="payouts_enabled") + assert(global() != 0u, comment="payouts_go_online_fee") + assert(global() != 0u, comment="payouts_percent") + assert(global() != 0u, comment="payouts_min_balance") + assert(global() != 0u, comment="payouts_max_balance") + (g, h): tuple = voter_params_get(0u) + (i, j): tuple = voter_params_get(0u) + } + + baremethod test_cases.avm_11.contract.Contract.__algopy_default_create(): void + { + } +} \ No newline at end of file diff --git a/test_cases/avm_11/out_O2/Contract.approval.teal b/test_cases/avm_11/out_O2/Contract.approval.teal new file mode 100644 index 0000000000..7e0118f54d --- /dev/null +++ b/test_cases/avm_11/out_O2/Contract.approval.teal @@ -0,0 +1,107 @@ +#pragma version 11 + +test_cases.avm_11.contract.Contract.approval_program: + intcblock 0 1 + callsub __puya_arc4_router__ + return + + +// test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> uint64: +__puya_arc4_router__: + proto 0 1 + txn NumAppArgs + bz __puya_arc4_router___bare_routing@5 + pushbytes 0xc2b8dd8a // method "test_new_ops()void" + txna ApplicationArgs 0 + match __puya_arc4_router___test_new_ops_route@2 + intc_0 // 0 + retsub + +__puya_arc4_router___test_new_ops_route@2: + txn OnCompletion + ! + assert // OnCompletion is NoOp + txn ApplicationID + assert // is not creating + callsub test_new_ops + intc_1 // 1 + retsub + +__puya_arc4_router___bare_routing@5: + txn OnCompletion + bnz __puya_arc4_router___after_if_else@9 + txn ApplicationID + ! + assert // is creating + intc_1 // 1 + retsub + +__puya_arc4_router___after_if_else@9: + intc_0 // 0 + retsub + + +// test_cases.avm_11.contract.Contract.test_new_ops() -> void: +test_new_ops: + proto 0 0 + pushint 1793 // 1793 + bzero + pushbytes 0x + dup + uncover 2 + falcon_verify + ! + assert + pushbytes 0x + sumhash512 + len + assert + online_stake + assert + intc_0 // 0 + block BlkProposer + global ZeroAddress + == + assert // proposer + intc_0 // 0 + block BlkFeesCollected + assert // fees collected + intc_0 // 0 + block BlkBonus + assert // bonus + intc_0 // 0 + block BlkBranch + len + assert // branch + intc_0 // 0 + block BlkFeeSink + global ZeroAddress + != + assert // fee sink + intc_0 // 0 + block BlkProtocol + len + assert // protocol + intc_0 // 0 + block BlkTxnCounter + assert // txn counter + intc_0 // 0 + block BlkProposerPayout + assert // proposer payout + global PayoutsEnabled + assert // payouts_enabled + global PayoutsGoOnlineFee + assert // payouts_go_online_fee + global PayoutsPercent + assert // payouts_percent + global PayoutsMinBalance + assert // payouts_min_balance + global PayoutsMaxBalance + assert // payouts_max_balance + intc_0 // 0 + voter_params_get VoterBalance + popn 2 + intc_0 // 0 + voter_params_get VoterIncentiveEligible + popn 2 + retsub diff --git a/test_cases/avm_11/out_O2/Contract.clear.teal b/test_cases/avm_11/out_O2/Contract.clear.teal new file mode 100644 index 0000000000..00e6c16dd3 --- /dev/null +++ b/test_cases/avm_11/out_O2/Contract.clear.teal @@ -0,0 +1,5 @@ +#pragma version 11 + +test_cases.avm_11.contract.Contract.clear_state_program: + pushint 1 // 1 + return diff --git a/test_cases/avm_11/out_O2/Contract.destructured.ir b/test_cases/avm_11/out_O2/Contract.destructured.ir new file mode 100644 index 0000000000..0d60a684c3 --- /dev/null +++ b/test_cases/avm_11/out_O2/Contract.destructured.ir @@ -0,0 +1,84 @@ +contract test_cases.avm_11.contract.Contract: + program approval: + subroutine algopy.arc4.ARC4Contract.approval_program() -> bool: + block@0: // L1 + let tmp%0#0: bool = test_cases.avm_11.contract.Contract.__puya_arc4_router__() + return tmp%0#0 + + subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> bool: + block@0: // L9 + let tmp%0#0: uint64 = (txn NumAppArgs) + goto tmp%0#0 ? block@1 : block@5 + block@1: // abi_routing_L9 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "test_new_ops()void" => block@2, * => return 0u} + block@2: // test_new_ops_route_L11 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: bool = (! tmp%3#0) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + (assert tmp%5#0) // is not creating + test_cases.avm_11.contract.Contract.test_new_ops() + return 1u + block@5: // bare_routing_L9 + let tmp%7#0: uint64 = (txn OnCompletion) + goto tmp%7#0 ? block@9 : block@6 + block@6: // __algopy_default_create_L1 + let tmp%8#0: uint64 = (txn ApplicationID) + let tmp%9#0: bool = (! tmp%8#0) + (assert tmp%9#0) // is creating + return 1u + block@9: // after_if_else_L9 + return 0u + + subroutine test_cases.avm_11.contract.Contract.test_new_ops() -> void: + block@0: // L11 + let tmp%0#0: bytes = (bzero 1793u) + let tmp%1#0: bool = (falcon_verify 0x 0x tmp%0#0) + let tmp%2#0: bool = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: bytes = (sumhash512 0x) + let tmp%4#0: uint64 = (len tmp%3#0) + (assert tmp%4#0) + let tmp%6#0: uint64 = online_stake + (assert tmp%6#0) + let tmp%11#0: bytes = ((block BlkProposer) 0u) + let tmp%12#0: bytes = (global ZeroAddress) + let tmp%13#0: bool = (== tmp%11#0 tmp%12#0) + (assert tmp%13#0) // proposer + let tmp%14#0: uint64 = ((block BlkFeesCollected) 0u) + (assert tmp%14#0) // fees collected + let tmp%16#0: uint64 = ((block BlkBonus) 0u) + (assert tmp%16#0) // bonus + let tmp%18#0: bytes = ((block BlkBranch) 0u) + let tmp%19#0: uint64 = (len tmp%18#0) + (assert tmp%19#0) // branch + let tmp%21#0: bytes = ((block BlkFeeSink) 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: bool = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // fee sink + let tmp%24#0: bytes = ((block BlkProtocol) 0u) + let tmp%25#0: uint64 = (len tmp%24#0) + (assert tmp%25#0) // protocol + let tmp%27#0: uint64 = ((block BlkTxnCounter) 0u) + (assert tmp%27#0) // txn counter + let tmp%29#0: uint64 = ((block BlkProposerPayout) 0u) + (assert tmp%29#0) // proposer payout + let tmp%31#0: bool = (global PayoutsEnabled) + (assert tmp%31#0) // payouts_enabled + let tmp%32#0: uint64 = (global PayoutsGoOnlineFee) + (assert tmp%32#0) // payouts_go_online_fee + let tmp%34#0: uint64 = (global PayoutsPercent) + (assert tmp%34#0) // payouts_percent + let tmp%36#0: uint64 = (global PayoutsMinBalance) + (assert tmp%36#0) // payouts_min_balance + let tmp%38#0: uint64 = (global PayoutsMaxBalance) + (assert tmp%38#0) // payouts_max_balance + let (g#0: uint64, h#0: bool) = ((voter_params_get VoterBalance) 0u) + let (i#0: bool, j#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) + return + + program clear-state: + subroutine algopy.arc4.ARC4Contract.clear_state_program() -> bool: + block@0: // L1 + return 1u \ No newline at end of file diff --git a/test_cases/avm_11/out_O2/avm_11_sig.destructured.ir b/test_cases/avm_11/out_O2/avm_11_sig.destructured.ir new file mode 100644 index 0000000000..0e977ec107 --- /dev/null +++ b/test_cases/avm_11/out_O2/avm_11_sig.destructured.ir @@ -0,0 +1,6 @@ +program logicsig test_cases.avm_11.contract.avm_11_sig: + subroutine test_cases.avm_11.contract.avm_11_sig() -> uint64: + block@0: // L4 + let tmp%0#0: bytes = (sumhash512 0x) + let tmp%1#0: uint64 = (len tmp%0#0) + return tmp%1#0 \ No newline at end of file diff --git a/test_cases/avm_11/out_O2/avm_11_sig.teal b/test_cases/avm_11/out_O2/avm_11_sig.teal new file mode 100644 index 0000000000..491958c962 --- /dev/null +++ b/test_cases/avm_11/out_O2/avm_11_sig.teal @@ -0,0 +1,7 @@ +#pragma version 11 + +test_cases.avm_11.contract.avm_11_sig: + pushbytes 0x + sumhash512 + len + return diff --git a/test_cases/avm_11/out_unoptimized/Contract.approval.teal b/test_cases/avm_11/out_unoptimized/Contract.approval.teal new file mode 100644 index 0000000000..657ee040f3 --- /dev/null +++ b/test_cases/avm_11/out_unoptimized/Contract.approval.teal @@ -0,0 +1,205 @@ +#pragma version 11 + +test_cases.avm_11.contract.Contract.approval_program: + intcblock 0 1 + callsub __puya_arc4_router__ + return + + +// test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> uint64: +__puya_arc4_router__: + // avm_11/contract.py:9 + // class Contract(ARC4Contract, avm_version=11): + proto 0 1 + txn NumAppArgs + intc_0 // 0 + != + bz __puya_arc4_router___bare_routing@5 + txna ApplicationArgs 0 + pushbytes 0xc2b8dd8a // method "test_new_ops()void" + swap + match __puya_arc4_router___test_new_ops_route@2 + b __puya_arc4_router___switch_case_default@3 + +__puya_arc4_router___test_new_ops_route@2: + // avm_11/contract.py:11 + // @arc4.abimethod + txn OnCompletion + intc_0 // NoOp + == + assert // OnCompletion is NoOp + txn ApplicationID + intc_0 // 0 + != + assert // is not creating + callsub test_new_ops + intc_1 // 1 + retsub + +__puya_arc4_router___switch_case_default@3: + b __puya_arc4_router___after_if_else@9 + +__puya_arc4_router___bare_routing@5: + // avm_11/contract.py:9 + // class Contract(ARC4Contract, avm_version=11): + txn OnCompletion + intc_0 // 0 + swap + match __puya_arc4_router_____algopy_default_create@6 + b __puya_arc4_router___switch_case_default@7 + +__puya_arc4_router_____algopy_default_create@6: + txn ApplicationID + intc_0 // 0 + == + assert // is creating + callsub __algopy_default_create + intc_1 // 1 + retsub + +__puya_arc4_router___switch_case_default@7: + +__puya_arc4_router___after_if_else@9: + // avm_11/contract.py:9 + // class Contract(ARC4Contract, avm_version=11): + intc_0 // 0 + retsub + + +// test_cases.avm_11.contract.Contract.test_new_ops() -> void: +test_new_ops: + // avm_11/contract.py:11-12 + // @arc4.abimethod + // def test_new_ops(self) -> None: + proto 0 0 + // avm_11/contract.py:13-14 + // # op functions + // assert not op.falcon_verify(b"", b"", op.bzero(1793)) + pushint 1793 // 1793 + bzero + pushbytes 0x + dup + uncover 2 + falcon_verify + ! + assert + // avm_11/contract.py:15 + // assert op.sumhash512(b"") + pushbytes 0x + sumhash512 + len + intc_0 // 0 + != + assert + // avm_11/contract.py:16 + // assert op.online_stake() + online_stake + intc_0 // 0 + != + assert + // avm_11/contract.py:23-24 + // # Block + // assert not op.Block.blk_proposer(0), "proposer" + intc_0 // 0 + block BlkProposer + global ZeroAddress + == + assert // proposer + // avm_11/contract.py:25 + // assert op.Block.blk_fees_collected(0), "fees collected" + intc_0 // 0 + block BlkFeesCollected + intc_0 // 0 + != + assert // fees collected + // avm_11/contract.py:26 + // assert op.Block.blk_bonus(0), "bonus" + intc_0 // 0 + block BlkBonus + intc_0 // 0 + != + assert // bonus + // avm_11/contract.py:27 + // assert op.Block.blk_branch(0), "branch" + intc_0 // 0 + block BlkBranch + len + intc_0 // 0 + != + assert // branch + // avm_11/contract.py:28 + // assert op.Block.blk_fee_sink(0), "fee sink" + intc_0 // 0 + block BlkFeeSink + global ZeroAddress + != + assert // fee sink + // avm_11/contract.py:29 + // assert op.Block.blk_protocol(0), "protocol" + intc_0 // 0 + block BlkProtocol + len + intc_0 // 0 + != + assert // protocol + // avm_11/contract.py:30 + // assert op.Block.blk_txn_counter(0), "txn counter" + intc_0 // 0 + block BlkTxnCounter + intc_0 // 0 + != + assert // txn counter + // avm_11/contract.py:31 + // assert op.Block.blk_proposer_payout(0), "proposer payout" + intc_0 // 0 + block BlkProposerPayout + intc_0 // 0 + != + assert // proposer payout + // avm_11/contract.py:33-34 + // # Global + // assert op.Global.payouts_enabled, "payouts_enabled" + global PayoutsEnabled + assert // payouts_enabled + // avm_11/contract.py:35 + // assert op.Global.payouts_go_online_fee, "payouts_go_online_fee" + global PayoutsGoOnlineFee + intc_0 // 0 + != + assert // payouts_go_online_fee + // avm_11/contract.py:36 + // assert op.Global.payouts_percent, "payouts_percent" + global PayoutsPercent + intc_0 // 0 + != + assert // payouts_percent + // avm_11/contract.py:37 + // assert op.Global.payouts_min_balance, "payouts_min_balance" + global PayoutsMinBalance + intc_0 // 0 + != + assert // payouts_min_balance + // avm_11/contract.py:38 + // assert op.Global.payouts_max_balance, "payouts_max_balance" + global PayoutsMaxBalance + intc_0 // 0 + != + assert // payouts_max_balance + // avm_11/contract.py:40-41 + // # Voter params + // g, h = op.VoterParamsGet.voter_balance(0) + intc_0 // 0 + voter_params_get VoterBalance + popn 2 + // avm_11/contract.py:42 + // i, j = op.VoterParamsGet.voter_incentive_eligible(0) + intc_0 // 0 + voter_params_get VoterIncentiveEligible + popn 2 + retsub + + +// test_cases.avm_11.contract.Contract.__algopy_default_create() -> void: +__algopy_default_create: + proto 0 0 + retsub diff --git a/test_cases/avm_11/out_unoptimized/Contract.clear.teal b/test_cases/avm_11/out_unoptimized/Contract.clear.teal new file mode 100644 index 0000000000..00e6c16dd3 --- /dev/null +++ b/test_cases/avm_11/out_unoptimized/Contract.clear.teal @@ -0,0 +1,5 @@ +#pragma version 11 + +test_cases.avm_11.contract.Contract.clear_state_program: + pushint 1 // 1 + return diff --git a/test_cases/avm_11/out_unoptimized/Contract.destructured.ir b/test_cases/avm_11/out_unoptimized/Contract.destructured.ir new file mode 100644 index 0000000000..29ff61235b --- /dev/null +++ b/test_cases/avm_11/out_unoptimized/Contract.destructured.ir @@ -0,0 +1,111 @@ +contract test_cases.avm_11.contract.Contract: + program approval: + subroutine algopy.arc4.ARC4Contract.approval_program() -> bool: + block@0: // L1 + let tmp%0#0: bool = test_cases.avm_11.contract.Contract.__puya_arc4_router__() + return tmp%0#0 + + subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__() -> bool: + block@0: // L9 + let tmp%0#0: uint64 = (txn NumAppArgs) + let tmp%1#0: bool = (!= tmp%0#0 0u) + goto tmp%1#0 ? block@1 : block@5 + block@1: // abi_routing_L9 + let tmp%2#0: bytes = (txna ApplicationArgs 0) + switch tmp%2#0 {method "test_new_ops()void" => block@2, * => block@3} + block@2: // test_new_ops_route_L11 + let tmp%3#0: uint64 = (txn OnCompletion) + let tmp%4#0: bool = (== tmp%3#0 NoOp) + (assert tmp%4#0) // OnCompletion is NoOp + let tmp%5#0: uint64 = (txn ApplicationID) + let tmp%6#0: bool = (!= tmp%5#0 0u) + (assert tmp%6#0) // is not creating + test_cases.avm_11.contract.Contract.test_new_ops() + return 1u + block@3: // switch_case_default_L9 + goto block@4 + block@4: // switch_case_next_L9 + goto block@9 + block@5: // bare_routing_L9 + let tmp%7#0: uint64 = (txn OnCompletion) + switch tmp%7#0 {0u => block@6, * => block@7} + block@6: // __algopy_default_create_L1 + let tmp%8#0: uint64 = (txn ApplicationID) + let tmp%9#0: bool = (== tmp%8#0 0u) + (assert tmp%9#0) // is creating + test_cases.avm_11.contract.Contract.__algopy_default_create() + return 1u + block@7: // switch_case_default_L9 + goto block@8 + block@8: // switch_case_next_L9 + goto block@9 + block@9: // after_if_else_L9 + return 0u + + subroutine test_cases.avm_11.contract.Contract.test_new_ops() -> void: + block@0: // L11 + let tmp%0#0: bytes = (bzero 1793u) + let tmp%1#0: bool = (falcon_verify 0x 0x tmp%0#0) + let tmp%2#0: bool = (! tmp%1#0) + (assert tmp%2#0) + let tmp%3#0: bytes = (sumhash512 0x) + let tmp%4#0: uint64 = (len tmp%3#0) + let tmp%5#0: bool = (!= tmp%4#0 0u) + (assert tmp%5#0) + let tmp%6#0: uint64 = online_stake + let tmp%7#0: bool = (!= tmp%6#0 0u) + (assert tmp%7#0) + let tmp%11#0: bytes = ((block BlkProposer) 0u) + let tmp%12#0: bytes = (global ZeroAddress) + let tmp%13#0: bool = (== tmp%11#0 tmp%12#0) + (assert tmp%13#0) // proposer + let tmp%14#0: uint64 = ((block BlkFeesCollected) 0u) + let tmp%15#0: bool = (!= tmp%14#0 0u) + (assert tmp%15#0) // fees collected + let tmp%16#0: uint64 = ((block BlkBonus) 0u) + let tmp%17#0: bool = (!= tmp%16#0 0u) + (assert tmp%17#0) // bonus + let tmp%18#0: bytes = ((block BlkBranch) 0u) + let tmp%19#0: uint64 = (len tmp%18#0) + let tmp%20#0: bool = (!= tmp%19#0 0u) + (assert tmp%20#0) // branch + let tmp%21#0: bytes = ((block BlkFeeSink) 0u) + let tmp%22#0: bytes = (global ZeroAddress) + let tmp%23#0: bool = (!= tmp%21#0 tmp%22#0) + (assert tmp%23#0) // fee sink + let tmp%24#0: bytes = ((block BlkProtocol) 0u) + let tmp%25#0: uint64 = (len tmp%24#0) + let tmp%26#0: bool = (!= tmp%25#0 0u) + (assert tmp%26#0) // protocol + let tmp%27#0: uint64 = ((block BlkTxnCounter) 0u) + let tmp%28#0: bool = (!= tmp%27#0 0u) + (assert tmp%28#0) // txn counter + let tmp%29#0: uint64 = ((block BlkProposerPayout) 0u) + let tmp%30#0: bool = (!= tmp%29#0 0u) + (assert tmp%30#0) // proposer payout + let tmp%31#0: bool = (global PayoutsEnabled) + (assert tmp%31#0) // payouts_enabled + let tmp%32#0: uint64 = (global PayoutsGoOnlineFee) + let tmp%33#0: bool = (!= tmp%32#0 0u) + (assert tmp%33#0) // payouts_go_online_fee + let tmp%34#0: uint64 = (global PayoutsPercent) + let tmp%35#0: bool = (!= tmp%34#0 0u) + (assert tmp%35#0) // payouts_percent + let tmp%36#0: uint64 = (global PayoutsMinBalance) + let tmp%37#0: bool = (!= tmp%36#0 0u) + (assert tmp%37#0) // payouts_min_balance + let tmp%38#0: uint64 = (global PayoutsMaxBalance) + let tmp%39#0: bool = (!= tmp%38#0 0u) + (assert tmp%39#0) // payouts_max_balance + let (tuple_assignment%6#0: uint64, tuple_assignment%7#0: bool) = ((voter_params_get VoterBalance) 0u) + let (tuple_assignment%8#0: bool, tuple_assignment%9#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) + return + + subroutine test_cases.avm_11.contract.Contract.__algopy_default_create() -> void: + block@0: // L1 + return + + program clear-state: + subroutine algopy.arc4.ARC4Contract.clear_state_program() -> bool: + block@0: // L1 + return 1u \ No newline at end of file diff --git a/test_cases/avm_11/out_unoptimized/avm_11_sig.destructured.ir b/test_cases/avm_11/out_unoptimized/avm_11_sig.destructured.ir new file mode 100644 index 0000000000..0e977ec107 --- /dev/null +++ b/test_cases/avm_11/out_unoptimized/avm_11_sig.destructured.ir @@ -0,0 +1,6 @@ +program logicsig test_cases.avm_11.contract.avm_11_sig: + subroutine test_cases.avm_11.contract.avm_11_sig() -> uint64: + block@0: // L4 + let tmp%0#0: bytes = (sumhash512 0x) + let tmp%1#0: uint64 = (len tmp%0#0) + return tmp%1#0 \ No newline at end of file diff --git a/test_cases/avm_11/out_unoptimized/avm_11_sig.teal b/test_cases/avm_11/out_unoptimized/avm_11_sig.teal new file mode 100644 index 0000000000..aff150abb9 --- /dev/null +++ b/test_cases/avm_11/out_unoptimized/avm_11_sig.teal @@ -0,0 +1,9 @@ +#pragma version 11 + +test_cases.avm_11.contract.avm_11_sig: + // avm_11/contract.py:6 + // return op.sumhash512(b"").length + pushbytes 0x + sumhash512 + len + return diff --git a/test_cases/avm_11/puya.log b/test_cases/avm_11/puya.log new file mode 100644 index 0000000000..d4eac4176c --- /dev/null +++ b/test_cases/avm_11/puya.log @@ -0,0 +1,764 @@ +debug: PuyaPyOptions(output_teal=True, output_source_map=True, output_arc32=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, output_bytecode=True, debug_level=1, optimization_level=1, target_avm_version=10, cli_template_definitions={}, template_vars_prefix='TMPL_', locals_coalescing_strategy=, paths=['avm_11'], output_awst=True, output_awst_json=False, output_client=True, log_level=) +info: Found python prefix: /.venv +info: writing avm_11/out/module.awst +debug: Sealing block@0: // L12 +debug: Terminated block@0: // L12 +debug: Looking for 'required_budget_with_buffer' in an unsealed block creating an incomplete Phi: block@1: // while_top_L20 +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_L20 +debug: Terminated block@1: // while_top_L20 +debug: Sealing block@2: // while_body_L21 +debug: Looking for 'fee_source' in an unsealed block creating an incomplete Phi: block@1: // while_top_L20 +debug: Created Phi assignment: let fee_source#1: uint64 = undefined while trying to resolve 'fee_source' in block@1: // while_top_L20 +debug: Terminated block@2: // while_body_L21 +debug: Sealing block@3: // switch_case_0_L28 +debug: Terminated block@3: // switch_case_0_L28 +debug: Sealing block@4: // switch_case_1_L30 +debug: Terminated block@4: // switch_case_1_L30 +debug: Sealing block@5: // switch_case_default_L26 +debug: Terminated block@5: // switch_case_default_L26 +debug: Sealing block@6: // switch_case_next_L26 +debug: Terminated block@6: // switch_case_next_L26 +debug: Sealing block@1: // while_top_L20 +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: // L12 +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_L26 +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_L28 +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_L30 +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_L26 +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_L26 +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: // L12 +debug: Created Phi assignment: let fee_source#2: uint64 = undefined while trying to resolve 'fee_source' in block@6: // switch_case_next_L26 +debug: Added fee_source#1 to Phi node: let fee_source#2: uint64 = φ(fee_source#1 <- block@3) in block@3: // switch_case_0_L28 +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_L30 +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_L26 +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_L26 +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@7: // after_while_L20 +debug: Terminated block@7: // after_while_L20 +debug: Sealing block@0: // L4 +debug: Terminated block@0: // L4 +debug: Looking for 'start' in an unsealed block creating an incomplete Phi: block@1: // while_top_L11 +debug: Created Phi assignment: let start#1: uint64 = undefined while trying to resolve 'start' in block@1: // while_top_L11 +debug: Looking for 'item' in an unsealed block creating an incomplete Phi: block@1: // while_top_L11 +debug: Created Phi assignment: let item#1: bytes = undefined while trying to resolve 'item' in block@1: // while_top_L11 +debug: Looking for 'sequence' in an unsealed block creating an incomplete Phi: block@1: // while_top_L11 +debug: Created Phi assignment: let sequence#1: bytes = undefined while trying to resolve 'sequence' in block@1: // while_top_L11 +debug: Terminated block@1: // while_top_L11 +debug: Sealing block@2: // while_body_L12 +debug: Terminated block@2: // while_body_L12 +debug: Sealing block@3: // if_body_L13 +debug: Terminated block@3: // if_body_L13 +debug: Sealing block@4: // after_if_else_L12 +debug: Terminated block@4: // after_if_else_L12 +debug: Sealing block@1: // while_top_L11 +debug: Added start#0 to Phi node: let start#1: uint64 = φ(start#0 <- block@0) in block@0: // L4 +debug: Added start#2 to Phi node: let start#1: uint64 = φ(start#0 <- block@0, start#2 <- block@4) in block@4: // after_if_else_L12 +debug: Added item#0 to Phi node: let item#1: bytes = φ(item#0 <- block@0) in block@0: // L4 +debug: Added item#1 to Phi node: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) in block@4: // after_if_else_L12 +debug: Replacing trivial Phi node: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) (item#1) with item#0 +debug: Deleting Phi assignment: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) +debug: Replaced trivial Phi node: let item#1: bytes = φ(item#0 <- block@0, item#1 <- block@4) (item#1) with item#0 in current definition for 3 blocks +debug: Added sequence#0 to Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0) in block@0: // L4 +debug: Added sequence#1 to Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) in block@4: // after_if_else_L12 +debug: Replacing trivial Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) (sequence#1) with sequence#0 +debug: Deleting Phi assignment: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) +debug: Replaced trivial Phi node: let sequence#1: bytes = φ(sequence#0 <- block@0, sequence#1 <- block@4) (sequence#1) with sequence#0 in current definition for 3 blocks +debug: Sealing block@5: // after_while_L11 +debug: Terminated block@5: // after_while_L11 +debug: Sealing block@0: // L25 +debug: Terminated block@0: // L25 +debug: Sealing block@0: // L44 +debug: Terminated block@0: // L44 +debug: Sealing block@0: // L62 +debug: Terminated block@0: // L62 +debug: Sealing block@0: // L92 +debug: Terminated block@0: // L92 +debug: Looking for 'head_offset' in an unsealed block creating an incomplete Phi: block@1: // for_header_L110 +debug: Created Phi assignment: let head_offset#1: uint64 = undefined while trying to resolve 'head_offset' in block@1: // for_header_L110 +debug: Terminated block@1: // for_header_L110 +debug: Sealing block@2: // for_body_L111 +debug: Looking for 'head_and_tail' in an unsealed block creating an incomplete Phi: block@1: // for_header_L110 +debug: Created Phi assignment: let head_and_tail#1: bytes = undefined while trying to resolve 'head_and_tail' in block@1: // for_header_L110 +debug: Looking for 'new_head' in an unsealed block creating an incomplete Phi: block@1: // for_header_L110 +debug: Created Phi assignment: let new_head#1: bytes = undefined while trying to resolve 'new_head' in block@1: // for_header_L110 +debug: Terminated block@2: // for_body_L111 +debug: Sealing block@3: // for_footer_L110 +debug: Terminated block@3: // for_footer_L110 +debug: Sealing block@1: // for_header_L110 +debug: Added head_offset#0 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0) in block@0: // L92 +debug: Added head_offset#2 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0, head_offset#2 <- block@3) in block@3: // for_footer_L110 +debug: Added head_and_tail#0 to Phi node: let head_and_tail#1: bytes = φ(head_and_tail#0 <- block@0) in block@0: // L92 +debug: Added head_and_tail#1 to Phi node: let head_and_tail#1: bytes = φ(head_and_tail#0 <- block@0, head_and_tail#1 <- block@3) in block@3: // for_footer_L110 +debug: Replacing trivial Phi node: let head_and_tail#1: bytes = φ(head_and_tail#0 <- block@0, head_and_tail#1 <- block@3) (head_and_tail#1) with head_and_tail#0 +debug: Deleting Phi assignment: let head_and_tail#1: bytes = φ(head_and_tail#0 <- block@0, head_and_tail#1 <- block@3) +debug: Replaced trivial Phi node: let head_and_tail#1: bytes = φ(head_and_tail#0 <- block@0, head_and_tail#1 <- block@3) (head_and_tail#1) with head_and_tail#0 in current definition for 3 blocks +debug: Added new_head#0 to Phi node: let new_head#1: bytes = φ(new_head#0 <- block@0) in block@0: // L92 +debug: Added new_head#2 to Phi node: let new_head#1: bytes = φ(new_head#0 <- block@0, new_head#2 <- block@3) in block@3: // for_footer_L110 +debug: Sealing block@4: // after_for_L110 +debug: Created Phi assignment: let length_minus_1#1: uint64 = undefined while trying to resolve 'length_minus_1' in block@1: // for_header_L110 +debug: Added length_minus_1#0 to Phi node: let length_minus_1#1: uint64 = φ(length_minus_1#0 <- block@0) in block@0: // L92 +debug: Added length_minus_1#1 to Phi node: let length_minus_1#1: uint64 = φ(length_minus_1#0 <- block@0, length_minus_1#1 <- block@3) in block@3: // for_footer_L110 +debug: Replacing trivial Phi node: let length_minus_1#1: uint64 = φ(length_minus_1#0 <- block@0, length_minus_1#1 <- block@3) (length_minus_1#1) with length_minus_1#0 +debug: Deleting Phi assignment: let length_minus_1#1: uint64 = φ(length_minus_1#0 <- block@0, length_minus_1#1 <- block@3) +debug: Replaced trivial Phi node: let length_minus_1#1: uint64 = φ(length_minus_1#0 <- block@0, length_minus_1#1 <- block@3) (length_minus_1#1) with length_minus_1#0 in current definition for 3 blocks +debug: Created Phi assignment: let popped_header_offset#1: uint64 = undefined while trying to resolve 'popped_header_offset' in block@1: // for_header_L110 +debug: Added popped_header_offset#0 to Phi node: let popped_header_offset#1: uint64 = φ(popped_header_offset#0 <- block@0) in block@0: // L92 +debug: Added popped_header_offset#1 to Phi node: let popped_header_offset#1: uint64 = φ(popped_header_offset#0 <- block@0, popped_header_offset#1 <- block@3) in block@3: // for_footer_L110 +debug: Replacing trivial Phi node: let popped_header_offset#1: uint64 = φ(popped_header_offset#0 <- block@0, popped_header_offset#1 <- block@3) (popped_header_offset#1) with popped_header_offset#0 +debug: Deleting Phi assignment: let popped_header_offset#1: uint64 = φ(popped_header_offset#0 <- block@0, popped_header_offset#1 <- block@3) +debug: Replaced trivial Phi node: let popped_header_offset#1: uint64 = φ(popped_header_offset#0 <- block@0, popped_header_offset#1 <- block@3) (popped_header_offset#1) with popped_header_offset#0 in current definition for 3 blocks +debug: Created Phi assignment: let popped_offset#1: uint64 = undefined while trying to resolve 'popped_offset' in block@1: // for_header_L110 +debug: Added popped_offset#0 to Phi node: let popped_offset#1: uint64 = φ(popped_offset#0 <- block@0) in block@0: // L92 +debug: Added popped_offset#1 to Phi node: let popped_offset#1: uint64 = φ(popped_offset#0 <- block@0, popped_offset#1 <- block@3) in block@3: // for_footer_L110 +debug: Replacing trivial Phi node: let popped_offset#1: uint64 = φ(popped_offset#0 <- block@0, popped_offset#1 <- block@3) (popped_offset#1) with popped_offset#0 +debug: Deleting Phi assignment: let popped_offset#1: uint64 = φ(popped_offset#0 <- block@0, popped_offset#1 <- block@3) +debug: Replaced trivial Phi node: let popped_offset#1: uint64 = φ(popped_offset#0 <- block@0, popped_offset#1 <- block@3) (popped_offset#1) with popped_offset#0 in current definition for 3 blocks +debug: Created Phi assignment: let popped#1: bytes = undefined while trying to resolve 'popped' in block@1: // for_header_L110 +debug: Added popped#0 to Phi node: let popped#1: bytes = φ(popped#0 <- block@0) in block@0: // L92 +debug: Added popped#1 to Phi node: let popped#1: bytes = φ(popped#0 <- block@0, popped#1 <- block@3) in block@3: // for_footer_L110 +debug: Replacing trivial Phi node: let popped#1: bytes = φ(popped#0 <- block@0, popped#1 <- block@3) (popped#1) with popped#0 +debug: Deleting Phi assignment: let popped#1: bytes = φ(popped#0 <- block@0, popped#1 <- block@3) +debug: Replaced trivial Phi node: let popped#1: bytes = φ(popped#0 <- block@0, popped#1 <- block@3) (popped#1) with popped#0 in current definition for 3 blocks +debug: Terminated block@4: // after_for_L110 +debug: Sealing block@0: // L124 +debug: Terminated block@0: // L124 +debug: Sealing block@1: // if_body_L147 +debug: Terminated block@1: // if_body_L147 +debug: Sealing block@2: // after_if_else_L146 +debug: Created Phi assignment: let array_length#1: uint64 = undefined while trying to resolve 'array_length' in block@2: // after_if_else_L146 +debug: Added array_length#0 to Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0) in block@0: // L124 +debug: Added array_length#0 to Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) in block@1: // if_body_L147 +debug: Replacing trivial Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) (array_length#1) with array_length#0 +debug: Deleting Phi assignment: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) +debug: Replaced trivial Phi node: let array_length#1: uint64 = φ(array_length#0 <- block@0, array_length#0 <- block@1) (array_length#1) with array_length#0 in current definition for 1 blocks +debug: Created Phi assignment: let is_packed#1: bool = undefined while trying to resolve 'is_packed' in block@2: // after_if_else_L146 +debug: Added is_packed#0 to Phi node: let is_packed#1: bool = φ(is_packed#0 <- block@0) in block@0: // L124 +debug: Added is_packed#0 to Phi node: let is_packed#1: bool = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) in block@1: // if_body_L147 +debug: Replacing trivial Phi node: let is_packed#1: bool = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) (is_packed#1) with is_packed#0 +debug: Deleting Phi assignment: let is_packed#1: bool = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) +debug: Replaced trivial Phi node: let is_packed#1: bool = φ(is_packed#0 <- block@0, is_packed#0 <- block@1) (is_packed#1) with is_packed#0 in current definition for 1 blocks +debug: Created Phi assignment: let new_items_count#1: uint64 = undefined while trying to resolve 'new_items_count' in block@2: // after_if_else_L146 +debug: Added new_items_count#0 to Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0) in block@0: // L124 +debug: Added new_items_count#0 to Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) in block@1: // if_body_L147 +debug: Replacing trivial Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) (new_items_count#1) with new_items_count#0 +debug: Deleting Phi assignment: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) +debug: Replaced trivial Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#0 <- block@1) (new_items_count#1) with new_items_count#0 in current definition for 1 blocks +debug: Terminated block@2: // after_if_else_L146 +debug: Looking for 'i' in an unsealed block creating an incomplete Phi: block@3: // for_header_L150 +debug: Created Phi assignment: let i#1: uint64 = undefined while trying to resolve 'i' in block@3: // for_header_L150 +debug: Terminated block@3: // for_header_L150 +debug: Sealing block@4: // for_body_L151 +debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@3: // for_header_L150 +debug: Created Phi assignment: let result#2: bytes = undefined while trying to resolve 'result' in block@3: // for_header_L150 +debug: Looking for 'write_offset' in an unsealed block creating an incomplete Phi: block@3: // for_header_L150 +debug: Created Phi assignment: let write_offset#1: uint64 = undefined while trying to resolve 'write_offset' in block@3: // for_header_L150 +debug: Looking for 'new_items_bytes' in an unsealed block creating an incomplete Phi: block@3: // for_header_L150 +debug: Created Phi assignment: let new_items_bytes#1: bytes = undefined while trying to resolve 'new_items_bytes' in block@3: // for_header_L150 +debug: Terminated block@4: // for_body_L151 +debug: Sealing block@5: // for_footer_L150 +debug: Terminated block@5: // for_footer_L150 +debug: Sealing block@3: // for_header_L150 +debug: Added i#0 to Phi node: let i#1: uint64 = φ(i#0 <- block@2) in block@2: // after_if_else_L146 +debug: Added i#2 to Phi node: let i#1: uint64 = φ(i#0 <- block@2, i#2 <- block@5) in block@5: // for_footer_L150 +debug: Created Phi assignment: let result#4: bytes = undefined while trying to resolve 'result' in block@2: // after_if_else_L146 +debug: Added result#0 to Phi node: let result#4: bytes = φ(result#0 <- block@0) in block@0: // L124 +debug: Added result#1 to Phi node: let result#4: bytes = φ(result#0 <- block@0, result#1 <- block@1) in block@1: // if_body_L147 +debug: Added result#4 to Phi node: let result#2: bytes = φ(result#4 <- block@2) in block@2: // after_if_else_L146 +debug: Added result#3 to Phi node: let result#2: bytes = φ(result#4 <- block@2, result#3 <- block@5) in block@5: // for_footer_L150 +debug: Added write_offset#0 to Phi node: let write_offset#1: uint64 = φ(write_offset#0 <- block@2) in block@2: // after_if_else_L146 +debug: Added write_offset#2 to Phi node: let write_offset#1: uint64 = φ(write_offset#0 <- block@2, write_offset#2 <- block@5) in block@5: // for_footer_L150 +debug: Created Phi assignment: let new_items_bytes#2: bytes = undefined while trying to resolve 'new_items_bytes' in block@2: // after_if_else_L146 +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@0) in block@0: // L124 +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) in block@1: // if_body_L147 +debug: Replacing trivial Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) (new_items_bytes#2) with new_items_bytes#0 +debug: Deleting Phi assignment: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) +debug: Replaced trivial Phi node: let new_items_bytes#2: bytes = φ(new_items_bytes#0 <- block@0, new_items_bytes#0 <- block@1) (new_items_bytes#2) with new_items_bytes#0 in current definition for 1 blocks +debug: Added new_items_bytes#0 to Phi node: let new_items_bytes#1: bytes = φ(new_items_bytes#0 <- block@2) in block@2: // after_if_else_L146 +debug: Added new_items_bytes#1 to Phi node: let new_items_bytes#1: bytes = φ(new_items_bytes#0 <- block@2, new_items_bytes#1 <- block@5) in block@5: // for_footer_L150 +debug: Replacing trivial Phi node: let new_items_bytes#1: bytes = φ(new_items_bytes#0 <- block@2, new_items_bytes#1 <- block@5) (new_items_bytes#1) with new_items_bytes#0 +debug: Deleting Phi assignment: let new_items_bytes#1: bytes = φ(new_items_bytes#0 <- block@2, new_items_bytes#1 <- block@5) +debug: Replaced trivial Phi node: let new_items_bytes#1: bytes = φ(new_items_bytes#0 <- block@2, new_items_bytes#1 <- block@5) (new_items_bytes#1) with new_items_bytes#0 in current definition for 3 blocks +debug: Sealing block@6: // after_for_L150 +debug: Terminated block@6: // after_for_L150 +debug: Sealing block@0: // L157 +debug: Terminated block@0: // L157 +debug: Sealing block@0: // L189 +debug: Terminated block@0: // L189 +debug: Looking for 'head_offset' in an unsealed block creating an incomplete Phi: block@1: // for_header_L199 +debug: Created Phi assignment: let head_offset#1: uint64 = undefined while trying to resolve 'head_offset' in block@1: // for_header_L199 +debug: Terminated block@1: // for_header_L199 +debug: Sealing block@2: // for_body_L200 +debug: Looking for 'array_head_and_tail' in an unsealed block creating an incomplete Phi: block@1: // for_header_L199 +debug: Created Phi assignment: let array_head_and_tail#1: bytes = undefined while trying to resolve 'array_head_and_tail' in block@1: // for_header_L199 +debug: Looking for 'new_head' in an unsealed block creating an incomplete Phi: block@1: // for_header_L199 +debug: Created Phi assignment: let new_head#1: bytes = undefined while trying to resolve 'new_head' in block@1: // for_header_L199 +debug: Looking for 'item_offset_adjustment' in an unsealed block creating an incomplete Phi: block@1: // for_header_L199 +debug: Created Phi assignment: let item_offset_adjustment#1: uint64 = undefined while trying to resolve 'item_offset_adjustment' in block@1: // for_header_L199 +debug: Terminated block@2: // for_body_L200 +debug: Sealing block@3: // for_footer_L199 +debug: Terminated block@3: // for_footer_L199 +debug: Sealing block@1: // for_header_L199 +debug: Added head_offset#0 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0) in block@0: // L189 +debug: Added head_offset#2 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0, head_offset#2 <- block@3) in block@3: // for_footer_L199 +debug: Added array_head_and_tail#0 to Phi node: let array_head_and_tail#1: bytes = φ(array_head_and_tail#0 <- block@0) in block@0: // L189 +debug: Added array_head_and_tail#1 to Phi node: let array_head_and_tail#1: bytes = φ(array_head_and_tail#0 <- block@0, array_head_and_tail#1 <- block@3) in block@3: // for_footer_L199 +debug: Replacing trivial Phi node: let array_head_and_tail#1: bytes = φ(array_head_and_tail#0 <- block@0, array_head_and_tail#1 <- block@3) (array_head_and_tail#1) with array_head_and_tail#0 +debug: Deleting Phi assignment: let array_head_and_tail#1: bytes = φ(array_head_and_tail#0 <- block@0, array_head_and_tail#1 <- block@3) +debug: Replaced trivial Phi node: let array_head_and_tail#1: bytes = φ(array_head_and_tail#0 <- block@0, array_head_and_tail#1 <- block@3) (array_head_and_tail#1) with array_head_and_tail#0 in current definition for 3 blocks +debug: Added new_head#0 to Phi node: let new_head#1: bytes = φ(new_head#0 <- block@0) in block@0: // L189 +debug: Added new_head#2 to Phi node: let new_head#1: bytes = φ(new_head#0 <- block@0, new_head#2 <- block@3) in block@3: // for_footer_L199 +debug: Added item_offset_adjustment#0 to Phi node: let item_offset_adjustment#1: uint64 = φ(item_offset_adjustment#0 <- block@0) in block@0: // L189 +debug: Added item_offset_adjustment#1 to Phi node: let item_offset_adjustment#1: uint64 = φ(item_offset_adjustment#0 <- block@0, item_offset_adjustment#1 <- block@3) in block@3: // for_footer_L199 +debug: Replacing trivial Phi node: let item_offset_adjustment#1: uint64 = φ(item_offset_adjustment#0 <- block@0, item_offset_adjustment#1 <- block@3) (item_offset_adjustment#1) with item_offset_adjustment#0 +debug: Deleting Phi assignment: let item_offset_adjustment#1: uint64 = φ(item_offset_adjustment#0 <- block@0, item_offset_adjustment#1 <- block@3) +debug: Replaced trivial Phi node: let item_offset_adjustment#1: uint64 = φ(item_offset_adjustment#0 <- block@0, item_offset_adjustment#1 <- block@3) (item_offset_adjustment#1) with item_offset_adjustment#0 in current definition for 3 blocks +debug: Sealing block@4: // after_for_L199 +debug: Created Phi assignment: let new_items_count#1: uint64 = undefined while trying to resolve 'new_items_count' in block@1: // for_header_L199 +debug: Added new_items_count#0 to Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0) in block@0: // L189 +debug: Added new_items_count#1 to Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#1 <- block@3) in block@3: // for_footer_L199 +debug: Replacing trivial Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#1 <- block@3) (new_items_count#1) with new_items_count#0 +debug: Deleting Phi assignment: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#1 <- block@3) +debug: Replaced trivial Phi node: let new_items_count#1: uint64 = φ(new_items_count#0 <- block@0, new_items_count#1 <- block@3) (new_items_count#1) with new_items_count#0 in current definition for 3 blocks +debug: Terminated block@4: // after_for_L199 +debug: Looking for 'head_offset' in an unsealed block creating an incomplete Phi: block@5: // for_header_L204 +debug: Created Phi assignment: let head_offset#4: uint64 = undefined while trying to resolve 'head_offset' in block@5: // for_header_L204 +debug: Terminated block@5: // for_header_L204 +debug: Sealing block@6: // for_body_L205 +debug: Looking for 'new_head_and_tail' in an unsealed block creating an incomplete Phi: block@5: // for_header_L204 +debug: Created Phi assignment: let new_head_and_tail#1: bytes = undefined while trying to resolve 'new_head_and_tail' in block@5: // for_header_L204 +debug: Looking for 'new_head' in an unsealed block creating an incomplete Phi: block@5: // for_header_L204 +debug: Created Phi assignment: let new_head#3: bytes = undefined while trying to resolve 'new_head' in block@5: // for_header_L204 +debug: Looking for 'item_offset_adjustment' in an unsealed block creating an incomplete Phi: block@5: // for_header_L204 +debug: Created Phi assignment: let item_offset_adjustment#3: uint64 = undefined while trying to resolve 'item_offset_adjustment' in block@5: // for_header_L204 +debug: Terminated block@6: // for_body_L205 +debug: Sealing block@7: // for_footer_L204 +debug: Terminated block@7: // for_footer_L204 +debug: Sealing block@5: // for_header_L204 +debug: Added head_offset#3 to Phi node: let head_offset#4: uint64 = φ(head_offset#3 <- block@4) in block@4: // after_for_L199 +debug: Added head_offset#5 to Phi node: let head_offset#4: uint64 = φ(head_offset#3 <- block@4, head_offset#5 <- block@7) in block@7: // for_footer_L204 +debug: Created Phi assignment: let new_head_and_tail#2: bytes = undefined while trying to resolve 'new_head_and_tail' in block@1: // for_header_L199 +debug: Added new_head_and_tail#0 to Phi node: let new_head_and_tail#2: bytes = φ(new_head_and_tail#0 <- block@0) in block@0: // L189 +debug: Added new_head_and_tail#2 to Phi node: let new_head_and_tail#2: bytes = φ(new_head_and_tail#0 <- block@0, new_head_and_tail#2 <- block@3) in block@3: // for_footer_L199 +debug: Replacing trivial Phi node: let new_head_and_tail#2: bytes = φ(new_head_and_tail#0 <- block@0, new_head_and_tail#2 <- block@3) (new_head_and_tail#2) with new_head_and_tail#0 +debug: Deleting Phi assignment: let new_head_and_tail#2: bytes = φ(new_head_and_tail#0 <- block@0, new_head_and_tail#2 <- block@3) +debug: Replaced trivial Phi node: let new_head_and_tail#2: bytes = φ(new_head_and_tail#0 <- block@0, new_head_and_tail#2 <- block@3) (new_head_and_tail#2) with new_head_and_tail#0 in current definition for 3 blocks +debug: Added new_head_and_tail#0 to Phi node: let new_head_and_tail#1: bytes = φ(new_head_and_tail#0 <- block@4) in block@4: // after_for_L199 +debug: Added new_head_and_tail#1 to Phi node: let new_head_and_tail#1: bytes = φ(new_head_and_tail#0 <- block@4, new_head_and_tail#1 <- block@7) in block@7: // for_footer_L204 +debug: Replacing trivial Phi node: let new_head_and_tail#1: bytes = φ(new_head_and_tail#0 <- block@4, new_head_and_tail#1 <- block@7) (new_head_and_tail#1) with new_head_and_tail#0 +debug: Deleting Phi assignment: let new_head_and_tail#1: bytes = φ(new_head_and_tail#0 <- block@4, new_head_and_tail#1 <- block@7) +debug: Replaced trivial Phi node: let new_head_and_tail#1: bytes = φ(new_head_and_tail#0 <- block@4, new_head_and_tail#1 <- block@7) (new_head_and_tail#1) with new_head_and_tail#0 in current definition for 3 blocks +debug: Added new_head#1 to Phi node: let new_head#3: bytes = φ(new_head#1 <- block@4) in block@4: // after_for_L199 +debug: Added new_head#4 to Phi node: let new_head#3: bytes = φ(new_head#1 <- block@4, new_head#4 <- block@7) in block@7: // for_footer_L204 +debug: Added item_offset_adjustment#2 to Phi node: let item_offset_adjustment#3: uint64 = φ(item_offset_adjustment#2 <- block@4) in block@4: // after_for_L199 +debug: Added item_offset_adjustment#3 to Phi node: let item_offset_adjustment#3: uint64 = φ(item_offset_adjustment#2 <- block@4, item_offset_adjustment#3 <- block@7) in block@7: // for_footer_L204 +debug: Replacing trivial Phi node: let item_offset_adjustment#3: uint64 = φ(item_offset_adjustment#2 <- block@4, item_offset_adjustment#3 <- block@7) (item_offset_adjustment#3) with item_offset_adjustment#2 +debug: Deleting Phi assignment: let item_offset_adjustment#3: uint64 = φ(item_offset_adjustment#2 <- block@4, item_offset_adjustment#3 <- block@7) +debug: Replaced trivial Phi node: let item_offset_adjustment#3: uint64 = φ(item_offset_adjustment#2 <- block@4, item_offset_adjustment#3 <- block@7) (item_offset_adjustment#3) with item_offset_adjustment#2 in current definition for 3 blocks +debug: Sealing block@8: // after_for_L204 +debug: Created Phi assignment: let array_items_count#1: uint64 = undefined while trying to resolve 'array_items_count' in block@5: // for_header_L204 +debug: Created Phi assignment: let array_items_count#2: uint64 = undefined while trying to resolve 'array_items_count' in block@1: // for_header_L199 +debug: Added array_items_count#0 to Phi node: let array_items_count#2: uint64 = φ(array_items_count#0 <- block@0) in block@0: // L189 +debug: Added array_items_count#2 to Phi node: let array_items_count#2: uint64 = φ(array_items_count#0 <- block@0, array_items_count#2 <- block@3) in block@3: // for_footer_L199 +debug: Replacing trivial Phi node: let array_items_count#2: uint64 = φ(array_items_count#0 <- block@0, array_items_count#2 <- block@3) (array_items_count#2) with array_items_count#0 +debug: Deleting Phi assignment: let array_items_count#2: uint64 = φ(array_items_count#0 <- block@0, array_items_count#2 <- block@3) +debug: Replaced trivial Phi node: let array_items_count#2: uint64 = φ(array_items_count#0 <- block@0, array_items_count#2 <- block@3) (array_items_count#2) with array_items_count#0 in current definition for 3 blocks +debug: Added array_items_count#0 to Phi node: let array_items_count#1: uint64 = φ(array_items_count#0 <- block@4) in block@4: // after_for_L199 +debug: Added array_items_count#1 to Phi node: let array_items_count#1: uint64 = φ(array_items_count#0 <- block@4, array_items_count#1 <- block@7) in block@7: // for_footer_L204 +debug: Replacing trivial Phi node: let array_items_count#1: uint64 = φ(array_items_count#0 <- block@4, array_items_count#1 <- block@7) (array_items_count#1) with array_items_count#0 +debug: Deleting Phi assignment: let array_items_count#1: uint64 = φ(array_items_count#0 <- block@4, array_items_count#1 <- block@7) +debug: Replaced trivial Phi node: let array_items_count#1: uint64 = φ(array_items_count#0 <- block@4, array_items_count#1 <- block@7) (array_items_count#1) with array_items_count#0 in current definition for 3 blocks +debug: Created Phi assignment: let new_items_count#2: uint64 = undefined while trying to resolve 'new_items_count' in block@5: // for_header_L204 +debug: Added new_items_count#0 to Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@4) in block@4: // after_for_L199 +debug: Added new_items_count#2 to Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@4, new_items_count#2 <- block@7) in block@7: // for_footer_L204 +debug: Replacing trivial Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@4, new_items_count#2 <- block@7) (new_items_count#2) with new_items_count#0 +debug: Deleting Phi assignment: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@4, new_items_count#2 <- block@7) +debug: Replaced trivial Phi node: let new_items_count#2: uint64 = φ(new_items_count#0 <- block@4, new_items_count#2 <- block@7) (new_items_count#2) with new_items_count#0 in current definition for 3 blocks +debug: Created Phi assignment: let array_head_and_tail#2: bytes = undefined while trying to resolve 'array_head_and_tail' in block@5: // for_header_L204 +debug: Added array_head_and_tail#0 to Phi node: let array_head_and_tail#2: bytes = φ(array_head_and_tail#0 <- block@4) in block@4: // after_for_L199 +debug: Added array_head_and_tail#2 to Phi node: let array_head_and_tail#2: bytes = φ(array_head_and_tail#0 <- block@4, array_head_and_tail#2 <- block@7) in block@7: // for_footer_L204 +debug: Replacing trivial Phi node: let array_head_and_tail#2: bytes = φ(array_head_and_tail#0 <- block@4, array_head_and_tail#2 <- block@7) (array_head_and_tail#2) with array_head_and_tail#0 +debug: Deleting Phi assignment: let array_head_and_tail#2: bytes = φ(array_head_and_tail#0 <- block@4, array_head_and_tail#2 <- block@7) +debug: Replaced trivial Phi node: let array_head_and_tail#2: bytes = φ(array_head_and_tail#0 <- block@4, array_head_and_tail#2 <- block@7) (array_head_and_tail#2) with array_head_and_tail#0 in current definition for 3 blocks +debug: Terminated block@8: // after_for_L204 +debug: Sealing block@0: // L217 +debug: Terminated block@0: // L217 +debug: Sealing block@0: // L240 +debug: Terminated block@0: // L240 +debug: Sealing block@0: // L252 +debug: Terminated block@0: // L252 +debug: Looking for 'head_offset' in an unsealed block creating an incomplete Phi: block@1: // for_header_L269 +debug: Created Phi assignment: let head_offset#1: uint64 = undefined while trying to resolve 'head_offset' in block@1: // for_header_L269 +debug: Terminated block@1: // for_header_L269 +debug: Sealing block@2: // for_body_L270 +debug: Looking for 'new_head_and_tail' in an unsealed block creating an incomplete Phi: block@1: // for_header_L269 +debug: Created Phi assignment: let new_head_and_tail#1: bytes = undefined while trying to resolve 'new_head_and_tail' in block@1: // for_header_L269 +debug: Looking for 'new_item_length' in an unsealed block creating an incomplete Phi: block@1: // for_header_L269 +debug: Created Phi assignment: let new_item_length#1: uint64 = undefined while trying to resolve 'new_item_length' in block@1: // for_header_L269 +debug: Looking for 'original_item_length' in an unsealed block creating an incomplete Phi: block@1: // for_header_L269 +debug: Created Phi assignment: let original_item_length#1: uint64 = undefined while trying to resolve 'original_item_length' in block@1: // for_header_L269 +debug: Terminated block@2: // for_body_L270 +debug: Sealing block@3: // for_footer_L269 +debug: Terminated block@3: // for_footer_L269 +debug: Sealing block@1: // for_header_L269 +debug: Added head_offset#0 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0) in block@0: // L252 +debug: Added head_offset#2 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0, head_offset#2 <- block@3) in block@3: // for_footer_L269 +debug: Added new_head_and_tail#0 to Phi node: let new_head_and_tail#1: bytes = φ(new_head_and_tail#0 <- block@0) in block@0: // L252 +debug: Added new_head_and_tail#2 to Phi node: let new_head_and_tail#1: bytes = φ(new_head_and_tail#0 <- block@0, new_head_and_tail#2 <- block@3) in block@3: // for_footer_L269 +debug: Added new_item_length#0 to Phi node: let new_item_length#1: uint64 = φ(new_item_length#0 <- block@0) in block@0: // L252 +debug: Added new_item_length#1 to Phi node: let new_item_length#1: uint64 = φ(new_item_length#0 <- block@0, new_item_length#1 <- block@3) in block@3: // for_footer_L269 +debug: Replacing trivial Phi node: let new_item_length#1: uint64 = φ(new_item_length#0 <- block@0, new_item_length#1 <- block@3) (new_item_length#1) with new_item_length#0 +debug: Deleting Phi assignment: let new_item_length#1: uint64 = φ(new_item_length#0 <- block@0, new_item_length#1 <- block@3) +debug: Replaced trivial Phi node: let new_item_length#1: uint64 = φ(new_item_length#0 <- block@0, new_item_length#1 <- block@3) (new_item_length#1) with new_item_length#0 in current definition for 3 blocks +debug: Added original_item_length#0 to Phi node: let original_item_length#1: uint64 = φ(original_item_length#0 <- block@0) in block@0: // L252 +debug: Added original_item_length#1 to Phi node: let original_item_length#1: uint64 = φ(original_item_length#0 <- block@0, original_item_length#1 <- block@3) in block@3: // for_footer_L269 +debug: Replacing trivial Phi node: let original_item_length#1: uint64 = φ(original_item_length#0 <- block@0, original_item_length#1 <- block@3) (original_item_length#1) with original_item_length#0 +debug: Deleting Phi assignment: let original_item_length#1: uint64 = φ(original_item_length#0 <- block@0, original_item_length#1 <- block@3) +debug: Replaced trivial Phi node: let original_item_length#1: uint64 = φ(original_item_length#0 <- block@0, original_item_length#1 <- block@3) (original_item_length#1) with original_item_length#0 in current definition for 3 blocks +debug: Sealing block@4: // after_for_L269 +debug: Terminated block@4: // after_for_L269 +debug: Sealing block@0: // L278 +debug: Terminated block@0: // L278 +debug: Sealing block@0: // L306 +debug: Terminated block@0: // L306 +debug: Looking for 'head_offset' in an unsealed block creating an incomplete Phi: block@1: // for_header_L327 +debug: Created Phi assignment: let head_offset#1: uint64 = undefined while trying to resolve 'head_offset' in block@1: // for_header_L327 +debug: Terminated block@1: // for_header_L327 +debug: Sealing block@2: // for_body_L328 +debug: Looking for 'tail_offset' in an unsealed block creating an incomplete Phi: block@1: // for_header_L327 +debug: Created Phi assignment: let tail_offset#1: uint64 = undefined while trying to resolve 'tail_offset' in block@1: // for_header_L327 +debug: Looking for 'array_head_and_tail' in an unsealed block creating an incomplete Phi: block@1: // for_header_L327 +debug: Created Phi assignment: let array_head_and_tail#1: bytes = undefined while trying to resolve 'array_head_and_tail' in block@1: // for_header_L327 +debug: Terminated block@2: // for_body_L328 +debug: Sealing block@3: // for_footer_L327 +debug: Terminated block@3: // for_footer_L327 +debug: Sealing block@1: // for_header_L327 +debug: Added head_offset#0 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0) in block@0: // L306 +debug: Added head_offset#3 to Phi node: let head_offset#1: uint64 = φ(head_offset#0 <- block@0, head_offset#3 <- block@3) in block@3: // for_footer_L327 +debug: Added tail_offset#0 to Phi node: let tail_offset#1: uint64 = φ(tail_offset#0 <- block@0) in block@0: // L306 +debug: Added tail_offset#2 to Phi node: let tail_offset#1: uint64 = φ(tail_offset#0 <- block@0, tail_offset#2 <- block@3) in block@3: // for_footer_L327 +debug: Added array_head_and_tail#0 to Phi node: let array_head_and_tail#1: bytes = φ(array_head_and_tail#0 <- block@0) in block@0: // L306 +debug: Added array_head_and_tail#2 to Phi node: let array_head_and_tail#1: bytes = φ(array_head_and_tail#0 <- block@0, array_head_and_tail#2 <- block@3) in block@3: // for_footer_L327 +debug: Sealing block@4: // after_for_L327 +debug: Terminated block@4: // after_for_L327 +debug: Sealing block@0: // L4 +debug: Terminated block@0: // L4 +debug: Sealing block@0: // L9 +debug: Terminated block@0: // L9 +debug: Sealing block@1: // abi_routing_L9 +debug: Terminated block@1: // abi_routing_L9 +debug: Sealing block@2: // test_new_ops_route_L11 +debug: Terminated block@2: // test_new_ops_route_L11 +debug: Sealing block@3: // switch_case_default_L9 +debug: Terminated block@3: // switch_case_default_L9 +debug: Sealing block@4: // switch_case_next_L9 +debug: Terminated block@4: // switch_case_next_L9 +debug: Sealing block@5: // bare_routing_L9 +debug: Terminated block@5: // bare_routing_L9 +debug: Sealing block@6: // __algopy_default_create_L1 +debug: Terminated block@6: // __algopy_default_create_L1 +debug: Sealing block@7: // switch_case_default_L9 +debug: Terminated block@7: // switch_case_default_L9 +debug: Sealing block@8: // switch_case_next_L9 +debug: Terminated block@8: // switch_case_next_L9 +debug: Sealing block@9: // after_if_else_L9 +debug: Terminated block@9: // after_if_else_L9 +debug: Sealing block@0: // L11 +debug: Terminated block@0: // L11 +debug: Sealing block@0: // L1 +debug: Terminated block@0: // L1 +debug: Sealing block@0: // L1 +debug: Terminated block@0: // L1 +debug: Sealing block@0: // L1 +debug: Terminated block@0: // L1 +debug: Output IR to avm_11/out/avm_11_sig.ssa.ir +info: optimizing test_cases.avm_11.contract.avm_11_sig at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine test_cases.avm_11.contract.avm_11_sig +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Don't know how to simplify sumhash512 of 0x +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: No optimizations performed in pass 1, ending loop +debug: Removing Phis from test_cases.avm_11.contract.avm_11_sig +debug: Coalescing local variables in test_cases.avm_11.contract.avm_11_sig using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Sequentializing parallel copies in test_cases.avm_11.contract.avm_11_sig +debug: Performing post-SSA optimizations +debug: Output IR to avm_11/out/avm_11_sig.destructured.ir +debug: Inserted main_block@0.ops[2]: 'l-store-copy tmp%0#0 0' +debug: Replaced main_block@0.ops[4]: 'v-load tmp%0#0' with 'l-load tmp%0#0' +debug: Inserted main_block@0.ops[6]: 'l-store-copy tmp%1#0 0' +debug: Replaced main_block@0.ops[8]: 'v-load tmp%1#0' with 'l-load tmp%1#0' +debug: Output IR to avm_11/out/Contract.ssa.ir +info: optimizing test_cases.avm_11.contract.Contract at level 1 +debug: Begin optimization pass 1/100 +debug: Optimizing subroutine algopy.arc4.ARC4Contract.approval_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__ +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (== tmp%3#0 NoOp) to (! tmp%3#0) +debug: Simplified (== tmp%8#0 0u) to (! tmp%8#0) +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%1#0 +debug: Removing unused variable tmp%6#0 +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: inlining the default target of a switch/goto nth +debug: adding block@1: // abi_routing_L9 as a predecessor of block@4: // switch_case_next_L9 due to inlining of block@3: // switch_case_default_L9 +debug: simplified terminator of block@1: // abi_routing_L9 from switch tmp%2#0 {method "test_new_ops()void" => block@2, * => block@3} to switch tmp%2#0 {method "test_new_ops()void" => block@2, * => block@4} +debug: simplifying a switch with constants into goto nth +debug: simplified terminator of block@5: // bare_routing_L9 from switch tmp%7#0 {0u => block@6, * => block@7} to goto_nth [block@6][tmp%7#0] else goto block@7 +debug: inlining the default target of a switch/goto nth +debug: adding block@1: // abi_routing_L9 as a predecessor of block@9: // after_if_else_L9 due to inlining of block@4: // switch_case_next_L9 +debug: simplified terminator of block@1: // abi_routing_L9 from switch tmp%2#0 {method "test_new_ops()void" => block@2, * => block@4} to switch tmp%2#0 {method "test_new_ops()void" => block@2, * => block@9} +debug: simplifying a goto nth with two targets into a conditional branch +debug: simplified terminator of block@5: // bare_routing_L9 from goto_nth [block@6][tmp%7#0] else goto block@7 to goto tmp%7#0 ? block@7 : block@6 +debug: inlining the default target of a switch/goto nth +debug: simplified terminator of block@1: // abi_routing_L9 from switch tmp%2#0 {method "test_new_ops()void" => block@2, * => block@9} to switch tmp%2#0 {method "test_new_ops()void" => block@2, * => return 0u} +debug: Optimizer: Remove Linear Jump +debug: Replaced predecessor block@4: // switch_case_next_L9 with block@3: // switch_case_default_L9 in block@9: // after_if_else_L9 +debug: Merged linear block@4: // switch_case_next_L9 into block@3: // switch_case_default_L9 +debug: Replaced predecessor block@8: // switch_case_next_L9 with block@7: // switch_case_default_L9 in block@9: // after_if_else_L9 +debug: Merged linear block@8: // switch_case_next_L9 into block@7: // switch_case_default_L9 +debug: Optimizer: Remove Empty Blocks +debug: Removed empty block: block@3: // switch_case_default_L9 +debug: Removed empty block: block@7: // switch_case_default_L9 +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine test_cases.avm_11.contract.Contract.test_new_ops +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Found equivalence set: tuple_assignment%0#0, a#0 +debug: Replacing {tuple_assignment%0#0} with a#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%1#0, b#0 +debug: Replacing {tuple_assignment%1#0} with b#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%2#0, c#0 +debug: Replacing {tuple_assignment%2#0} with c#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%3#0, d#0 +debug: Replacing {tuple_assignment%3#0} with d#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%4#0, e#0 +debug: Replacing {tuple_assignment%4#0} with e#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%5#0, f#0 +debug: Replacing {tuple_assignment%5#0} with f#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%6#0, g#0 +debug: Replacing {tuple_assignment%6#0} with g#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%7#0, h#0 +debug: Replacing {tuple_assignment%7#0} with h#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%8#0, i#0 +debug: Replacing {tuple_assignment%8#0} with i#0 made 1 modifications +debug: Found equivalence set: tuple_assignment%9#0, j#0 +debug: Replacing {tuple_assignment%9#0} with j#0 made 1 modifications +debug: Optimizer: Intrinsic Simplifier +debug: Don't know how to simplify sumhash512 of 0x +debug: Don't know how to simplify sumhash512 of 0x +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%5#0 +debug: Removing unused variable tmp%7#0 +debug: Removing unused variable a#0 +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 tmp%15#0 +debug: Removing unused variable tmp%17#0 +debug: Removing unused variable tmp%20#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%33#0 +debug: Removing unused variable tmp%35#0 +debug: Removing unused variable tmp%37#0 +debug: Removing unused variable tmp%39#0 +debug: Not removing unused assignment since source is not marked as pure: let (g#0: uint64, h#0: bool) = ((voter_params_get VoterBalance) 0u) +debug: Not removing unused assignment since source is not marked as pure: let (i#0: bool, j#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine test_cases.avm_11.contract.Contract.__algopy_default_create +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine algopy.arc4.ARC4Contract.clear_state_program +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Output IR to avm_11/out/Contract.ssa.opt_pass_1.ir +debug: Begin optimization pass 2/100 +debug: Optimizing subroutine algopy.arc4.ARC4Contract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__ +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine test_cases.avm_11.contract.Contract.test_new_ops +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Don't know how to simplify sumhash512 of 0x +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%8#0 +debug: Removing unused variable tmp%9#0 +debug: Removing unused variable tmp%10#0 +debug: Not removing unused assignment since source is not marked as pure: let (g#0: uint64, h#0: bool) = ((voter_params_get VoterBalance) 0u) +debug: Not removing unused assignment since source is not marked as pure: let (i#0: bool, j#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine algopy.arc4.ARC4Contract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Output IR to avm_11/out/Contract.ssa.opt_pass_2.ir +debug: Begin optimization pass 3/100 +debug: Optimizing subroutine algopy.arc4.ARC4Contract.approval_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine test_cases.avm_11.contract.Contract.__puya_arc4_router__ +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine test_cases.avm_11.contract.Contract.test_new_ops +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Don't know how to simplify sumhash512 of 0x +debug: Optimizer: Remove Unused Variables +debug: Not removing unused assignment since source is not marked as pure: let (g#0: uint64, h#0: bool) = ((voter_params_get VoterBalance) 0u) +debug: Not removing unused assignment since source is not marked as pure: let (i#0: bool, j#0: bool) = ((voter_params_get VoterIncentiveEligible) 0u) +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: Optimizing subroutine algopy.arc4.ARC4Contract.clear_state_program +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Replace Compiled References +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination +debug: Optimizer: Remove Calls To No Op Subroutines +debug: No optimizations performed in pass 3, ending loop +debug: Removing Phis from algopy.arc4.ARC4Contract.approval_program +debug: Removing Phis from test_cases.avm_11.contract.Contract.__puya_arc4_router__ +debug: Removing Phis from test_cases.avm_11.contract.Contract.test_new_ops +debug: Removing Phis from algopy.arc4.ARC4Contract.clear_state_program +debug: Coalescing local variables in algopy.arc4.ARC4Contract.approval_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.avm_11.contract.Contract.__puya_arc4_router__ using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.avm_11.contract.Contract.test_new_ops using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in algopy.arc4.ARC4Contract.clear_state_program using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s +debug: Sequentializing parallel copies in algopy.arc4.ARC4Contract.approval_program +debug: Sequentializing parallel copies in test_cases.avm_11.contract.Contract.__puya_arc4_router__ +debug: Sequentializing parallel copies in test_cases.avm_11.contract.Contract.test_new_ops +debug: Sequentializing parallel copies in algopy.arc4.ARC4Contract.clear_state_program +debug: Performing post-SSA optimizations +debug: Output IR to avm_11/out/Contract.destructured.ir +debug: Inserted main_block@0.ops[1]: 'l-store-copy tmp%0#0 0' +debug: Replaced main_block@0.ops[3]: 'v-load tmp%0#0' with 'l-load tmp%0#0' +debug: Inserted __puya_arc4_router___block@0.ops[1]: 'l-store-copy tmp%0#0 0' +debug: Replaced __puya_arc4_router___block@0.ops[3]: 'v-load tmp%0#0' with 'l-load tmp%0#0' +debug: Inserted __puya_arc4_router___abi_routing@1.ops[1]: 'l-store-copy tmp%2#0 0' +debug: Replaced __puya_arc4_router___abi_routing@1.ops[4]: 'v-load tmp%2#0' with 'l-load tmp%2#0' +debug: Inserted __puya_arc4_router___test_new_ops_route@2.ops[1]: 'l-store-copy tmp%3#0 0' +debug: Replaced __puya_arc4_router___test_new_ops_route@2.ops[3]: 'v-load tmp%3#0' with 'l-load tmp%3#0' +debug: Inserted __puya_arc4_router___test_new_ops_route@2.ops[5]: 'l-store-copy tmp%4#0 0' +debug: Replaced __puya_arc4_router___test_new_ops_route@2.ops[7]: 'v-load tmp%4#0' with 'l-load tmp%4#0' +debug: Inserted __puya_arc4_router___test_new_ops_route@2.ops[10]: 'l-store-copy tmp%5#0 0' +debug: Replaced __puya_arc4_router___test_new_ops_route@2.ops[12]: 'v-load tmp%5#0' with 'l-load tmp%5#0' +debug: Inserted __puya_arc4_router___bare_routing@5.ops[1]: 'l-store-copy tmp%7#0 0' +debug: Replaced __puya_arc4_router___bare_routing@5.ops[3]: 'v-load tmp%7#0' with 'l-load tmp%7#0' +debug: Inserted __puya_arc4_router_____algopy_default_create@6.ops[1]: 'l-store-copy tmp%8#0 0' +debug: Replaced __puya_arc4_router_____algopy_default_create@6.ops[3]: 'v-load tmp%8#0' with 'l-load tmp%8#0' +debug: Inserted __puya_arc4_router_____algopy_default_create@6.ops[5]: 'l-store-copy tmp%9#0 0' +debug: Replaced __puya_arc4_router_____algopy_default_create@6.ops[7]: 'v-load tmp%9#0' with 'l-load tmp%9#0' +debug: Inserted test_new_ops_block@0.ops[7]: 'l-store-copy tmp%1#0 0' +debug: Replaced test_new_ops_block@0.ops[9]: 'v-load tmp%1#0' with 'l-load tmp%1#0' +debug: Inserted test_new_ops_block@0.ops[11]: 'l-store-copy tmp%2#0 0' +debug: Replaced test_new_ops_block@0.ops[13]: 'v-load tmp%2#0' with 'l-load tmp%2#0' +debug: Inserted test_new_ops_block@0.ops[17]: 'l-store-copy tmp%3#0 0' +debug: Replaced test_new_ops_block@0.ops[19]: 'v-load tmp%3#0' with 'l-load tmp%3#0' +debug: Inserted test_new_ops_block@0.ops[21]: 'l-store-copy tmp%4#0 0' +debug: Replaced test_new_ops_block@0.ops[23]: 'v-load tmp%4#0' with 'l-load tmp%4#0' +debug: Inserted test_new_ops_block@0.ops[26]: 'l-store-copy tmp%6#0 0' +debug: Replaced test_new_ops_block@0.ops[28]: 'v-load tmp%6#0' with 'l-load tmp%6#0' +debug: Inserted test_new_ops_block@0.ops[38]: 'l-store-copy tmp%13#0 0' +debug: Replaced test_new_ops_block@0.ops[40]: 'v-load tmp%13#0' with 'l-load tmp%13#0' +debug: Inserted test_new_ops_block@0.ops[44]: 'l-store-copy tmp%14#0 0' +debug: Replaced test_new_ops_block@0.ops[46]: 'v-load tmp%14#0' with 'l-load tmp%14#0' +debug: Inserted test_new_ops_block@0.ops[50]: 'l-store-copy tmp%16#0 0' +debug: Replaced test_new_ops_block@0.ops[52]: 'v-load tmp%16#0' with 'l-load tmp%16#0' +debug: Inserted test_new_ops_block@0.ops[56]: 'l-store-copy tmp%18#0 0' +debug: Replaced test_new_ops_block@0.ops[58]: 'v-load tmp%18#0' with 'l-load tmp%18#0' +debug: Inserted test_new_ops_block@0.ops[60]: 'l-store-copy tmp%19#0 0' +debug: Replaced test_new_ops_block@0.ops[62]: 'v-load tmp%19#0' with 'l-load tmp%19#0' +debug: Inserted test_new_ops_block@0.ops[72]: 'l-store-copy tmp%23#0 0' +debug: Replaced test_new_ops_block@0.ops[74]: 'v-load tmp%23#0' with 'l-load tmp%23#0' +debug: Inserted test_new_ops_block@0.ops[78]: 'l-store-copy tmp%24#0 0' +debug: Replaced test_new_ops_block@0.ops[80]: 'v-load tmp%24#0' with 'l-load tmp%24#0' +debug: Inserted test_new_ops_block@0.ops[82]: 'l-store-copy tmp%25#0 0' +debug: Replaced test_new_ops_block@0.ops[84]: 'v-load tmp%25#0' with 'l-load tmp%25#0' +debug: Inserted test_new_ops_block@0.ops[88]: 'l-store-copy tmp%27#0 0' +debug: Replaced test_new_ops_block@0.ops[90]: 'v-load tmp%27#0' with 'l-load tmp%27#0' +debug: Inserted test_new_ops_block@0.ops[94]: 'l-store-copy tmp%29#0 0' +debug: Replaced test_new_ops_block@0.ops[96]: 'v-load tmp%29#0' with 'l-load tmp%29#0' +debug: Inserted test_new_ops_block@0.ops[99]: 'l-store-copy tmp%31#0 0' +debug: Replaced test_new_ops_block@0.ops[101]: 'v-load tmp%31#0' with 'l-load tmp%31#0' +debug: Inserted test_new_ops_block@0.ops[104]: 'l-store-copy tmp%32#0 0' +debug: Replaced test_new_ops_block@0.ops[106]: 'v-load tmp%32#0' with 'l-load tmp%32#0' +debug: Inserted test_new_ops_block@0.ops[109]: 'l-store-copy tmp%34#0 0' +debug: Replaced test_new_ops_block@0.ops[111]: 'v-load tmp%34#0' with 'l-load tmp%34#0' +debug: Inserted test_new_ops_block@0.ops[114]: 'l-store-copy tmp%36#0 0' +debug: Replaced test_new_ops_block@0.ops[116]: 'v-load tmp%36#0' with 'l-load tmp%36#0' +debug: Inserted test_new_ops_block@0.ops[119]: 'l-store-copy tmp%38#0 0' +debug: Replaced test_new_ops_block@0.ops[121]: 'v-load tmp%38#0' with 'l-load tmp%38#0' +debug: Inserted test_new_ops_block@0.ops[34]: 'l-store-copy tmp%12#0 0' +debug: Replaced test_new_ops_block@0.ops[37]: 'v-load tmp%12#0' with 'l-load tmp%12#0' +debug: Inserted test_new_ops_block@0.ops[69]: 'l-store-copy tmp%22#0 0' +debug: Replaced test_new_ops_block@0.ops[72]: 'v-load tmp%22#0' with 'l-load tmp%22#0' +debug: Inserted test_new_ops_block@0.ops[2]: 'l-store-copy tmp%0#0 0' +debug: Replaced test_new_ops_block@0.ops[6]: 'v-load tmp%0#0' with 'l-load tmp%0#0' +debug: Inserted test_new_ops_block@0.ops[33]: 'l-store-copy tmp%11#0 0' +debug: Replaced test_new_ops_block@0.ops[38]: 'v-load tmp%11#0' with 'l-load tmp%11#0' +debug: Inserted test_new_ops_block@0.ops[69]: 'l-store-copy tmp%21#0 0' +debug: Replaced test_new_ops_block@0.ops[74]: 'v-load tmp%21#0' with 'l-load tmp%21#0' +debug: Found 3 edge set/s for test_cases.avm_11.contract.Contract.__puya_arc4_router__ +info: Writing avm_11/out/avm_11_sig.teal +info: Writing avm_11/out/avm_11_sig.bin +info: Writing avm_11/out/avm_11_sig.puya.map +info: Writing avm_11/out/Contract.arc32.json +info: Writing avm_11/out/Contract.approval.teal +info: Writing avm_11/out/Contract.clear.teal +info: Writing avm_11/out/Contract.approval.bin +info: Writing avm_11/out/Contract.clear.bin +info: Writing avm_11/out/Contract.approval.puya.map +info: Writing avm_11/out/Contract.clear.puya.map +info: writing avm_11/out/client_Contract.py \ No newline at end of file diff --git a/tests/test_assemble.py b/tests/test_assemble.py index fd84064f5d..2e936365f7 100644 --- a/tests/test_assemble.py +++ b/tests/test_assemble.py @@ -123,7 +123,7 @@ def test_assemble_last_op_jump() -> None: ), program=teal.TealProgram( id="", - target_avm_version=10, + avm_version=10, main=teal.TealSubroutine( is_main=True, signature=Signature(name="", parameters=(), returns=()),