diff options
Diffstat (limited to 'data/transactions/logic/TEAL_opcodes_v4.md')
-rw-r--r-- | data/transactions/logic/TEAL_opcodes_v4.md | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/data/transactions/logic/TEAL_opcodes_v4.md b/data/transactions/logic/TEAL_opcodes_v4.md index 3da0bcba0..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 @@ -199,7 +199,7 @@ The notation J,K indicates that two uint64 values J and K are interpreted as a u ## intcblock -- Syntax: `intcblock UINT ...` ∋ UINT ...: a block of int constant values +- Syntax: `intcblock UINT ...` where UINT ...: a block of int constant values - Bytecode: 0x20 {varuint count, [varuint ...]} - Stack: ... → ... - prepare block of uint64 constants for use by intc @@ -208,7 +208,7 @@ The notation J,K indicates that two uint64 values J and K are interpreted as a u ## intc -- Syntax: `intc I` ∋ I: an index in the intcblock +- Syntax: `intc I` where I: an index in the intcblock - Bytecode: 0x21 {uint8} - Stack: ... → ..., uint64 - Ith constant from intcblock @@ -239,7 +239,7 @@ The notation J,K indicates that two uint64 values J and K are interpreted as a u ## bytecblock -- Syntax: `bytecblock BYTES ...` ∋ BYTES ...: a block of byte constant values +- Syntax: `bytecblock BYTES ...` where BYTES ...: a block of byte constant values - Bytecode: 0x26 {varuint count, [varuint length, bytes ...]} - Stack: ... → ... - prepare block of byte-array constants for use by bytec @@ -248,7 +248,7 @@ The notation J,K indicates that two uint64 values J and K are interpreted as a u ## bytec -- Syntax: `bytec I` ∋ I: an index in the bytecblock +- Syntax: `bytec I` where I: an index in the bytecblock - Bytecode: 0x27 {uint8} - Stack: ... → ..., []byte - Ith constant from bytecblock @@ -279,7 +279,7 @@ The notation J,K indicates that two uint64 values J and K are interpreted as a u ## arg -- Syntax: `arg N` ∋ N: an arg index +- Syntax: `arg N` where N: an arg index - Bytecode: 0x2c {uint8} - Stack: ... → ..., []byte - Nth LogicSig argument @@ -315,7 +315,7 @@ The notation J,K indicates that two uint64 values J and K are interpreted as a u ## txn -- Syntax: `txn F` ∋ F: [txn](#field-group-txn) +- Syntax: `txn F` where F: [txn](#field-group-txn) - Bytecode: 0x31 {uint8} - Stack: ... → ..., any - field F of current transaction @@ -382,7 +382,7 @@ Fields (see [transaction reference](https://developer.algorand.org/docs/referenc ## global -- Syntax: `global F` ∋ F: [global](#field-group-global) +- Syntax: `global F` where F: [global](#field-group-global) - Bytecode: 0x32 {uint8} - Stack: ... → ..., any - global field F @@ -407,7 +407,7 @@ Fields ## gtxn -- Syntax: `gtxn T F` ∋ T: transaction group index, F: [txn](#field-group-txn) +- Syntax: `gtxn T F` where T: transaction group index, F: [txn](#field-group-txn) - Bytecode: 0x33 {uint8}, {uint8} - Stack: ... → ..., any - field F of the Tth transaction in the current group @@ -416,21 +416,21 @@ for notes on transaction fields available, see `txn`. If this transaction is _i_ ## load -- Syntax: `load I` ∋ I: position in scratch space to load from +- Syntax: `load I` where I: position in scratch space to load from - Bytecode: 0x34 {uint8} - Stack: ... → ..., any - Ith scratch space value. All scratch spaces are 0 at program start. ## store -- Syntax: `store I` ∋ I: position in scratch space to store to +- Syntax: `store I` where I: position in scratch space to store to - Bytecode: 0x35 {uint8} - Stack: ..., A → ... - store A to the Ith scratch space ## txna -- Syntax: `txna F I` ∋ F: [txna](#field-group-txna), I: transaction field array index +- Syntax: `txna F I` where F: [txna](#field-group-txna), I: transaction field array index - Bytecode: 0x36 {uint8}, {uint8} - Stack: ... → ..., any - Ith value of the array field F of the current transaction<br />`txna` can be called using `txn` with 2 immediates. @@ -450,7 +450,7 @@ Fields (see [transaction reference](https://developer.algorand.org/docs/referenc ## gtxna -- Syntax: `gtxna T F I` ∋ T: transaction group index, F: [txna](#field-group-txna), I: transaction field array index +- Syntax: `gtxna T F I` where T: transaction group index, F: [txna](#field-group-txna), I: transaction field array index - Bytecode: 0x37 {uint8}, {uint8}, {uint8} - Stack: ... → ..., any - Ith value of the array field F from the Tth transaction in the current group<br />`gtxna` can be called using `gtxn` with 3 immediates. @@ -458,7 +458,7 @@ Fields (see [transaction reference](https://developer.algorand.org/docs/referenc ## gtxns -- Syntax: `gtxns F` ∋ F: [txn](#field-group-txn) +- Syntax: `gtxns F` where F: [txn](#field-group-txn) - Bytecode: 0x38 {uint8} - Stack: ..., A: uint64 → ..., any - field F of the Ath transaction in the current group @@ -468,7 +468,7 @@ for notes on transaction fields available, see `txn`. If top of stack is _i_, `g ## gtxnsa -- Syntax: `gtxnsa F I` ∋ F: [txna](#field-group-txna), I: transaction field array index +- Syntax: `gtxnsa F I` where F: [txna](#field-group-txna), I: transaction field array index - Bytecode: 0x39 {uint8}, {uint8} - Stack: ..., A: uint64 → ..., any - Ith value of the array field F from the Ath transaction in the current group<br />`gtxnsa` can be called using `gtxns` with 2 immediates. @@ -476,7 +476,7 @@ for notes on transaction fields available, see `txn`. If top of stack is _i_, `g ## gload -- Syntax: `gload T I` ∋ T: transaction group index, I: position in scratch space to load from +- Syntax: `gload T I` where T: transaction group index, I: position in scratch space to load from - Bytecode: 0x3a {uint8}, {uint8} - Stack: ... → ..., any - Ith scratch space value of the Tth transaction in the current group @@ -487,7 +487,7 @@ for notes on transaction fields available, see `txn`. If top of stack is _i_, `g ## gloads -- Syntax: `gloads I` ∋ I: position in scratch space to load from +- Syntax: `gloads I` where I: position in scratch space to load from - Bytecode: 0x3b {uint8} - Stack: ..., A: uint64 → ..., any - Ith scratch space value of the Ath transaction in the current group @@ -498,7 +498,7 @@ for notes on transaction fields available, see `txn`. If top of stack is _i_, `g ## gaid -- Syntax: `gaid T` ∋ T: transaction group index +- Syntax: `gaid T` where T: transaction group index - Bytecode: 0x3c {uint8} - Stack: ... → ..., uint64 - ID of the asset or application created in the Tth transaction of the current group @@ -519,7 +519,7 @@ for notes on transaction fields available, see `txn`. If top of stack is _i_, `g ## bnz -- Syntax: `bnz TARGET` ∋ TARGET: branch offset +- Syntax: `bnz TARGET` where TARGET: branch offset - Bytecode: 0x40 {int16 (big-endian)} - Stack: ..., A: uint64 → ... - branch to TARGET if value A is not zero @@ -530,7 +530,7 @@ At v2 it became allowed to branch to the end of the program exactly after the la ## bz -- Syntax: `bz TARGET` ∋ TARGET: branch offset +- Syntax: `bz TARGET` where TARGET: branch offset - Bytecode: 0x41 {int16 (big-endian)} - Stack: ..., A: uint64 → ... - branch to TARGET if value A is zero @@ -540,7 +540,7 @@ See `bnz` for details on how branches work. `bz` inverts the behavior of `bnz`. ## b -- Syntax: `b TARGET` ∋ TARGET: branch offset +- Syntax: `b TARGET` where TARGET: branch offset - Bytecode: 0x42 {int16 (big-endian)} - Stack: ... → ... - branch unconditionally to TARGET @@ -583,7 +583,7 @@ See `bnz` for details on how branches work. `b` always jumps to the offset. ## dig -- Syntax: `dig N` ∋ N: depth +- Syntax: `dig N` where N: depth - Bytecode: 0x4b {uint8} - Stack: ..., A, [N items] → ..., A, [N items], A - Nth value from the top of the stack. dig 0 is equivalent to dup @@ -614,7 +614,7 @@ See `bnz` for details on how branches work. `b` always jumps to the offset. ## substring -- Syntax: `substring S E` ∋ S: start position, E: end position +- Syntax: `substring S E` where S: start position, E: end position - Bytecode: 0x51 {uint8}, {uint8} - Stack: ..., A: []byte → ..., []byte - A range of bytes from A starting at S up to but not including E. If E < S, or either is larger than the array length, the program fails @@ -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 @@ -763,7 +763,7 @@ Deleting a key which is already absent has no effect on the application global s ## asset_holding_get -- Syntax: `asset_holding_get F` ∋ F: [asset_holding](#field-group-asset_holding) +- Syntax: `asset_holding_get F` where F: [asset_holding](#field-group-asset_holding) - Bytecode: 0x70 {uint8} - Stack: ..., A, B: uint64 → ..., X: any, Y: bool - X is field F from account A's holding of asset B. Y is 1 if A is opted into B, else 0 @@ -784,7 +784,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ address), asset id (or ## asset_params_get -- Syntax: `asset_params_get F` ∋ F: [asset_params](#field-group-asset_params) +- Syntax: `asset_params_get F` where F: [asset_params](#field-group-asset_params) - Bytecode: 0x71 {uint8} - Stack: ..., A: uint64 → ..., X: any, Y: bool - X is field F from asset A. Y is 1 if A exists, else 0 @@ -824,7 +824,7 @@ params: Txn.Accounts offset (or, since v4, an _available_ account address), _ava ## pushbytes -- Syntax: `pushbytes BYTES` ∋ BYTES: a byte constant +- Syntax: `pushbytes BYTES` where BYTES: a byte constant - Bytecode: 0x80 {varuint length, bytes} - Stack: ... → ..., []byte - immediate BYTES @@ -834,7 +834,7 @@ pushbytes args are not added to the bytecblock during assembly processes ## pushint -- Syntax: `pushint UINT` ∋ UINT: an int constant +- Syntax: `pushint UINT` where UINT: an int constant - Bytecode: 0x81 {varuint} - Stack: ... → ..., uint64 - immediate UINT @@ -844,7 +844,7 @@ pushint args are not added to the intcblock during assembly processes ## callsub -- Syntax: `callsub TARGET` ∋ TARGET: branch offset +- Syntax: `callsub TARGET` where TARGET: branch offset - Bytecode: 0x88 {int16 (big-endian)} - Stack: ... → ... - branch unconditionally to TARGET, saving the next instruction on the call stack @@ -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 |