diff options
author | John Jannotti <jannotti@gmail.com> | 2024-01-19 11:08:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-19 11:08:18 -0500 |
commit | d8dfaadadf73cfd1a10198dd9660afb7276bce09 (patch) | |
tree | 4a54ee86f54be9786963b8eb6589a0abf33675fa | |
parent | 434dca0f02d48d30af1d42eb223039d9e16f0bab (diff) |
AVM: Add a lot of type annotations to opcodes (#5902)
26 files changed, 369 insertions, 630 deletions
diff --git a/data/transactions/logic/README.md b/data/transactions/logic/README.md index a38ba1462..e1c5cfe21 100644 --- a/data/transactions/logic/README.md +++ b/data/transactions/logic/README.md @@ -52,9 +52,6 @@ assembly time to do type checking and to provide more informative error messages | Name | Bound | AVM Type | | ---- | ---- | -------- | -| [32]byte | len(x) == 32 | []byte | -| [64]byte | len(x) == 64 | []byte | -| [80]byte | len(x) == 80 | []byte | | []byte | len(x) <= 4096 | []byte | | address | len(x) == 32 | []byte | | any | | any | diff --git a/data/transactions/logic/TEAL_opcodes_v1.md b/data/transactions/logic/TEAL_opcodes_v1.md index f255c4bec..35bcca925 100644 --- a/data/transactions/logic/TEAL_opcodes_v1.md +++ b/data/transactions/logic/TEAL_opcodes_v1.md @@ -133,7 +133,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi diff --git a/data/transactions/logic/TEAL_opcodes_v10.md b/data/transactions/logic/TEAL_opcodes_v10.md index 83c6e9dfe..b90801521 100644 --- a/data/transactions/logic/TEAL_opcodes_v10.md +++ b/data/transactions/logic/TEAL_opcodes_v10.md @@ -43,7 +43,7 @@ The 32 byte public key is the last element on the stack, preceded by the 64 byte - Syntax: `ecdsa_verify V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x05 {uint8} -- Stack: ..., A: [32]byte, B: []byte, C: []byte, D: []byte, E: []byte → ..., bool +- Stack: ..., A: [32]byte, B: [32]byte, C: [32]byte, D: [32]byte, E: [32]byte → ..., bool - for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1} - **Cost**: Secp256k1=1700; Secp256r1=2500 - Availability: v5 @@ -64,7 +64,7 @@ The 32 byte Y-component of a public key is the last element on the stack, preced - Syntax: `ecdsa_pk_decompress V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x06 {uint8} -- Stack: ..., A: []byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [33]byte → ..., X: [32]byte, Y: [32]byte - decompress pubkey A into components X, Y - **Cost**: Secp256k1=650; Secp256r1=2400 - Availability: v5 @@ -75,7 +75,7 @@ The 33 byte public key in a compressed form to be decompressed into X and Y (top - Syntax: `ecdsa_pk_recover V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x07 {uint8} -- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: [32]byte, Y: [32]byte - for (data A, recovery id B, signature C, D) recover a public key - **Cost**: 2000 - Availability: v5 @@ -175,7 +175,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -896,7 +896,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A, B: []byte → ..., any +- Stack: ..., A, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -906,7 +906,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -916,7 +916,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -926,7 +926,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -936,7 +936,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A, B: []byte, C → ... +- Stack: ..., A, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -946,7 +946,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -954,7 +954,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A, B: []byte → ... +- Stack: ..., A, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -966,7 +966,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application @@ -1254,7 +1254,7 @@ bitlen interprets arrays as big-endian integers, unlike setbit/getbit ## bsqrt - Bytecode: 0x96 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: bigint → ..., bigint - The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers - **Cost**: 40 - Availability: v6 @@ -1271,7 +1271,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## sha3_256 - Bytecode: 0x98 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: []byte → ..., [32]byte - SHA3_256 hash of value A, yields [32]byte - **Cost**: 130 - Availability: v7 @@ -1353,7 +1353,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## b% - Bytecode: 0xaa -- Stack: ..., A: []byte, B: []byte → ..., []byte +- Stack: ..., A: bigint, B: bigint → ..., bigint - A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero. - **Cost**: 20 - Availability: v4 @@ -1608,7 +1608,7 @@ For boxes that exceed 4,096 bytes, consider `box_create`, `box_extract`, and `bo - Syntax: `vrf_verify S` where S: [vrf_verify](#field-group-vrf_verify) - Bytecode: 0xd0 {uint8} -- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: []byte, Y: bool +- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: [64]byte, Y: bool - Verify the proof B of message A against pubkey C. Returns vrf output and verification flag. - **Cost**: 5700 - Availability: v7 diff --git a/data/transactions/logic/TEAL_opcodes_v2.md b/data/transactions/logic/TEAL_opcodes_v2.md index 0f0fa9248..84d21cb74 100644 --- a/data/transactions/logic/TEAL_opcodes_v2.md +++ b/data/transactions/logic/TEAL_opcodes_v2.md @@ -133,7 +133,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -540,7 +540,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A: uint64, B: []byte → ..., any +- Stack: ..., A: uint64, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -550,7 +550,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A: uint64, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -560,7 +560,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -570,7 +570,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -580,7 +580,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A: uint64, B: []byte, C → ... +- Stack: ..., A: uint64, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -590,7 +590,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -598,7 +598,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A: uint64, B: []byte → ... +- Stack: ..., A: uint64, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -610,7 +610,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application diff --git a/data/transactions/logic/TEAL_opcodes_v3.md b/data/transactions/logic/TEAL_opcodes_v3.md index b8e2c7e96..b9b21b141 100644 --- a/data/transactions/logic/TEAL_opcodes_v3.md +++ b/data/transactions/logic/TEAL_opcodes_v3.md @@ -133,7 +133,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -628,7 +628,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A: uint64, B: []byte → ..., any +- Stack: ..., A: uint64, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -638,7 +638,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A: uint64, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -648,7 +648,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -658,7 +658,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -668,7 +668,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A: uint64, B: []byte, C → ... +- Stack: ..., A: uint64, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -678,7 +678,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -686,7 +686,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A: uint64, B: []byte → ... +- Stack: ..., A: uint64, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -698,7 +698,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application diff --git a/data/transactions/logic/TEAL_opcodes_v4.md b/data/transactions/logic/TEAL_opcodes_v4.md index 66ebc2cc2..2fb554bed 100644 --- a/data/transactions/logic/TEAL_opcodes_v4.md +++ b/data/transactions/logic/TEAL_opcodes_v4.md @@ -133,7 +133,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -682,7 +682,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A, B: []byte → ..., any +- Stack: ..., A, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -692,7 +692,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -702,7 +702,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -712,7 +712,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -722,7 +722,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A, B: []byte, C → ... +- Stack: ..., A, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -732,7 +732,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -740,7 +740,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A, B: []byte → ... +- Stack: ..., A, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -752,7 +752,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application @@ -984,7 +984,7 @@ bitlen interprets arrays as big-endian integers, unlike setbit/getbit ## b% - Bytecode: 0xaa -- Stack: ..., A: []byte, B: []byte → ..., []byte +- Stack: ..., A: bigint, B: bigint → ..., bigint - A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero. - **Cost**: 20 - Availability: v4 diff --git a/data/transactions/logic/TEAL_opcodes_v5.md b/data/transactions/logic/TEAL_opcodes_v5.md index 46c79662a..92f52f59a 100644 --- a/data/transactions/logic/TEAL_opcodes_v5.md +++ b/data/transactions/logic/TEAL_opcodes_v5.md @@ -43,7 +43,7 @@ The 32 byte public key is the last element on the stack, preceded by the 64 byte - Syntax: `ecdsa_verify V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x05 {uint8} -- Stack: ..., A: [32]byte, B: []byte, C: []byte, D: []byte, E: []byte → ..., bool +- Stack: ..., A: [32]byte, B: [32]byte, C: [32]byte, D: [32]byte, E: [32]byte → ..., bool - for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1} - **Cost**: Secp256k1=1700 - Availability: v5 @@ -63,7 +63,7 @@ The 32 byte Y-component of a public key is the last element on the stack, preced - Syntax: `ecdsa_pk_decompress V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x06 {uint8} -- Stack: ..., A: []byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [33]byte → ..., X: [32]byte, Y: [32]byte - decompress pubkey A into components X, Y - **Cost**: Secp256k1=650 - Availability: v5 @@ -74,7 +74,7 @@ The 33 byte public key in a compressed form to be decompressed into X and Y (top - Syntax: `ecdsa_pk_recover V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x07 {uint8} -- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: [32]byte, Y: [32]byte - for (data A, recovery id B, signature C, D) recover a public key - **Cost**: 2000 - Availability: v5 @@ -174,7 +174,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -796,7 +796,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A, B: []byte → ..., any +- Stack: ..., A, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -806,7 +806,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -816,7 +816,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -826,7 +826,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -836,7 +836,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A, B: []byte, C → ... +- Stack: ..., A, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -846,7 +846,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -854,7 +854,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A, B: []byte → ... +- Stack: ..., A, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -866,7 +866,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application @@ -1127,7 +1127,7 @@ bitlen interprets arrays as big-endian integers, unlike setbit/getbit ## b% - Bytecode: 0xaa -- Stack: ..., A: []byte, B: []byte → ..., []byte +- Stack: ..., A: bigint, B: bigint → ..., bigint - A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero. - **Cost**: 20 - Availability: v4 diff --git a/data/transactions/logic/TEAL_opcodes_v6.md b/data/transactions/logic/TEAL_opcodes_v6.md index 56d79cd07..bacca46d4 100644 --- a/data/transactions/logic/TEAL_opcodes_v6.md +++ b/data/transactions/logic/TEAL_opcodes_v6.md @@ -43,7 +43,7 @@ The 32 byte public key is the last element on the stack, preceded by the 64 byte - Syntax: `ecdsa_verify V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x05 {uint8} -- Stack: ..., A: [32]byte, B: []byte, C: []byte, D: []byte, E: []byte → ..., bool +- Stack: ..., A: [32]byte, B: [32]byte, C: [32]byte, D: [32]byte, E: [32]byte → ..., bool - for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1} - **Cost**: Secp256k1=1700 - Availability: v5 @@ -63,7 +63,7 @@ The 32 byte Y-component of a public key is the last element on the stack, preced - Syntax: `ecdsa_pk_decompress V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x06 {uint8} -- Stack: ..., A: []byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [33]byte → ..., X: [32]byte, Y: [32]byte - decompress pubkey A into components X, Y - **Cost**: Secp256k1=650 - Availability: v5 @@ -74,7 +74,7 @@ The 33 byte public key in a compressed form to be decompressed into X and Y (top - Syntax: `ecdsa_pk_recover V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x07 {uint8} -- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: [32]byte, Y: [32]byte - for (data A, recovery id B, signature C, D) recover a public key - **Cost**: 2000 - Availability: v5 @@ -174,7 +174,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -801,7 +801,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A, B: []byte → ..., any +- Stack: ..., A, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -811,7 +811,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -821,7 +821,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -831,7 +831,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -841,7 +841,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A, B: []byte, C → ... +- Stack: ..., A, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -851,7 +851,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -859,7 +859,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A, B: []byte → ... +- Stack: ..., A, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -871,7 +871,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application @@ -1078,7 +1078,7 @@ bitlen interprets arrays as big-endian integers, unlike setbit/getbit ## bsqrt - Bytecode: 0x96 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: bigint → ..., bigint - The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers - **Cost**: 40 - Availability: v6 @@ -1169,7 +1169,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## b% - Bytecode: 0xaa -- Stack: ..., A: []byte, B: []byte → ..., []byte +- Stack: ..., A: bigint, B: bigint → ..., bigint - A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero. - **Cost**: 20 - Availability: v4 diff --git a/data/transactions/logic/TEAL_opcodes_v7.md b/data/transactions/logic/TEAL_opcodes_v7.md index 3536f35f8..3a0c678b0 100644 --- a/data/transactions/logic/TEAL_opcodes_v7.md +++ b/data/transactions/logic/TEAL_opcodes_v7.md @@ -43,7 +43,7 @@ The 32 byte public key is the last element on the stack, preceded by the 64 byte - Syntax: `ecdsa_verify V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x05 {uint8} -- Stack: ..., A: [32]byte, B: []byte, C: []byte, D: []byte, E: []byte → ..., bool +- Stack: ..., A: [32]byte, B: [32]byte, C: [32]byte, D: [32]byte, E: [32]byte → ..., bool - for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1} - **Cost**: Secp256k1=1700; Secp256r1=2500 - Availability: v5 @@ -64,7 +64,7 @@ The 32 byte Y-component of a public key is the last element on the stack, preced - Syntax: `ecdsa_pk_decompress V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x06 {uint8} -- Stack: ..., A: []byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [33]byte → ..., X: [32]byte, Y: [32]byte - decompress pubkey A into components X, Y - **Cost**: Secp256k1=650; Secp256r1=2400 - Availability: v5 @@ -75,7 +75,7 @@ The 33 byte public key in a compressed form to be decompressed into X and Y (top - Syntax: `ecdsa_pk_recover V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x07 {uint8} -- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: [32]byte, Y: [32]byte - for (data A, recovery id B, signature C, D) recover a public key - **Cost**: 2000 - Availability: v5 @@ -175,7 +175,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -869,7 +869,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A, B: []byte → ..., any +- Stack: ..., A, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -879,7 +879,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -889,7 +889,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -899,7 +899,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -909,7 +909,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A, B: []byte, C → ... +- Stack: ..., A, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -919,7 +919,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -927,7 +927,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A, B: []byte → ... +- Stack: ..., A, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -939,7 +939,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application @@ -1154,7 +1154,7 @@ bitlen interprets arrays as big-endian integers, unlike setbit/getbit ## bsqrt - Bytecode: 0x96 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: bigint → ..., bigint - The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers - **Cost**: 40 - Availability: v6 @@ -1171,7 +1171,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## sha3_256 - Bytecode: 0x98 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: []byte → ..., [32]byte - SHA3_256 hash of value A, yields [32]byte - **Cost**: 130 - Availability: v7 @@ -1253,7 +1253,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## b% - Bytecode: 0xaa -- Stack: ..., A: []byte, B: []byte → ..., []byte +- Stack: ..., A: bigint, B: bigint → ..., bigint - A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero. - **Cost**: 20 - Availability: v4 @@ -1446,7 +1446,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with - Syntax: `vrf_verify S` where S: [vrf_verify](#field-group-vrf_verify) - Bytecode: 0xd0 {uint8} -- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: []byte, Y: bool +- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: [64]byte, Y: bool - Verify the proof B of message A against pubkey C. Returns vrf output and verification flag. - **Cost**: 5700 - Availability: v7 diff --git a/data/transactions/logic/TEAL_opcodes_v8.md b/data/transactions/logic/TEAL_opcodes_v8.md index b24a14508..f06e087e5 100644 --- a/data/transactions/logic/TEAL_opcodes_v8.md +++ b/data/transactions/logic/TEAL_opcodes_v8.md @@ -43,7 +43,7 @@ The 32 byte public key is the last element on the stack, preceded by the 64 byte - Syntax: `ecdsa_verify V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x05 {uint8} -- Stack: ..., A: [32]byte, B: []byte, C: []byte, D: []byte, E: []byte → ..., bool +- Stack: ..., A: [32]byte, B: [32]byte, C: [32]byte, D: [32]byte, E: [32]byte → ..., bool - for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1} - **Cost**: Secp256k1=1700; Secp256r1=2500 - Availability: v5 @@ -64,7 +64,7 @@ The 32 byte Y-component of a public key is the last element on the stack, preced - Syntax: `ecdsa_pk_decompress V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x06 {uint8} -- Stack: ..., A: []byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [33]byte → ..., X: [32]byte, Y: [32]byte - decompress pubkey A into components X, Y - **Cost**: Secp256k1=650; Secp256r1=2400 - Availability: v5 @@ -75,7 +75,7 @@ The 33 byte public key in a compressed form to be decompressed into X and Y (top - Syntax: `ecdsa_pk_recover V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x07 {uint8} -- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: [32]byte, Y: [32]byte - for (data A, recovery id B, signature C, D) recover a public key - **Cost**: 2000 - Availability: v5 @@ -175,7 +175,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -893,7 +893,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A, B: []byte → ..., any +- Stack: ..., A, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -903,7 +903,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -913,7 +913,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -923,7 +923,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -933,7 +933,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A, B: []byte, C → ... +- Stack: ..., A, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -943,7 +943,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -951,7 +951,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A, B: []byte → ... +- Stack: ..., A, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -963,7 +963,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application @@ -1251,7 +1251,7 @@ bitlen interprets arrays as big-endian integers, unlike setbit/getbit ## bsqrt - Bytecode: 0x96 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: bigint → ..., bigint - The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers - **Cost**: 40 - Availability: v6 @@ -1268,7 +1268,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## sha3_256 - Bytecode: 0x98 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: []byte → ..., [32]byte - SHA3_256 hash of value A, yields [32]byte - **Cost**: 130 - Availability: v7 @@ -1350,7 +1350,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## b% - Bytecode: 0xaa -- Stack: ..., A: []byte, B: []byte → ..., []byte +- Stack: ..., A: bigint, B: bigint → ..., bigint - A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero. - **Cost**: 20 - Availability: v4 @@ -1605,7 +1605,7 @@ For boxes that exceed 4,096 bytes, consider `box_create`, `box_extract`, and `bo - Syntax: `vrf_verify S` where S: [vrf_verify](#field-group-vrf_verify) - Bytecode: 0xd0 {uint8} -- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: []byte, Y: bool +- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: [64]byte, Y: bool - Verify the proof B of message A against pubkey C. Returns vrf output and verification flag. - **Cost**: 5700 - Availability: v7 diff --git a/data/transactions/logic/TEAL_opcodes_v9.md b/data/transactions/logic/TEAL_opcodes_v9.md index f64d98931..e14f4d7d7 100644 --- a/data/transactions/logic/TEAL_opcodes_v9.md +++ b/data/transactions/logic/TEAL_opcodes_v9.md @@ -43,7 +43,7 @@ The 32 byte public key is the last element on the stack, preceded by the 64 byte - Syntax: `ecdsa_verify V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x05 {uint8} -- Stack: ..., A: [32]byte, B: []byte, C: []byte, D: []byte, E: []byte → ..., bool +- Stack: ..., A: [32]byte, B: [32]byte, C: [32]byte, D: [32]byte, E: [32]byte → ..., bool - for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1} - **Cost**: Secp256k1=1700; Secp256r1=2500 - Availability: v5 @@ -64,7 +64,7 @@ The 32 byte Y-component of a public key is the last element on the stack, preced - Syntax: `ecdsa_pk_decompress V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x06 {uint8} -- Stack: ..., A: []byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [33]byte → ..., X: [32]byte, Y: [32]byte - decompress pubkey A into components X, Y - **Cost**: Secp256k1=650; Secp256r1=2400 - Availability: v5 @@ -75,7 +75,7 @@ The 33 byte public key in a compressed form to be decompressed into X and Y (top - Syntax: `ecdsa_pk_recover V` where V: [ECDSA](#field-group-ecdsa) - Bytecode: 0x07 {uint8} -- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: []byte, Y: []byte +- Stack: ..., A: [32]byte, B: uint64, C: [32]byte, D: [32]byte → ..., X: [32]byte, Y: [32]byte - for (data A, recovery id B, signature C, D) recover a public key - **Cost**: 2000 - Availability: v5 @@ -175,7 +175,7 @@ Overflow is an error condition which halts execution and fails the transaction. ## itob - Bytecode: 0x16 -- Stack: ..., A: uint64 → ..., []byte +- Stack: ..., A: uint64 → ..., [8]byte - converts uint64 A to big-endian byte array, always of length 8 ## btoi @@ -893,7 +893,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_local_get - Bytecode: 0x62 -- Stack: ..., A, B: []byte → ..., any +- Stack: ..., A, B: stateKey → ..., any - local state of the key B in the current application in account A - Availability: v2 - Mode: Application @@ -903,7 +903,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_get_ex - Bytecode: 0x63 -- Stack: ..., A, B: uint64, C: []byte → ..., X: any, Y: bool +- Stack: ..., A, B: uint64, C: stateKey → ..., X: any, Y: bool - X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -913,7 +913,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## app_global_get - Bytecode: 0x64 -- Stack: ..., A: []byte → ..., any +- Stack: ..., A: stateKey → ..., any - global state of the key A in the current application - Availability: v2 - Mode: Application @@ -923,7 +923,7 @@ params: state key. Return: value. The value is zero (of type uint64) if the key ## app_global_get_ex - Bytecode: 0x65 -- Stack: ..., A: uint64, B: []byte → ..., X: any, Y: bool +- Stack: ..., A: uint64, B: stateKey → ..., X: any, Y: bool - X is the global state of application A, key B. Y is 1 if key existed, else 0 - Availability: v2 - Mode: Application @@ -933,7 +933,7 @@ params: Txn.ForeignApps offset (or, since v4, an _available_ application id), st ## app_local_put - Bytecode: 0x66 -- Stack: ..., A, B: []byte, C → ... +- Stack: ..., A, B: stateKey, C → ... - write C to key B in account A's local state of the current application - Availability: v2 - Mode: Application @@ -943,7 +943,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_global_put - Bytecode: 0x67 -- Stack: ..., A: []byte, B → ... +- Stack: ..., A: stateKey, B → ... - write B to key A in the global state of the current application - Availability: v2 - Mode: Application @@ -951,7 +951,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), stat ## app_local_del - Bytecode: 0x68 -- Stack: ..., A, B: []byte → ... +- Stack: ..., A, B: stateKey → ... - delete key B from account A's local state of the current application - Availability: v2 - Mode: Application @@ -963,7 +963,7 @@ Deleting a key which is already absent has no effect on the application local st ## app_global_del - Bytecode: 0x69 -- Stack: ..., A: []byte → ... +- Stack: ..., A: stateKey → ... - delete key A from the global state of the current application - Availability: v2 - Mode: Application @@ -1251,7 +1251,7 @@ bitlen interprets arrays as big-endian integers, unlike setbit/getbit ## bsqrt - Bytecode: 0x96 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: bigint → ..., bigint - The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers - **Cost**: 40 - Availability: v6 @@ -1268,7 +1268,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## sha3_256 - Bytecode: 0x98 -- Stack: ..., A: []byte → ..., []byte +- Stack: ..., A: []byte → ..., [32]byte - SHA3_256 hash of value A, yields [32]byte - **Cost**: 130 - Availability: v7 @@ -1350,7 +1350,7 @@ The notation A,B indicates that A and B are interpreted as a uint128 value, with ## b% - Bytecode: 0xaa -- Stack: ..., A: []byte, B: []byte → ..., []byte +- Stack: ..., A: bigint, B: bigint → ..., bigint - A modulo B. A and B are interpreted as big-endian unsigned integers. Fail if B is zero. - **Cost**: 20 - Availability: v4 @@ -1605,7 +1605,7 @@ For boxes that exceed 4,096 bytes, consider `box_create`, `box_extract`, and `bo - Syntax: `vrf_verify S` where S: [vrf_verify](#field-group-vrf_verify) - Bytecode: 0xd0 {uint8} -- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: []byte, Y: bool +- Stack: ..., A: []byte, B: [80]byte, C: [32]byte → ..., X: [64]byte, Y: bool - Verify the proof B of message A against pubkey C. Returns vrf output and verification flag. - **Cost**: 5700 - Availability: v7 diff --git a/data/transactions/logic/crypto_test.go b/data/transactions/logic/crypto_test.go index bb6ef59c5..5aad23028 100644 --- a/data/transactions/logic/crypto_test.go +++ b/data/transactions/logic/crypto_test.go @@ -198,7 +198,7 @@ assert`, "int 1"}, {"falcon_verify", "", ` byte 0x62fdfc072182654f163f5f0f9a621d729566c74d0aa413bf009c9800418c19cd // msg // public key -byte 0xba00a5222fbaa5e2a1a61f708198a4dbc3de94b60d925042d9fa5a299ebb4be27156b1d86a174df4939342f11b776dffb8a0e874714f23318ca9acb823e9aeb14a926ed5cf76e736faa0b22e4bdedf7910decd19329f353b926ae4b404653dbc6db1885c010052b94675d4cc209ef2cf3cfe910c4ef51b6af16d8c7ab6651e57934ab19c89f771058f389ad80474740c529d59a3ea9ab9db228415fb9315dee23e8c7229398c4b0a2b7c5d6eff6e7d8cf1a776ae37f6272082796c0b2a0af637f7ce8fa7f1675dfbd1766543cbf3f19544d635298ea1fafe96ad1bb06fcc6ae9ff9c34acacb88653555c37f2ad6c4eb408478b0d2b6269841243f29b18fa8e0d5050f4f93878e53aac466dc4eb5a7194cb2213c26a2b8c7ccea06f89af26ae85315454da1b15952be639bb94fe3e99236291c4a1edfbe9faf8f32589bf47eb536b28e2cfbdea799d9cf4c88ef85ae45d451e1ab3431c247b796cbf12e63b737cc4894ad7a204f680a449cbbd2e86deca1069b3592977bd8ac7c5b5e1c1b436cde65177b6e82b2e666117a8e37b58122d1a31307ca112311e665b32c68bd42531b4e6bc79957d3d865f6470b8213db8175e5c7115f4ad520a4711b12d9004e661346c4da4cb3e95954ac58e075a320b862a6a317e0988d8fc376fb14562773b9d35d5a44ba951d866a3a06ac93a55e1a26fa91718db49a53e78d9e61d6120dfadd2b4929579ac56ccaac0f8e704826b55b4ca6d8020e42a6e62b5e41708e2e6848cd047385fa1df4f51733df35dbee25c96c4176eae332ca4df31c695fff8be31b4be62e63c3e049483c89384fb1d802e58db5514a59eb96e527b202d0cf45dc760fa0439afbc661868b9408e67254c8cf7c689c50d2f29bccd59c71ea7b6dd368de68669fdf889ac1f8cd390ea17894dd0538ff6e7c740bbf03b4fe32ad66c483c823548eea84f85826da44016bd8cdf2315b07a96a9737ebc7cb244547be3f759bdf50b467552c58333ed7e61cde799346bccc29d5d377d9d5364c369ffd88a83f90a699b3622184436b518e9196524ac9b55385b39ec099d9c18386e06b9dcad2499ddb9673cb87c652209ee60511c9249f1b7ab2b948b5e8b9115c218d5b793d65b96e2fc9e2c6c40ba63791bb89d7d96c33536ad7e6668a85e52ec7e1450a69f25766deeaeb41bcd249394b8ab65a286312db461c363cebe431c4dd5fd3b6bb5d26ae2c597799f400abb3ba160522e2e6da5ebd170a45c9ce80b135a5b330656aab26399bcacd857a7f237dfd2b14ecbfbcaabc7291ba78fe19ac2ecf005b66bb9771bf64f090269a2341967e79702733dc617b469ac12123faeb4c70d6fffac25f9fcd7dbd12ca363985b9bd845e939e6caf328e2bf8e53725bae94fbe30bfdbbc21e584ba72d7badbc2a0915c9faf9c69ad3703cf99a16399b38df157be8ec3a78f20d24b2131f9c25b3c1da70fc6c0c7aa9e9da3108368ca6211dcfa4988b1ace3c28b15b0559224570fbe3cde364734c7a66a0525c1d41e26788cd1c8a3888f344c9385804364f8430ca7d22338cc941917da3dc47a00aae13e3e972af49940c8fa179574694e369a3d5e67db6c91bf843151ca0fff512d9c322c690063ae9bd671815e9d03b3a841952ce04683509e415b8d5aebfcdbd6bd55efbffb2463cf2b96ccb8650a6cee732c8d4ce6409b9a747317866759553f1c5bcc392c98d14a034ccaaa6df5723bb88c38e80 +byte 0xba00a5222fbaa5e2a1a61f708198a4dbc3de94b60d925042d9fa5a299ebb4be27156b1d86a174df4939342f11b776dffb8a0e874714f23318ca9acb823e9aeb14a926ed5cf76e736faa0b22e4bdedf7910decd19329f353b926ae4b404653dbc6db1885c010052b94675d4cc209ef2cf3cfe910c4ef51b6af16d8c7ab6651e57934ab19c89f771058f389ad80474740c529d59a3ea9ab9db228415fb9315dee23e8c7229398c4b0a2b7c5d6eff6e7d8cf1a776ae37f6272082796c0b2a0af637f7ce8fa7f1675dfbd1766543cbf3f19544d635298ea1fafe96ad1bb06fcc6ae9ff9c34acacb88653555c37f2ad6c4eb408478b0d2b6269841243f29b18fa8e0d5050f4f93878e53aac466dc4eb5a7194cb2213c26a2b8c7ccea06f89af26ae85315454da1b15952be639bb94fe3e99236291c4a1edfbe9faf8f32589bf47eb536b28e2cfbdea799d9cf4c88ef85ae45d451e1ab3431c247b796cbf12e63b737cc4894ad7a204f680a449cbbd2e86deca1069b3592977bd8ac7c5b5e1c1b436cde65177b6e82b2e666117a8e37b58122d1a31307ca112311e665b32c68bd42531b4e6bc79957d3d865f6470b8213db8175e5c7115f4ad520a4711b12d9004e661346c4da4cb3e95954ac58e075a320b862a6a317e0988d8fc376fb14562773b9d35d5a44ba951d866a3a06ac93a55e1a26fa91718db49a53e78d9e61d6120dfadd2b4929579ac56ccaac0f8e704826b55b4ca6d8020e42a6e62b5e41708e2e6848cd047385fa1df4f51733df35dbee25c96c4176eae332ca4df31c695fff8be31b4be62e63c3e049483c89384fb1d802e58db5514a59eb96e527b202d0cf45dc760fa0439afbc661868b9408e67254c8cf7c689c50d2f29bccd59c71ea7b6dd368de68669fdf889ac1f8cd390ea17894dd0538ff6e7c740bbf03b4fe32ad66c483c823548eea84f85826da44016bd8cdf2315b07a96a9737ebc7cb244547be3f759bdf50b467552c58333ed7e61cde799346bccc29d5d377d9d5364c369ffd88a83f90a699b3622184436b518e9196524ac9b55385b39ec099d9c18386e06b9dcad2499ddb9673cb87c652209ee60511c9249f1b7ab2b948b5e8b9115c218d5b793d65b96e2fc9e2c6c40ba63791bb89d7d96c33536ad7e6668a85e52ec7e1450a69f25766deeaeb41bcd249394b8ab65a286312db461c363cebe431c4dd5fd3b6bb5d26ae2c597799f400abb3ba160522e2e6da5ebd170a45c9ce80b135a5b330656aab26399bcacd857a7f237dfd2b14ecbfbcaabc7291ba78fe19ac2ecf005b66bb9771bf64f090269a2341967e79702733dc617b469ac12123faeb4c70d6fffac25f9fcd7dbd12ca363985b9bd845e939e6caf328e2bf8e53725bae94fbe30bfdbbc21e584ba72d7badbc2a0915c9faf9c69ad3703cf99a16399b38df157be8ec3a78f20d24b2131f9c25b3c1da70fc6c0c7aa9e9da3108368ca6211dcfa4988b1ace3c28b15b0559224570fbe3cde364734c7a66a0525c1d41e26788cd1c8a3888f344c9385804364f8430ca7d22338cc941917da3dc47a00aae13e3e972af49940c8fa179574694e369a3d5e67db6c91bf843151ca0fff512d9c322c690063ae9bd671815e9d03b3a841952ce04683509e415b8d5aebfcdbd6bd55efbffb2463cf2b96ccb8650a6cee732c8d4ce6409b9a747317866759553f1c5bcc392c98d14a034ccaaa6df5723bb88c38e80 // sig byte 0x0a85ea3bb342a95a3941a4c2280c686729c76bc164092c0e203388460c556273e6f0a92640650c37e9d5b08fbd8d6bcca940acac9964e64a9e78bd28086b52898812264985e19c3d26318be2ec8852ca2ae2380746428cd08124cf792790d127d3dad09fe891cbadefef36269ae7d584b77ec428d794a6c3b7555956db00314d14a0aa14936830c8622623916639743b218243344224472240cfd158819190ede108394063c3df9c474eb16aa750e48663515d8229d3849670e30891142b632a6a282d915273a5f219d65ebe6b9e6c88170ac62c16a44895a950bfec82819221dab1358861bf0aa6b6342477016d50502a298840ddc42b3ade784b643c63c5e47993ada37dfdc0d56a1c7e4690b5a1d6485900b84f0b61425383b14d4b7ccc0abe8284a47a6f22050838b0482ad8ad389151c25e790ad670d5530f9b3dc518bb0a410f64346a74dc824238026daaa4ad97518d93670a48cf8f86ece593d23ab3a0d601d49a975db291f0d76263551e9f0b8a1b42396a27d9a122210330c692d5545d67c808b50560fc3d4933fa70c463513d7183e8aa091f34dd4426272620fe4b357deea710c687bb7a475d0ed0a40a26ae8f2a357e7a8fa5d5434050c1a36beaa7a90ee4db213a126db8151f2f4bbb4889d4e42bbd19f62dd7285def148071fb7f4f16b28c1d145d2e621fee275161a3d5b9319e7a59527c3d5c2838ef503e4166f2c22118b22bf80e8a1fc1bbbba00f231d2b1a8d3e592bdcc5fd40a2ecebb5ad27a51e7867715b54185a3e62951a5d808d80c31a59e6a3ca53a51eadc34c76dfd6aac22a6e805163b5e9ac8090869a9cd1e2972af7192bcd1da39c30f423ebc86d1976e8f52052262521d3b8ae7eb99d0ad623d811bac636f447e7dc9dcef6f52befd95861f1917116517b0e9b56a85967ab701ff8f1d4de443efce1b2a3d85b592df7a8c87814e8981575ef4e72757c5afa6bec4358e2f29966ad2830e4782f9a293351dfcaac1d0ca30ec1b5fd08a40a6e82938427a68641b96252a85443141c081982ba4d3c8ab05a1a545ea49c23ee07643ec5f013c2676db09cb834ef61817e615ad19c5829216026e5635dc13cad5ffb8bc267bf58d4ebbf100c3045e250c02c10772e96c580db049c80fdd3188e19ad893d16ac100052c557378416929319c9c262c21b768e6058a09b4e4800ae624c892117ec71504a283f558c623a212d048d5d401b00448b18ac25e1c99ab35d91f78badebcd651e86f3465ef99a0afa1721d2153e4a7b51d22b344a8dd102e7411abfe4bd5b8e2d62015edc08fc461fa90cfa666a9a42a0a86e11d6988913ba0259096cb846a1fd311c4cb693c4e3e1ed2ab57e2a5e0bd4616a79e22b28caa6d10dd09225e44bbdbfa1b7b23887055a90918220252777d5a620351cb013cc28346fc69d348165a39d03243a84a9c9bcd4d557a8e9607256baab893a0a5644520686be935e9ead84501f743a489a431cf10b8c27d3901c87b8771ce65e3130a7fe6ad62b709c23bbef1381b1ed49222f487db16af3c9d6779c01c986ea9f823be017fb8bce8e00f2b32840d54e8f656139a4c492257ee8743a8c5f51450c0366655e2b02d27619d07e556001430b04454891247813c8bc31bdee926d039a5038bfca8dc35e57789950442ad7ab3cfc031a8354bd9c462a37052d0b62066bcee0c292b890a71f4ea65895a7d837283404842c59f08414b20ec1b4fda6cc0c4d62216e8ead74ba90196168bc449a2050b442181ea57b915581bc387ed412e4cd5970fd0fb83c94fbbf960d05ffe6d0a26171c249809604a0b2b411e2d6622145c936e31258baf2b7d3c413a9a1d67bc4026d01b47a10b6c5b87f6a36ba1cedd681ca55b9c042bf9afcfcb636040793e08158dd877c49c16658f819129e26237427a1d80b941fbabb4abd4f1da0b6d428a59fbc450620eeb1651849e5972fb12e6dc8092a9fda70206a48d9dc2645641a147626350cf45b1a7d57724fcab0a594df7c023928a3c7a2fc3c9d33e9af10ae5ed282c475a611671d20d90752f2a28db48b7e5d9184212432fa948fbc885f866c93a0b7f510329aea4d53ecf9482f42974beaf289086afdb4797aa129d10639948f46a805ea4000cf1554505f4bd9d775d5894da115f5840913d5070c860b3a623eb261f5f928a31cbcec17c4274b5d1b28fdb231cc8f606c9dc324db5c12f97518fd03466541f7881762c25d711976c6d4f9271d29fa51dc263f650a32010343a51e7dab344e2f6d768864072ddb5df58486434998a280aad94886ea7a11132184e6274d4cd59a5deabf8a4dbbe29e9c234a52d3972608d0a3ea92a78e08531bb938384444246be5bc594ed4d06168e870924e8913f8242bd35f7c9d5ee238cb6db17496047acce0183f2d10a4cf2bbc8e39daf44e630393a0473b8983863b1998c17026ff35ec32a8058fd603ec369b80a94cb7b555cb469f6468de3909b21293b8d0a53a5c813d218d7c630f4d47bb1eb88253e6e1af721ba8a4453e falcon_verify @@ -431,7 +431,7 @@ byte 0x%s if test.pass { testAccepts(t, src, 5) } else { - testPanics(t, src, 5) + testPanics(t, notrack(src), 5) } }) } @@ -473,7 +473,10 @@ byte 0x%s } // coverage for pk length check - testPanics(t, `int 31; bzero; byte 0x; byte 0x; byte 0x; byte 0x; ecdsa_verify Secp256k1`, 5, "must be 32") + testPanics(t, notrack(`int 31; bzero; byte 0x; byte 0x; byte 0x; byte 0x; ecdsa_verify Secp256k1`), 5, "must be 32") + + // we did not implement arg length checks for x,y & r,s, so we must simply fail to verify, not panic + testAccepts(t, notrack(`int 32; bzero; byte 0x; byte 0x; byte 0x; byte 0x; ecdsa_verify Secp256k1; !`), 5) // ecdsa recover tests source = ` @@ -583,7 +586,7 @@ byte 0x%s if test.pass { testAccepts(t, src, fidoVersion) } else { - testPanics(t, src, fidoVersion) + testPanics(t, notrack(src), fidoVersion) } }) } @@ -685,11 +688,8 @@ func TestEcdsaCostVariation(t *testing.T) { // Doesn't matter if the actual verify returns true or false. Just confirm the cost depends on curve. source := ` -global ZeroAddress // need 32 bytes -byte "signature r" -byte "signature s" -byte "PK x" -byte "PK y" +global ZeroAddress // need 32 bytes for all 5 args +dup; dup; dup; dup; ecdsa_verify Secp256k1 ! assert @@ -700,11 +700,8 @@ int ` + fmt.Sprintf("%d", testLogicBudget-1700-8) + ` testAccepts(t, source, 6) // Secp256k1 was 5, but OpcodeBudget is 6 source = ` -global ZeroAddress // need 32 bytes -byte "signature r" -byte "signature s" -byte "PK x" -byte "PK y" +global ZeroAddress // need 32 bytes for all 5 args +dup; dup; dup; dup ecdsa_verify Secp256r1 ! assert diff --git a/data/transactions/logic/eval.go b/data/transactions/logic/eval.go index bd56b9b01..210d7a316 100644 --- a/data/transactions/logic/eval.go +++ b/data/transactions/logic/eval.go @@ -28,6 +28,7 @@ import ( "math/big" "math/bits" "runtime" + "strconv" "strings" "golang.org/x/exp/slices" @@ -798,7 +799,7 @@ var ( // AllStackTypes is a map of all the stack types we recognize // so that we can iterate over them in doc prep // and use them for opcode proto shorthand - AllStackTypes = map[rune]StackType{ + AllStackTypes = map[byte]StackType{ 'a': StackAny, 'b': StackBytes, 'i': StackUint64, @@ -806,9 +807,6 @@ var ( 'A': StackAddress, 'I': StackBigInt, 'T': StackBoolean, - '3': StackBytes32, - '6': StackBytes64, - '8': StackBytes80, 'M': StackMethodSelector, 'K': StackStateKey, 'N': StackBoxName, @@ -946,13 +944,31 @@ func parseStackTypes(spec string) StackTypes { if spec == "" { return nil } - types := make(StackTypes, len(spec)) - for i, letter := range spec { + types := make(StackTypes, 0, len(spec)) + for i := 0; i < len(spec); i++ { + letter := spec[i] + if letter == '{' { + if types[len(types)-1] != StackBytes { + panic("{ after non-bytes " + spec) + } + end := strings.IndexByte(spec[i:], '}') + if end == -1 { + panic("No } after b{ " + spec) + } + size, err := strconv.Atoi(spec[i+1 : i+end]) + if err != nil { + panic("b{} does not contain a number " + spec) + } + // replace the generic type with the constrained type + types[len(types)-1] = NewStackType(avmBytes, static(uint64(size)), fmt.Sprintf("[%d]byte", size)) + i += end + continue + } st, ok := AllStackTypes[letter] if !ok { panic(spec) } - types[i] = st + types = append(types, st) } return types } diff --git a/data/transactions/logic/evalStateful_test.go b/data/transactions/logic/evalStateful_test.go index 12d1b8c28..91ad91d1f 100644 --- a/data/transactions/logic/evalStateful_test.go +++ b/data/transactions/logic/evalStateful_test.go @@ -1991,12 +1991,12 @@ func TestAppLocalGlobalErrorCases(t *testing.T) { if ep.Proto.LogicSigVersion < directRefEnabledVersion { sender = "int 0;" } - testApp(t, fmt.Sprintf(`byte "%v"; int 1;`+g+`int 1`, strings.Repeat("v", ep.Proto.MaxAppKeyLen+1)), ep, "key too long") + testApp(t, notrack(fmt.Sprintf(`byte "%v"; int 1;`+g+`int 1`, strings.Repeat("v", ep.Proto.MaxAppKeyLen+1))), ep, "key too long") testApp(t, fmt.Sprintf(`byte "%v"; int 1;`+g+`int 1`, strings.Repeat("v", ep.Proto.MaxAppKeyLen)), ep) ledger.NewLocals(tx.Sender, 888) - testApp(t, fmt.Sprintf(sender+`byte "%v"; int 1;`+l+`int 1`, strings.Repeat("v", ep.Proto.MaxAppKeyLen+1)), ep, "key too long") + testApp(t, notrack(fmt.Sprintf(sender+`byte "%v"; int 1;`+l+`int 1`, strings.Repeat("v", ep.Proto.MaxAppKeyLen+1))), ep, "key too long") testApp(t, fmt.Sprintf(sender+`byte "%v"; int 1;`+l+`int 1`, strings.Repeat("v", ep.Proto.MaxAppKeyLen)), ep) @@ -3214,8 +3214,7 @@ func TestReturnTypes(t *testing.T) { "err": true, "return": true, - // these have unusual input size requirements not encoded in proto - "falcon_verify": true, + // panics unless the pk is proper "ecdsa_pk_decompress": true, "frame_dig": true, // would need a "proto" subroutine diff --git a/data/transactions/logic/eval_test.go b/data/transactions/logic/eval_test.go index b7c55faf8..3ede2c134 100644 --- a/data/transactions/logic/eval_test.go +++ b/data/transactions/logic/eval_test.go @@ -5098,8 +5098,8 @@ func TestBytesMath(t *testing.T) { testAccepts(t, "byte 0xffffff; bsqrt; len; int 2; ==; return", 6) // 64 byte long inputs are accepted, even if they produce longer outputs testAccepts(t, fmt.Sprintf("byte 0x%s; bsqrt; len; int 32; ==", effs), 6) - // 65 byte inputs are not ok. - testPanics(t, fmt.Sprintf("byte 0x%s00; bsqrt; pop; int 1", effs), 6) + // 65 byte inputs are not ok (no track allows assembly) + testPanics(t, notrack(fmt.Sprintf("byte 0x%s00; bsqrt; pop; int 1", effs)), 6) } func TestBytesCompare(t *testing.T) { diff --git a/data/transactions/logic/langspec_v1.json b/data/transactions/logic/langspec_v1.json index 6839e4092..5fd347507 100644 --- a/data/transactions/logic/langspec_v1.json +++ b/data/transactions/logic/langspec_v1.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -463,7 +436,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", diff --git a/data/transactions/logic/langspec_v10.json b/data/transactions/logic/langspec_v10.json index d971b2715..f59103f0f 100644 --- a/data/transactions/logic/langspec_v10.json +++ b/data/transactions/logic/langspec_v10.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -208,10 +181,10 @@ "Name": "ecdsa_verify", "Args": [ "[32]byte", - "[]byte", - "[]byte", - "[]byte", - "[]byte" + "[32]byte", + "[32]byte", + "[32]byte", + "[32]byte" ], "Returns": [ "bool" @@ -241,11 +214,11 @@ "Opcode": 6, "Name": "ecdsa_pk_decompress", "Args": [ - "[]byte" + "[33]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -278,8 +251,8 @@ "[32]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -562,7 +535,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -2594,7 +2567,7 @@ "Name": "app_local_get", "Args": [ "any", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2614,7 +2587,7 @@ "Args": [ "any", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2633,7 +2606,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2652,7 +2625,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2672,7 +2645,7 @@ "Name": "app_local_put", "Args": [ "any", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2688,7 +2661,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2704,7 +2677,7 @@ "Name": "app_local_del", "Args": [ "any", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2719,7 +2692,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -3292,10 +3265,10 @@ "Opcode": 150, "Name": "bsqrt", "Args": [ - "[]byte" + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "40", @@ -3332,7 +3305,7 @@ "[]byte" ], "Returns": [ - "[]byte" + "[32]byte" ], "Size": 1, "DocCost": "130", @@ -3526,11 +3499,11 @@ "Opcode": 170, "Name": "b%", "Args": [ - "[]byte", - "[]byte" + "bigint", + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "20", @@ -4590,7 +4563,7 @@ "[32]byte" ], "Returns": [ - "[]byte", + "[64]byte", "bool" ], "Size": 2, diff --git a/data/transactions/logic/langspec_v2.json b/data/transactions/logic/langspec_v2.json index a832f8664..24f9ad97f 100644 --- a/data/transactions/logic/langspec_v2.json +++ b/data/transactions/logic/langspec_v2.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -463,7 +436,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -1533,7 +1506,7 @@ "Name": "app_local_get", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -1553,7 +1526,7 @@ "Args": [ "uint64", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -1572,7 +1545,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -1591,7 +1564,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -1611,7 +1584,7 @@ "Name": "app_local_put", "Args": [ "uint64", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -1627,7 +1600,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -1643,7 +1616,7 @@ "Name": "app_local_del", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -1658,7 +1631,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", diff --git a/data/transactions/logic/langspec_v3.json b/data/transactions/logic/langspec_v3.json index f1566b528..085084359 100644 --- a/data/transactions/logic/langspec_v3.json +++ b/data/transactions/logic/langspec_v3.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -463,7 +436,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -1910,7 +1883,7 @@ "Name": "app_local_get", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -1930,7 +1903,7 @@ "Args": [ "uint64", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -1949,7 +1922,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -1968,7 +1941,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -1988,7 +1961,7 @@ "Name": "app_local_put", "Args": [ "uint64", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2004,7 +1977,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2020,7 +1993,7 @@ "Name": "app_local_del", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2035,7 +2008,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", diff --git a/data/transactions/logic/langspec_v4.json b/data/transactions/logic/langspec_v4.json index 49591c10f..ddbf65187 100644 --- a/data/transactions/logic/langspec_v4.json +++ b/data/transactions/logic/langspec_v4.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -463,7 +436,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -2032,7 +2005,7 @@ "Name": "app_local_get", "Args": [ "any", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2052,7 +2025,7 @@ "Args": [ "any", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2071,7 +2044,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2090,7 +2063,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2110,7 +2083,7 @@ "Name": "app_local_put", "Args": [ "any", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2126,7 +2099,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2142,7 +2115,7 @@ "Name": "app_local_del", "Args": [ "any", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2157,7 +2130,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2642,11 +2615,11 @@ "Opcode": 170, "Name": "b%", "Args": [ - "[]byte", - "[]byte" + "bigint", + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "20", diff --git a/data/transactions/logic/langspec_v5.json b/data/transactions/logic/langspec_v5.json index ccde5509f..2cca3941d 100644 --- a/data/transactions/logic/langspec_v5.json +++ b/data/transactions/logic/langspec_v5.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -208,10 +181,10 @@ "Name": "ecdsa_verify", "Args": [ "[32]byte", - "[]byte", - "[]byte", - "[]byte", - "[]byte" + "[32]byte", + "[32]byte", + "[32]byte", + "[32]byte" ], "Returns": [ "bool" @@ -240,11 +213,11 @@ "Opcode": 6, "Name": "ecdsa_pk_decompress", "Args": [ - "[]byte" + "[33]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -276,8 +249,8 @@ "[32]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -559,7 +532,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -2350,7 +2323,7 @@ "Name": "app_local_get", "Args": [ "any", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2370,7 +2343,7 @@ "Args": [ "any", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2389,7 +2362,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2408,7 +2381,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2428,7 +2401,7 @@ "Name": "app_local_put", "Args": [ "any", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2444,7 +2417,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2460,7 +2433,7 @@ "Name": "app_local_del", "Args": [ "any", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2475,7 +2448,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -3011,11 +2984,11 @@ "Opcode": 170, "Name": "b%", "Args": [ - "[]byte", - "[]byte" + "bigint", + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "20", diff --git a/data/transactions/logic/langspec_v6.json b/data/transactions/logic/langspec_v6.json index 72e1d9c64..6795706db 100644 --- a/data/transactions/logic/langspec_v6.json +++ b/data/transactions/logic/langspec_v6.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -208,10 +181,10 @@ "Name": "ecdsa_verify", "Args": [ "[32]byte", - "[]byte", - "[]byte", - "[]byte", - "[]byte" + "[32]byte", + "[32]byte", + "[32]byte", + "[32]byte" ], "Returns": [ "bool" @@ -240,11 +213,11 @@ "Opcode": 6, "Name": "ecdsa_pk_decompress", "Args": [ - "[]byte" + "[33]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -276,8 +249,8 @@ "[32]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -559,7 +532,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -2368,7 +2341,7 @@ "Name": "app_local_get", "Args": [ "any", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2388,7 +2361,7 @@ "Args": [ "any", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2407,7 +2380,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2426,7 +2399,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2446,7 +2419,7 @@ "Name": "app_local_put", "Args": [ "any", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2462,7 +2435,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2478,7 +2451,7 @@ "Name": "app_local_del", "Args": [ "any", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2493,7 +2466,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2885,10 +2858,10 @@ "Opcode": 150, "Name": "bsqrt", "Args": [ - "[]byte" + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "40", @@ -3102,11 +3075,11 @@ "Opcode": 170, "Name": "b%", "Args": [ - "[]byte", - "[]byte" + "bigint", + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "20", diff --git a/data/transactions/logic/langspec_v7.json b/data/transactions/logic/langspec_v7.json index 7229ee534..a7b4df95b 100644 --- a/data/transactions/logic/langspec_v7.json +++ b/data/transactions/logic/langspec_v7.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -208,10 +181,10 @@ "Name": "ecdsa_verify", "Args": [ "[32]byte", - "[]byte", - "[]byte", - "[]byte", - "[]byte" + "[32]byte", + "[32]byte", + "[32]byte", + "[32]byte" ], "Returns": [ "bool" @@ -241,11 +214,11 @@ "Opcode": 6, "Name": "ecdsa_pk_decompress", "Args": [ - "[]byte" + "[33]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -278,8 +251,8 @@ "[32]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -562,7 +535,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -2528,7 +2501,7 @@ "Name": "app_local_get", "Args": [ "any", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2548,7 +2521,7 @@ "Args": [ "any", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2567,7 +2540,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2586,7 +2559,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2606,7 +2579,7 @@ "Name": "app_local_put", "Args": [ "any", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2622,7 +2595,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2638,7 +2611,7 @@ "Name": "app_local_del", "Args": [ "any", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2653,7 +2626,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -3064,10 +3037,10 @@ "Opcode": 150, "Name": "bsqrt", "Args": [ - "[]byte" + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "40", @@ -3104,7 +3077,7 @@ "[]byte" ], "Returns": [ - "[]byte" + "[32]byte" ], "Size": 1, "DocCost": "130", @@ -3298,11 +3271,11 @@ "Opcode": 170, "Name": "b%", "Args": [ - "[]byte", - "[]byte" + "bigint", + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "20", @@ -4238,7 +4211,7 @@ "[32]byte" ], "Returns": [ - "[]byte", + "[64]byte", "bool" ], "Size": 2, diff --git a/data/transactions/logic/langspec_v8.json b/data/transactions/logic/langspec_v8.json index 2f1576864..186f9cdfe 100644 --- a/data/transactions/logic/langspec_v8.json +++ b/data/transactions/logic/langspec_v8.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -208,10 +181,10 @@ "Name": "ecdsa_verify", "Args": [ "[32]byte", - "[]byte", - "[]byte", - "[]byte", - "[]byte" + "[32]byte", + "[32]byte", + "[32]byte", + "[32]byte" ], "Returns": [ "bool" @@ -241,11 +214,11 @@ "Opcode": 6, "Name": "ecdsa_pk_decompress", "Args": [ - "[]byte" + "[33]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -278,8 +251,8 @@ "[32]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -562,7 +535,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -2588,7 +2561,7 @@ "Name": "app_local_get", "Args": [ "any", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2608,7 +2581,7 @@ "Args": [ "any", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2627,7 +2600,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2646,7 +2619,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2666,7 +2639,7 @@ "Name": "app_local_put", "Args": [ "any", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2682,7 +2655,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2698,7 +2671,7 @@ "Name": "app_local_del", "Args": [ "any", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2713,7 +2686,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -3286,10 +3259,10 @@ "Opcode": 150, "Name": "bsqrt", "Args": [ - "[]byte" + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "40", @@ -3326,7 +3299,7 @@ "[]byte" ], "Returns": [ - "[]byte" + "[32]byte" ], "Size": 1, "DocCost": "130", @@ -3520,11 +3493,11 @@ "Opcode": 170, "Name": "b%", "Args": [ - "[]byte", - "[]byte" + "bigint", + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "20", @@ -4584,7 +4557,7 @@ "[32]byte" ], "Returns": [ - "[]byte", + "[64]byte", "bool" ], "Size": 2, diff --git a/data/transactions/logic/langspec_v9.json b/data/transactions/logic/langspec_v9.json index 3ec2d39af..cab0aa6d9 100644 --- a/data/transactions/logic/langspec_v9.json +++ b/data/transactions/logic/langspec_v9.json @@ -3,33 +3,6 @@ "LogicSigVersion": 10, "NamedTypes": [ { - "Name": "[32]byte", - "Abbreviation": "3", - "Bound": [ - 32, - 32 - ], - "AVMType": "[]byte" - }, - { - "Name": "[64]byte", - "Abbreviation": "6", - "Bound": [ - 64, - 64 - ], - "AVMType": "[]byte" - }, - { - "Name": "[80]byte", - "Abbreviation": "8", - "Bound": [ - 80, - 80 - ], - "AVMType": "[]byte" - }, - { "Name": "[]byte", "Abbreviation": "b", "Bound": [ @@ -208,10 +181,10 @@ "Name": "ecdsa_verify", "Args": [ "[32]byte", - "[]byte", - "[]byte", - "[]byte", - "[]byte" + "[32]byte", + "[32]byte", + "[32]byte", + "[32]byte" ], "Returns": [ "bool" @@ -241,11 +214,11 @@ "Opcode": 6, "Name": "ecdsa_pk_decompress", "Args": [ - "[]byte" + "[33]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -278,8 +251,8 @@ "[32]byte" ], "Returns": [ - "[]byte", - "[]byte" + "[32]byte", + "[32]byte" ], "Size": 2, "ArgEnum": [ @@ -562,7 +535,7 @@ "uint64" ], "Returns": [ - "[]byte" + "[8]byte" ], "Size": 1, "DocCost": "1", @@ -2588,7 +2561,7 @@ "Name": "app_local_get", "Args": [ "any", - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2608,7 +2581,7 @@ "Args": [ "any", "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2627,7 +2600,7 @@ "Opcode": 100, "Name": "app_global_get", "Args": [ - "[]byte" + "stateKey" ], "Returns": [ "any" @@ -2646,7 +2619,7 @@ "Name": "app_global_get_ex", "Args": [ "uint64", - "[]byte" + "stateKey" ], "Returns": [ "any", @@ -2666,7 +2639,7 @@ "Name": "app_local_put", "Args": [ "any", - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2682,7 +2655,7 @@ "Opcode": 103, "Name": "app_global_put", "Args": [ - "[]byte", + "stateKey", "any" ], "Size": 1, @@ -2698,7 +2671,7 @@ "Name": "app_local_del", "Args": [ "any", - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -2713,7 +2686,7 @@ "Opcode": 105, "Name": "app_global_del", "Args": [ - "[]byte" + "stateKey" ], "Size": 1, "DocCost": "1", @@ -3286,10 +3259,10 @@ "Opcode": 150, "Name": "bsqrt", "Args": [ - "[]byte" + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "40", @@ -3326,7 +3299,7 @@ "[]byte" ], "Returns": [ - "[]byte" + "[32]byte" ], "Size": 1, "DocCost": "130", @@ -3520,11 +3493,11 @@ "Opcode": 170, "Name": "b%", "Args": [ - "[]byte", - "[]byte" + "bigint", + "bigint" ], "Returns": [ - "[]byte" + "bigint" ], "Size": 1, "DocCost": "20", @@ -4584,7 +4557,7 @@ "[32]byte" ], "Returns": [ - "[]byte", + "[64]byte", "bool" ], "Size": 2, diff --git a/data/transactions/logic/opcodes.go b/data/transactions/logic/opcodes.go index 18af2af1b..b8ecd76ca 100644 --- a/data/transactions/logic/opcodes.go +++ b/data/transactions/logic/opcodes.go @@ -488,34 +488,34 @@ func (spec *OpSpec) deadens() bool { // assembly-time, with ops.returns() var OpSpecs = []OpSpec{ {0x00, "err", opErr, proto(":x"), 1, detDefault()}, - {0x01, "sha256", opSHA256, proto("b:3"), 1, costly(7)}, - {0x02, "keccak256", opKeccak256, proto("b:3"), 1, costly(26)}, - {0x03, "sha512_256", opSHA512_256, proto("b:3"), 1, costly(9)}, + {0x01, "sha256", opSHA256, proto("b:b{32}"), 1, costly(7)}, + {0x02, "keccak256", opKeccak256, proto("b:b{32}"), 1, costly(26)}, + {0x03, "sha512_256", opSHA512_256, proto("b:b{32}"), 1, costly(9)}, // Cost of these opcodes increases in AVM version 2 based on measured // performance. Should be able to run max hashes during stateful TEAL // and achieve reasonable TPS. Same opcode for different versions // is OK. - {0x01, "sha256", opSHA256, proto("b:3"), 2, costly(35)}, - {0x02, "keccak256", opKeccak256, proto("b:3"), 2, costly(130)}, - {0x03, "sha512_256", opSHA512_256, proto("b:3"), 2, costly(45)}, + {0x01, "sha256", opSHA256, proto("b:b{32}"), 2, costly(35)}, + {0x02, "keccak256", opKeccak256, proto("b:b{32}"), 2, costly(130)}, + {0x03, "sha512_256", opSHA512_256, proto("b:b{32}"), 2, costly(45)}, /* Tabling these changes until we offer unlimited global storage as there is currently a useful pattern that requires hashes on long slices to creating logicsigs in apps. - {0x01, "sha256", opSHA256, proto("b:b"), ?, costByLength(...)}, - {0x02, "keccak256", opKeccak256, proto("b:b"), ?, costByLength(...)}, - {0x03, "sha512_256", opSHA512_256, proto("b:b"), ?, costByLength(...)}, + {0x01, "sha256", opSHA256, proto("b:b{32}"), ?, costByLength(...)}, + {0x02, "keccak256", opKeccak256, proto("b:b{32}"), ?, costByLength(...)}, + {0x03, "sha512_256", opSHA512_256, proto("b:b{32}"), ?, costByLength(...)}, */ - {0x04, "ed25519verify", opEd25519Verify, proto("b63:T"), 1, costly(1900).only(ModeSig)}, - {0x04, "ed25519verify", opEd25519Verify, proto("b63:T"), 5, costly(1900)}, + {0x04, "ed25519verify", opEd25519Verify, proto("bb{64}b{32}:T"), 1, costly(1900).only(ModeSig)}, + {0x04, "ed25519verify", opEd25519Verify, proto("bb{64}b{32}:T"), 5, costly(1900)}, - {0x05, "ecdsa_verify", opEcdsaVerify, proto("3bbbb:T"), 5, costByField("v", &EcdsaCurves, ecdsaVerifyCosts)}, - {0x06, "ecdsa_pk_decompress", opEcdsaPkDecompress, proto("b:bb"), 5, costByField("v", &EcdsaCurves, ecdsaDecompressCosts)}, - {0x07, "ecdsa_pk_recover", opEcdsaPkRecover, proto("3i33:bb"), 5, field("v", &EcdsaCurves).costs(2000)}, + {0x05, "ecdsa_verify", opEcdsaVerify, proto("b{32}b{32}b{32}b{32}b{32}:T"), 5, costByField("v", &EcdsaCurves, ecdsaVerifyCosts)}, + {0x06, "ecdsa_pk_decompress", opEcdsaPkDecompress, proto("b{33}:b{32}b{32}"), 5, costByField("v", &EcdsaCurves, ecdsaDecompressCosts)}, + {0x07, "ecdsa_pk_recover", opEcdsaPkRecover, proto("b{32}ib{32}b{32}:b{32}b{32}"), 5, field("v", &EcdsaCurves).costs(2000)}, {0x08, "+", opPlus, proto("ii:i"), 1, detDefault()}, {0x09, "-", opMinus, proto("ii:i"), 1, detDefault()}, @@ -531,7 +531,7 @@ var OpSpecs = []OpSpec{ {0x13, "!=", opNeq, proto("aa:T"), 1, typed(typeEquals)}, {0x14, "!", opNot, proto("i:i"), 1, detDefault()}, {0x15, "len", opLen, proto("b:i"), 1, detDefault()}, - {0x16, "itob", opItob, proto("i:b"), 1, detDefault()}, + {0x16, "itob", opItob, proto("i:b{8}"), 1, detDefault()}, {0x17, "btoi", opBtoi, proto("b:i"), 1, detDefault()}, {0x18, "%", opModulo, proto("ii:i"), 1, detDefault()}, {0x19, "|", opBitOr, proto("ii:i"), 1, detDefault()}, @@ -621,18 +621,18 @@ var OpSpecs = []OpSpec{ {0x60, "balance", opBalance, proto("a:i"), directRefEnabledVersion, only(ModeApp)}, {0x61, "app_opted_in", opAppOptedIn, proto("ii:T"), 2, only(ModeApp)}, {0x61, "app_opted_in", opAppOptedIn, proto("ai:T"), directRefEnabledVersion, only(ModeApp)}, - {0x62, "app_local_get", opAppLocalGet, proto("ib:a").appStateExplain(opAppLocalGetStateChange), 2, only(ModeApp)}, - {0x62, "app_local_get", opAppLocalGet, proto("ab:a").appStateExplain(opAppLocalGetStateChange), directRefEnabledVersion, only(ModeApp)}, - {0x63, "app_local_get_ex", opAppLocalGetEx, proto("iib:aT").appStateExplain(opAppLocalGetExStateChange), 2, only(ModeApp)}, - {0x63, "app_local_get_ex", opAppLocalGetEx, proto("aib:aT").appStateExplain(opAppLocalGetExStateChange), directRefEnabledVersion, only(ModeApp)}, - {0x64, "app_global_get", opAppGlobalGet, proto("b:a").appStateExplain(opAppGlobalGetStateChange), 2, only(ModeApp)}, - {0x65, "app_global_get_ex", opAppGlobalGetEx, proto("ib:aT").appStateExplain(opAppGlobalGetExStateChange), 2, only(ModeApp)}, - {0x66, "app_local_put", opAppLocalPut, proto("iba:").appStateExplain(opAppLocalPutStateChange), 2, only(ModeApp)}, - {0x66, "app_local_put", opAppLocalPut, proto("aba:").appStateExplain(opAppLocalPutStateChange), directRefEnabledVersion, only(ModeApp)}, - {0x67, "app_global_put", opAppGlobalPut, proto("ba:").appStateExplain(opAppGlobalPutStateChange), 2, only(ModeApp)}, - {0x68, "app_local_del", opAppLocalDel, proto("ib:").appStateExplain(opAppLocalDelStateChange), 2, only(ModeApp)}, - {0x68, "app_local_del", opAppLocalDel, proto("ab:").appStateExplain(opAppLocalDelStateChange), directRefEnabledVersion, only(ModeApp)}, - {0x69, "app_global_del", opAppGlobalDel, proto("b:").appStateExplain(opAppGlobalDelStateChange), 2, only(ModeApp)}, + {0x62, "app_local_get", opAppLocalGet, proto("iK:a").appStateExplain(opAppLocalGetStateChange), 2, only(ModeApp)}, + {0x62, "app_local_get", opAppLocalGet, proto("aK:a").appStateExplain(opAppLocalGetStateChange), directRefEnabledVersion, only(ModeApp)}, + {0x63, "app_local_get_ex", opAppLocalGetEx, proto("iiK:aT").appStateExplain(opAppLocalGetExStateChange), 2, only(ModeApp)}, + {0x63, "app_local_get_ex", opAppLocalGetEx, proto("aiK:aT").appStateExplain(opAppLocalGetExStateChange), directRefEnabledVersion, only(ModeApp)}, + {0x64, "app_global_get", opAppGlobalGet, proto("K:a").appStateExplain(opAppGlobalGetStateChange), 2, only(ModeApp)}, + {0x65, "app_global_get_ex", opAppGlobalGetEx, proto("iK:aT").appStateExplain(opAppGlobalGetExStateChange), 2, only(ModeApp)}, + {0x66, "app_local_put", opAppLocalPut, proto("iKa:").appStateExplain(opAppLocalPutStateChange), 2, only(ModeApp)}, + {0x66, "app_local_put", opAppLocalPut, proto("aKa:").appStateExplain(opAppLocalPutStateChange), directRefEnabledVersion, only(ModeApp)}, + {0x67, "app_global_put", opAppGlobalPut, proto("Ka:").appStateExplain(opAppGlobalPutStateChange), 2, only(ModeApp)}, + {0x68, "app_local_del", opAppLocalDel, proto("iK:").appStateExplain(opAppLocalDelStateChange), 2, only(ModeApp)}, + {0x68, "app_local_del", opAppLocalDel, proto("aK:").appStateExplain(opAppLocalDelStateChange), directRefEnabledVersion, only(ModeApp)}, + {0x69, "app_global_del", opAppGlobalDel, proto("K:").appStateExplain(opAppGlobalDelStateChange), 2, only(ModeApp)}, {0x70, "asset_holding_get", opAssetHoldingGet, proto("ii:aT"), 2, field("f", &AssetHoldingFields).only(ModeApp)}, {0x70, "asset_holding_get", opAssetHoldingGet, proto("ai:aT"), directRefEnabledVersion, field("f", &AssetHoldingFields).only(ModeApp)}, {0x71, "asset_params_get", opAssetParamsGet, proto("i:aT"), 2, field("f", &AssetParamsFields).only(ModeApp)}, @@ -648,9 +648,9 @@ var OpSpecs = []OpSpec{ {0x82, "pushbytess", opPushBytess, proto(":", "", "[N items]").stackExplain(opPushBytessStackChange), 8, constants(asmPushBytess, checkByteImmArgs, "bytes ...", immBytess).typed(typePushBytess).trust()}, {0x83, "pushints", opPushInts, proto(":", "", "[N items]").stackExplain(opPushIntsStackChange), 8, constants(asmPushInts, checkIntImmArgs, "uint ...", immInts).typed(typePushInts).trust()}, - {0x84, "ed25519verify_bare", opEd25519VerifyBare, proto("b63:T"), 7, costly(1900)}, - {0x85, "falcon_verify", opFalconVerify, proto("bbb:T"), spOpcodesVersion, costly(1700)}, // dynamic for internal hash? - {0x86, "sumhash512", opSumhash512, proto("b:6"), spOpcodesVersion, costByLength(150, 7, 4, 0)}, + {0x84, "ed25519verify_bare", opEd25519VerifyBare, proto("bb{64}b{32}:T"), 7, costly(1900)}, + {0x85, "falcon_verify", opFalconVerify, proto("bb{1232}b{1793}:T"), spOpcodesVersion, costly(1700)}, // dynamic for internal hash? + {0x86, "sumhash512", opSumhash512, proto("b:b{64}"), spOpcodesVersion, costByLength(150, 7, 4, 0)}, // "Function oriented" {0x88, "callsub", opCallSub, proto(":"), 4, detBranch()}, @@ -669,11 +669,11 @@ var OpSpecs = []OpSpec{ {0x93, "bitlen", opBitLen, proto("a:i"), 4, detDefault()}, {0x94, "exp", opExp, proto("ii:i"), 4, detDefault()}, {0x95, "expw", opExpw, proto("ii:ii"), 4, costly(10)}, - {0x96, "bsqrt", opBytesSqrt, proto("b:b"), 6, costly(40)}, + {0x96, "bsqrt", opBytesSqrt, proto("I:I"), 6, costly(40)}, {0x97, "divw", opDivw, proto("iii:i"), 6, detDefault()}, - {0x98, "sha3_256", opSHA3_256, proto("b:b"), 7, costly(130)}, + {0x98, "sha3_256", opSHA3_256, proto("b:b{32}"), 7, costly(130)}, /* Will end up following keccak256 - - {0x98, "sha3_256", opSHA3_256, proto("b:b"), ?, costByLength(...)},}, + {0x98, "sha3_256", opSHA3_256, proto("b:b{32}"), ?, costByLength(...)},}, */ // Byteslice math. @@ -687,7 +687,7 @@ var OpSpecs = []OpSpec{ {0xa7, "b>=", opBytesGe, proto("II:T"), 4, detDefault()}, {0xa8, "b==", opBytesEq, proto("II:T"), 4, detDefault()}, {0xa9, "b!=", opBytesNeq, proto("II:T"), 4, detDefault()}, - {0xaa, "b%", opBytesModulo, proto("bb:b"), 4, costly(20)}, + {0xaa, "b%", opBytesModulo, proto("II:I"), 4, costly(20)}, {0xab, "b|", opBytesBitOr, proto("bb:b"), 4, costly(6)}, {0xac, "b&", opBytesBitAnd, proto("bb:b"), 4, costly(6)}, {0xad, "b^", opBytesBitXor, proto("bb:b"), 4, costly(6)}, @@ -724,7 +724,7 @@ var OpSpecs = []OpSpec{ {0xc6, "gitxnas", opGitxnas, proto("i:a"), 6, immediates("t", "f").field("f", &TxnArrayFields).only(ModeApp)}, // randomness support - {0xd0, "vrf_verify", opVrfVerify, proto("b83:bT"), randomnessVersion, field("s", &VrfStandards).costs(5700)}, + {0xd0, "vrf_verify", opVrfVerify, proto("bb{80}b{32}:b{64}T"), randomnessVersion, field("s", &VrfStandards).costs(5700)}, {0xd1, "block", opBlock, proto("i:a"), randomnessVersion, field("f", &BlockFields)}, {0xd2, "box_splice", opBoxSplice, proto("Niib:").appStateExplain(opBoxSpliceStateChange), spliceVersion, only(ModeApp)}, {0xd3, "box_resize", opBoxResize, proto("Ni:").appStateExplain(opBoxResizeStateChange), spliceVersion, only(ModeApp)}, |