summaryrefslogtreecommitdiff
path: root/data/transactions/logic/doc.go
diff options
context:
space:
mode:
Diffstat (limited to 'data/transactions/logic/doc.go')
-rw-r--r--data/transactions/logic/doc.go536
1 files changed, 306 insertions, 230 deletions
diff --git a/data/transactions/logic/doc.go b/data/transactions/logic/doc.go
index cb1c323f3..0e4a64664 100644
--- a/data/transactions/logic/doc.go
+++ b/data/transactions/logic/doc.go
@@ -24,98 +24,115 @@ import (
// short description of every op
var opDocByName = map[string]string{
- "err": "Error. Panic immediately. This is primarily a fencepost against accidental zero bytes getting compiled into programs.",
- "sha256": "SHA256 hash of value X, yields [32]byte",
- "keccak256": "Keccak256 hash of value X, yields [32]byte",
- "sha512_256": "SHA512_256 hash of value X, yields [32]byte",
- "ed25519verify": "for (data A, signature B, pubkey C) verify the signature of (\"ProgData\" || program_hash || data) against the pubkey => {0 or 1}",
- "+": "A plus B. Panic on overflow.",
- "-": "A minus B. Panic if B > A.",
- "/": "A divided by B (truncated division). Panic if B == 0.",
- "*": "A times B. Panic on overflow.",
- "<": "A less than B => {0 or 1}",
- ">": "A greater than B => {0 or 1}",
- "<=": "A less than or equal to B => {0 or 1}",
- ">=": "A greater than or equal to B => {0 or 1}",
- "&&": "A is not zero and B is not zero => {0 or 1}",
- "||": "A is not zero or B is not zero => {0 or 1}",
- "==": "A is equal to B => {0 or 1}",
- "!=": "A is not equal to B => {0 or 1}",
- "!": "X == 0 yields 1; else 0",
- "len": "yields length of byte value X",
- "itob": "converts uint64 X to big endian bytes",
- "btoi": "converts bytes X as big endian to uint64",
- "%": "A modulo B. Panic if B == 0.",
- "|": "A bitwise-or B",
- "&": "A bitwise-and B",
- "^": "A bitwise-xor B",
- "~": "bitwise invert value X",
- "shl": "A times 2^B, modulo 2^64",
- "shr": "A divided by 2^B",
- "sqrt": "The largest integer B such that B^2 <= X",
- "bitlen": "The highest set bit in X. If X is a byte-array, it is interpreted as a big-endian unsigned integer. bitlen of 0 is 0, bitlen of 8 is 4",
- "exp": "A raised to the Bth power. Panic if A == B == 0 and on overflow",
- "expw": "A raised to the Bth power as a 128-bit long result as low (top) and high uint64 values on the stack. Panic if A == B == 0 or if the results exceeds 2^128-1",
- "mulw": "A times B out to 128-bit long result as low (top) and high uint64 values on the stack",
- "addw": "A plus B out to 128-bit long result as sum (top) and carry-bit uint64 values on the stack",
- "divmodw": "Pop four uint64 values. The deepest two are interpreted as a uint128 dividend (deepest value is high word), the top two are interpreted as a uint128 divisor. Four uint64 values are pushed to the stack. The deepest two are the quotient (deeper value is the high uint64). The top two are the remainder, low bits on top.",
- "intcblock": "prepare block of uint64 constants for use by intc",
- "intc": "push Ith constant from intcblock to stack",
- "intc_0": "push constant 0 from intcblock to stack",
- "intc_1": "push constant 1 from intcblock to stack",
- "intc_2": "push constant 2 from intcblock to stack",
- "intc_3": "push constant 3 from intcblock to stack",
- "pushint": "push immediate UINT to the stack as an integer",
- "bytecblock": "prepare block of byte-array constants for use by bytec",
- "bytec": "push Ith constant from bytecblock to stack",
- "bytec_0": "push constant 0 from bytecblock to stack",
- "bytec_1": "push constant 1 from bytecblock to stack",
- "bytec_2": "push constant 2 from bytecblock to stack",
- "bytec_3": "push constant 3 from bytecblock to stack",
- "pushbytes": "push the following program bytes to the stack",
- "bzero": "push a byte-array of length X, containing all zero bytes",
- "arg": "push Nth LogicSig argument to stack",
- "arg_0": "push LogicSig argument 0 to stack",
- "arg_1": "push LogicSig argument 1 to stack",
- "arg_2": "push LogicSig argument 2 to stack",
- "arg_3": "push LogicSig argument 3 to stack",
- "txn": "push field F of current transaction to stack",
- "gtxn": "push field F of the Tth transaction in the current group",
- "gtxns": "push field F of the Xth transaction in the current group",
- "txna": "push Ith value of the array field F of the current transaction",
- "gtxna": "push Ith value of the array field F from the Tth transaction in the current group",
- "gtxnsa": "push Ith value of the array field F from the Xth transaction in the current group",
- "global": "push value from globals to stack",
- "load": "copy a value from scratch space to the stack",
- "store": "pop a value from the stack and store to scratch space",
- "gload": "push Ith scratch space index of the Tth transaction in the current group",
- "gloads": "push Ith scratch space index of the Xth transaction in the current group",
- "gaid": "push the ID of the asset or application created in the Tth transaction of the current group",
- "gaids": "push the ID of the asset or application created in the Xth transaction of the current group",
- "bnz": "branch to TARGET if value X is not zero",
- "bz": "branch to TARGET if value X is zero",
- "b": "branch unconditionally to TARGET",
- "return": "use last value on stack as success value; end",
- "pop": "discard value X from stack",
- "dup": "duplicate last value on stack",
- "dup2": "duplicate two last values on stack: A, B -> A, B, A, B",
- "dig": "push the Nth value from the top of the stack. dig 0 is equivalent to dup",
- "cover": "remove top of stack, and place it down the stack such that N elements are above it",
- "uncover": "remove the value at depth N in the stack and shift above items down so the Nth deep value is on top of the stack",
- "swap": "swaps two last values on stack: A, B -> B, A",
- "select": "selects one of two values based on top-of-stack: A, B, C -> (if C != 0 then B else A)",
- "concat": "pop two byte-arrays A and B and join them, push the result",
- "substring": "pop a byte-array A. For immediate values in 0..255 S and E: extract a range of bytes from A starting at S up to but not including E, push the substring result. If E < S, or either is larger than the array length, the program fails",
- "substring3": "pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including C, push the substring result. If C < B, or either is larger than the array length, the program fails",
- "getbit": "pop a target A (integer or byte-array), and index B. Push the Bth bit of A.",
- "setbit": "pop a target A, index B, and bit C. Set the Bth bit of A to C, and push the result",
- "getbyte": "pop a byte-array A and integer B. Extract the Bth byte of A and push it as an integer",
- "setbyte": "pop a byte-array A, integer B, and small integer C (between 0..255). Set the Bth byte of A to C, and push the result",
- "extract": "pop a byte-array A. For immediate values in 0..255 S and L: extract a range of bytes from A starting at S up to but not including S+L, push the substring result. If L is 0, then extract to the end of the string. If S or S+L is larger than the array length, the program fails",
- "extract3": "pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including B+C, push the substring result. If B or B+C is larger than the array length, the program fails",
- "extract16bits": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+2, convert bytes as big endian and push the uint64 result. If B or B+2 is larger than the array length, the program fails",
- "extract32bits": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+4, convert bytes as big endian and push the uint64 result. If B or B+4 is larger than the array length, the program fails",
- "extract64bits": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+8, convert bytes as big endian and push the uint64 result. If B or B+8 is larger than the array length, the program fails",
+ "err": "Error. Fail immediately. This is primarily a fencepost against accidental zero bytes getting compiled into programs.",
+ "sha256": "SHA256 hash of value X, yields [32]byte",
+ "keccak256": "Keccak256 hash of value X, yields [32]byte",
+ "sha512_256": "SHA512_256 hash of value X, yields [32]byte",
+ "ed25519verify": "for (data A, signature B, pubkey C) verify the signature of (\"ProgData\" || program_hash || data) against the pubkey => {0 or 1}",
+ "ecdsa_verify": "for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1}",
+ "ecdsa_pk_decompress": "decompress pubkey A into components X, Y => [*... stack*, X, Y]",
+ "ecdsa_pk_recover": "for (data A, recovery id B, signature C, D) recover a public key => [*... stack*, X, Y]",
+
+ "+": "A plus B. Fail on overflow.",
+ "-": "A minus B. Fail if B > A.",
+ "/": "A divided by B (truncated division). Fail if B == 0.",
+ "*": "A times B. Fail on overflow.",
+ "<": "A less than B => {0 or 1}",
+ ">": "A greater than B => {0 or 1}",
+ "<=": "A less than or equal to B => {0 or 1}",
+ ">=": "A greater than or equal to B => {0 or 1}",
+ "&&": "A is not zero and B is not zero => {0 or 1}",
+ "||": "A is not zero or B is not zero => {0 or 1}",
+ "==": "A is equal to B => {0 or 1}",
+ "!=": "A is not equal to B => {0 or 1}",
+ "!": "X == 0 yields 1; else 0",
+ "len": "yields length of byte value X",
+ "itob": "converts uint64 X to big endian bytes",
+ "btoi": "converts bytes X as big endian to uint64",
+ "%": "A modulo B. Fail if B == 0.",
+ "|": "A bitwise-or B",
+ "&": "A bitwise-and B",
+ "^": "A bitwise-xor B",
+ "~": "bitwise invert value X",
+ "shl": "A times 2^B, modulo 2^64",
+ "shr": "A divided by 2^B",
+ "sqrt": "The largest integer B such that B^2 <= X",
+ "bitlen": "The highest set bit in X. If X is a byte-array, it is interpreted as a big-endian unsigned integer. bitlen of 0 is 0, bitlen of 8 is 4",
+ "exp": "A raised to the Bth power. Fail if A == B == 0 and on overflow",
+ "expw": "A raised to the Bth power as a 128-bit long result as low (top) and high uint64 values on the stack. Fail if A == B == 0 or if the results exceeds 2^128-1",
+ "mulw": "A times B out to 128-bit long result as low (top) and high uint64 values on the stack",
+ "addw": "A plus B out to 128-bit long result as sum (top) and carry-bit uint64 values on the stack",
+ "divmodw": "Pop four uint64 values. The deepest two are interpreted as a uint128 dividend (deepest value is high word), the top two are interpreted as a uint128 divisor. Four uint64 values are pushed to the stack. The deepest two are the quotient (deeper value is the high uint64). The top two are the remainder, low bits on top.",
+
+ "intcblock": "prepare block of uint64 constants for use by intc",
+ "intc": "push Ith constant from intcblock to stack",
+ "intc_0": "push constant 0 from intcblock to stack",
+ "intc_1": "push constant 1 from intcblock to stack",
+ "intc_2": "push constant 2 from intcblock to stack",
+ "intc_3": "push constant 3 from intcblock to stack",
+ "pushint": "push immediate UINT to the stack as an integer",
+ "bytecblock": "prepare block of byte-array constants for use by bytec",
+ "bytec": "push Ith constant from bytecblock to stack",
+ "bytec_0": "push constant 0 from bytecblock to stack",
+ "bytec_1": "push constant 1 from bytecblock to stack",
+ "bytec_2": "push constant 2 from bytecblock to stack",
+ "bytec_3": "push constant 3 from bytecblock to stack",
+ "pushbytes": "push the following program bytes to the stack",
+
+ "bzero": "push a byte-array of length X, containing all zero bytes",
+ "arg": "push Nth LogicSig argument to stack",
+ "arg_0": "push LogicSig argument 0 to stack",
+ "arg_1": "push LogicSig argument 1 to stack",
+ "arg_2": "push LogicSig argument 2 to stack",
+ "arg_3": "push LogicSig argument 3 to stack",
+ "args": "push Xth LogicSig argument to stack",
+ "txn": "push field F of current transaction to stack",
+ "gtxn": "push field F of the Tth transaction in the current group",
+ "gtxns": "push field F of the Xth transaction in the current group",
+ "txna": "push Ith value of the array field F of the current transaction",
+ "gtxna": "push Ith value of the array field F from the Tth transaction in the current group",
+ "gtxnsa": "push Ith value of the array field F from the Xth transaction in the current group",
+ "txnas": "push Xth value of the array field F of the current transaction",
+ "gtxnas": "push Xth value of the array field F from the Tth transaction in the current group",
+ "gtxnsas": "pop an index A and an index B. push Bth value of the array field F from the Ath transaction in the current group",
+ "itxn": "push field F of the last inner transaction to stack",
+ "itxna": "push Ith value of the array field F of the last inner transaction to stack",
+
+ "global": "push value from globals to stack",
+ "load": "copy a value from scratch space to the stack. All scratch spaces are 0 at program start.",
+ "store": "pop value X. store X to the Ith scratch space",
+ "loads": "copy a value from the Xth scratch space to the stack. All scratch spaces are 0 at program start.",
+ "stores": "pop indexes A and B. store B to the Ath scratch space",
+ "gload": "push Ith scratch space index of the Tth transaction in the current group",
+ "gloads": "push Ith scratch space index of the Xth transaction in the current group",
+ "gaid": "push the ID of the asset or application created in the Tth transaction of the current group",
+ "gaids": "push the ID of the asset or application created in the Xth transaction of the current group",
+
+ "bnz": "branch to TARGET if value X is not zero",
+ "bz": "branch to TARGET if value X is zero",
+ "b": "branch unconditionally to TARGET",
+ "return": "use last value on stack as success value; end",
+ "pop": "discard value X from stack",
+ "dup": "duplicate last value on stack",
+ "dup2": "duplicate two last values on stack: A, B -> A, B, A, B",
+ "dig": "push the Nth value from the top of the stack. dig 0 is equivalent to dup",
+ "cover": "remove top of stack, and place it deeper in the stack such that N elements are above it. Fails if stack depth <= N.",
+ "uncover": "remove the value at depth N in the stack and shift above items down so the Nth deep value is on top of the stack. Fails if stack depth <= N.",
+ "swap": "swaps two last values on stack: A, B -> B, A",
+ "select": "selects one of two values based on top-of-stack: A, B, C -> (if C != 0 then B else A)",
+
+ "concat": "pop two byte-arrays A and B and join them, push the result",
+ "substring": "pop a byte-array A. For immediate values in 0..255 S and E: extract a range of bytes from A starting at S up to but not including E, push the substring result. If E < S, or either is larger than the array length, the program fails",
+ "substring3": "pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including C, push the substring result. If C < B, or either is larger than the array length, the program fails",
+ "getbit": "pop a target A (integer or byte-array), and index B. Push the Bth bit of A.",
+ "setbit": "pop a target A, index B, and bit C. Set the Bth bit of A to C, and push the result",
+ "getbyte": "pop a byte-array A and integer B. Extract the Bth byte of A and push it as an integer",
+ "setbyte": "pop a byte-array A, integer B, and small integer C (between 0..255). Set the Bth byte of A to C, and push the result",
+ "extract": "pop a byte-array A. For immediate values in 0..255 S and L: extract a range of bytes from A starting at S up to but not including S+L, push the substring result. If L is 0, then extract to the end of the string. If S or S+L is larger than the array length, the program fails",
+ "extract3": "pop a byte-array A and two integers B and C. Extract a range of bytes from A starting at B up to but not including B+C, push the substring result. If B+C is larger than the array length, the program fails",
+ "extract_uint16": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+2, convert bytes as big endian and push the uint64 result. If B+2 is larger than the array length, the program fails",
+ "extract_uint32": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+4, convert bytes as big endian and push the uint64 result. If B+4 is larger than the array length, the program fails",
+ "extract_uint64": "pop a byte-array A and integer B. Extract a range of bytes from A starting at B up to but not including B+8, convert bytes as big endian and push the uint64 result. If B+8 is larger than the array length, the program fails",
"balance": "get balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted.",
"min_balance": "get minimum required balance for account A, in microalgos. Required balance is affected by [ASA](https://developer.algorand.org/docs/features/asa/#assets-overview) and [App](https://developer.algorand.org/docs/features/asc1/stateful/#minimum-balance-requirement-for-a-smart-contract) usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes.",
@@ -136,8 +153,8 @@ var opDocByName = map[string]string{
"retsub": "pop the top instruction from the call stack and branch to it",
"b+": "A plus B, where A and B are byte-arrays interpreted as big-endian unsigned integers",
- "b-": "A minus B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Panic on underflow.",
- "b/": "A divided by B (truncated division), where A and B are byte-arrays interpreted as big-endian unsigned integers. Panic if B is zero.",
+ "b-": "A minus B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail on underflow.",
+ "b/": "A divided by B (truncated division), where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail if B is zero.",
"b*": "A times B, where A and B are byte-arrays interpreted as big-endian unsigned integers.",
"b<": "A is less than B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}",
"b>": "A is greater than B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}",
@@ -145,13 +162,16 @@ var opDocByName = map[string]string{
"b>=": "A is greater than or equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}",
"b==": "A is equals to B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}",
"b!=": "A is not equal to B, where A and B are byte-arrays interpreted as big-endian unsigned integers => { 0 or 1}",
- "b%": "A modulo B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Panic if B is zero.",
+ "b%": "A modulo B, where A and B are byte-arrays interpreted as big-endian unsigned integers. Fail if B is zero.",
"b|": "A bitwise-or B, where A and B are byte-arrays, zero-left extended to the greater of their lengths",
"b&": "A bitwise-and B, where A and B are byte-arrays, zero-left extended to the greater of their lengths",
"b^": "A bitwise-xor B, where A and B are byte-arrays, zero-left extended to the greater of their lengths",
"b~": "X with all bits inverted",
- "log": "write bytes to log state of the current application",
+ "log": "write bytes to log state of the current application",
+ "itxn_begin": "Begin preparation of a new inner transaction",
+ "itxn_field": "Set field F of the current inner transaction to X",
+ "itxn_submit": "Execute the current inner transaction. Fail if 16 inner transactions have already been executed, or if the transaction itself fails.",
}
// OpDoc returns a description of the op
@@ -160,37 +180,54 @@ func OpDoc(opName string) string {
}
var opcodeImmediateNotes = map[string]string{
- "intcblock": "{varuint length} [{varuint value}, ...]",
- "intc": "{uint8 int constant index}",
- "pushint": "{varuint int}",
- "bytecblock": "{varuint length} [({varuint value length} bytes), ...]",
- "bytec": "{uint8 byte constant index}",
- "pushbytes": "{varuint length} {bytes}",
- "arg": "{uint8 arg index N}",
- "txn": "{uint8 transaction field index}",
- "gtxn": "{uint8 transaction group index} {uint8 transaction field index}",
- "gtxns": "{uint8 transaction field index}",
- "txna": "{uint8 transaction field index} {uint8 transaction field array index}",
- "gtxna": "{uint8 transaction group index} {uint8 transaction field index} {uint8 transaction field array index}",
- "gtxnsa": "{uint8 transaction field index} {uint8 transaction field array index}",
- "global": "{uint8 global field index}",
- "bnz": "{int16 branch offset, big endian}",
- "bz": "{int16 branch offset, big endian}",
- "b": "{int16 branch offset, big endian}",
- "callsub": "{int16 branch offset, big endian}",
- "load": "{uint8 position in scratch space to load from}",
- "store": "{uint8 position in scratch space to store to}",
- "gload": "{uint8 transaction group index} {uint8 position in scratch space to load from}",
- "gloads": "{uint8 position in scratch space to load from}",
- "gaid": "{uint8 transaction group index}",
- "substring": "{uint8 start position} {uint8 end position}",
- "extract": "{uint8 start position} {uint8 length}",
- "dig": "{uint8 depth}",
- "cover": "{uint8 depth}",
- "uncover": "{uint8 depth}",
+ "intcblock": "{varuint length} [{varuint value}, ...]",
+ "intc": "{uint8 int constant index}",
+ "pushint": "{varuint int}",
+ "bytecblock": "{varuint length} [({varuint value length} bytes), ...]",
+ "bytec": "{uint8 byte constant index}",
+ "pushbytes": "{varuint length} {bytes}",
+
+ "arg": "{uint8 arg index N}",
+ "global": "{uint8 global field index}",
+
+ "txn": "{uint8 transaction field index}",
+ "gtxn": "{uint8 transaction group index} {uint8 transaction field index}",
+ "gtxns": "{uint8 transaction field index}",
+ "txna": "{uint8 transaction field index} {uint8 transaction field array index}",
+ "gtxna": "{uint8 transaction group index} {uint8 transaction field index} {uint8 transaction field array index}",
+ "gtxnsa": "{uint8 transaction field index} {uint8 transaction field array index}",
+ "txnas": "{uint8 transaction field index}",
+ "gtxnas": "{uint8 transaction group index} {uint8 transaction field index}",
+ "gtxnsas": "{uint8 transaction field index}",
+
+ "bnz": "{int16 branch offset, big endian}",
+ "bz": "{int16 branch offset, big endian}",
+ "b": "{int16 branch offset, big endian}",
+ "callsub": "{int16 branch offset, big endian}",
+
+ "load": "{uint8 position in scratch space to load from}",
+ "store": "{uint8 position in scratch space to store to}",
+ "gload": "{uint8 transaction group index} {uint8 position in scratch space to load from}",
+ "gloads": "{uint8 position in scratch space to load from}",
+ "gaid": "{uint8 transaction group index}",
+
+ "substring": "{uint8 start position} {uint8 end position}",
+ "extract": "{uint8 start position} {uint8 length}",
+ "dig": "{uint8 depth}",
+ "cover": "{uint8 depth}",
+ "uncover": "{uint8 depth}",
+
"asset_holding_get": "{uint8 asset holding field index}",
"asset_params_get": "{uint8 asset params field index}",
"app_params_get": "{uint8 app params field index}",
+
+ "itxn_field": "{uint8 transaction field index}",
+ "itxn": "{uint8 transaction field index}",
+ "itxna": "{uint8 transaction field index} {uint8 transaction field array index}",
+
+ "ecdsa_verify": "{uint8 curve index}",
+ "ecdsa_pk_decompress": "{uint8 curve index}",
+ "ecdsa_pk_recover": "{uint8 curve index}",
}
// OpImmediateNote returns a short string about immediate data which follows the op byte
@@ -200,45 +237,50 @@ func OpImmediateNote(opName string) string {
// further documentation on the function of the opcode
var opDocExtras = map[string]string{
- "ed25519verify": "The 32 byte public key is the last element on the stack, preceded by the 64 byte signature at the second-to-last element on the stack, preceded by the data which was signed at the third-to-last element on the stack.",
- "bnz": "The `bnz` instruction opcode 0x40 is followed by two immediate data bytes which are a high byte first and low byte second which together form a 16 bit offset which the instruction may branch to. For a bnz instruction at `pc`, if the last element of the stack is not zero then branch to instruction at `pc + 3 + N`, else proceed to next instruction at `pc + 3`. Branch targets must be aligned instructions. (e.g. Branching to the second byte of a 2 byte op will be rejected.) Starting at v4, the offset is treated as a signed 16 bit integer allowing for backward branches and looping. In prior version (v1 to v3), branch offsets are limited to forward branches only, 0-0x7fff.\n\nAt v2 it became allowed to branch to the end of the program exactly after the last instruction: bnz to byte N (with 0-indexing) was illegal for a TEAL program with N bytes before v2, and is legal after it. This change eliminates the need for a last instruction of no-op as a branch target at the end. (Branching beyond the end--in other words, to a byte larger than N--is still illegal and will cause the program to fail.)",
- "bz": "See `bnz` for details on how branches work. `bz` inverts the behavior of `bnz`.",
- "b": "See `bnz` for details on how branches work. `b` always jumps to the offset.",
- "callsub": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.",
- "retsub": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.",
- "intcblock": "`intcblock` loads following program bytes into an array of integer constants in the evaluator. These integer constants can be referred to by `intc` and `intc_*` which will push the value onto the stack. Subsequent calls to `intcblock` reset and replace the integer constants available to the script.",
- "bytecblock": "`bytecblock` loads the following program bytes into an array of byte-array constants in the evaluator. These constants can be referred to by `bytec` and `bytec_*` which will push the value onto the stack. Subsequent calls to `bytecblock` reset and replace the bytes constants available to the script.",
- "*": "Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `mulw`.",
- "+": "Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `addw`.",
- "/": "`divmodw` is available to divide the two-element values produced by `mulw` and `addw`.",
- "bitlen": "bitlen interprets arrays as big-endian integers, unlike setbit/getbit",
- "txn": "FirstValidTime causes the program to fail. The field is reserved for future use.",
- "gtxn": "for notes on transaction fields available, see `txn`. If this transaction is _i_ in the group, `gtxn i field` is equivalent to `txn field`.",
- "gtxns": "for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction.",
- "gload": "`gload` fails unless the requested transaction is an ApplicationCall and T < GroupIndex.",
- "gloads": "`gloads` fails unless the requested transaction is an ApplicationCall and X < GroupIndex.",
- "gaid": "`gaid` fails unless the requested transaction created an asset or application and T < GroupIndex.",
- "gaids": "`gaids` fails unless the requested transaction created an asset or application and X < GroupIndex.",
- "btoi": "`btoi` panics if the input is longer than 8 bytes.",
- "concat": "`concat` panics if the result would be greater than 4096 bytes.",
- "pushbytes": "pushbytes args are not added to the bytecblock during assembly processes",
- "pushint": "pushint args are not added to the intcblock during assembly processes",
- "getbit": "see explanation of bit ordering in setbit",
- "setbit": "When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10.",
- "balance": "params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
- "min_balance": "params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
- "app_opted_in": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise.",
- "app_local_get": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key. Return: value. The value is zero (of type uint64) if the key does not exist.",
- "app_local_get_ex": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset), state key. Return: did_exist flag (top of the stack, 1 if exist and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.",
- "app_global_get_ex": "params: Txn.ForeignApps offset (or, since v4, an application id that appears in Txn.ForeignApps or is the CurrentApplicationID), state key. Return: did_exist flag (top of the stack, 1 if exist and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.",
- "app_global_get": "params: state key. Return: value. The value is zero (of type uint64) if the key does not exist.",
- "app_local_put": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key, value.",
- "app_local_del": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key.\n\nDeleting a key which is already absent has no effect on the application local state. (In particular, it does _not_ cause the program to fail.)",
- "app_global_del": "params: state key.\n\nDeleting a key which is already absent has no effect on the application global state. (In particular, it does _not_ cause the program to fail.)",
- "asset_holding_get": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if exist and 0 otherwise), value.",
- "asset_params_get": "params: Before v4, Txn.ForeignAssets offset. Since v4, Txn.ForeignAssets offset or an asset id that appears in Txn.ForeignAssets. Return: did_exist flag (1 if exist and 0 otherwise), value.",
- "app_params_get": "params: Txn.ForeignApps offset or an app id that appears in Txn.ForeignApps. Return: did_exist flag (1 if exist and 0 otherwise), value.",
- "log": "`log` can be called up to MaxLogCalls times in a program, and log up to a total of 1k bytes.",
+ "ed25519verify": "The 32 byte public key is the last element on the stack, preceded by the 64 byte signature at the second-to-last element on the stack, preceded by the data which was signed at the third-to-last element on the stack.",
+ "ecdsa_verify": "The 32 byte Y-component of a public key is the last element on the stack, preceded by X-component of a pubkey, preceded by S and R components of a signature, preceded by the data that is fifth element on the stack. All values are big-endian encoded. The signed data must be 32 bytes long, and signatures in lower-S form are only accepted.",
+ "ecdsa_pk_decompress": "The 33 byte public key in a compressed form to be decompressed into X and Y (top) components. All values are big-endian encoded.",
+ "ecdsa_pk_recover": "S (top) and R elements of a signature, recovery id and data (bottom) are expected on the stack and used to deriver a public key. All values are big-endian encoded. The signed data must be 32 bytes long.",
+ "bnz": "The `bnz` instruction opcode 0x40 is followed by two immediate data bytes which are a high byte first and low byte second which together form a 16 bit offset which the instruction may branch to. For a bnz instruction at `pc`, if the last element of the stack is not zero then branch to instruction at `pc + 3 + N`, else proceed to next instruction at `pc + 3`. Branch targets must be aligned instructions. (e.g. Branching to the second byte of a 2 byte op will be rejected.) Starting at v4, the offset is treated as a signed 16 bit integer allowing for backward branches and looping. In prior version (v1 to v3), branch offsets are limited to forward branches only, 0-0x7fff.\n\nAt v2 it became allowed to branch to the end of the program exactly after the last instruction: bnz to byte N (with 0-indexing) was illegal for a TEAL program with N bytes before v2, and is legal after it. This change eliminates the need for a last instruction of no-op as a branch target at the end. (Branching beyond the end--in other words, to a byte larger than N--is still illegal and will cause the program to fail.)",
+ "bz": "See `bnz` for details on how branches work. `bz` inverts the behavior of `bnz`.",
+ "b": "See `bnz` for details on how branches work. `b` always jumps to the offset.",
+ "callsub": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.",
+ "retsub": "The call stack is separate from the data stack. Only `callsub` and `retsub` manipulate it.",
+ "intcblock": "`intcblock` loads following program bytes into an array of integer constants in the evaluator. These integer constants can be referred to by `intc` and `intc_*` which will push the value onto the stack. Subsequent calls to `intcblock` reset and replace the integer constants available to the script.",
+ "bytecblock": "`bytecblock` loads the following program bytes into an array of byte-array constants in the evaluator. These constants can be referred to by `bytec` and `bytec_*` which will push the value onto the stack. Subsequent calls to `bytecblock` reset and replace the bytes constants available to the script.",
+ "*": "Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `mulw`.",
+ "+": "Overflow is an error condition which halts execution and fails the transaction. Full precision is available from `addw`.",
+ "/": "`divmodw` is available to divide the two-element values produced by `mulw` and `addw`.",
+ "bitlen": "bitlen interprets arrays as big-endian integers, unlike setbit/getbit",
+ "txn": "FirstValidTime causes the program to fail. The field is reserved for future use.",
+ "gtxn": "for notes on transaction fields available, see `txn`. If this transaction is _i_ in the group, `gtxn i field` is equivalent to `txn field`.",
+ "gtxns": "for notes on transaction fields available, see `txn`. If top of stack is _i_, `gtxns field` is equivalent to `gtxn _i_ field`. gtxns exists so that _i_ can be calculated, often based on the index of the current transaction.",
+ "gload": "`gload` fails unless the requested transaction is an ApplicationCall and T < GroupIndex.",
+ "gloads": "`gloads` fails unless the requested transaction is an ApplicationCall and X < GroupIndex.",
+ "gaid": "`gaid` fails unless the requested transaction created an asset or application and T < GroupIndex.",
+ "gaids": "`gaids` fails unless the requested transaction created an asset or application and X < GroupIndex.",
+ "btoi": "`btoi` fails if the input is longer than 8 bytes.",
+ "concat": "`concat` fails if the result would be greater than 4096 bytes.",
+ "pushbytes": "pushbytes args are not added to the bytecblock during assembly processes",
+ "pushint": "pushint args are not added to the intcblock during assembly processes",
+ "getbit": "see explanation of bit ordering in setbit",
+ "setbit": "When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10.",
+ "balance": "params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
+ "min_balance": "params: Before v4, Txn.Accounts offset. Since v4, Txn.Accounts offset or an account address that appears in Txn.Accounts or is Txn.Sender). Return: value.",
+ "app_opted_in": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise.",
+ "app_local_get": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key. Return: value. The value is zero (of type uint64) if the key does not exist.",
+ "app_local_get_ex": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), application id (or, since v4, a Txn.ForeignApps offset), state key. Return: did_exist flag (top of the stack, 1 if the application existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.",
+ "app_global_get_ex": "params: Txn.ForeignApps offset (or, since v4, an application id that appears in Txn.ForeignApps or is the CurrentApplicationID), state key. Return: did_exist flag (top of the stack, 1 if the application existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.",
+ "app_global_get": "params: state key. Return: value. The value is zero (of type uint64) if the key does not exist.",
+ "app_local_put": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key, value.",
+ "app_local_del": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), state key.\n\nDeleting a key which is already absent has no effect on the application local state. (In particular, it does _not_ cause the program to fail.)",
+ "app_global_del": "params: state key.\n\nDeleting a key which is already absent has no effect on the application global state. (In particular, it does _not_ cause the program to fail.)",
+ "asset_holding_get": "params: Txn.Accounts offset (or, since v4, an account address that appears in Txn.Accounts or is Txn.Sender), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if the asset existed and 0 otherwise), value.",
+ "asset_params_get": "params: Before v4, Txn.ForeignAssets offset. Since v4, Txn.ForeignAssets offset or an asset id that appears in Txn.ForeignAssets. Return: did_exist flag (1 if the asset existed and 0 otherwise), value.",
+ "app_params_get": "params: Txn.ForeignApps offset or an app id that appears in Txn.ForeignApps. Return: did_exist flag (1 if the application existed and 0 otherwise), value.",
+ "log": "`log` fails if called more than MaxLogCalls times in a program, or if the sum of logged bytes exceeds 1024 bytes.",
+ "itxn_begin": "`itxn_begin` initializes Sender to the application address; Fee to the minimum allowable, taking into account MinTxnFee and credit from overpaying in earlier transactions; FirstValid/LastValid to the values in the top-level transaction, and all other fields to zero values.",
+ "itxn_field": "`itxn_field` fails if X is of the wrong type for F, including a byte array of the wrong size for use as an address when F is an address field. `itxn_field` also fails if X is an account or asset that does not appear in `txn.Accounts` or `txn.ForeignAssets` of the top-level transaction. (Setting addresses in asset creation are exempted from this requirement.)",
}
// OpDocExtra returns extra documentation text about an op
@@ -246,15 +288,18 @@ func OpDocExtra(opName string) string {
return opDocExtras[opName]
}
-// OpGroups is groupings of ops for documentation purposes.
+// OpGroups is groupings of ops for documentation purposes. The order
+// here is the order args opcodes are presented, so place related
+// opcodes consecutively, even if their opcode values are not.
var OpGroups = map[string][]string{
- "Arithmetic": {"sha256", "keccak256", "sha512_256", "ed25519verify", "+", "-", "/", "*", "<", ">", "<=", ">=", "&&", "||", "shl", "shr", "sqrt", "bitlen", "exp", "==", "!=", "!", "len", "itob", "btoi", "%", "|", "&", "^", "~", "mulw", "addw", "divmodw", "expw", "getbit", "setbit", "getbyte", "setbyte", "concat"},
- "Byte Array Slicing": {"substring", "substring3", "extract", "extract3", "extract16bits", "extract32bits", "extract64bits"},
- "Byteslice Arithmetic": {"b+", "b-", "b/", "b*", "b<", "b>", "b<=", "b>=", "b==", "b!=", "b%"},
- "Byteslice Logic": {"b|", "b&", "b^", "b~"},
- "Loading Values": {"intcblock", "intc", "intc_0", "intc_1", "intc_2", "intc_3", "pushint", "bytecblock", "bytec", "bytec_0", "bytec_1", "bytec_2", "bytec_3", "pushbytes", "bzero", "arg", "arg_0", "arg_1", "arg_2", "arg_3", "txn", "gtxn", "txna", "gtxna", "gtxns", "gtxnsa", "global", "load", "store", "gload", "gloads", "gaid", "gaids"},
- "Flow Control": {"err", "bnz", "bz", "b", "return", "pop", "dup", "dup2", "dig", "cover", "uncover", "swap", "select", "assert", "callsub", "retsub"},
- "State Access": {"balance", "min_balance", "app_opted_in", "app_local_get", "app_local_get_ex", "app_global_get", "app_global_get_ex", "app_local_put", "app_global_put", "app_local_del", "app_global_del", "asset_holding_get", "asset_params_get", "app_params_get", "log"},
+ "Arithmetic": {"sha256", "keccak256", "sha512_256", "ed25519verify", "ecdsa_verify", "ecdsa_pk_recover", "ecdsa_pk_decompress", "+", "-", "/", "*", "<", ">", "<=", ">=", "&&", "||", "shl", "shr", "sqrt", "bitlen", "exp", "==", "!=", "!", "len", "itob", "btoi", "%", "|", "&", "^", "~", "mulw", "addw", "divmodw", "expw", "getbit", "setbit", "getbyte", "setbyte", "concat"},
+ "Byte Array Slicing": {"substring", "substring3", "extract", "extract3", "extract_uint16", "extract_uint32", "extract_uint64"},
+ "Byte Array Arithmetic": {"b+", "b-", "b/", "b*", "b<", "b>", "b<=", "b>=", "b==", "b!=", "b%"},
+ "Byte Array Logic": {"b|", "b&", "b^", "b~"},
+ "Loading Values": {"intcblock", "intc", "intc_0", "intc_1", "intc_2", "intc_3", "pushint", "bytecblock", "bytec", "bytec_0", "bytec_1", "bytec_2", "bytec_3", "pushbytes", "bzero", "arg", "arg_0", "arg_1", "arg_2", "arg_3", "args", "txn", "gtxn", "txna", "txnas", "gtxna", "gtxnas", "gtxns", "gtxnsa", "gtxnsas", "global", "load", "loads", "store", "stores", "gload", "gloads", "gaid", "gaids"},
+ "Flow Control": {"err", "bnz", "bz", "b", "return", "pop", "dup", "dup2", "dig", "cover", "uncover", "swap", "select", "assert", "callsub", "retsub"},
+ "State Access": {"balance", "min_balance", "app_opted_in", "app_local_get", "app_local_get_ex", "app_global_get", "app_global_get_ex", "app_local_put", "app_global_put", "app_local_del", "app_global_del", "asset_holding_get", "asset_params_get", "app_params_get", "log"},
+ "Inner Transactions": {"itxn_begin", "itxn_field", "itxn_submit", "itxn", "itxna"},
}
// OpCost indicates the cost of an operation over the range of
@@ -322,47 +367,55 @@ func OnCompletionDescription(value uint64) string {
const OnCompletionPreamble = "An application transaction must indicate the action to be taken following the execution of its approvalProgram or clearStateProgram. The constants below describe the available actions."
var txnFieldDocs = map[string]string{
- "Sender": "32 byte address",
- "Fee": "micro-Algos",
- "FirstValid": "round number",
- "FirstValidTime": "Causes program to fail; reserved for future use",
- "LastValid": "round number",
- "Note": "Any data up to 1024 bytes",
- "Lease": "32 byte lease value",
- "Receiver": "32 byte address",
- "Amount": "micro-Algos",
- "CloseRemainderTo": "32 byte address",
- "VotePK": "32 byte address",
- "SelectionPK": "32 byte address",
- "VoteFirst": "The first round that the participation key is valid.",
- "VoteLast": "The last round that the participation key is valid.",
- "VoteKeyDilution": "Dilution for the 2-level participation key",
- "Type": "Transaction type as bytes",
- "TypeEnum": "See table below",
- "XferAsset": "Asset ID",
- "AssetAmount": "value in Asset's units",
- "AssetSender": "32 byte address. Causes clawback of all value of asset from AssetSender if Sender is the Clawback address of the asset.",
- "AssetReceiver": "32 byte address",
- "AssetCloseTo": "32 byte address",
- "GroupIndex": "Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1",
- "TxID": "The computed ID for this transaction. 32 bytes.",
- "ApplicationID": "ApplicationID from ApplicationCall transaction",
- "OnCompletion": "ApplicationCall transaction on completion action",
- "ApplicationArgs": "Arguments passed to the application in the ApplicationCall transaction",
- "NumAppArgs": "Number of ApplicationArgs",
- "Accounts": "Accounts listed in the ApplicationCall transaction",
- "NumAccounts": "Number of Accounts",
- "Assets": "Foreign Assets listed in the ApplicationCall transaction",
- "NumAssets": "Number of Assets",
- "Applications": "Foreign Apps listed in the ApplicationCall transaction",
- "NumApplications": "Number of Applications",
- "GlobalNumUint": "Number of global state integers in ApplicationCall",
- "GlobalNumByteSlice": "Number of global state byteslices in ApplicationCall",
- "LocalNumUint": "Number of local state integers in ApplicationCall",
- "LocalNumByteSlice": "Number of local state byteslices in ApplicationCall",
- "ApprovalProgram": "Approval program",
- "ClearStateProgram": "Clear state program",
- "RekeyTo": "32 byte Sender's new AuthAddr",
+ "Type": "Transaction type as bytes",
+ "TypeEnum": "See table below",
+ "Sender": "32 byte address",
+ "Fee": "micro-Algos",
+ "FirstValid": "round number",
+ "FirstValidTime": "Causes program to fail; reserved for future use",
+ "LastValid": "round number",
+ "Note": "Any data up to 1024 bytes",
+ "Lease": "32 byte lease value",
+ "RekeyTo": "32 byte Sender's new AuthAddr",
+
+ "GroupIndex": "Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1",
+ "TxID": "The computed ID for this transaction. 32 bytes.",
+
+ "Receiver": "32 byte address",
+ "Amount": "micro-Algos",
+ "CloseRemainderTo": "32 byte address",
+
+ "VotePK": "32 byte address",
+ "SelectionPK": "32 byte address",
+ "VoteFirst": "The first round that the participation key is valid.",
+ "VoteLast": "The last round that the participation key is valid.",
+ "VoteKeyDilution": "Dilution for the 2-level participation key",
+ "Nonparticipation": "Marks an account nonparticipating for rewards",
+
+ "XferAsset": "Asset ID",
+ "AssetAmount": "value in Asset's units",
+ "AssetSender": "32 byte address. Causes clawback of all value of asset from AssetSender if Sender is the Clawback address of the asset.",
+ "AssetReceiver": "32 byte address",
+ "AssetCloseTo": "32 byte address",
+
+ "ApplicationID": "ApplicationID from ApplicationCall transaction",
+ "OnCompletion": "ApplicationCall transaction on completion action",
+ "ApplicationArgs": "Arguments passed to the application in the ApplicationCall transaction",
+ "NumAppArgs": "Number of ApplicationArgs",
+ "Accounts": "Accounts listed in the ApplicationCall transaction",
+ "NumAccounts": "Number of Accounts",
+ "Assets": "Foreign Assets listed in the ApplicationCall transaction",
+ "NumAssets": "Number of Assets",
+ "Applications": "Foreign Apps listed in the ApplicationCall transaction",
+ "NumApplications": "Number of Applications",
+ "GlobalNumUint": "Number of global state integers in ApplicationCall",
+ "GlobalNumByteSlice": "Number of global state byteslices in ApplicationCall",
+ "LocalNumUint": "Number of local state integers in ApplicationCall",
+ "LocalNumByteSlice": "Number of local state byteslices in ApplicationCall",
+ "ApprovalProgram": "Approval program",
+ "ClearStateProgram": "Clear state program",
+ "ExtraProgramPages": "Number of additional pages for each of the application's approval and clear state programs. An ExtraProgramPages of 1 means 2048 more total bytes, or 1024 for each program.",
+
"ConfigAsset": "Asset ID in asset config transaction",
"ConfigAssetTotal": "Total number of units of this asset created",
"ConfigAssetDecimals": "Number of digits to display after the decimal place when displaying the asset",
@@ -375,10 +428,15 @@ var txnFieldDocs = map[string]string{
"ConfigAssetReserve": "32 byte address",
"ConfigAssetFreeze": "32 byte address",
"ConfigAssetClawback": "32 byte address",
- "FreezeAsset": "Asset ID being frozen or un-frozen",
- "FreezeAssetAccount": "32 byte address of the account whose asset slot is being frozen or un-frozen",
- "FreezeAssetFrozen": "The new frozen value, 0 or 1",
- "ExtraProgramPages": "Number of additional pages for each of the application's approval and clear state programs. An ExtraProgramPages of 1 means 2048 more total bytes, or 1024 for each program.",
+
+ "FreezeAsset": "Asset ID being frozen or un-frozen",
+ "FreezeAssetAccount": "32 byte address of the account whose asset slot is being frozen or un-frozen",
+ "FreezeAssetFrozen": "The new frozen value, 0 or 1",
+
+ "Logs": "Log messages emitted by an application call (itxn only)",
+ "NumLogs": "Number of Logs (itxn only)",
+ "CreatedAssetID": "Asset ID allocated by the creation of an ASA (itxn only)",
+ "CreatedApplicationID": "ApplicationID allocated by the creation of an application (itxn only)",
}
// TxnFieldDocs are notes on fields available by `txn` and `gtxn` with extra versioning info if any
@@ -387,16 +445,18 @@ func TxnFieldDocs() map[string]string {
}
var globalFieldDocs = map[string]string{
- "MinTxnFee": "micro Algos",
- "MinBalance": "micro Algos",
- "MaxTxnLife": "rounds",
- "ZeroAddress": "32 byte address of all zero bytes",
- "GroupSize": "Number of transactions in this atomic transaction group. At least 1",
- "LogicSigVersion": "Maximum supported TEAL version",
- "Round": "Current round number",
- "LatestTimestamp": "Last confirmed block UNIX timestamp. Fails if negative",
- "CurrentApplicationID": "ID of current application executing. Fails if no such application is executing",
- "CreatorAddress": "Address of the creator of the current application. Fails if no such application is executing",
+ "MinTxnFee": "micro Algos",
+ "MinBalance": "micro Algos",
+ "MaxTxnLife": "rounds",
+ "ZeroAddress": "32 byte address of all zero bytes",
+ "GroupSize": "Number of transactions in this atomic transaction group. At least 1",
+ "LogicSigVersion": "Maximum supported TEAL version",
+ "Round": "Current round number",
+ "LatestTimestamp": "Last confirmed block UNIX timestamp. Fails if negative",
+ "CurrentApplicationID": "ID of current application executing. Fails in LogicSigs",
+ "CreatorAddress": "Address of the creator of the current application. Fails if no such application is executing",
+ "CurrentApplicationAddress": "Address that the current application controls. Fails in LogicSigs",
+ "GroupID": "ID of the transaction group. 32 zero bytes if the transaction is not part of a group.",
}
// GlobalFieldDocs are notes on fields available in `global` with extra versioning info if any
@@ -433,8 +493,8 @@ var AssetHoldingFieldDocs = map[string]string{
"AssetFrozen": "Is the asset frozen or not",
}
-// AssetParamsFieldDocs are notes on fields available in `asset_params_get`
-var AssetParamsFieldDocs = map[string]string{
+// assetParamsFieldDocs are notes on fields available in `asset_params_get`
+var assetParamsFieldDocs = map[string]string{
"AssetTotal": "Total number of units of this asset",
"AssetDecimals": "See AssetParams.Decimals",
"AssetDefaultFrozen": "Frozen by default or not",
@@ -449,8 +509,13 @@ var AssetParamsFieldDocs = map[string]string{
"AssetCreator": "Creator address",
}
-// AppParamsFieldDocs are notes on fields available in `app_params_get`
-var AppParamsFieldDocs = map[string]string{
+// AssetParamsFieldDocs are notes on fields available in `asset_params_get` with extra versioning info if any
+func AssetParamsFieldDocs() map[string]string {
+ return fieldsDocWithExtra(assetParamsFieldDocs, assetParamsFieldSpecByName)
+}
+
+// appParamsFieldDocs are notes on fields available in `app_params_get`
+var appParamsFieldDocs = map[string]string{
"AppApprovalProgram": "Bytecode of Approval Program",
"AppClearStateProgram": "Bytecode of Clear State Program",
"AppGlobalNumUint": "Number of uint64 values allowed in Global State",
@@ -459,4 +524,15 @@ var AppParamsFieldDocs = map[string]string{
"AppLocalNumByteSlice": "Number of byte array values allowed in Local State",
"AppExtraProgramPages": "Number of Extra Program Pages of code space",
"AppCreator": "Creator address",
+ "AppAddress": "Address for which this application has authority",
+}
+
+// AppParamsFieldDocs are notes on fields available in `app_params_get` with extra versioning info if any
+func AppParamsFieldDocs() map[string]string {
+ return fieldsDocWithExtra(appParamsFieldDocs, appParamsFieldSpecByName)
+}
+
+// EcdsaCurveDocs are notes on curves available in `ecdsa_` opcodes
+var EcdsaCurveDocs = map[string]string{
+ "Secp256k1": "secp256k1 curve",
}