balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted. Changes caused by inner transactions are observable immediately following itxn_submit
min_balance
minimum required balance for account A, in microalgos. Required balance is affected by ASA, App, and Box usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes. Changes caused by inner transactions or box usage are observable immediately following the opcode effecting the change.
acct_params_get f
X is field F from account A. Y is 1 if A owns positive algos, else 0
voter_params_get f
X is field F from online account A as of the balance round: 320 rounds before the current round. Y is 1 if A had positive algos online in the agreement round, else Y is 0 and X is a type specific zero-value
Box opcodes that create, delete, or resize boxes affect the minimum
balance requirement of the calling application’s account. The change
is immediate, and can be observed after exection by using
min_balance. If the account does not possess the new minimum
balance, the opcode fails.
All box related opcodes fail immediately if used in a
ClearStateProgram. This behavior is meant to discourage Smart Contract
authors from depending upon the availability of boxes in a ClearState
transaction, as accounts using ClearState are under no requirement to
furnish appropriate Box References. Authors would do well to keep the
same issue in mind with respect to the availability of Accounts,
Assets, and Apps though State Access opcodes are allowed in
ClearState programs because the current application and sender account
are sure to be available.
OPCODE
DESCRIPTION
box_create
create a box named A, of length B. Fail if the name A is empty or B exceeds 32,768. Returns 0 if A already existed, else 1
box_extract
read C bytes from box A, starting at offset B. Fail if A does not exist, or the byte range is outside A’s size.
box_replace
write byte-array C into box A, starting at offset B. Fail if A does not exist, or the byte range is outside A’s size.
box_splice
set box A to contain its previous bytes up to index B, followed by D, followed by the original bytes of A that began at index B+C.
box_del
delete box named A if it exists. Return 1 if A existed, 0 otherwise
box_len
X is the length of box A if A exists, else 0. Y is 1 if A exists, else 0.
box_get
X is the contents of box A if A exists, else ‘’. Y is 1 if A exists, else 0.
box_put
replaces the contents of box A with byte-array B. Fails if A exists and len(B) != len(box A). Creates A if it does not exist
box_resize
change the size of box named A to be of length B, adding zero bytes to end or removing bytes from the end, as needed. Fail if the name A is empty, A is not an existing box, or B exceeds 32,768.